Skip to content

Automation

Automation config lets you set up webhooks and callbacks at the agent level. When generations complete, rows change, or other events occur, GEN sends a POST request to your configured URL.

{
"webhook_url": "https://example.com/webhooks/gen",
"callback_url": "https://example.com/callbacks/gen",
"polling_enabled": true
}
FieldDescription
webhook_urlURL that receives event notifications (generation complete, status changes, etc.).
callback_urlURL called when specific automation actions complete.
polling_enabledWhether the agent can be polled for status updates.

Returns the current automation configuration for an agent.

GET /v1/agents/{agent_id}/automation_config
ParameterTypeDescription
agent_idintegerThe agent ID.
{
"webhook_url": "https://example.com/webhooks/gen",
"callback_url": null,
"polling_enabled": false
}
Terminal window
curl "https://api.gen.pro/v1/agents/42/automation_config" \
-H "X-API-Key: your-api-key"

Updates the automation configuration for an agent. Only the provided fields are changed.

PATCH /v1/agents/{agent_id}/automation_config
ParameterTypeDescription
agent_idintegerThe agent ID.
FieldTypeRequiredDescription
automation_config.webhook_urlstringNoWebhook URL. Set to null to disable.
automation_config.callback_urlstringNoCallback URL. Set to null to disable.
automation_config.polling_enabledbooleanNoEnable or disable polling.

Returns the updated config.

Terminal window
curl -X PATCH "https://api.gen.pro/v1/agents/42/automation_config" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"automation_config": {"webhook_url": "https://example.com/webhooks/gen", "polling_enabled": true}}'
await fetch("https://api.gen.pro/v1/agents/42/automation_config", {
method: "PATCH",
headers: {
"X-API-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
automation_config: {
webhook_url: "https://example.com/webhooks/gen",
polling_enabled: true,
},
}),
});
StatusError codeDescription
404not_foundAgent not found or not accessible.
422validation_errorInvalid URL format.

Sends a test payload to the configured webhook URL. Use this to verify your endpoint receives and processes events correctly.

POST /v1/agents/{agent_id}/automation_config/test_webhook
ParameterTypeDescription
agent_idintegerThe agent ID.
{
"success": true
}

If the webhook endpoint is unreachable or returns an error:

{
"success": false,
"error": "Connection refused"
}
Terminal window
curl -X POST "https://api.gen.pro/v1/agents/42/automation_config/test_webhook" \
-H "X-API-Key: your-api-key"

Sends a test payload to the configured callback URL.

POST /v1/agents/{agent_id}/automation_config/test_callback
ParameterTypeDescription
agent_idintegerThe agent ID.
{
"success": true
}

If the callback endpoint is unreachable or returns an error:

{
"success": false,
"error": "Timeout after 10s"
}
Terminal window
curl -X POST "https://api.gen.pro/v1/agents/42/automation_config/test_callback" \
-H "X-API-Key: your-api-key"
StatusError codeDescription
404not_foundAgent not found or not accessible.
422validation_errorNo webhook/callback URL configured.