> For the complete documentation index, see [llms.txt](https://gramhal.gitbook.io/matar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gramhal.gitbook.io/matar/developer-reference/api/user-login/logout.md).

# Logout

{% hint style="info" %}
Logout Flow for the Matar App
{% endhint %}

***

## Logout from the App

<img src="/files/UCeKKtfK4sD4ABJEngp4" alt="API: - https://matar.in.ngrok.io/api/v1/logout" class="gitbook-drawing">

### Params

**Header Parameter ⬇️**

<table data-full-width="false"><thead><tr><th width="230.33333333333331">Header Parameter</th><th width="126">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Bearer {{access_token}} </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Access tokens enable secure login and logout.</td></tr></tbody></table>

***

**Sample Request ⬇️️ (Header Parameter)**

```
curl --location --request POST 'https://matar.in.ngrok.io/api/v1/logout' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2V4YW1wbGUuYXV0aDAuY29tLyIsImF1ZCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tL2NhbGFuZGFyL3YxLyIsInN1YiI6InVzcl8xMjMiLCJpYXQiOjE0NTg3ODU3OTYsImV4cCI6MTQ1ODg3MjE5Nn0.CA7eaHjIHz5NxeIJoFK9krqaeZrPLwmMmgI_XiQiIkQ'
```

**Responses ⬇️**

Status Code: **🟢200** (200 denotes **'ok'**)

```200
{
    "message": "Successfully logged out"
}
```

***

## **When Token is Revoked.**

<img src="/files/UCeKKtfK4sD4ABJEngp4" alt="API: - https://matar.in.ngrok.io/api/v1/logout" class="gitbook-drawing">

### Params

**Header Parameter ⬇️**

<table data-full-width="false"><thead><tr><th width="230.33333333333331">Header Parameter</th><th width="126">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Bearer {{access_token}} </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Access tokens enable secure login and logout.</td></tr></tbody></table>

***

**Sample Request ⬇️️ (Header Parameter)**

{% hint style="info" %}
{% code overflow="wrap" %}

```
When a token is already revoked: Removal of the client permissions associated with the specified token for accessing the protected Matar resources.
```

{% endcode %}
{% endhint %}

```
curl --location --request POST 'https://matar.app/api/v1/logout' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2V4YW1wbGUuYXV0aDAuY29tLyIsImF1ZCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tL2NhbGFuZGFyL3YxLyIsInN1YiI6InVzcl8xMjMiLCJpYXQiOjE0NTg3ODU3OTYsImV4cCI6MTQ1ODg3MjE5Nn0.CA7eaHjIHz5NxeIJoFK9krqaeZrPLwmMmgI_XiQiIkQ'

```

**Responses ⬇️**

Status Code: 🔴**401** (401 denotes **'Unauthorized'**)

```
{
    "description": "The token has been revoked.",
    "error": "token_revoked"
}
```
