> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-docs-event-stream-action-templates.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth0 Logout

> Log out a user and optionally redirect them to a specified URL after logout.

## Endpoint

`GET /v2/logout`

Use this endpoint to logout a user. If you want to navigate the user to a specific URL after the logout, set that URL at the `returnTo` parameter. The URL should be included in the appropriate `Allowed Logout URLs` list:

* If the `client_id` parameter is included, the `returnTo` URL must be listed in the `Allowed Logout URLs` set at the application level. To learn more, read [Log Users Out of Applications](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-applications).
* If the `client_id` parameter is NOT included, the `returnTo` URL must be listed in the `Allowed Logout URLs` set at the tenant level. To learn more, read [Log Users Out of Auth0](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0).
* If the `client_id` parameter is included and the `returnTo` URL is NOT set, the server returns the user to the first Allowed Logout URLs set in the Dashboard. To learn more, read [Log Users Out of Applications](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-applications).

### Remarks

* Logging the user out of their identity provider is not common practice, so think about the user experience before you use the `federated` query string parameter.
* The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](https://auth0.com/docs/libraries/auth0js).

### Learn More

* [Logout](https://auth0.com/docs/authenticate/login/logout)

## Query Parameters

<ParamField query="client_id" type="string">
  The `client_id` of your application.
</ParamField>

<ParamField query="returnTo" type="string" required>
  URL to redirect the user after the logout.
</ParamField>

<ParamField query="federated" type="string">
  Add this query string parameter to the logout URL, to log the user out of their identity provider.
</ParamField>

## Response Messages

| Status | Description                                              |
| ------ | -------------------------------------------------------- |
| 200    | Successfully logged out                                  |
| 400    | Bad request, possibly due to missing required parameters |
