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

# Reference

> Every method in the SDK.

## `new Doconda(options?)`

`apiKey`, `baseUrl`, `maxRetries`, `fetch`. See [get started](/en/sdk/introduction).

## `doconda.documents`

| Method | Returns | |
| - | - | - |
| `create(body, { idempotencyKey?, signal? })` | `Document` | Creates, reviews or edits, and waits for it to finish. |
| `createInBackground(body, options?)` | `Document` | Responds immediately (`status: "queued"`). |
| `stream(body, options?)` | `AsyncGenerator<DocumentEvent>` | Creates and yields its events live. |
| `wait(id, { signal? })` | `Document` | Waits for it to finish. |
| `get(id)` | `Document` | Its current state. |
| `list({ status? })` | `AsyncGenerator<Document>` | All of them, newest first. |
| `page({ limit?, cursor?, status? })` | `{ data, next_cursor }` | A single page. |
| `events(id, { after?, signal? })` | `AsyncGenerator<DocumentEvent>` | Its events, resumable. |
| `cancel(id)` | `Document` | Stops it if it has not finished yet. |
| `outputs(id, { expiresIn? })` | `Output[]` | Download links (and an artifact's page). |
| `download(id, kind)` | `Uint8Array` | Downloads `docx`, `pdf`, `pptx`, `xlsx`… |
| `report(id)` | `Report` | Issues, fixes and changes. |
| `data(id)` / `data(id, collection)` | collections / records | An artifact's data. |

The `body` is the same as for [`POST /documents`](/en/api-reference/introduction), without `stream` or `background`.

## `doconda.files`

| Method | Returns | |
| - | - | - |
| `upload(file, filename)` | `DocondaFile` | `Blob`, `File` or bytes (`Uint8Array`, `Buffer`). |
| `get(id)` | `DocondaFile` | Its details. |
| `delete(id)` | — | Deletes it. |

## `DocondaError`

`status`, `code`, `message`, `errors`, `requestId`. See [errors and retries](/en/sdk/errors).

## Types

`Document`, `DocumentEvent`, `Output`, `Report`, `ArtifactRecord` and `CreateDocumentBody` are exported from
`@doconda/sdk`: they are the same ones the API uses to validate each request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.