You can register webhook endpoints via the API to be notified about workflow events that happen in your workspace.
Register Webhook
To register a webhook, send a POST request to https://api.copy.ai/api/webhook with a JSON body containing your webhook URL, the event type you want to be notified about, and an optional workflow ID.
For example:
POST
{
"url": "<https://mywebsite.com/webhook>",
"eventType": "workflowRun.completed",
"workflowId": "<my-workflow-id>"
}Response:
{
"status": "success",
"data": {
"id": "<id of webhook>",
"url": "<https://mywebsite.com/webhook>",
"eventType": "workflowRun.completed",
"workflowId": "<my-workflow-id>"
}
}Note: If a workflow ID is not included, you will receive events for all workflows in your workspace.
Event Types
| Event Type | Description |
|---|---|
workflowRun.started | Sends an event anytime a workflow run is started. |
workflowRun.completed | Sends an event anytime a workflow run is completed. |
workflowRun.failed | Sends an event anytime a workflow run fails. |
workflowCreditLimit.reached | Sends an event when your workspace reaches the credit limit. |
Copy.ai API key for authentication
{
"url": "https://mywebsite.com/webhook",
"eventType": "workflowRun.completed",
"workflowId": ""
} Success
{
"status": "success",
"data": {
"id": "",
"url": "https://mywebsite.com/webhook",
"eventType": "workflowRun.completed",
"workflowId": ""
}
} Bad Request
Not Found
Validation Error