Actions
GET/POST /v1/actions, GET/PATCH/DELETE /v1/actions/{id}, and PATCH /v1/actions/{id}/toggle. Manage the HTTP calls agents and workflows can make, with an API key.
An action is one HTTP call to one of your systems: look up an order, post a decision, open a case. Agents and workflow steps call actions by name. This is the same resource as the dashboard's Actions page, served by the same code, so anything you can set up there you can set up here.
All endpoints need a full-access API key. A read-only key can list and fetch actions; a runtime key cannot reach them at all.
List actions
GET https://api.liyaengine.ai/v1/actions
Authorization: Bearer liya_xxxxxxxxxxxxReturns every action in the workspace, newest first. Header values and signing secrets are never returned: headers come back as "••••••••" and signing_secret is "••••••••" when set, null when not.
Create an action
POST https://api.liyaengine.ai/v1/actions
Authorization: Bearer liya_xxxxxxxxxxxx
Content-Type: application/json
{
"name": "post_determination",
"description": "Records a determination and the notice to send.",
"endpoint_url": "https://claims.example.com/api/determinations",
"method": "POST",
"sensitivity": "write",
"compliance_mode": "hipaa",
"headers": { "X-Source": "westfield-um" },
"signing_secret": "whsec_...",
"parameters": [
{ "name": "request_ref", "type": "string", "required": true, "description": "The reference number of the request" },
{ "name": "decision", "type": "enum", "required": true, "enum_values": ["approved", "pended"], "description": "The determination being recorded" }
]
}| Field | Notes |
|---|---|
name, endpoint_url, method, sensitivity | Required. method is GET, POST, PUT, PATCH or DELETE. sensitivity is read or write. |
endpoint_url | A public HTTPS address with no embedded credentials. Private and internal addresses are refused. |
parameters | What the AI (or a workflow step) fills in. Types are string, number, boolean or enum. Names are trimmed, since they are used as field names. |
headers, signing_secret | Write-only. Sent with every call; never returned. |
compliance_mode | none, hipaa or pci. |
requires_confirmation | Ask a person to approve each call. Leave off for an action a workflow calls, because the workflow's Approval step already gates it. |
workflow_only | Only a workflow step can call it, never an agent or a visitor. |
GET and DELETE calls send parameters in the query string. Other methods get a JSON body: { parameters, ticket_id, tenant_id }.
Get, update, switch off, delete
GET /v1/actions/{id}
PATCH /v1/actions/{id} # any of the create fields; fields left out are unchanged
PATCH /v1/actions/{id}/toggle # flips is_active
DELETE /v1/actions/{id}A switched-off action cannot be called by an agent or a workflow. Deleting an action leaves workflows that used it without a call to make, so switch it off first if you are unsure. To remove a signing secret, send "signing_secret": "".
Verifying a call
When an action has a signing_secret, every call to your endpoint carries two headers:
| Header | Value |
|---|---|
X-Liya-Timestamp | Milliseconds since the epoch when the call was made. |
X-Liya-Signature | sha256= followed by the hex HMAC-SHA256, keyed with your signing secret, of <timestamp>.<content>. |
content is what your endpoint can read from the request itself:
- For
POST,PUTandPATCH, the raw request body, exactly as received. - For
GETandDELETE, the query string exactly as sent, without the leading?(an empty string when there are no parameters).
const content = req.method === "GET" || req.method === "DELETE" ? new URL(req.url).search.slice(1) : rawBody;
const expected = "sha256=" + crypto.createHmac("sha256", secret).update(`${timestamp}.${content}`).digest("hex");Compare with a constant-time check, and reject a timestamp more than a few minutes old so a captured call cannot be replayed.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | MISSING_NAME, MISSING_ENDPOINT | A required field is empty. |
| 400 | INVALID_ENDPOINT | Not a public HTTPS address. |
| 400 | INVALID_METHOD, INVALID_SENSITIVITY | Not one of the allowed values. |
| 401 | UNAUTHORIZED | No valid key. |
| 404 | NOT_FOUND | No action with that id in this workspace. |
Testing an action
Testing makes a real call to the action's endpoint, so it stays in the dashboard (Build → Actions → Test) and is not available with an API key.
Agents
GET/POST /v1/agents, GET/PATCH/DELETE /v1/agents/{agentKey}, plus deploy, run, and run/session history — standalone Agents via API key.
Workflows
GET/POST /v1/workflows, GET/PATCH/DELETE /v1/workflows/{workflowIdOrKey}, plus toggle, deploy, webhook secret rotate, run, and run history — multi-step automations via API key.