Link Search Menu Expand Document

Logging users out

Contents

Overview

  • Call name: logout
  • Endpoint URL: https://api0.spaaza.com/auth/logout
  • Request methods: DELETE
  • Response Content-Type: application/json
  • Auth required: yes

This endpoint allows a user to log out of the Spaaza system by destroying their current session. When called with a valid session key in the headers, it invalidates that session, effectively logging the user out of the system.

Version-specific information

The following version-specific changes apply to this endpoint. See the versioning page for more details.

Version Change details
N/A N/A

Permissions and Authentication

This API call requires:

  • A valid session key in the HTTP headers
  • No specific user permissions are required beyond having a valid session

Headers

The following headers must be passed to the API call:

Parameter Description
X-Spaaza-Session-Key (mandatory) A valid session key for the user logging out. Must be a properly formatted session key string.
X-Spaaza-Session-User-Id (mandatory) The user ID associated with the session. Must be a valid integer between 1 and 9999999999.

HTTP Parameters

No specific parameters are required for this endpoint.

Sample request

DELETE /auth/logout

Headers:
X-Spaaza-Session-Key: a1b2c3d4e5f6g7h8i9j0...
X-Spaaza-Session-User-Id: 12345

No request body is required for this DELETE request.

Sample response

Returns an OK code and information about the logged out user:

{
    "result": {
        "code": 1,
        "status": "ok"
    },
    "results": {
        "result_type": "logout",
        "username": "user@example.com"
    }
}

Possible error responses

The following represents a list of possible error responses for the logout endpoint:

Code Name and Description HTTP Status Code
4 http_request_method_not_allowed
This HTTP method is not allowed for this API call
405
6 no_valid_session
The user needs to be logged in and a valid session key needs to be sent
401
228 auth_method_invalid
The given auth_method parameter has an invalid value
401
330 server_error
Unexpected server error
500