Code example
Agent commands (correlation_id)
Deduplication via correlation_id
POST /api/v1/operator/agent_commands accepts an optional correlation_id. When provided, if a command with the same correlation_id already exists within the deduplication window, the existing command is returned (HTTP 200) instead of creating a duplicate. The correlation_id must be unique per workspace.
# Retry-safe command submission
correlation_id = str(uuid.uuid4())
# Store UUID locally BEFORE making the API call
# On network failure, retry with the SAME UUID
POST /api/v1/operator/agent_commands
Authorization: Bearer {token}
{
"service_agent_id": "...",
"command_type": "deploy.workflow",
"payload": {...},
"correlation_id": correlation_id
}