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.

emitEvent()

Send one event about a watched thing. This is how data gets in — the start of every Flow.

Parameters

Parameters for emitEvent()
NameTypeRequiredWhat it is
subjectstringYesThe watched thing this event is about, e.g. "pump-12".
kindstringYesWhat kind of event this is, e.g. "observation".
dataobjectNoAny extra fields you want kept with the event.

Request

from dmzagent import Client

client = Client(api_key="YOUR_API_KEY")
client.emit_event(
    subject="pump-12",
    kind="observation",
    data={"route": "/checkout", "status": 200},
)

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.

guard()

Check a message before your chatbot answers. One of three answers, with a plain reason.

Parameters

Parameters for guard()
NameTypeRequiredWhat it is
deploymentstringYesYour guarded chatbot deployment id.
messagestringYesThe user message to check, before your bot sees it.

Request

from dmzagent import Client

client = Client(api_key="YOUR_API_KEY")
verdict = client.guard(
    deployment="YOUR_DEPLOYMENT_ID",
    message=user_message,
)
if verdict.allowed:
    reply = your_bot(user_message)

Placeholder key shown. Signed-in users see their real key on working screens.

Response

{
  "allowed": false,
  "verdict": "block",
  "reason": "matches a warning label in your rule packs",
  "record": "rec_01HZX…"
}

allow, take a look, or block — with the reason and a link to the logbook record. A denying state fails safe to block.

ackOutput()

Tell the platform a dispatched fix completed in your system — this closes the decision record.

Parameters

Parameters for ackOutput()
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

from dmzagent import Client

client = Client(api_key="YOUR_API_KEY")
client.ack_output(
    output_id="OUTPUT_ID",
    ack_ref=your_ticket_id,  # idempotent on (output_id, ack_ref)
)

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.