# Revoke a refresh token

Source: https://business-api-docs.youhodler.com/api/reference/auth/oauth-revoke

**Authentication:** This endpoint does not require a bearer token.

Ends the session of a refresh token (RFC 7009), as on sign-out: every refresh token of that session stops working. Answers `200` with an empty object for any well-formed request, whether or not the token is known, so the endpoint does not reveal which tokens exist. An access token is accepted and ignored: it stays valid until its `exp`. `token_type_hint` is optional; any value is accepted and ignored. A body without `token` is a `400` `invalid_request`. Refusals use the same `{error, error_description}` body as `/oauth/token`, with `Cache-Control: no-store`.

## Request

Required request body.

### Request body schema

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `token` | string | Yes | minLength: 1 |
| `token_type_hint` | string | No |  |

Additional fields are not accepted.

**Request URL — POST**
```http
POST /oauth/revoke
```

**Request Body — application/json**
```json
{
  "token": "yhrt_0000000000000000000000000000000000000000001",
  "token_type_hint": "refresh_token"
}
```

## Responses

**200 Operation succeeded**

Operation succeeded.

```json
{}
```

**400 The request was refused**

The request was refused. On `/oauth/token`, `error` is `invalid_request` (malformed body, or a refused subject token or client), `invalid_grant` (every refused refresh) or `unsupported_grant_type`. On `/oauth/revoke` it is `invalid_request`.

```json
{
  "error": "invalid_grant",
  "error_description": "The authorization grant or refresh token is invalid, expired or revoked."
}
```

**401 Client authentication failed (`invalid_client`)**

Client authentication failed (`invalid_client`).

```json
{
  "error": "invalid_client",
  "error_description": "Client authentication failed."
}
```

**500 Unexpected server error (`server_error`)**

Unexpected server error (`server_error`).

```json
{
  "error": "server_error",
  "error_description": "The server encountered an unexpected error."
}
```

**503 The service is temporarily unavailable (`temporarily_unavailable`)**

The service is temporarily unavailable (`temporarily_unavailable`); retry later.

```json
{
  "error": "temporarily_unavailable",
  "error_description": "The service is temporarily unavailable. Try again later."
}
```
### Response 200 schema

Content type: `application/json`.

#### application/json body

Type: `object`. No additional fields

### Response 400 schema

Content type: `application/json`.

#### application/json body

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `error` | "invalid_request" / "invalid_client" / "invalid_grant" / "unsupported_grant_type" / "temporarily_unavailable" / "server_error" | Yes |  |
| `error_description` | string | Yes |  |

Additional fields are not accepted.

### Response 401 schema

Content type: `application/json`.

#### application/json body

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `error` | "invalid_request" / "invalid_client" / "invalid_grant" / "unsupported_grant_type" / "temporarily_unavailable" / "server_error" | Yes |  |
| `error_description` | string | Yes |  |

Additional fields are not accepted.

### Response 500 schema

Content type: `application/json`.

#### application/json body

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `error` | "invalid_request" / "invalid_client" / "invalid_grant" / "unsupported_grant_type" / "temporarily_unavailable" / "server_error" | Yes |  |
| `error_description` | string | Yes |  |

Additional fields are not accepted.

### Response 503 schema

Content type: `application/json`.

#### application/json body

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `error` | "invalid_request" / "invalid_client" / "invalid_grant" / "unsupported_grant_type" / "temporarily_unavailable" / "server_error" | Yes |  |
| `error_description` | string | Yes |  |

Additional fields are not accepted.
