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
Bodyrequired
session_tokenstringrequired
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 (auto)
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 (auto)
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"
}
}
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://accounts.<domain>/auth/self-service/logout/api");
var content = new StringContent("{\n \"session_token\": \"string\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());