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-idheader. - Sorted by name, case-sensitively. Names starting with an uppercase letter come before names starting with a lowercase one, so
Zebrais listed beforeapple. - 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=voicefindsInvoicesandvoice 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 useFILEAI_BASE_URL, set to https://api.orion.file.ai/prod/v1 or your regional host.
Response
200 OK
Page through all tags
This endpoint uses page numbers, not cursors. Request pages in order until you havetotal 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
tagswithGET /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, yourPATCHoverwrites 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. LeavingtagIdsout 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_FAILEDnaming 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.
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 oncode.
400: personal key without x-project-id
400: personal key without x-project-id
401: missing or unknown key
401: missing or unknown key
detail Invalid API key.403: inactive key or project out of reach
403: inactive key or project out of reach
detail You do not have access to this project.422: invalid query parameter
422: invalid query parameter
Request:
GET /v1/tags?limit=500429: rate limit exceeded
429: rate limit exceeded
Related
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.