LiyaEngine Docs
API Reference

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.

Dashboard

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_xxxxxxxxxxxx

Returns 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" }
  ]
}
FieldNotes
name, endpoint_url, method, sensitivityRequired. method is GET, POST, PUT, PATCH or DELETE. sensitivity is read or write.
endpoint_urlA public HTTPS address with no embedded credentials. Private and internal addresses are refused.
parametersWhat 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_secretWrite-only. Sent with every call; never returned.
compliance_modenone, hipaa or pci.
requires_confirmationAsk a person to approve each call. Leave off for an action a workflow calls, because the workflow's Approval step already gates it.
workflow_onlyOnly 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:

HeaderValue
X-Liya-TimestampMilliseconds since the epoch when the call was made.
X-Liya-Signaturesha256= 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, PUT and PATCH, the raw request body, exactly as received.
  • For GET and DELETE, 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

StatusCodeMeaning
400MISSING_NAME, MISSING_ENDPOINTA required field is empty.
400INVALID_ENDPOINTNot a public HTTPS address.
400INVALID_METHOD, INVALID_SENSITIVITYNot one of the allowed values.
401UNAUTHORIZEDNo valid key.
404NOT_FOUNDNo 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.

On this page