Skip to content

Invoke an operation safely

Send schema-valid input, preserve idempotency, and handle synchronous or asynchronous results.

Updated View as Markdown

Prerequisites

Discover the operation first and validate the request body against its inputSchema.

Create a stable idempotency key

Use one key for one intended effect. Keep it when retrying an uncertain response; use a new key only for a new intended call.

Send the input object directly

curl -X POST \
  https://api.agent.mq/v1/agent/applications/app_<32-lowercase-hex>/operations/<operation-id>/invoke \
  -H "Authorization: Bearer $AGENTMQ_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: <stable-request-key>" \
  -d '{"<schema-field>":"<value>"}'

Do not wrap the body in input.

Handle the response mode

A completed service call returns 200. A native text or workflow execution can return 202; read its receipt until it reaches a terminal state.

Verify

Replaying the same key with the same intent returns the recorded invocation. A conflicting replay returns 409 instead of dispatching a second effect.

Next steps

Navigation

Type to search…

↑↓ navigate↵ selectEsc close