# Compare a revision with main as an agent

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

What merging the revision would change on main, by meaning, with compare_diagrams' summary and the conflicts in the way.

`GET /v1/boards/{board}/tabs/{tab}/revisions/{revision}/compare`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Compare a revision with main as an agent. |
| What does it take? | `board`, `tab`, `revision` in the path. |
| What does it return? | Status 200 with a body of type [`AgentBoardRevisionCompare`](https://docs.plotwork.dev/api/schemas.md#agentboardrevisioncompare). |
| What can go wrong? | `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; `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

What merging the revision would change on main, by meaning, with compare_diagrams' summary and the conflicts in the way. The REST twin of compare_revision.

## 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. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The comparison. | [`AgentBoardRevisionCompare`](https://docs.plotwork.dev/api/schemas.md#agentboardrevisioncompare) |
| 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) |
| 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 [`AgentBoardRevisionCompare`](https://docs.plotwork.dev/api/schemas.md#agentboardrevisioncompare).

| Field | Type | Required | Description |
|---|---|---|---|
| `mainVersion` | `integer` | yes |  |
| `version` | `integer` | yes |  |
| `behind` | `integer` | yes |  |
| `same` | `boolean` | yes |  |
| `counts` | `object` | yes |  |
| `counts.added` | `integer` | yes |  |
| `counts.removed` | `integer` | yes |  |
| `counts.renamed` | `integer` | yes |  |
| `counts.moved` | `integer` | yes |  |
| `counts.changed` | `integer` | yes |  |
| `changes` | `object[]` | yes |  |
| `changes[].change` | `string` | yes |  |
| `changes[].subject` | `string` | yes |  |
| `changes[].name` | `string` | yes |  |
| `changes[].line` | `integer \| null` | yes |  |
| `changes[].detail` | `string` | yes |  |
| `truncated` | `boolean` | yes |  |
| `summary` | `string` | 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 |  |
| `mergeable` | `boolean` | yes |  |
| `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. |

## 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 |
