Skip to main content

Collections Endpoint Reference

Reference for 9 Collections endpoints of the Talonic API: parameters, request body, curl and Node.js examples, response and errors.

Named groups of documents, filled by rules and by hand, and optionally assigned to people or groups.

Every request needs an API key in the Authorization: Bearer header. Examples read the key from the TALONIC_API_KEY environment variable.

GET/v1/documents/{id}/collections

Required scope: read

Path parameters

id*string (uuid)

curl

curl -X GET 'https://api.talonic.com/v1/documents/3fa85f64-5717-4562-b3fc-2c963f66afa6/collections' \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/documents/3fa85f64-5717-4562-b3fc-2c963f66afa6/collections", {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 404 — The requested resource was not found.
  • 429 — Daily rate limit exceeded.
PATCH/v1/documents/{id}/traits

Required scope: documents:write

Path parameters

id*string (uuid)

Request body (application/json)

addstring[]
removestring[]

curl

curl -X PATCH 'https://api.talonic.com/v1/documents/3fa85f64-5717-4562-b3fc-2c963f66afa6/traits' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "add": [
    "string"
  ],
  "remove": [
    "string"
  ]
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/documents/3fa85f64-5717-4562-b3fc-2c963f66afa6/traits", {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "add": [
      "string"
    ],
    "remove": [
      "string"
    ]
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 404 — The requested resource was not found.
  • 429 — Daily rate limit exceeded.
POST/v1/documents/{id}/move

Required scope: documents:write

Path parameters

id*string (uuid)

Request body (application/json)

fromstring (uuid)
tostring (uuid)

curl

curl -X POST 'https://api.talonic.com/v1/documents/3fa85f64-5717-4562-b3fc-2c963f66afa6/move' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/documents/3fa85f64-5717-4562-b3fc-2c963f66afa6/move", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "from": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "to": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 404 — The requested resource was not found.
  • 409 — The request conflicts with the current resource state.
  • 429 — Daily rate limit exceeded.
PUT/v1/documents/{id}/parties

Required scope: documents:write

Path parameters

id*string (uuid)

Request body (application/json)

parties*DocumentParty[]
completeboolean

curl

curl -X PUT 'https://api.talonic.com/v1/documents/3fa85f64-5717-4562-b3fc-2c963f66afa6/parties' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "parties": [
    {
      "id": "email:jane@acme.com",
      "role": "from"
    }
  ],
  "complete": true
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/documents/3fa85f64-5717-4562-b3fc-2c963f66afa6/parties", {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "parties": [
      {
        "id": "email:jane@acme.com",
        "role": "from"
      }
    ],
    "complete": true
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 404 — The requested resource was not found.
  • 429 — Daily rate limit exceeded.
GET/v1/collections/config

Required scope: read

curl

curl -X GET 'https://api.talonic.com/v1/collections/config' \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/collections/config", {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 429 — Daily rate limit exceeded.
PUT/v1/collections/config

Required scope: documents:write

Query parameters

dry_runbooleanCheck and preview the change; nothing is saved. Default: false
prunebooleanRemove keyed collections the document does not name. Default: false

Request body (application/json)

documentobjectThe configuration document.
yamlstringThe configuration document as YAML or JSON text.

curl

curl -X PUT 'https://api.talonic.com/v1/collections/config' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "document": {},
  "yaml": "string"
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/collections/config", {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "document": {},
    "yaml": "string"
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 409 — The request conflicts with the current resource state.
  • 429 — Daily rate limit exceeded.
POST/v1/collections/proposal

Required scope: read

curl

curl -X POST 'https://api.talonic.com/v1/collections/proposal' \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/collections/proposal", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 429 — Daily rate limit exceeded.
GET/v1/collections/directory

Required scope: read

curl

curl -X GET 'https://api.talonic.com/v1/collections/directory' \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/collections/directory", {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 429 — Daily rate limit exceeded.
PUT/v1/collections/directory

Required scope: documents:write

Request body (application/json)

entriesobject[]
removestring (uuid)[]
waitbooleanWait up to 60 seconds for the documents to be relabelled.

curl

curl -X PUT 'https://api.talonic.com/v1/collections/directory' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "entries": [
    {
      "match_value": "string",
      "relationship": "string"
    }
  ],
  "remove": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "wait": true
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/collections/directory", {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "entries": [
      {
        "match_value": "string",
        "relationship": "string"
      }
    ],
    "remove": [
      "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    ],
    "wait": true
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 404 — The requested resource was not found.
  • 429 — Daily rate limit exceeded.