# Deny an agent request

Denies a pending request and returns the receipt. Requires a signed-in session belonging to the grant’s owner. Denial sticks to the action, so asking again in different words returns the same denied decision.

## POST `/v1/approvals/{approvalId}/deny`

### Authorization

```
__Host-better-auth.session_token
```
API key · cookie required

Dashboard session cookie set at sign-in. An operation that lists only this scheme needs a person: API keys and machine credentials are refused. The same session token also works as `Authorization: Bearer`.

### Path parameters

`approvalId` string required
- min length 1

### Responses

#### 200 Response for status 200

```json
{
  "$schema": "string<uri>",
  "data": {
    "id": "string",
    "status": "string",
    "result": {
      "property1": null,
      "property2": null
    }
  }
}
```

- `$schema` string <uri>  
  Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.

- `data` object required  
  Show properties Hide properties  
  - `id` string required  
  - `status` string required  
    - Allowed: `completed`, `denied`, `expired`
  - `result` object  
    default Error. Every 4xx and 5xx response is one RFC 9457 problem document served as `application/problem+json`.

#### Error Response

```json
{
  "$schema": "string<uri>",
  "type": "string",
  "title": "string",
  "status": integer,
  "detail": "string",
  "code": "string",
  "pointer": "string",
  "details": {
    "property1": null,
    "property2": null
  },
  "suggestions": ["string"],
  "next": ["string"],
  "requestId": "string"
}
```

### Try it

#### Server

Base URL: https://api.spacefast.com

#### cURL Example

```
curl -X POST "https://api.spacefast.com/v1/approvals/string/deny" \
  -H "Cookie: __Host-better-auth.session_token=YOUR_API_KEY"
```

#### JavaScript Example

```
const response = await fetch("https://api.spacefast.com/v1/approvals/string/deny", {
  method: "POST",
  headers: {
    "Cookie": "__Host-better-auth.session_token=YOUR_API_KEY"
  }
});
```

#### Python Example

```
import requests

response = requests.post(
    "https://api.spacefast.com/v1/approvals/string/deny",
    headers={
        "Cookie": "__Host-better-auth.session_token=YOUR_API_KEY"
    },
)
```
