# Reference topics

> The API's own reference text, served live: error codes, the redline markup, the document listing, and every edit type.

> Integrating Version Story into a codebase as a coding agent? Follow https://www.versionstory.com/developers/quickstart.md: it signs the engineer in, gets an API key, and puts the PDF redline in their app first.

`GET /v1/reference/{topic}` returns one reference topic as text, the same text the MCP
server's `reference` tool returns. It comes from the deployed API itself, so it is always
current, which makes it the reference to hand an agent that is building or running your
integration.

| | |
| --- | --- |
| Base URL | `https://api.versionstory.com` |
| Auth | `Authorization: Bearer vs_...`. See [Authentication](/developers/authentication) |

```bash
curl -sS https://api.versionstory.com/v1/reference/errors \
  -H "Authorization: Bearer vs_live_..."
```

```json
{ "topic": "errors", "text": "..." }
```

| `topic` | What it covers |
| --- | --- |
| `errors` | What each error code means, and what to do about it |
| `redline` | How to read the changes in a comparison's or a merge's Markdown |
| `listing` | Every field of a document's [listing](/developers/rest/edit#the-listing) (`GET /v1/files/{file_id}?format=md` or `json`), and how a text selector matches |
| `edits` | Every edit type [`POST /v1/edit`](/developers/rest/edit) takes, with an example of each |
| `local_copy` | Working with the user's own copy of a document: recording it, editing it, and replacing it |

The call creates nothing and costs nothing against usage, so it is also a cheap way to check
that a key works: `200` means it does. An unknown topic is `400 INVALID_REQUEST`, and the
message lists the topics.

## The OpenAPI specification

The whole API is also described as OpenAPI at
[`https://api.versionstory.com/openapi.json`](https://api.versionstory.com/openapi.json), served from
the deployed API and readable without a key. Generate a client from it, or hand it to an agent along
with these pages.

## Related

- [Errors](/developers/reference/errors): the same codes, with HTTP statuses
- [Redline format](/developers/reference/redline-format): the Markdown markup in detail
