# Answer a grant ask

Source: https://amanucci.com/fr/docs/developers/api/cases/answerGrantRequest

## POST /v1/entities/{entityId}/client-requests/{requestId}/grant-answer

Answer a grant ask

An owner approves or denies the firm's grant ask, in ONE transaction (§12 q. 33 (a)): one `access_grant` row is appended (`granted` true or false, `granted_by` you, `reason` the request id) and the ask is answered with it. Not a signed act. A member is 403 `owner-required`; a firm seat is 404; a question or document ask is 422 `request_kind_invalid`; an answered ask is 409; granting a `documents.issue` ask while `documents.exchange` is not granted is 409 `grant_needs_exchange`, nothing written.

Operation ID: `answerGrantRequest`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "requestId",
    "in": "path"
  }
]
```

### Request body

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/AnswerGrantRequest"
      }
    }
  }
}
```

### Responses

#### 200 The ask, answered by the grant row.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/GrantAnswerResult"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 409 The world is not in the state the request assumed: a stale `expectedSeq`, or a transition already made.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
