Perform Logout for Native Apps
DELETEhttps://accounts.<domain>/auth/self-service/logout/api
Use this endpoint to log out an identity using an Session Token. If the Session Token was successfully revoked, the server returns a 204 No Content response. A 204 No Content response is also sent when the Session Token has been revoked already before.
If the Session Token is malformed or does not exist a 403 Forbidden response will be returned.
This endpoint does not remove any HTTP Cookies - use the Browser-Based Self-Service Logout Flow instead.
Request
- application/json
Body
required
session_token stringrequired
The Session Token
Invalidate this session token.
Responses
- 204
- 400
- default
Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201.
errorGeneric
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
errorGeneric
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X DELETE 'https://accounts.<domain>/auth/self-service/logout/api' \
-H 'Content-Type: application/json' \
--data-raw '{
"session_token": "string"
}'