# Logout

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

***

## Logout from the App

<img src="https://203590333-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIHuU6kmTWQfXxOUkN7No%2Fuploads%2FNSsZ0fRdDvwNPVMVHG5G%2Ffile.excalidraw.svg?alt=media&#x26;token=db02fc74-cd68-4f6d-8b18-59ac05008c78" 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="https://203590333-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIHuU6kmTWQfXxOUkN7No%2Fuploads%2FNSsZ0fRdDvwNPVMVHG5G%2Ffile.excalidraw.svg?alt=media&#x26;token=db02fc74-cd68-4f6d-8b18-59ac05008c78" 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"
}
```
