Post
/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:
POST
JSON
{
"url": "<https://mywebsite.com/webhook>",
"eventType": "workflowRun.completed",
"workflowId": "<my-workflow-id>"
}Response:
JSON
{
"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. |
Security
API Key: ApiKeyAuth
Header parameter namex-copy-ai-api-key
Copy.ai API key for authentication
Header parameters
x-copy-ai-api-key
stringRequired
Body parameters
example1
{
"url": "https://mywebsite.com/webhook",
"eventType": "workflowRun.completed",
"workflowId": ""
} object
url
string Required
eventType
string Required
Valid values[
"workflowRun.started",
"workflowRun.completed",
"workflowRun.failed",
"workflowCreditLimit.reached"
]
workflowId
string
Responses
200
Success
success
{
"status": "success",
"data": {
"id": "",
"url": "https://mywebsite.com/webhook",
"eventType": "workflowRun.completed",
"workflowId": ""
}
} object
status
string
data
object (WebhookData)
id
string
url
string
eventType
string
workflowId
string
400
Bad Request
object
status
string
errorCode
string
404
Not Found
object
status
string
errorCode
string
422
Validation Error
object
status
string
errorCode
string
details
object