> ## Documentation Index
> Fetch the complete documentation index at: https://pay3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke AI Sessions — Individual and Bulk Revocation

> DELETE /api/ai-sessions/:id revokes a single session. POST /api/ai-sessions/revoke-all immediately revokes all active sessions on your account.

Pay3 provides two revocation endpoints so you can cut off an AI assistant's spending access immediately — whether you need to retire a single session or perform an emergency shutdown of all active sessions at once. Revoking a session invalidates its MCP auth token and prevents any further transactions from being submitted under it. Any transactions that are already in the `SIGNING` or `SUBMITTING` state at the moment of revocation may still complete.

***

## Revoke a single session

Remove access for one specific AI session by its ID. Use this when rotating session credentials, decommissioning a particular AI client, or responding to a suspected compromise of a single token.

### Endpoint

```
DELETE /api/ai-sessions/:id
```

### Authentication

```
Authorization: Bearer <token>
```

### Path parameters

**id** `string` *required*

The UUID of the AI session to revoke.

### Response

Returns HTTP `204 No Content` on success — no response body is sent.

### Error responses

| Status | Meaning |
| - | - |
| `400 Bad Request` | The provided `id` is not a valid UUID. |
| `401 Unauthorized` | Missing or invalid bearer token. |
| `404 Not Found` | No session exists for the given `id`, or it does not belong to your account. |

### Example request

```bash theme={null}
curl -X DELETE https://api.pay3.dev/api/ai-sessions/e3b0c442-98fc-1c14-9afb-f4c8996fb924 \
  -H "Authorization: Bearer <token>"
```

***

## Revoke all sessions

Immediately revoke every active AI session on your account. This is an emergency control designed for situations where you suspect a credentials leak, want to perform a full security reset, or are shutting down all AI-driven activity.

### Endpoint

```
POST /api/ai-sessions/revoke-all
```

### Authentication

```
Authorization: Bearer <token>
```

### Request body

No request body is required.

### Response fields

**revokedCount** `number` *required*

The number of active sessions that were revoked by this call. Returns `0` if no active sessions existed at the time of the request.

### Example request

```bash theme={null}
curl -X POST https://api.pay3.dev/api/ai-sessions/revoke-all \
  -H "Authorization: Bearer <token>"
```

### Example response

```json theme={null}
{
  "revokedCount": 3
}
```

> [!WARNING]
>
> **Revoke-all is irreversible.** All active AI sessions will be disconnected immediately and their MCP auth tokens permanently invalidated. Every AI assistant currently using Pay3 — Cursor, Claude, ChatGPT, or any other client — will lose spending access at once. You will need to create new sessions and re-configure each client to restore access.

> [!NOTE]
>
> Revoked sessions remain visible in [GET /api/ai-sessions](https://pay3.mintlify.site/api-reference/ai-sessions/list.md) with a status of `REVOKED`, so your audit history is preserved.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.