SDK reference · Python · TypeScript · curl
SDK reference
Every call shows the request, the response, and a copyable example. Docs show placeholder values; signed-in users see their real key on working screens. Your language choice sticks across every page.
emit_event()
Send one event about a watched thing. This is how data gets in — the start of every Flow.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
| kind | string | Yes | What kind of event this is: subject_says, tool_call, tool_result, or observation. |
| agent_subject_id | string | Yes | The agent identity every event is grounded against — the conversation anchor, e.g. "pump-12". |
| subject_type | string | Yes | One of chat, lead, journey, sensor, or ticket. |
| payload | object | No | The event body — a sensor reading, the text said, a tool call. Any extra fields kept with the event. |
Request
from dmzagent import DMZAgent
cx = DMZAgent(api_key="YOUR_API_KEY")
cx.emit_event(
"observation",
agent_subject_id="pump-12",
subject_type="sensor",
payload={"reading": 41.2, "unit": "F"},
)Placeholder key shown. Signed-in users see their real key on working screens.
Response
{
"frame_id": "fr_01HZX…",
"accepted": true,
"n_workspaces": 2
}The event id, whether it was taken in, and how many work areas will weigh it.
check()
Guard a sensitive action: check the breaker before your chatbot acts. One of three answers, with a plain reason.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
| subject_id | string | Yes | The subject to check — its circuit-breaker standing. Pass this or interaction_id. |
| interaction_id | string | No | Check the whole interaction instead of a single subject. Pass exactly one of the two. |
Request
from dmzagent import DMZAgent
cx = DMZAgent(api_key="YOUR_API_KEY")
result = cx.check(subject_id="pump-12")
if result.allow:
reply = your_bot(user_message)Placeholder key shown. Signed-in users see their real key on working screens.
Response
{
"allow": false,
"state": "open",
"warning": false,
"reason": "matches a warning label in your rule packs"
}allow (closed), take a look (half_open), or block (open) — with the reason. A denying state fails safe to block.
POST /v1/agent-outputs/{id}/ack
Tell the platform a dispatched fix completed in your system — this closes the decision record.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
| output_id | string | Yes | The held action’s id, from the review screen or the dispatch call to your system. |
| ack_ref | string | Yes | Your ticket or change id. The call is idempotent on (output_id, ack_ref). |
Request
curl -X POST 'https://api.dmzagent.com/v1/agent-outputs/OUTPUT_ID/ack' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"ack_ref": "TICKET-123"}'Placeholder key shown. Signed-in users see their real key on working screens.
Response
{
"output_id": "out_01HZX…",
"state": "acknowledged"
}The decision record moves to acknowledged. Sending the same pair twice is safe; if no acknowledgment arrives in time, the record marks itself failed.