# Link a request to a conversation (https://notert.io/docs/api/reference/link-a-request-to-a-conversation)

`POST /api/v1/conversations/{id}/requests`

Records that a conversation asked for a request already on the board: it votes for the request for the customer, so they count among the people who want it, and lists the request on the conversation. Where the workspace keeps no contact for the customer, the vote is the token's holder's. Sent again, it changes nothing.

Access: A token with conversations:write.

## Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The conversation's id. At most 64 characters. |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `requestId` | string | Yes | The request the customer asked for. At most 64 characters. |

## Response 200

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The conversation's id. |
| `requestId` | string | The request's id. Where an endpoint takes one, its key as its page shows it, such as REQ-44, works too. |
| `votedFor` | string | Whose vote the link holds: the customer's, or the token's holder's where the workspace keeps no contact for the customer, or banned them. One of: `customer`, `holder`. |
| `votes` | integer | How many people want the request now. Left out where it couldn't be read once the vote stood. |

## Errors

| Status | Code | Message |
| --- | --- | --- |
| 400 | `BAD_REQUEST` | Input validation failed. |
| 401 | `UNAUTHORIZED` | Send a valid API token as a Bearer token. |
| 403 | `BANNED` | The workspace banned that person, so nothing is written for them. |
| 403 | `HOLDER_NOT_ALLOWED` | The teammate who holds this API token's secret can't do this in the workspace now. A teammate who can should roll it in the workspace's settings. |
| 403 | `INSUFFICIENT_SCOPE` | This API token can't reply to or organize conversations. Create one that may in the workspace's settings. |
| 403 | `NETWORK_NOT_ALLOWED` | This API token works only from the networks it was made for. Call from one of them, or create a token for this one in the workspace's settings. |
| 403 | `NO_SEAT` | This workspace's plan has no seat for you. |
| 403 | `WORKSPACE_SUSPENDED` | This workspace is suspended. |
| 404 | `NOT_FOUND` | Not Found. |
| 409 | `CHANGED_MEANWHILE` | Something changed meanwhile. Try again. |
| 409 | `PICKS_GONE` | The customer was just removed from this workspace, so no vote was cast. Read the conversation again. Its data holds `board`, `tagIds`, `ownerIds`, `author`. |
| 429 | `TOO_MANY_REQUESTS` | Too Many Requests. Its data holds `retryAfter`. |

## Example request

```sh
curl -X POST https://app.notert.io/api/v1/conversations/3b7e2a90-5c1d-4f8e-9a6b-1d2c3e4f5a60/requests \
  -H "Authorization: Bearer $NOTERT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "requestId": "8f2c4b1e-3a6d-4f0b-9c2e-5d7a1b3c9e40"
}'
```

## Example response 200

```json
{
  "id": "3b7e2a90-5c1d-4f8e-9a6b-1d2c3e4f5a60",
  "requestId": "8f2c4b1e-3a6d-4f0b-9c2e-5d7a1b3c9e40",
  "votedFor": "customer",
  "votes": 12
}
```
