---
title: "Approve or deny an MCP authorization request"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Approve or deny an MCP authorization request

Path: Nicer API › Assistant

`POST /agent/mcp/authorizations/{requestId}`

URL: `https://api.nicer.travel/agent/mcp/authorizations/{requestId}`

Approves or denies what an AI client asks for, as the signed-in person; the person's normal session token is the only way to approve. The answer is `redirectUrl`, where the consent page sends the browser next: the client's redirect URI with `code`, `state` and `iss` when approved, or with `error=access_denied`, `state` and `iss` when denied. The code works once, within 60 seconds, and only for this client, redirect URI, PKCE challenge and server; the connection exists once the client trades it at `https://mcp.<env>/token`, and acts as the person who approved. `access` is what the person picked on the consent page, `READ`, `WRITE` or `MONEY`, whatever the client's scopes asked; left out, the preselected access (`READ` or `WRITE`) is granted, so `MONEY` is granted only when sent. A request is decided once. An `INTERNAL` request opens `mcp.<env>/internal` and may be approved or denied only by Nicer staff with the superadmin platform role, on the same consent page in the portal. A person holds at most 20 connections: Nicer never removes one to make room, not even the oldest unused one, so at the limit the approval fails and the request stays open until the person revokes one or it expires. Errors: 400 `ERROR_BODY_VALIDATION` for an `access` with `DENY`; 404 `ERROR_ITEM_NOT_FOUND` for a request that does not exist, has expired or was already decided; 403 `ERROR_MCP_SESSION_REQUIRED` for a token minted from a connection; 403 `ERROR_FORBIDDEN` for deciding an `INTERNAL` request as anyone but a platform superadmin; 409 `ERROR_MCP_CONNECTION_LIMIT` for approving with 20 connections held; 429 `ERROR_RATE_LIMIT` past 10 decisions an hour.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Path parameters

- `requestId` (`agent.mcp.authorizations.update.path.requestId`; string, required)

## Request body

_Required._

- `decision` (`agent.mcp.authorizations.update.decision`; string, required) — APPROVE sends the client a one-time code; DENY sends it error=access_denied.
  - one of `"APPROVE"`, `"DENY"`
- `access` (`agent.mcp.authorizations.update.access`; string, optional) — Only with APPROVE: the access the person picked, READ, WRITE or MONEY, whatever the client's scopes asked. Left out, the access the consent page preselects (READ or WRITE, never MONEY): MONEY is granted only when sent here.
  - one of `"READ"`, `"WRITE"`, `"MONEY"`

## Example request

```json
{
  "access": "READ",
  "decision": "APPROVE"
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
});

await nicer.agent.mcp.authorizations.update({
  "requestId": "string",
  "access": "READ",
  "decision": "APPROVE"
});
```

### Nicer CLI

```bash
nicer agent mcp authorizations update --request-id 'string' --input - <<'JSON'
{
  "access": "READ",
  "decision": "APPROVE"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/agent/mcp/authorizations/<requestId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "access": "READ",
  "decision": "APPROVE"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/agent/mcp/authorizations/<requestId>';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({access: 'READ', decision: 'APPROVE'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/agent/mcp/authorizations/<requestId>"

payload = {
    "access": "READ",
    "decision": "APPROVE"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "redirectUrl": "http://example.com"
}
```

- `redirectUrl` (`agent.mcp.authorizations.update.response.200.redirectUrl`; string, required) — The client's redirect URI with the authorization response in its query: code, state and iss when approved (RFC 6749 §4.1.2, RFC 9207), or error=access_denied, state and iss when denied (RFC 6749 §4.1.2.1). The consent page navigates to it.
  - format: `uri`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.mcp.authorizations.update.response.400.errorCode`; string, required)
- `errorMessage` (`agent.mcp.authorizations.update.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.mcp.authorizations.update.response.401.errorCode`; string, required)
- `errorMessage` (`agent.mcp.authorizations.update.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.mcp.authorizations.update.response.403.errorCode`; string, required)
- `errorMessage` (`agent.mcp.authorizations.update.response.403.errorMessage`; string, required)

### 429

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.mcp.authorizations.update.response.429.errorCode`; string, required)
- `errorMessage` (`agent.mcp.authorizations.update.response.429.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Assistant/agent.mcp.authorizations.update/index.md
