Compliance Endpoint Reference
Reference for 4 Compliance endpoints of the Talonic API: parameters, request body, curl and Node.js examples, response and errors.
Turns compliance and regulatory frameworks into checkable rules and judges documents against them. A framework is a workspace document; rules are derived from its text, and a person turns the framework ON. Documents and document sets are then evaluated against the rules of the ON frameworks (pass, fail, not applicable or unclear, each with a reason and a quote), and the failed and unclear checks form a worklist. A workspace can switch its decider to external, so that every model step is offered as a task to its own agent instead of the platform's model. These endpoints belong to the Compliance app (catalog slug compliance); 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.
/v1/compliance/frameworks/{documentId}/rules/compileRequired scope: write
Path parameters
Request body (application/json)
heavy rule of the framework when absent.curl
curl -X POST 'https://api.talonic.com/v1/compliance/frameworks/3fa85f64-5717-4562-b3fc-2c963f66afa6/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/compliance/frameworks/3fa85f64-5717-4562-b3fc-2c963f66afa6/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; empty when no rule is left to propose for.
{
"data": [
{
"rule_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "check",
"check": {
"readback": {},
"fields": []
}
}
]
}- 400 — The request is invalid.
- 401 — Missing or invalid API key.
- 403 — The API key does not have the required scope.
- 404 — The framework belongs to another app, or the workspace has not added the app.
- 409 — The app is switched off in this workspace, or a rule named is already checked by its fields.
- 422 — No document on the Evaluations list has extracted fields yet, so no rule can be checked by its fields.
- 502 — Checks cannot be proposed right now; try again.
/v1/compliance/frameworks/{documentId}/rules/modesRequired scope: write
Path parameters
Request body (application/json)
curl
curl -X POST 'https://api.talonic.com/v1/compliance/frameworks/3fa85f64-5717-4562-b3fc-2c963f66afa6/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/compliance/frameworks/3fa85f64-5717-4562-b3fc-2c963f66afa6/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 in this framework, the framework belongs to another app, or the workspace has not added the app.
/v1/compliance/rules/{ruleId}/compileRequired scope: write
Path parameters
Request body (application/json)
curl
curl -X POST 'https://api.talonic.com/v1/compliance/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/compliance/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
heavyfirst). - 422 — No document on the Evaluations list has extracted fields yet.
- 502 — Checks cannot be proposed right now; try again.
/v1/compliance/rules/{ruleId}/modeRequired scope: write
Path parameters
Request body (application/json)
curl
curl -X POST 'https://api.talonic.com/v1/compliance/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/compliance/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",
"position": 1,
"rule_code": "string",
"text": "string",
"obligation": "must",
"section": "string",
"applies_to": "string",
"condition": "string",
"threshold": "string",
"testable": true,
"source_quote": "string",
"source_fields": [
"string"
],
"origin": "ai"
}- 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.