# Pin a thread message

Pins the message a thread keeps at the top, or with `{pinned: false}` unpins it. Anyone on the thread may pin, not only the author: what matters is the thread's business. Answers the message.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/threads/{threadId}/messages/{messageId}/pin`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| threadId | path | string | Yes |
| messageId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "pinned": true
  },
  "params": {
    ":key": "string",
    ":messageId": "",
    ":threadId": ""
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "authorName": "string",
    "authorUserId": 1.5,
    "body": "string",
    "createdAt": "string",
    "id": "",
    "mentions": [
      "string"
    ],
    "pinned": true,
    "threadId": ""
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
