Skip to content

Create a webhook

POST
/webhooks
curl --request POST \
--url https://docs.ywork.dev/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "url": "https://example.com/hooks/ywork", "events": [ "task.created", "task.updated" ] }'
Media typeapplication/json
object
url
required
string format: uri
events
required
Array<string>
>= 1 items
Allowed values: task.created task.updated task.deleted project.created project.updated
Example
{
"url": "https://example.com/hooks/ywork",
"events": [
"task.created",
"task.updated"
]
}

The created webhook.

Media typeapplication/json
object
id
required
string
object
required
string
Allowed value: webhook
url
required
string format: uri
events
required
Array<string>
Allowed values: task.created task.updated task.deleted project.created project.updated
created_at
required
string format: date-time
Example
{
"id": "whk_1Za7Yb3cVn",
"object": "webhook",
"url": "https://example.com/hooks/ywork",
"events": [
"task.created"
]
}

No valid API key was provided.

Media typeapplication/json
object
error
required
object
type
required

A broad category for the error.

string
Allowed values: authentication_error invalid_request_error rate_limit_error api_error
code
required

A short machine-readable code for the specific error.

string
message
required

A human-readable description of the error.

string
request_id

A unique identifier for the request, useful for support.

string
Example
{
"error": {
"type": "authentication_error",
"code": "missing_api_key",
"message": "No API key provided. Send your key as a bearer token in the Authorization header.",
"request_id": "req_9f2a1c7b4e"
}
}

The request body failed validation.

Media typeapplication/json
object
error
required
object
type
required

A broad category for the error.

string
Allowed values: authentication_error invalid_request_error rate_limit_error api_error
code
required

A short machine-readable code for the specific error.

string
message
required

A human-readable description of the error.

string
request_id

A unique identifier for the request, useful for support.

string
Example
{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "The 'name' field is required.",
"request_id": "req_7c3f5a9e12"
}
}