> ## Documentation Index
> Fetch the complete documentation index at: https://developers.essal.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Documents

> API reference for Essal Office document operations — list, create, update, delete, and publish.

## List Documents

`GET /v1/office/documents`

Returns a paginated list of documents in the workspace.

**Query Parameters**

| Parameter  | Type    | Description                              |
| ---------- | ------- | ---------------------------------------- |
| `owner_id` | string  | Filter by owner user ID                  |
| `status`   | enum    | `draft`, `published`, `archived`         |
| `limit`    | integer | Results per page (default: 20, max: 100) |
| `cursor`   | string  | Pagination cursor from previous response |

**Response**

```json theme={null}
{
  "data": [
    {
      "id": "doc_01HXYZABC",
      "title": "Q3 Strategy Overview",
      "status": "published",
      "owner_id": "usr_01HXYZ1234",
      "created_at": "2026-06-01T09:00:00Z",
      "updated_at": "2026-06-15T14:22:00Z"
    }
  ],
  "meta": { "total": 84, "next_cursor": "doc_01HXYZ999", "has_more": true }
}
```

***

## Get a Document

`GET /v1/office/documents/{id}`

Returns a single document by ID, including its content and permission settings.

***

## Create a Document

`POST /v1/office/documents`

**Request Body**

```json theme={null}
{
  "title": "Q4 Planning Notes",
  "content": "<h1>Q4 Planning</h1>",
  "content_type": "html",
  "permissions": { "visibility": "private" }
}
```

**Response** — `201 Created`

```json theme={null}
{
  "id": "doc_01HXYZ9876",
  "title": "Q4 Planning Notes",
  "status": "draft",
  "created_at": "2026-07-10T09:00:00Z"
}
```

***

## Update a Document

`PATCH /v1/office/documents/{id}`

Partial update — only fields provided are changed.

**Request Body**

```json theme={null}
{ "title": "Q4 Planning Notes (Revised)", "status": "published" }
```

***

## Delete a Document

`DELETE /v1/office/documents/{id}`

Soft-deletes the document. Pass `?hard=true` to permanently delete (irreversible).

**Response** — `204 No Content`
