Skip to content

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

Parameters for emit_event()
NameTypeRequiredWhat it is
kindstringYesWhat kind of event this is: subject_says, tool_call, tool_result, or observation.
agent_subject_idstringYesThe agent identity every event is grounded against — the conversation anchor, e.g. "pump-12".
subject_typestringYesOne of chat, lead, journey, sensor, or ticket.
payloadobjectNoThe 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

Parameters for check()
NameTypeRequiredWhat it is
subject_idstringYesThe subject to check — its circuit-breaker standing. Pass this or interaction_id.
interaction_idstringNoCheck 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

Parameters for POST /v1/agent-outputs/{id}/ack
NameTypeRequiredWhat it is
output_idstringYesThe held action’s id, from the review screen or the dispatch call to your system.
ack_refstringYesYour 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.