API HumanLayer v1.0
Integrate qualified human decisions into your AI agents via a simple REST API. Submit, track and receive structured verdicts in just a few lines of code.
Arbitrium is exposed as an escalation state in the system. Your agent runs automated by default, then HumanLayer routes to the right Sentinel once the threshold is reached.
Authentication
All agent requests must include your API key in the x-api-key header.
Base URL: https://humanlayer.systems/.netlify/functions
Decision Flow
The complete lifecycle of a decision request:
- The agent submits a decision request via
POST /ai-request. - When the Arbitrium threshold is reached, the API assigns a qualified Sentinel automatically.
- The Sentinel reviews the case and renders a verdict (approved / rejected / escalated).
- The agent retrieves the decision via
GET /ai-request?id=xxx.
What your system gets back
request_idand lifecycle state (pending,assigned,decided)verdictandreasoningsigned_atdecision timestamp- an audit-ready evidence artifact
Submit a Request
Creates a new human decision request. The API attempts to automatically assign a qualified Sentinel.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
| agent_id | string | required | Unique identifier for your agent |
| agent_name | string | optional | Human-readable agent name (e.g. "QuoteBot Agent") |
| request_type | string | required | compliance | judgment | signature |
conformité | jugement
|
| domain | string | required | Expertise domain: legal, finance,
compliance, medical, etc.
|
| jurisdiction | string | optional | Applicable jurisdiction (e.g. "Québec", "France", "EU") |
| summary | string | required | Clear summary of the decision request |
| context_json | object | optional | Structured context (supporting documents, data, etc.) |
| priority | string | optional | normal (default) | urgent |
| expires_at | ISO 8601 | optional | Expiration date (default: 48h) |
| callback_url | string | optional | Webhook URL — will receive a POST with the verdict as soon as the Sentinel decides |
Response (200)
pending instead of
assigned.
The request remains in the queue until a matching Sentinel is activated.
Check Status
Poll the status of a specific request. Use this endpoint in a loop to wait for the Sentinel's decision.
Response (200) — pending
Response (200) — decided
List Requests
Retrieve all requests submitted by an agent, sorted by date descending (max 100).
Response (200)
Code Examples
curl — Submit a request
curl — Check status
JavaScript / Node.js — Full flow
Python — Full flow
Request Statuses
| Status | Description |
|---|---|
| pending | Awaiting assignment — no qualified Sentinel available |
| assigned | Assigned to a Sentinel — under review |
| decided | Verdict rendered — verdict and reasoning available |
Possible Verdicts
approved— The request is approved by the Sentinelrejected— The request is rejected with justificationescalated— Escalated for additional review
Error Handling
| Code | Meaning | Action |
|---|---|---|
400 |
Missing fields or invalid request type | Check the JSON body |
401 |
Invalid or missing API key | Check the x-api-key header |
404 |
Request not found | Check the request_id |
500 |
Server error | Retry after a few seconds |
All errors return a JSON object with an error field:
Webhook (callback)
Instead of polling in a loop, provide a callback_url in your POST request. As soon as
the Sentinel renders a verdict, HumanLayer will send a POST to that URL: