Agentic AI · Orchestrate
Triggers
What starts a run. A trigger created from a template is never armed — a new tenant should not have agents running before anybody has read what they do.
/api/agentic/triggersPublished as /api/v1/triggersOverview
| Package | Agentic AI |
|---|---|
| Authentication | Bearer token: a service account's token (POST /api/auth/service-token) or, for the published path, an API key |
| Authorization | The caller's roles must hold Agentic AI › Triggers on the Roles screen: display for GET, add for POST, change for PUT, delete for DELETE; an action needs the grant of the button that runs it on the screen. |
| Table | agent.triggers · kept per company (and organisational unit where it has one) |
| Record | Created, changed and (where the screen allows) deleted; key id |
| Rules | The same as the screen: validation, numbering, approvals, posting, the company the caller belongs to, and the audit trail. |
API reference
6 operations. Open one for its parameters, bodies, responses and a sample request.
GET/api/agentic/triggersList triggers
Query parameters
| Name | Description | Example |
|---|---|---|
limit | Rows per page (50 by default, at most 200) | limit=100 |
offset | Rows to skip | offset=200 |
q | Free-text search over the search columns | q=acme |
sort | column:asc or column:desc, several separated by commas | sort=created_at:desc |
filter | A JSON condition or group (see the filter language), URL-encoded; any field below can be filtered and sorted | filter={"col":"status","op":"eq","value":"open"} |
<field>=<value> | Shorthand for "field is value" |
Response 200
{
"rows": [
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"code": "COD-000001",
"name": "Example",
"name_local": "Example",
"workflow_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"agent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"trigger_kind": "text",
"schedule_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"cron_expr": "text",
"timezone": "text",
"event_name": "Example",
"target_module": "text",
"target_resource": "text"
}
],
"count": 1
}Sample request
curl "https://demo.tranxact.ai/api/agentic/triggers?limit=20" \
-H "Authorization: Bearer $TOKEN"GET/api/agentic/triggers/{id}Read one triggers
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Response 200
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"code": "COD-000001",
"name": "Example",
"name_local": "Example",
"workflow_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"agent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"trigger_kind": "text",
"schedule_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"cron_expr": "text",
"timezone": "text",
"event_name": "Example",
"target_module": "text",
"target_resource": "text"
}404 when no record with that id is visible to the caller.
Sample request
curl "https://demo.tranxact.ai/api/agentic/triggers/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"POST/api/agentic/triggersCreate a triggers
Request body
The record as JSON. Fields marked Yes are required.
| Field | Type | Required | Description |
|---|---|---|---|
code | text | Yes | Code |
name | text | Yes | Name |
name_local | text | No | Name local |
workflow_id | uuid | No | Workflow |
agent_id | uuid | No | Agent — One or the other. A trigger that names both runs the workflow. |
trigger_kind | text | No | Kind |
cron_expr | text | No | Schedule — For a scheduled trigger: five fields as cron writes them (minute hour day month weekday), e.g. 0 7 * * 1-5 for 07:00 on weekdays. |
timezone | text | No | Time zone — The time zone the schedule is read in. Type to find one, e.g. Riyadh. Empty: UTC. |
event_name | text | No | Event — For an event trigger: the event that starts it, e.g. acct.ar_invoice.posted. The list shows the events raised here; choose Other to type a name with * in it, e.g. acct.*.posted. |
target_module | text | No | Module — For a record trigger: the module of the records watched, e.g. HR. |
target_resource | text | No | Resource — For a record trigger: the screen whose records are watched, e.g. Employees. |
record_event | text | No | When a record is Allowed: created updated deleted status_changed |
filter_expr | text | No | Only when — A condition the record or event must meet, e.g. amount > 10000. Empty: every one. |
cube_key | text | No | Cube — For a threshold trigger: the figures it watches. |
measure_key | text | No | Measure — For a threshold trigger: the figure in that cube. |
comparator | text | No | Crosses — gt above, gte at or above, lt below, lte at or below, eq equal, neq not equal, changes_by moves by at least the threshold. Allowed: gt gte lt lte eq neq changes_by |
threshold_value | numeric | No | Threshold — The figure compared against. |
webhook_path | text | No | Webhook path |
min_interval_seconds | integer | No | Never more often than (seconds) — A quiet period after it fires, e.g. 3600 for at most once an hour. |
max_per_day | integer | No | Most per day — It stops firing for the day after this many runs. |
status | text | No | Status — The one setting that decides whether it fires: only an active trigger starts runs. One made from a template starts inactive. error means it was stopped because it could not start a run (Last error says why); it stays stopped until the cause is fixed and it is set active again. Changing Status clears Last error. Allowed: inactive active paused error |
is_active | boolean | No | Is active |
Sample body
{
"code": "COD-000001",
"name": "Example",
"name_local": "Example",
"workflow_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"agent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"trigger_kind": "text"
}Response 201
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"code": "COD-000001",
"name": "Example",
"name_local": "Example",
"workflow_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"agent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"trigger_kind": "text",
"schedule_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"cron_expr": "text",
"timezone": "text",
"event_name": "Example",
"target_module": "text",
"target_resource": "text"
}Sample request
curl -X POST "https://demo.tranxact.ai/api/agentic/triggers" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"code":"COD-000001","name":"Example","name_local":"Example","workflow_id":"3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73","agent_id":"3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73","trigger_kind":"text"}'PUT/api/agentic/triggers/{id}Change a triggers
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Request body
Only the fields to change; fields left out keep their value.
| Field | Type | Required | Description |
|---|---|---|---|
code | text | Yes | Code |
name | text | Yes | Name |
name_local | text | No | Name local |
workflow_id | uuid | No | Workflow |
agent_id | uuid | No | Agent — One or the other. A trigger that names both runs the workflow. |
trigger_kind | text | No | Kind |
cron_expr | text | No | Schedule — For a scheduled trigger: five fields as cron writes them (minute hour day month weekday), e.g. 0 7 * * 1-5 for 07:00 on weekdays. |
timezone | text | No | Time zone — The time zone the schedule is read in. Type to find one, e.g. Riyadh. Empty: UTC. |
event_name | text | No | Event — For an event trigger: the event that starts it, e.g. acct.ar_invoice.posted. The list shows the events raised here; choose Other to type a name with * in it, e.g. acct.*.posted. |
target_module | text | No | Module — For a record trigger: the module of the records watched, e.g. HR. |
target_resource | text | No | Resource — For a record trigger: the screen whose records are watched, e.g. Employees. |
record_event | text | No | When a record is Allowed: created updated deleted status_changed |
filter_expr | text | No | Only when — A condition the record or event must meet, e.g. amount > 10000. Empty: every one. |
cube_key | text | No | Cube — For a threshold trigger: the figures it watches. |
measure_key | text | No | Measure — For a threshold trigger: the figure in that cube. |
comparator | text | No | Crosses — gt above, gte at or above, lt below, lte at or below, eq equal, neq not equal, changes_by moves by at least the threshold. Allowed: gt gte lt lte eq neq changes_by |
threshold_value | numeric | No | Threshold — The figure compared against. |
webhook_path | text | No | Webhook path |
min_interval_seconds | integer | No | Never more often than (seconds) — A quiet period after it fires, e.g. 3600 for at most once an hour. |
max_per_day | integer | No | Most per day — It stops firing for the day after this many runs. |
status | text | No | Status — The one setting that decides whether it fires: only an active trigger starts runs. One made from a template starts inactive. error means it was stopped because it could not start a run (Last error says why); it stays stopped until the cause is fixed and it is set active again. Changing Status clears Last error. Allowed: inactive active paused error |
is_active | boolean | No | Is active |
Sample body
{
"code": "COD-000001",
"name": "Example"
}Response 200
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"code": "COD-000001",
"name": "Example",
"name_local": "Example",
"workflow_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"agent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"trigger_kind": "text",
"schedule_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"cron_expr": "text",
"timezone": "text",
"event_name": "Example",
"target_module": "text",
"target_resource": "text"
}Sample request
curl -X PUT "https://demo.tranxact.ai/api/agentic/triggers/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"code":"COD-000001","name":"Example"}'DELETE/api/agentic/triggers/{id}Delete a triggers
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Response 200
{ "deleted": true }Many documents are cancelled or reversed instead; the API refuses a delete the screen would refuse.
Sample request
curl -X DELETE "https://demo.tranxact.ai/api/agentic/triggers/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"POST/api/agentic/triggers/{id}/copyCopy
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Request body
The keys this action reads (* = required; "one of" lists the only values):
overrides, preview, withLinesResponse
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X POST "https://demo.tranxact.ai/api/agentic/triggers/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/copy" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"overrides":"value","preview":"value","withLines":"value"}'Data model
Every field of a triggers, as the API returns it. Field names are the JSON keys; any of them can be filtered and sorted on a list.
| Field | Type | Access | Description |
|---|---|---|---|
id | uuid | read only | Id |
org_id | uuid | read only | Org id |
org_unit_id | uuid | read only | Org unit id |
code | text | read, write | Code |
name | text | read, write | Name |
name_local | text | read, write | Name local |
workflow_id | uuid | read, write | Workflow |
agent_id | uuid | read, write | Agent — One or the other. A trigger that names both runs the workflow. |
trigger_kind | text | read, write | Kind |
schedule_id | uuid | read only | Schedule id |
cron_expr | text | read, write | Schedule — For a scheduled trigger: five fields as cron writes them (minute hour day month weekday), e.g. 0 7 * * 1-5 for 07:00 on weekdays. |
timezone | text | read, write | Time zone — The time zone the schedule is read in. Type to find one, e.g. Riyadh. Empty: UTC. |
event_name | text | read, write | Event — For an event trigger: the event that starts it, e.g. acct.ar_invoice.posted. The list shows the events raised here; choose Other to type a name with * in it, e.g. acct.*.posted. |
target_module | text | read, write | Module — For a record trigger: the module of the records watched, e.g. HR. |
target_resource | text | read, write | Resource — For a record trigger: the screen whose records are watched, e.g. Employees. |
record_event | text | read, write | When a record is Allowed: created updated deleted status_changed |
filter_expr | text | read, write | Only when — A condition the record or event must meet, e.g. amount > 10000. Empty: every one. |
cube_key | text | read, write | Cube — For a threshold trigger: the figures it watches. |
measure_key | text | read, write | Measure — For a threshold trigger: the figure in that cube. |
comparator | text | read, write | Crosses — gt above, gte at or above, lt below, lte at or below, eq equal, neq not equal, changes_by moves by at least the threshold. Allowed: gt gte lt lte eq neq changes_by |
threshold_value | numeric | read, write | Threshold — The figure compared against. |
webhook_path | text | read, write | Webhook path |
webhook_secret_cipher | bytea | read only | Webhook secret cipher |
webhook_secret_last4 | text | read only | Webhook secret last4 |
min_interval_seconds | integer | read, write | Never more often than (seconds) — A quiet period after it fires, e.g. 3600 for at most once an hour. |
max_per_day | integer | read, write | Most per day — It stops firing for the day after this many runs. |
fired_count | bigint | read only | Fired count |
last_fired_at | timestamp with time zone | read only | Last fired at |
next_due_at | timestamp with time zone | read only | Next due at |
status | text | read, write | Status — The one setting that decides whether it fires: only an active trigger starts runs. One made from a template starts inactive. error means it was stopped because it could not start a run (Last error says why); it stays stopped until the cause is fixed and it is set active again. Changing Status clears Last error. Allowed: inactive active paused error |
last_error | text | read only | Last error |
is_active | boolean | read, write | Is active |
created_at | timestamp with time zone | read only | Created at |
created_by | uuid | read only | Created by |
updated_at | timestamp with time zone | read only | Updated at |
updated_by | uuid | read only | Updated by |
last_value | numeric | read only | Last value |
last_state | boolean | read only | Last state |
last_checked_at | timestamp with time zone | read only | Last checked at |
claimed_by | text | read only | Claimed by |
claimed_at | timestamp with time zone | read only | Claimed at |
xf_text_1 | text | read only | Xf text 1 |
xf_text_2 | text | read only | Xf text 2 |
xf_text_3 | text | read only | Xf text 3 |
xf_text_4 | text | read only | Xf text 4 |
xf_text_5 | text | read only | Xf text 5 |
xf_num_1 | numeric | read only | Xf num 1 |
xf_num_2 | numeric | read only | Xf num 2 |
xf_num_3 | numeric | read only | Xf num 3 |
xf_date_1 | date | read only | Xf date 1 |
xf_date_2 | date | read only | Xf date 2 |
Errors
| Status | Meaning |
|---|---|
| 400 | The request could not be read: a filter that is not JSON, a bad parameter |
| 401 | No credential, or it is wrong, revoked or expired |
| 403 | The caller's roles do not hold Agentic AI › Triggers for this verb, or the address or origin is not allowed |
| 404 | No record with that id is visible to the caller |
| 409 | A conflict: a duplicate number, a document in a state that does not allow it, or a record changed or locked by someone else |
| 422 | Refused by the same validation as the screen; the error names the field and why |
Every error is JSON: {"error": "a sentence saying what was wrong"}, with field where it applies.