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. Pass this or subject_id, 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.

verify_webhook_signature()

Check a delivery came from us before you read the body. Present in all four SDKs; returns a boolean and never raises.

Parameters

Parameters for verify_webhook_signature()
NameTypeRequiredWhat it is
payloadbytes | stringYesThe raw request body, exactly as received. Parsing it first changes the bytes and fails the check.
signature_headerstringYesThe DMZAgent-Signature header — a timestamp and a signature.
secretstringYesThe endpoint’s signing secret.
tolerance_secondsintNoHow old a timestamp may be. Defaults to 300 seconds, which stops a captured delivery being replayed later.

Request

from dmzagent.webhook import verify_webhook_signature

# False for a bad signature, a malformed header, or a timestamp outside
# the tolerance window. It never raises, so one branch covers every case.
if not verify_webhook_signature(
    raw_body, request.headers["DMZAgent-Signature"], secret
):
    return 400

payload = json.loads(raw_body)

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

Response

true

False for a bad signature, a malformed header, or a stale timestamp. One branch covers every failure.

GET /v1/reviews

Read the calls waiting on a person, so your own system can route them.

Parameters

Parameters for GET /v1/reviews
NameTypeRequiredWhat it is
statestringNowaiting, mine, or handled. Defaults to waiting.
limitintNoPage size. Send back next_cursor for the next page.

Request

curl 'https://api.dmzagent.com/v1/reviews?state=waiting&limit=50' \
  -H 'Authorization: Bearer YOUR_API_KEY'

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

Response

{
  "items": [
    {
      "review_id": "rv_01HZX…",
      "subject_id": "pump-12",
      "proposed_action": "revoke_access",
      "reason": "temperature-excursion crossed the build-up threshold",
      "waiting_since": "2026-08-30T12:04:11Z"
    }
  ],
  "count": 1,
  "next_cursor": null
}

Each item is one held action. Claim it before working it.

GET /v1/compliance/frameworks/{id}/export

Build a portable evidence pack: the framework, its controls, their evidence, and the entries behind them.

Parameters

Parameters for GET /v1/compliance/frameworks/{id}/export
NameTypeRequiredWhat it is
framework_idstringYesThe framework to export.

Request

curl 'https://api.dmzagent.com/v1/compliance/frameworks/FRAMEWORK_ID/export' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -o evidence-pack.json

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

Response

{
  "manifest": {
    "kind": "dmzagent.audit-evidence-pack/v1",
    "record_count": 412,
    "ledger_entry_count": 268,
    "hash_algo": "sha256",
    "content_hash": "9f3c…a71e"
  },
  "jsonl": "…one canonical JSON record per line…"
}

Three of the four verification checks need no key. A recipient re-derives every hash from the file.

GET /v1/library/manifests/{hash}

Audit replay: the exact rule-pack manifest a content hash names.

Parameters

Parameters for GET /v1/library/manifests/{hash}
NameTypeRequiredWhat it is
manifest_hashstringYesThe content hash printed on the installed version.

Request

curl 'https://api.dmzagent.com/v1/library/manifests/MANIFEST_HASH' \
  -H 'Authorization: Bearer YOUR_API_KEY'

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

Response

{
  "hash": "sha256:7ae1…0f34",
  "version": "2.3.0",
  "manifest": { "vocabulary": { "…": "…" } }
}

This is how an auditor confirms what a rule was reading on a given day.