# Revoke an agent's access with its refresh token

> Revoke an agent's access with its refresh token: CustomDomain™ API reference in the agents group. Covers parameters, request body, responses and error codes.

Source: https://docs.customdomain.ai/docs/api-reference/agents/revokeAgentToken

## `POST https://api.customdomain.ai/v1/oauth/agent/revoke`

RFC 7009. Revokes the grant behind a refresh token, so the agent's access ends within one access token lifetime (15 minutes at most). It answers `200` for a token it does not know, so it cannot be used to find out which tokens exist, and for a refresh token that was already replaced or revoked, which revokes nothing. Send the client's `client_id` with the token. The workspace's owners and admins are told once.

### Authentication

None.

### Request body (JSON)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `token` | string | yes | The refresh token. |
| `client_id` | string | no | The client the token was issued to. |

### Responses

| Status | Description |
| --- | --- |
| `200` | Revoked, or the token was not known |
| `400` | `invalid_request`: no token. |
| `503` | Agent access is not enabled on this deployment. |

The full specification is served at `GET https://api.customdomain.ai/v1/openapi.json`.
