# DELETE /api/v1/oauth/grants/{grant_id}

> Revoke connected app

- **Tag:** oauth-grants
- **Operation ID:** `revoke_oauth_grant_api_v1_oauth_grants__grant_id__delete`

## Description

Revoke access for a connected OAuth client.

**Path Parameters:**
- `grant_id`: UUID of the grant to revoke

**Effect:**
- Marks the grant as revoked
- Blacklists the linked refresh token

**Returns:** Revoked grant metadata with revocation timestamp.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `grant_id` (path, string, required)

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_OAuthGrantRevokeResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (OAuthGrantRevokeResponse)

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X DELETE 'https://api.ondayzero.com/api/v1/oauth/grants/{grant_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/oauth/grants/{grant_id}', {
  method: 'DELETE',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

response = httpx.delete("https://api.ondayzero.com/api/v1/oauth/grants/{grant_id}", headers=headers)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/oauth-grants/revoke-oauth-grant
- OpenAPI slice: https://www.ondayzero.com/docs/reference/oauth-grants/revoke-oauth-grant/openapi.json
- Other endpoints in **oauth-grants**: https://www.ondayzero.com/docs/reference/oauth-grants
