# API Quickstart

Get up and running with the **Anesya Public API** in minutes.

The public API is designed around a simple workflow:

* [Upload a document](/api/schema/documents/document_create)
* [Create a parsing resource](/api/schema/parsings/parsing_create)
* [Create an extract resource from a schema](/api/schema/extracts/extract_create)

---

## Prerequisites

{% admonition type="info" name="Create an account and an API token" %}
  Before sending your first API request, <a href="https://dashboard.anesya.app/api" target='_blank'>create an Anesya account</a> and [generate an API token](/tutorials/api_key) from the dashboard.
{% /admonition %}

Anesya endpoints use the `X-API-Key` header:

```http
X-API-Key: <YOUR_API_KEY>
```

> Important: do not share your token and never commit it to Git.

---

## Quickstart

The fastest way to get started is:

1. [Upload a file](/api/schema/documents/document_create) with `POST /v0/documents`
2. [Create a parsing](/api/schema/parsings/parsing_create) with `POST /v0/parsing`
3. [Poll the parsing](/api/schema/parsings/parsing_retrieve) until its status reaches a final state
4. [Create an extract](/api/schema/extracts/extract_create) with `POST /v0/extract`
5. [Poll the extract](/api/schema/extracts/extract_retrieve) until its status reaches a final state

### Which Endpoint To Use

* Use [documents](/api/schema/documents/document_list) when you want to store uploaded files, [retrieve them](/api/schema/documents/document_retrieve), and [reuse them later in a parsing](/api/schema/parsings/parsing_create).
* Use [parsing](/api/schema/parsings/parsing_list) when you need OCR output, markdown content, and page-level parsing data, or when you want to [check processing status](/api/schema/parsings/parsing_retrieve).
* Use [extract](/api/schema/extracts/extract_create) when you want structured output generated from a schema and then [retrieve the final result](/api/schema/extracts/extract_retrieve).

---

## Common Error Codes

| HTTP Code | Description                             |
| --------- | --------------------------------------- |
| `200`     | Resource retrieved successfully         |
| `201`     | Resource created and processing started |
| `400`     | Missing or invalid fields               |
| `401`     | Missing or invalid authentication       |
| `404`     | Resource not found                      |

---

Need help? Contact us at [support@anesya.app](mailto:support@anesya.app).



## Servers

Anesya base url
```
https://api.anesya.app
```

## Security

### ApiKeyAuth

API key required for `v0` endpoints.

Type: apiKey
In: header
Name: X-API-Key

## Download OpenAPI description

[API Quickstart](https://docs.anesya.app/_bundle/API/schema.yaml)

## Documents

Upload, list, retrieve, and download source documents.

Start with [Create document](/api/schema/documents/document_create), browse your files with [List documents](/api/schema/documents/document_list), and continue to [Create parsing](/api/schema/parsings/parsing_create).

### List documents

 - [GET /v0/documents](https://docs.anesya.app/api/schema/documents/document_list.md): List all documents available in your Anesya workspace.

Related endpoints:

* Create document
* Retrieve document
* Create parsing

### Create document

 - [POST /v0/documents](https://docs.anesya.app/api/schema/documents/document_create.md): Upload a new document to Anesya using a multipart file upload.

Related endpoints:

* List documents
* Retrieve document
* Create parsing

### Retrieve document

 - [GET /v0/documents/{id}](https://docs.anesya.app/api/schema/documents/document_retrieve.md): Retrieve a document by ID.

Related endpoints:

* List documents
* Download document
* Create parsing

### Download document

 - [GET /v0/documents/{id}/download](https://docs.anesya.app/api/schema/documents/document_download.md): Get the download URL for a document file.

Related endpoints:

* Retrieve document
* List documents

## Parsings

Turn documents into OCR, markdown, and page-level parsing data.

Use [Create parsing](/api/schema/parsings/parsing_create) to start processing, [List parsings](/api/schema/parsings/parsing_list) to browse jobs, and [Retrieve parsing](/api/schema/parsings/parsing_retrieve) to poll one parsing until completion.

### List parsings

 - [GET /v0/parsing](https://docs.anesya.app/api/schema/parsings/parsing_list.md): List all parsings available in your Anesya workspace.

Related endpoints:

* Create parsing
* Retrieve parsing
* Create extract

### Create parsing

 - [POST /v0/parsing](https://docs.anesya.app/api/schema/parsings/parsing_create.md): Create one or more parsings from a document ID, a public URL, a list of public URLs, or a multipart file upload.

Related endpoints:

* List parsings
* Retrieve parsing
* Create extract

### Retrieve parsing

 - [GET /v0/parsing/{id}](https://docs.anesya.app/api/schema/parsings/parsing_retrieve.md): Retrieve a parsing by ID.

Related endpoints:

* List parsings
* Create extract

## Extracts

Generate structured output from a parsing and a schema.

Start with [Create extract](/api/schema/extracts/extract_create) and use [Retrieve extract](/api/schema/extracts/extract_retrieve) to poll the result.

### Create extract

 - [POST /v0/extract](https://docs.anesya.app/api/schema/extracts/extract_create.md): Create an extract from an existing parsing or directly from a document ID, a public URL, or a multipart file upload. When you provide a parsing ID, the parsing must already be in FINISHED or PARTIAL_FINISHED status.

Related endpoints:

* List parsings
* Retrieve parsing
* Retrieve extract

### Retrieve extract

 - [GET /v0/extract/{id}](https://docs.anesya.app/api/schema/extracts/extract_retrieve.md): Retrieve an extract by ID.

Related endpoints:

* Create extract
* Retrieve parsing

