Skip to main content

Accounts Payable Endpoint Reference

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

Reads the supplier bills a workspace already captured into posting-ready vendor bills (vendor, entity, terms, due date, lines with account, department and class) and splits them into ready and held, with the dollars at stake. A simulated NetSuite sandbox shows the exact records a posting sends and posts them without calling NetSuite. These endpoints belong to the Accounts Payable app (catalog slug payables); they return 404 in a workspace that has not added the app — GET /v1/apps lists a workspace's apps by slug.

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

GET/v1/ap/risk

curl

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

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/ap/risk", {
  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 — The risk matrix.

{
  "currency": "string",
  "defaults": {
    "likelihood": {},
    "impact": {
      "high": 1.5,
      "medium": 1.5
    }
  },
  "overrides": {
    "likelihood": {},
    "impact": {
      "high": 1.5,
      "medium": 1.5
    }
  },
  "settings": {
    "likelihood": {},
    "impact": {
      "high": 1.5,
      "medium": 1.5
    }
  },
  "matrix": {}
}
PUT/v1/ap/risk

Request body (application/json)

riskobject

curl

curl -X PUT 'https://api.talonic.com/v1/ap/risk' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "risk": {
    "likelihood": {},
    "impact": {
      "high": 1.5,
      "medium": 1.5
    }
  }
}'

Node.js (18+)

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

Response 200 — The risk matrix as saved.

{
  "currency": "string",
  "defaults": {
    "likelihood": {},
    "impact": {
      "high": 1.5,
      "medium": 1.5
    }
  },
  "overrides": {
    "likelihood": {},
    "impact": {
      "high": 1.5,
      "medium": 1.5
    }
  },
  "settings": {
    "likelihood": {},
    "impact": {
      "high": 1.5,
      "medium": 1.5
    }
  },
  "matrix": {}
}
  • 400 — The request is invalid.
GET/v1/ap/tolerance

curl

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

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/ap/tolerance", {
  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 — The tolerance.

{
  "value_tolerance_pct": 1.5,
  "default": 1.5
}
PUT/v1/ap/tolerance

Request body (application/json)

value_tolerance_pctnumber

curl

curl -X PUT 'https://api.talonic.com/v1/ap/tolerance' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "value_tolerance_pct": 1.5
}'

Node.js (18+)

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

Response 200 — The tolerance as saved.

{
  "value_tolerance_pct": 1.5,
  "default": 1.5
}
  • 400 — The request is invalid.
POST/v1/ap/rules/checks/approve

Request body (application/json)

rule_ids*string (uuid)[]

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/checks/approve' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "rule_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ]
}'

Node.js (18+)

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

Response 201 — How many rules changed.

{
  "approved": 1
}
  • 400 — The request is invalid.
GET/v1/ap/dossier

curl

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

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/ap/dossier", {
  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 — The choice and the options.

{
  "selected": {
    "schema_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "columns": {
      "supplier_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "order_number": "string",
      "contract_number": "string",
      "invoice_number": "string",
      "document_type": "string",
      "order_value": "string",
      "document_date": "string",
      "order_conditions": "string",
      "contract_conditions": "string",
      "valid_until": "string"
    },
    "order_type": "string",
    "contract_value": 1.5,
    "contract_type": "string"
  },
  "state": "none",
  "specs": [
    {
      "schema_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string",
      "columns": [
        "string"
      ]
    }
  ]
}
PUT/v1/ap/dossier

Request body (application/json)

dossierobject

curl

curl -X PUT 'https://api.talonic.com/v1/ap/dossier' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "dossier": {
    "schema_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "columns": {
      "supplier_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "order_number": "string",
      "contract_number": "string",
      "invoice_number": "string",
      "document_type": "string",
      "order_value": "string",
      "document_date": "string",
      "order_conditions": "string",
      "contract_conditions": "string",
      "valid_until": "string"
    },
    "order_type": "string",
    "contract_value": 1.5,
    "contract_type": "string"
  }
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/ap/dossier", {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "dossier": {
      "schema_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "columns": {
        "supplier_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "order_number": "string",
        "contract_number": "string",
        "invoice_number": "string",
        "document_type": "string",
        "order_value": "string",
        "document_date": "string",
        "order_conditions": "string",
        "contract_conditions": "string",
        "valid_until": "string"
      },
      "order_type": "string",
      "contract_value": 1.5,
      "contract_type": "string"
    }
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — The choice as saved and the options.

{
  "selected": {
    "schema_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "columns": {
      "supplier_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "order_number": "string",
      "contract_number": "string",
      "invoice_number": "string",
      "document_type": "string",
      "order_value": "string",
      "document_date": "string",
      "order_conditions": "string",
      "contract_conditions": "string",
      "valid_until": "string"
    },
    "order_type": "string",
    "contract_value": 1.5,
    "contract_type": "string"
  },
  "state": "none",
  "specs": [
    {
      "schema_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string",
      "columns": [
        "string"
      ]
    }
  ]
}
  • 400 — The request is invalid.
GET/v1/ap/rules

curl

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

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/ap/rules", {
  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 — The batches.

[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "string",
    "created_at": "2026-01-15T09:30:00Z",
    "files": [
      {
        "document_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "filename": "string",
        "status": "string",
        "rules_status": "string",
        "error": "string",
        "rule_count": 1
      }
    ],
    "rules": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "document_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "code": "string",
        "text": "string",
        "obligation": "string",
        "source_quote": "string",
        "origin": "string"
      }
    ]
  }
]
POST/v1/ap/rules/batches

Request body (application/json)

document_ids*string (uuid)[]
namestring

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/batches' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "document_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "name": "string"
}'

Node.js (18+)

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

Response 201: The batch.

  • 404 — The requested resource was not found.
DELETE/v1/ap/rules/batches/{id}

Path parameters

id*string (uuid)

curl

curl -X DELETE 'https://api.talonic.com/v1/ap/rules/batches/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/ap/rules/batches/3fa85f64-5717-4562-b3fc-2c963f66afa6", {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
// 200: no JSON body

Response 200: Removed.

  • 404 — The requested resource was not found.
POST/v1/ap/rules/batches/{id}/rules

Path parameters

id*string (uuid)

Request body (application/json)

text*string

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/batches/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "string"
}'

Node.js (18+)

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

Response 201: The rule.

  • 404 — The requested resource was not found.
DELETE/v1/ap/rules/rules/{ruleId}

Path parameters

ruleId*string (uuid)

curl

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

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/ap/rules/rules/3fa85f64-5717-4562-b3fc-2c963f66afa6", {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
// 200: no JSON body

Response 200: Removed.

  • 404 — The requested resource was not found.
POST/v1/ap/rules/effects

Request body (application/json)

rule_ids*string (uuid)[]
effect*string ("condition", "general", "payer")

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/effects' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "rule_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "effect": "condition"
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/ap/rules/effects", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "rule_ids": [
      "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    ],
    "effect": "condition"
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
// 201: no JSON body

Response 201: Saved.

  • 404 — The requested resource was not found.
POST/v1/ap/rules/rules/{ruleId}/effect

Path parameters

ruleId*string (uuid)

Request body (application/json)

effect*string ("condition", "general", "payer")

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/rules/3fa85f64-5717-4562-b3fc-2c963f66afa6/effect' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "effect": "condition"
}'

Node.js (18+)

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

Response 201: Saved.

  • 404 — The requested resource was not found.
POST/v1/ap/intake

Request body (application/json)

dry_runboolean

curl

curl -X POST 'https://api.talonic.com/v1/ap/intake' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "dry_run": true
}'

Node.js (18+)

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

Response 201 — What was added.

{
  "pipeline_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "added": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ]
}
  • 400 — The request is invalid.
  • 403 — The API key does not have the required scope.
POST/v1/ap/bills/accept

Required scope: write

Request body (application/json)

bill_key*stringThe bill's key.
field*string ("entity", "due_date", "fx_rate", "po_number")

curl

curl -X POST 'https://api.talonic.com/v1/ap/bills/accept' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "bill_key": "string",
  "field": "entity"
}'

Node.js (18+)

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

Response 201 — Accepted.

{
  "accepted": true
}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 404 — The bill was not found (or its document is hidden from the key's person), or the workspace has not added the app.
  • 422 — The bill has no suggestion for that field.
POST/v1/ap/bills/withdraw

Required scope: write

Request body (application/json)

bill_key*stringThe bill's key.
field*string ("entity", "due_date", "fx_rate", "po_number")

curl

curl -X POST 'https://api.talonic.com/v1/ap/bills/withdraw' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "bill_key": "string",
  "field": "entity"
}'

Node.js (18+)

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

Response 201 — The outcome.

{
  "withdrawn": true
}
  • 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.
POST/v1/ap/rules/compile

Required scope: write

Request body (application/json)

localestringThe language the checks' wording is written in (de, en, es, fr, it, pt; English otherwise).
rule_idsstring (uuid)[]Only these rules; every heavy rule when absent.

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/compile' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "locale": "string",
  "rule_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ]
}'

Node.js (18+)

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

Response 201 — One proposal per rule.

[
  {
    "rule_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "check",
    "check": {
      "readback": {
        "headline": "string",
        "body": "string",
        "outcomes": {}
      },
      "fields": [
        "string"
      ]
    }
  }
]
  • 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 app is switched off in this workspace, or a rule named is already checked by its fields.
  • 502 — Checks cannot be proposed right now; try again.
POST/v1/ap/rules/modes

Required scope: write

Request body (application/json)

rule_ids*string (uuid)[]
mode*string ("heavy")

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/modes' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "rule_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "mode": "heavy"
}'

Node.js (18+)

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

Response 201 — Saved.

{
  "updated": 1
}
  • 400 — The request is invalid.
  • 401 — Missing or invalid API key.
  • 403 — The API key does not have the required scope.
  • 404 — A rule is not one of the app's payment rules, or the workspace has not added the app.
POST/v1/ap/rules/rules/{ruleId}/compile

Required scope: write

Path parameters

ruleId*string (uuid)

Request body (application/json)

localestringThe language the check's wording is written in (de, en, es, fr, it, pt; English otherwise).

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/rules/3fa85f64-5717-4562-b3fc-2c963f66afa6/compile' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "locale": "string"
}'

Node.js (18+)

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

Response 201 — The proposal.

{
  "rule_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "check",
  "check": {
    "readback": {
      "headline": "string",
      "body": "string",
      "outcomes": {
        "passed": "string",
        "failed": "string",
        "unclear": "string"
      }
    },
    "fields": [
      "string"
    ]
  }
}
  • 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 app is switched off in this workspace, or the rule is already checked by its fields (send it back to heavy first).
  • 502 — Checks cannot be proposed right now; try again.
POST/v1/ap/rules/rules/{ruleId}/mode

Required scope: write

Path parameters

ruleId*string (uuid)

Request body (application/json)

mode*string ("heavy")

curl

curl -X POST 'https://api.talonic.com/v1/ap/rules/rules/3fa85f64-5717-4562-b3fc-2c963f66afa6/mode' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "heavy"
}'

Node.js (18+)

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

Response 201 — The rule.

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "document_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "code": "string",
  "text": "string",
  "obligation": "string",
  "source_quote": "string",
  "origin": "string",
  "mode": "heavy",
  "check": {
    "readback": {
      "headline": "string",
      "body": "string",
      "outcomes": {
        "passed": "string",
        "failed": "string",
        "unclear": "string"
      }
    },
    "fields": [
      "string"
    ]
  },
  "light": {
    "agree": 1,
    "needed": 1,
    "disagreed": true,
    "last_disagreement": {
      "evaluation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "light": "string",
      "heavy": "string",
      "by": "person",
      "at": "2026-01-15T09:30:00Z"
    }
  }
}
  • 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.