Collections hold the faces the face_recognition booster matches a request against. What they are, what they cost and how a search reads is on Collections. Every route is at https://api.decisionnode.com/v1/collectionshttps://api.decisionnode.com/ and takes a Full access key; a Decisions-only key gets 403 key_scope_denied.
| Method and path | What it does |
|---|---|
POST /v1/collections | Create a collection |
GET /v1/collections | List collections: yours, newest first, then the public ones |
GET /v1/collections/{id} | Retrieve a collection |
DELETE /v1/collections/{id} | Delete a collection and every item in it |
POST / | Enroll a face: one face, with your reference, label and metadata |
GET / | List items, all or by reference |
PATCH / | Update an item: its reference, label or metadata |
DELETE / | Delete an item |
POST / | Add a document to a knowledge base: Markdown or text, indexed in the background |
PUT / | Replace a document, the old version answering until the new one is ready |
GET / | Retrieve an item; a document's stored text with ?include=text |
GET / | List a document's passages |
POST / | Search a knowledge base without a decision |
The collection object#
{
"id": "col_3f6c1a9e0b2d4c7f8a1e5d9b2c4f6a80",
"type": "face",
"name": "Staff, Stockholm office",
"public": false,
"items": 412,
"created_at": "2026-10-12T09:00:00Z",
"deletion": null
}idstringcol_and 32 hex digits for your own; the public collection's id is its name,celebrities.typestringface.namestring- 1 to 80 characters, unique among your collections, with no control or invisible characters.
publicbooleantrueon a public collection.itemsinteger- How many items it holds now.
created_atstring- When it was created, RFC 3339.
deletionnull- On your own collections only, and always
null. When an unpaid storage charge marks your items for deletion, the date reaches your owner and admins by email. A public collection has nodeletion.
A knowledge base#
A collection of type text holds documents for the knowledge booster (Knowledge) and carries these fields besides; it is never public.
{
"id": "col_3f6c1a9e0b2d4c7f8a1e5d9b2c4f6a80",
"type": "text",
"name": "Claims policy",
"public": false,
"items": 12,
"created_at": "2026-10-20T10:00:00Z",
"deletion": null,
"scope_key": "mission",
"chunks": 412,
"tokens": 81230,
"version": 41,
"status_counts": { "queued": 1, "processing": 1, "ready": 9, "failed": 1 },
"pinned": {
"tokens": 230,
"cap": 512,
"largest_scope": { "value": "M-42", "tokens": 96 }
}
}typestringtext.scope_keystring or null- The metadata key that scopes a document, 1 to 40 characters of
a-z,0-9and_; fixed for the knowledge base's life. See Scope. chunksinteger- Passages a request can read now.
tokensinteger- Their tokens.
versioninteger- Rises with every change a search can see: a document ready, edited or deleted.
status_countsobject- Documents by the status of their newest version:
queued,processing,ready,failed. pinnedobject- What pinned documents take of their cap:
tokens(the global pins and, with them, those of the largest scope value),cap(512 unless we set it otherwise, up to 4,096) andlargest_scope(that scopevalueand itstokens, ornull).
The item object#
{
"id": "itm_9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d",
"reference": "emp-1042",
"label": "Anna, reception",
"metadata": { "department": "reception", "badge": 1042, "visitor": false },
"created_at": "2026-10-12T09:00:00Z"
}idstringitm_and 32 hex digits.referencestring- Your key for the item, 1 to 64 characters of
A-Z,a-z,0-9and_ . : -. It may repeat within a collection. labelstring or null- Up to 128 characters, shown in a match;
nullon an item without one. metadataobject- Your flat metadata for the item,
{}when it has none. See metadata on Enroll a face. created_atstring- When it was enrolled, RFC 3339.
Who may call what#
- A Full access key only. A Decisions-only key gets
403key_scope_deniedon every route here, before anything else. - Creating and enrolling need a workspace in good standing: an empty balance is
402insufficient_credit, a suspended workspace403workspace_suspended. - Listing, reading and deleting stay open whatever the balance. Editing an item is free and stays open on an empty balance, but not for a suspended workspace.
- Public collections are read-only: an enrollment, an edit, a delete or a list of their items is
403collection_read_only. - A workspace whose data is kept in a storage location other than the default cannot create a collection or enroll:
403collections_region_unavailable, "Collections are not available yet for this workspace's storage location." - Limits: 100 collections and 1,000,000 items in all of them per workspace, unless we set yours otherwise; past them,
409collections_limit_reachedoritems_limit_reached.
Retrying a write#
POST /v1/collections, POST / and PATCH / take an optional Idempotency-Key header: 1 to 255 printable ASCII characters, kept 24 hours. Send a fresh key with each new write and the same key with every retry of it.
- The same key, route and body get the first answer again, its status and body, with
x-decisionnode-idempotent-replay: true: nothing is done or billed twice. - Only an answer that changed something or was billed is kept: a create's
201, an enrollment's201and its billed422no_face, an edit's200. Any other answer gives the key back, so a retry runs again. A529whose key could not be given back, and a request whose server went away mid-way, hold the key for its 60-second lease: a retry with it gets409idempotency_in_progressuntil then, and runs after. - A key is your workspace's: every API key of the workspace shares it, so two services must not reuse each other's keys.
- The same key with another body or route is
409idempotency_key_reused, "This Idempotency-Key was already used with a different request." Never retry it: use a new key. - While the first request still runs, a repeat is
409idempotency_in_progresswithRetry-After: 1. - A key sent twice, or not 1 to 255 printable ASCII characters, is
400api_usage_error. - The SDKs send a key of their own on every create and enrollment: a new UUID per call, the same on each of its retries.
Errors#
| Status | Type | When |
|---|---|---|
400 | api_usage_error | A bad query value on the items list, reference with reference_prefix, or a malformed Idempotency-Key |
400 | image_url_refused | An enrollment's url we do not fetch, as on a decision; not billed |
401 | authentication_error | The key is missing, unknown or revoked |
402 | insufficient_credit | A create or an enrollment the balance cannot pay |
403 | key_scope_denied | A Decisions-only key: "This key may only make decisions." |
403 | collection_read_only | A write to a public collection, or a list of its items |
403 | collections_region_unavailable | A create or an enrollment in a workspace whose storage location is not the default |
403 | workspace_suspended | A create, an enrollment or an edit in a suspended workspace |
404 | collection_not_found, item_not_found | No such collection or item for your workspace |
409 | collections_limit_reached, items_limit_reached | Past your workspace's limits |
409 | idempotency_key_reused, idempotency_in_progress | See Retrying |
413 | request_too_large_error | A create's or an edit's body over 4 KiB, or an enrollment over the request body limit |
422 | a detail list | A field out of bounds, a name already used (name_taken), a picture with no face (no_face, billed) or one that cannot be read (image_unreadable, not billed), bad metadata |
529 | overloaded_error | No room right now (retry after Retry-After); on an enrollment, details.reason enrollment_unpriced (never retried) or face_model_unavailable (retry later): see Enroll a face |