# Ask for a revision to be merged, as an agent

> Page: https://docs.plotwork.dev/api/post-v1-boards-board-tabs-tab-revisions-revision-merge-request. Index of every page: https://docs.plotwork.dev/llms.txt

The revision waits for a person who manages the board, who merges or declines it in the portal.

`POST /v1/boards/{board}/tabs/{tab}/revisions/{revision}/merge-request`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Ask for a revision to be merged, as an agent. |
| What does it take? | A JSON body of type [`BoardMergeRequestBody`](https://docs.plotwork.dev/api/schemas.md#boardmergerequestbody). |
| What does it return? | Status 200 with a body of type [`AgentBoardMergeRequest`](https://docs.plotwork.dev/api/schemas.md#agentboardmergerequest). |
| What can go wrong? | `400` the body is not valid; `401` the API key is missing or not valid; `403` the account's plan does not include the REST API (plan.rest_not_included), the key is a person's own (boards.org_key_required), a trusted publisher (boards.publisher_not_allowed), an organisation key without the boards scope (key.scope_missing), boards are not on (boards.not_enabled), or the caller may look but not change the board (boards.forbidden); `404` no such board, tab or revision, or one not open to the caller (boards.revision_not_found): the cases look alike; `409` the revision is merged or discarded (boards.revision_closed); `413` the body is larger than the API takes; `429` too many requests, or a daily limit is spent; `503` live whiteboards are not set up on this server. Every failure uses the one error envelope. |

## What it does

The revision waits for a person who manages the board, who merges or declines it in the portal. An agent never merges. The REST twin of request_merge.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `board` | `string` | yes | The board's id: 22 letters and digits. |
| `tab` | `string` | yes | The tab's id: 12 letters and digits. |
| `revision` | `string` | yes | The revision's id. |

## Request body

The body has the type [`BoardMergeRequestBody`](https://docs.plotwork.dev/api/schemas.md#boardmergerequestbody).

| Field | Type | Required | Description |
|---|---|---|---|
| `note` | `string` | no | at least 1 character; at most 500 characters. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The request. | [`AgentBoardMergeRequest`](https://docs.plotwork.dev/api/schemas.md#agentboardmergerequest) |
| 400 | The body is not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 401 | The API key is missing or not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | The account's plan does not include the REST API (plan.rest_not_included), the key is a person's own (boards.org_key_required), a trusted publisher (boards.publisher_not_allowed), an organisation key without the boards scope (key.scope_missing), boards are not on (boards.not_enabled), or the caller may look but not change the board (boards.forbidden). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such board, tab or revision, or one not open to the caller (boards.revision_not_found): the cases look alike. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 409 | The revision is merged or discarded (boards.revision_closed). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 413 | The body is larger than the API takes. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests, or a daily limit is spent. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Live whiteboards are not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`AgentBoardMergeRequest`](https://docs.plotwork.dev/api/schemas.md#agentboardmergerequest).

| Field | Type | Required | Description |
|---|---|---|---|
| `revision` | `any` | yes |  |
| `revision.id` | `string` | yes | at least 12 characters; at most 12 characters; pattern `^[0-9A-Za-z]+$`. |
| `revision.tab` | `string` | yes |  |
| `revision.name` | `string` | yes |  |
| `revision.author` | `RevisionPerson` | yes |  |
| `revision.author.kind` | `"person" \| "agent" \| "key"` | yes |  |
| `revision.author.label` | `string` | yes |  |
| `revision.visibility` | `"private" \| "board" \| "people"` | yes | private: the author only; board: everyone the board is open to; people: the author and the people named. |
| `revision.status` | `"open" \| "pending" \| "merged" \| "discarded"` | yes | open, pending (a merge waits for approval), merged, or discarded. |
| `revision.baseVersion` | `integer` | yes | The main version it forked from, or was last updated from. |
| `revision.version` | `integer` | yes |  |
| `revision.behind` | `integer` | yes | Main versions made since baseVersion. |
| `revision.createdAt` | `integer` | yes |  |
| `revision.updatedAt` | `integer` | yes |  |
| `revision.updatedBy` | `RevisionPerson` | yes |  |
| `revision.updatedBy.kind` | `"person" \| "agent" \| "key"` | yes |  |
| `revision.updatedBy.label` | `string` | yes |  |
| `revision.readable` | `boolean` | yes | False for a private revision shown by its name only, to the people who manage the board. |
| `revision.mine` | `boolean` | yes |  |
| `revision.request` | `object \| null` | yes |  |
| `revision.request.by` | `RevisionPerson` | yes |  |
| `revision.request.at` | `integer` | yes |  |
| `revision.request.note` | `string \| null` | yes |  |
| `revision.review` | `object \| null` | yes |  |
| `revision.review.by` | `RevisionPerson` | yes |  |
| `revision.review.at` | `integer` | yes |  |
| `revision.review.comment` | `string \| null` | yes |  |
| `revision.mergedVersion` | `integer \| null` | yes |  |
| `revision.mergedBy` | `any` | yes |  |
| `revision.mergedBy.kind` | `"person" \| "agent" \| "key"` | yes |  |
| `revision.mergedBy.label` | `string` | yes |  |
| `revision.closedAt` | `integer \| null` | yes |  |
| `revision.shared` | `integer` | yes | People it is shared with by name. |
| `status` | `"pending"` | yes |  |
| `mergeable` | `boolean` | yes |  |
| `conflicts` | `BoardMergeConflict[]` | yes |  |
| `conflicts[].key` | `string` | yes | The statement: its id, its label in quotes, or an edge by its ends. A resolution names it. |
| `conflicts[].subject` | `string` | yes |  |
| `conflicts[].base` | `string \| null` | yes |  |
| `conflicts[].main` | `string \| null` | yes |  |
| `conflicts[].revision` | `string \| null` | yes |  |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
