Logout a User API
On this page
The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the client and revoke the refresh token. This API does nothing if the request does not contain an access token or refresh token cookies.
The refresh token is only revoked if the request contains the refresh_token cookie or the refreshToken request parameter.
Request#
Send the access token and refresh token cookies to remove, or the refresh token as a request parameter.
OpenAPI Spec
Request Cookies#
access_tokenThe access token cookie. When this cookie available in the request it will be deleted from the client.
refresh_tokenThe refresh token cookie. When this cookie available in the request it will be deleted from the client and revoked in FusionAuth.
Request Headers#
X-FusionAuth-TenantIdThe unique Id of the tenant used to scope this API request.
The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.
Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.
See Making an API request using a Tenant Id for additional information.
Request Body#
eventInfoInformation about the request. FusionAuth adds the information to the events the request triggers, as event.info. For more information, see Pass Context From API Requests to Webhooks.
eventInfo.data An object that holds any JSON you choose, such as a trace Id. FusionAuth copies the object to event.info.data without changes.
eventInfo.deviceDescription A description of the end user's device.
eventInfo.deviceName The name of the end user's device.
eventInfo.deviceType The type of the end user's device.
eventInfo.ipAddress The IP address of the end user. When your server calls FusionAuth for the end user, set this value to the end user's IP address. When this value is omitted, FusionAuth uses the IP address of the client that sent the request.
eventInfo.os The operating system of the end user's device.
eventInfo.userAgent The user agent of the end user's browser.
globalWhen this value is set to true, revokes:
- all of the refresh tokens issued to the owner of the provided refresh token
- the FusionAuth SSO session
If no refresh token is provided on the request, no refresh tokens will be revoked.
refreshTokenThe refresh token to revoke.
If provided, FusionAuth uses the token provided in this parameter instead of the token provided in the refresh_token cookie.
Response#
This API does not return a JSON response body.
| Code | Description |
|---|---|
| 200 | The update was successful. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. |
Related
API documentation for the FusionAuth Authenticate a User API.
API documentation for the FusionAuth Authenticate a User with a One Time Password API.
API documentation for the FusionAuth Complete Multi-Factor Authentication API.
API documentation for the FusionAuth Login API.