# Change definitions key threads threadId messages messageId

Rewrites one message. THE AUTHOR ONLY — anyone else's message is a 404 — and the row keeps an edited stamp so the app can say it was changed. A blank body is refused.

Access class: `def:read`.

## Endpoint

`PATCH /v1/definitions/{key}/threads/{threadId}/messages/{messageId}`

## 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": {
    "body": "string"
  },
  "params": {
    ":key": "string",
    ":messageId": "",
    ":threadId": ""
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "authorName": "string",
    "authorUserId": 1,
    "body": "string",
    "createdAt": "string",
    "editedAt": "string",
    "id": "",
    "mentions": [
      1
    ],
    "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"
}
```
