# API reference
Source: https://docs.file.ai/api-reference/overview

> Base URLs, authentication and the conventions every fileAI endpoint shares, with an index of every endpoint group.

Get started

# API reference

Copy pageCopy page

Base URLs, authentication and the conventions every fileAI endpoint shares, with an index of every endpoint group.

Copy pageCopy page

The fileAI API is REST over HTTPS. Every endpoint lives under `/v1`, takes and returns JSON, authenticates with an `x-api-key` header, and answers errors in one format. This page covers what all endpoints share; the pages below it describe each endpoint, with a **Try it** playground on every one.

## 

[​

](#make-a-request)

Make a request

Host`[https://api.orion.file.ai/prod](https://api.orion.file.ai/prod)`

The default instance. Other regions only change the hostname; see [Regions](/authentication#regions).

Version`/v1`

The only version. Changes inside it are additive; see [Versioning](/api/versioning).

Key`x-api-key: $FILEAI_API_KEY`

A project key, or a personal key plus an `x-project-id` header. Create keys at the [Developer Portal](https://developer.file.ai); see [Authentication](/authentication#key-types).

Trace`X-Request-Id`

On every response. Quote it to support; send your own to correlate.

The Developer Portal works with Developer Portal workspaces. If your workspace was set up in the fileAI app, create keys in the app instead: **Settings → API Keys** at [orion.file.ai](https://orion.file.ai).

A quick check that your key and host are right is to ask which account the key belongs to. The call fails with `401` if the key is wrong, and otherwise names the project and workspace your requests land in:

cURL

Python

Node.js

```
curl "https://api.orion.file.ai/prod/v1/me" \
  -H "x-api-key: $FILEAI_API_KEY"
```

```
import os, requests

r = requests.get(
    "https://api.orion.file.ai/prod/v1/me",
    headers={"x-api-key": os.environ["FILEAI_API_KEY"]},
)
r.raise_for_status()  # 401: wrong key or wrong instance
print(r.json()["project"]["name"], r.headers["X-Request-Id"])
```

```
const res = await fetch("https://api.orion.file.ai/prod/v1/me", {
  headers: { "x-api-key": process.env.FILEAI_API_KEY },
});
if (!res.ok) throw new Error(`${res.status}: wrong key or wrong instance`);
const me = await res.json();
console.log(me.project.name, res.headers.get("x-request-id"));
```

A key only authenticates on the instance that issued it. If you get `401` with a key you know is valid, check the hostname before anything else.

## 

[​

](#conventions)

Conventions

What every endpoint does

Read more

**Errors**

RFC 9457 problem documents (`application/problem+json`) with a stable `code` to branch on and a `requestId`. Branch on `code`, never on `detail`.

[Errors](/api/errors)

**Pagination**

`GET /v1/files`, `/v1/schemas` and `/v1/directories` support cursor mode (`cursor`, `limit`; response `pagination.nextCursor`, `pagination.hasMore`). Agent session lists use cursor mode only. Other list endpoints use `page` and `limit`.

[Pagination](/api/pagination)

**Retries**

Send an `Idempotency-Key` on JSON writes: a retry with the same key and body returns the stored response for 24 hours. `multipart/form-data` endpoints (`/v1/extract`, `/v1/split`, `/v1/classify`) ignore the key, so a retry creates a new job.

[Idempotency](/api/idempotency)

**Rate limits**

Every authenticated response carries `RateLimit` and `RateLimit-Policy`. A `429 RATE_LIMITED` adds `Retry-After`.

[Rate limits](/api/rate-limits)

**Long-running work**

Uploads, document jobs and forensics runs return an id at once. Poll it, or receive a callback where one exists.

[Async jobs](/api/async-jobs)

**Change**

New fields, optional parameters, error codes and status values can appear inside `/v1`. Ignore what you don’t recognize.

[Versioning](/api/versioning)

## 

[​

](#endpoint-groups)

Endpoint groups

[**Uploads**Request a presigned URL, upload single files, batches and large files in parts, and track processing._8 endpoints_](/api-reference/uploads/upload-a-file)[**Files**List and delete files, read extracted values and page text, correct values, re-run extraction and set export status._7 endpoints_](/api-reference/files/get-all-files)[**Schemas & file types**List schemas and file types, edit field definitions, approve, rename or delete file types, and import or export schemas._10 endpoints_](/api-reference/schemas-file-types/get-file-types)[**Document jobs**Extract, split or classify a document without storing it, then poll the job._4 endpoints_](/api-reference/document-jobs/submit-a-document-for-extraction)[**Forensics**Run fileForensics checks on a stored file, read the run, retry or delete it._5 endpoints_](/api-reference/forensics/start-a-forensics-run-on-a-stored-file)[**Folders**Create, list and delete folders, attach, remove and move files, and read checklist results._7 endpoints_](/api-reference/folders/get-all-directories-folders)[**Agent sessions**Ask Minto questions about your files and read the answers turn by turn._7 endpoints_](/api-reference/agent-sessions/create-an-agent-session)[**Previews**Create file previews, one at a time or in a batch._2 endpoints_](/api-reference/previews/create-a-file-preview)[**Query & workflows**Run a query builder configuration, read saved AI queries and read workflow results._5 endpoints_](/api-reference/query-workflows/execute-a-query-builder-configuration)[**Account**See which key, project and workspace a request uses._1 endpoint_](/api-reference/account/get-the-account-behind-this-api-key)[**Workspace**Read and update project defaults, and read your workspace subscription._3 endpoints_](/api-reference/workspace/get-project-setting)

## 

[​

](#related)

Related

## API quickstart

Upload a file and read its values end to end.

## Production checklist

Everything to set up before you go live.

[

Upload a file

Upload a file to the server, this will return a presigned upload url to be used for the upload.

Next

](/api-reference/uploads/upload-a-file)

⌘I

## On this page

*   [Make a request](#make-a-request)
*   [Conventions](#conventions)
*   [Endpoint groups](#endpoint-groups)
*   [Related](#related)
