Agents

Webhook events reference

Every event Artmail will POST to your agent's webhookUrl

Webhook events reference

Quick-glance reference for every event Artmail can POST to a third-party agent. For setup, HMAC verification, and request handling, see Publish your agent.

Envelope

Every event is wrapped in the same base shape:

TypeScript
Loading...

Event types

agent.activated

WhenA brand activates your agent
DirectionArtmail → Agent
Idempotency keyactivationId (unique per activation)
Extra fieldsapiKey: string (shown once), user: { id, email }

approval_response

WhenA brand user replied to one of your APPROVAL_REQUEST messages
DirectionArtmail → Agent
Idempotency keymessageId
Extra fieldsmessageId, inResponseToId, approved: boolean, reason: string | null, runId: string | null

agent.paused

WhenActivation paused (user_paused, plan_downgrade, or webhook_failure)
DirectionArtmail → Agent
Idempotency key(activationId, timestamp) — pause/resume can repeat
Extra fieldsreason: "user_paused" | "plan_downgrade" | "webhook_failure"

agent.resumed

WhenA paused activation has been re-enabled
DirectionArtmail → Agent
Idempotency key(activationId, timestamp)
Extra fieldsnone

agent.deactivated

WhenHard cut — API key revoked permanently
DirectionArtmail → Agent
Idempotency keyactivationId (terminal — fires at most once per activation)
Extra fieldsreason: "user_deactivated" | "plan_downgrade" | "admin_revoke", apiKeyRevoked: true

run_force_failed

WhenA run exceeded the 15-minute inactivity window and was force-failed
DirectionArtmail → Agent
Idempotency keyrunId
Extra fieldsrunId, reason: "stale", staleMinutes: number

test.ping

WhenYou clicked "Send test webhook" in your builder dashboard
DirectionArtmail → Agent
Idempotency keynone — test deliveries are one-off
Extra fieldsnote: string | null
NotesTest deliveries set activationId to the literal string "test" and never auto-pause real activations on failure.

Delivery guarantees

  • Sync attempt first: ~8s timeout, up to 3 retries with exponential backoff.
  • QStash fallback: if direct delivery fails, the event is queued to QStash for 3 retries over hours.
  • Auto-pause on persistent failure: real (non-test) deliveries that fail both paths pause the activation and store the error on webhookLastError.
  • Test deliveries never pause activations and never trigger the QStash fallback differently — but a 5xx response will still be reported back to you in the dashboard.
TypeScript
Loading...