Documents
List the workspace's documents, get one with its body as Markdown, and create and update documents. Reads need Read, writes need Write.
Overview
GET /api/v1/documents lists the documents in your workspace, and GET /api/v1/documents/{id} returns one of them with its body as Markdown. You get the documents you can read in the app, which means you can read every record a document links to. Deleted and archived documents never come back.
Both need the Read permission. A document linked to a candidate or an application also needs Read candidate data, which the API names candidates:read. So does a draft of the public applicant list, because its body names applicants. Without that permission these documents stay out of the list, and getting one answers 404. A key can hold it only while a workspace admin has Candidate data in the API turned on in Settings → API.
A key limited to some teams gets a document only when it has at least one link and every link is on those teams. A job counts when one of those teams has access to it, and a candidate when they have an application on one of those teams. A document with no link stays out, because nothing puts it on a team.
A title or a body holds what people wrote, and a document that links to nobody can still name someone in its text. Nothing else about who wrote the document comes back.
POST /api/v1/documents creates a document on a team or a job, and PATCH /api/v1/documents/{id} changes one. Both need the Write permission. You write only documents you can edit in the app, and never one linked to a candidate or an application.
Authentication, Errors and Rate limits cover what every operation shares. This page covers the parameters and the fields.
Request
curl "https://attia.app/api/v1/documents?limit=50" \ -H "Authorization: Bearer $ATTIA_API_KEY"All three query parameters are optional.
| Parameter | Type | Default | Meaning |
|---|---|---|---|
limit | integer, 1 to 100 | 25 | How many documents to return |
cursor | string | none | The next_cursor of the previous page |
updated_since | RFC 3339 timestamp | none | Only documents updated at or after this time |
A parameter outside this table gets a 400 with the code invalid-request. So does a parameter sent twice.
Response
The answer holds the documents in data, sorted by updated_at and then id, oldest change first. next_cursor is a string when more documents exist and null on the last page. The list carries no body, so get the document to read it.
{ "data": [ { "id": "0192f5c3-7d20-7b1e-a4f6-3c2d1e0f9a01", "title": "Interview plan", "targets": [ { "type": "job", "id": "0192f3a1-6b02-7d4c-8e11-5a9c0b7d3e01" } ], "created_at": "2026-10-02T08:15:30.482913Z", "updated_at": "2026-10-03T11:20:04.007311Z" } ], "next_cursor": null}| Field | Type | Meaning |
|---|---|---|
id | UUID | The document's id. It never changes |
title | string | The document's title |
targets | array | The records the document links to, each with a type and an id. Empty when it links to none |
created_at | timestamp | When the document was created |
updated_at | timestamp | When the document last changed. Adding, removing or moving a link counts |
In a target, type is candidate, application, job or team, and id is that record's id.
An enum can gain a value in version 1, so handle one you do not know. Timestamps, nulls and enums describes each format.
Page and poll
Paging and polling work as they do for jobs. Send next_cursor back as cursor until it is null, and poll with updated_since set five minutes before the largest updated_at you have stored. Jobs walks through both, and Pagination explains the sort order.
A document someone archives or deletes drops out of your answers, and so does one you lose access to. When you keep a copy, get each document you hold now and then, because a 404 is the only sign that it left.
Get one document
GET /api/v1/documents/{id} returns the document with that id. It takes no query parameters, so one gets a 400 with the code invalid-request.
curl "https://attia.app/api/v1/documents/0192f5c3-7d20-7b1e-a4f6-3c2d1e0f9a01" \ -H "Authorization: Bearer $ATTIA_API_KEY"The answer holds the document in data, with the same fields as a document in the list and its body.
| Field | Type | Meaning |
|---|---|---|
body_markdown | string | The body as Markdown, or as plain text when it holds something else. Empty when the document is empty |
Markdown here covers headings of levels 1 to 3, paragraphs, bulleted and numbered lists, bold, italic, links, and images uploaded to Attia, each on a line of its own. A body with anything else, such as a table or a comment, comes as its stored plain text with no formatting, so none of its words go missing.
A 404 with the code not-found means no document your key can read has that id. It may not exist, be deleted or archived, or belong to another workspace. It may link to a record you cannot read, or your key's permissions or teams may leave it out. Every one of these gets the same answer, so a 404 never tells you whether the document exists. An id that is not a UUID gets the same 404.
Create a document
POST /api/v1/documents creates a document on a team or a job. It needs the Write permission.
curl -X POST "https://attia.app/api/v1/documents" \ -H "Authorization: Bearer $ATTIA_API_KEY" \ -H "Idempotency-Key: 0192f5c4-1e2a-7b3c-9d4e-5f6a7b8c9d01" \ -H "Content-Type: application/json" \ -d '{"title": "Interview plan", "content": "## Rounds\n\nA **short** call first.", "job_id": "0192f3a1-6b02-7d4c-8e11-5a9c0b7d3e01"}'The body is a JSON object with a title, an optional body and exactly one of team_id and job_id.
| Field | Type | Meaning |
|---|---|---|
title | string | The title, at most 200 characters. It cannot be blank, and spaces at either end are removed |
content | string | The body as Markdown, at most 400,000 characters. Leave it out for an empty document |
team_id | UUID | The team the document belongs to |
job_id | UUID | The job the document belongs to |
The body takes the Markdown that Get one document returns: headings of levels 1 to 3, paragraphs, bulleted and numbered lists, bold, italic, links, and the markdown of an uploaded image on a line of its own. Anything else is kept as plain text.
A body that is not a JSON object gets a 400 with the code invalid-request. So does a missing or blank title, a title or a body over its limit, a numbered list that counts past 999,999,999, both team_id and job_id or neither, a field outside this table and any query parameter. errors names each one.
The answer is a 201 with the document in data, with the same fields as Get one document. The Location header holds the document's path. In the app, the workspace audit log names you as the creator, followed by "via API".
You must be able to edit documents on the team or the job in the app, and a key limited to some teams must include the team or one of the job's teams. Otherwise the answer is a 400 invalid-request that names team_id or job_id, and nothing is created. The answer is the same whether the team or the job does not exist, is archived, belongs to another workspace, or is one your key's teams leave out. A view-only workspace gets workspace-view-only.
The API does not create a document on a candidate or an application. Create those in the app.
Update a document
PATCH /api/v1/documents/{id} changes the title, the body or both. It needs the Write permission. A field you leave out keeps its value.
curl -X PATCH "https://attia.app/api/v1/documents/0192f5c3-7d20-7b1e-a4f6-3c2d1e0f9a01" \ -H "Authorization: Bearer $ATTIA_API_KEY" \ -H "Idempotency-Key: 0192f5c5-3a4b-7c5d-8e6f-7a8b9c0d1e02" \ -H "Content-Type: application/json" \ -d '{"title": "Interview plan, final"}'| Field | Type | Meaning |
|---|---|---|
title | string | The new title, with the rules of a create |
content | string | The new body as Markdown. It replaces the whole body |
A body with neither field gets a 400 invalid-request, and so does a field outside this table or a numbered list that counts past 999,999,999.
The answer is a 200 with the document in data, as Get one document gives it. In the app, the workspace audit log names you, followed by "via API".
A body with something Markdown cannot carry, such as a table or a comment, comes from Get one document as plain text. New content would delete the table, so the API does not change such a body: the answer is a 400 invalid-request that names content. A new title alone works. Change the body in the app.
A 404 with the code not-found means no document your key can edit has that id. Every case that gets a 404 from Get one document gets one here. So does a document you can read but not edit, one linked to a candidate or an application, and a draft of the public applicant list. Each gets the same answer. A view-only workspace gets workspace-view-only.
Retry a write safely
Every create and update needs an Idempotency-Key header. Pick a new value for each call: 1 to 255 letters, digits, - or _. A UUID works. A call without one gets a 400 idempotency-key-required.
When a call times out or the connection drops, send it again with the same key. Within 24 hours, the same key with the same body and the same API key writes nothing and gets the first answer back, plus the header Idempotency-Replayed: true. A replay checks again that you can read the document, so one you have lost access to since gets the refusal a new call would get.
The same key with another body or another API key gets a 422 idempotency-key-reused, and so does the same key after 24 hours, up to 90 days. A refused call keeps nothing, so you can send it again with the same key once you have fixed the cause.