Tags are the labels your team puts on files in the fileAI app, such as Invoices or Needs review. GET /v1/tags lists the tags in a project, with each tag’s id, name, slug and color, so your integration can show the same labels or match them to its own.

How it works

  • One project per request. The list covers the project your API key works in. A project key uses its own project. A personal key names the project in the x-project-id header.
  • Sorted by name, case-sensitively. Names starting with an uppercase letter come before names starting with a lowercase one, so Zebra is listed before apple.
  • Deleted tags are left out. Every other tag in the project is listed, including tags that aren’t on any file yet.
  • Search matches part of a name. search=voice finds Invoices and voice notes. Matching ignores case, and characters such as . or * are matched literally, not as patterns.
  • Read-only keys work. Listing tags is a GET, so a read-only key can call it.

Example

The examples use FILEAI_BASE_URL, set to https://api.orion.file.ai/prod/v1 or your regional host.
With a personal key, add the project:

Response

200 OK

Page through all tags

This endpoint uses page numbers, not cursors. Request pages in order until you have total tags. A page past the end returns 200 with an empty data array.

Set a file’s tags

PATCH /v1/files/{fileId} with tagIds replaces the file’s tags with the ones you send. Use ids from GET /v1/tags.
200 OK
  • It replaces, not adds. To add a tag, read the file’s current tags with GET /v1/files?fileIds=<fileId>, append the new id, then send the full list. The two calls aren’t atomic: if something else changes the file’s tags in between, your PATCH overwrites that change. When more than one system tags the same files, have one of them own the tags, or read again after writing to check.
  • [] removes every tag. Leaving tagIds out keeps the current tags.
  • Up to 50 ids. Repeated ids are collapsed, and the order you send is kept.
  • All or nothing. An unknown or deleted tag id returns 422 VALIDATION_FAILED naming the bad ids, and the file is not changed.
  • Deleted files can’t be tagged. Changing the tags of a deleted file returns 404.
  • Read-only keys can’t set tags. This is a write, so a read-only key gets 403 READONLY_KEY.
The same endpoint records an export outcome with integrationExportStatus. You can send both in one request. If the file has an export status, the response includes its exportInfo too. See Xero export for the export fields. GET /v1/files returns each file’s tags as { id, name, slug, color }, in the order they were set. Deleted tags are left out.

Reference

Headers

Query parameters

page and limit must be whole numbers written as plain digits: 1.5, 1e1, two and repeated values such as page=1&page=2 are rejected. Any other query parameter is rejected too, so a typo such as serach= returns a 422 instead of being silently ignored.

Errors

Errors are problem documents. Branch on code.
An unknown key returns the same code with detail Invalid API key.
A personal key naming a project it can’t open returns the same code with detail You do not have access to this project.
Request: GET /v1/tags?limit=500
See List tags in the API reference to try the request in the playground.

Files and folders

Group files into folders in the app or with the API.

Authentication

Project and personal keys, and the x-project-id header.

Pagination

How other list endpoints page their results.

Errors

Problem documents, error codes and request ids.