post https://api.copy.ai/api/webhook
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:
{
"url": "<https://mywebsite.com/webhook>",
"eventType": "workflowRun.completed",
"workflowId": "<my-workflow-id>"
}
You will receive a response with the details of your registered webhook:
{
"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. |