# Ask the client

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

## POST /v1/entities/{entityId}/cases/{caseId}/client-requests

Ask the client

Ask the client one question on this case: one `client_request`, and the case waits `awaiting_client`. `kind` is `question` (default) or `document` (a file the books lack — answered by an upload, `finalizeUpload`'s `answersRequestId`); a grant is asked through `requestGrant` (422 `request_kind_invalid`). `addressee` names who it is for — a role or one seated person (default `{ role: 'member' }`; a person without a seat reaching the entity is 422). `missingInfo` names the typed facts the answer may assert. Channel `app` only until a sender exists (`email`/`sms` are 422 `channel_unavailable`). The client-minted id is the idempotency key: a retry is the same request; the same id with another question is 409.

Operation ID: `askClient`

### Parameters

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

### Request body

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

### Responses

#### 200 Duplicate-ok: this id was asked.

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

#### 201 The question, asked.

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

#### 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"
    }
  }
}
```
