Notifications
Create a notification
Create a new notification for a job event
Authorization
Authorization
header
string
required
Enter the project access token with the Bearer prefix, e.g. "Bearer project_access_token"
Bodyapplication/json
Notification creation parameters
Event specifies the type of event that triggered the notification.
Available options:
job.completedjob.failedjob.cancelledupload.completedupload.failedupload.expired
ObjectId specifies the object that triggered this notification.
Examples:
job_A1cce6120E56e7Tu9ioP09Nhjk9
WebhookId specifies the webhook endpoint that will receive the notification.
Examples:
wh_A1cce6120E56e7Tu9ioP09Nhjk9
Responses
application/jsonData contains the response object
created_at
string
date-time
required
Timestamp when the notification was created
Examples:
2025-01-01T12:00:00Z
Type of event that triggered this notification
Available options:
job.completedjob.failedjob.cancelledupload.completedupload.failedupload.expired
Unique identifier of the notification
Examples:
notf_2G6MJiNz71bHQGNzGwKx5cJwPFS
ID of the object that triggered this notification
Examples:
job_2G6MJiNz71bHQGNzGwKx5cJwPFS
JSON payload that was sent to the webhook endpoint
Examples:
{"event":"job.completed""job":{"id":"job_123"}}
Webhook endpoint configuration that received this notification
Whether the webhook is currently enabled
Array of event types this webhook subscribes to
Available options:
job.completedjob.failedjob.cancelledupload.completedupload.failedupload.expired
Examples:
[job.completed job.failed]
Unique identifier of the webhook
Examples:
wh_2G6MJiNz71bHQGNzGwKx5cJwPFS
ID of the project this webhook belongs to
Examples:
proj_2G6MJiNz71bHQGNzGwKx5cJwPFS
URL where webhook events will be sent
Examples:
https://example.com/webhook
response_status_code
integer
HTTP status code received from the webhook endpoint
status
"success"
string
required
Status indicates the response status "success"
The notification was created successfully
application/jsonCode is the HTTP status code
Message is a human-readable error description
Examples:
Invalid request parameters
type
"ValidationError"
string
required
Type indicates the error category
Available options:
ValidationError
status
"error"
string
required
Status indicates the response status "error"
Invalid request parameters
application/jsonError response details
Code is the HTTP status code
Message is a human-readable error description
Examples:
Authentication error: invalid token or subscription inactive
type
"AuthenticationError"
string
required
Type indicates the error category
Available options:
AuthenticationError
status
"error"
string
required
Status indicates the response status "error"
Authentication error: invalid token or subscription inactive
application/jsonError response details
Code is the HTTP status code
Message is a human-readable error description
Examples:
Rate limit exceeded
type
"TooManyRequestsError"
string
required
Type indicates the error category
Available options:
TooManyRequestsError
status
"error"
string
required
Status indicates the response status "error"
Rate limit exceeded
# Create a notification
> Create a new notification for a job event
```json
{
"path": "/api/notifications",
"method": "post",
"schema": {
"description": "Create a new notification for a job event",
"operationId": "createNotification",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationCreateParams"
}
}
},
"description": "Notification creation parameters",
"required": true,
"x-originalParamName": "request"
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationResponse"
}
}
},
"description": "The notification was created successfully"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResponseErrorValidation"
}
}
},
"description": "Invalid request parameters"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResponseErrorAuthentication"
}
}
},
"description": "Authentication error: invalid token or subscription inactive"
},
"429": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResponseErrorTooManyRequests"
}
}
},
"description": "Rate limit exceeded"
}
},
"security": [
{
"ProjectAccessToken": []
}
],
"summary": "Create a notification",
"tags": [
"Notifications"
],
"x-codeSamples": [
{
"lang": "JavaScript",
"source": "import Chunkify from '@chunkify/chunkify';\n\nconst client = new Chunkify({\n projectAccessToken: 'My Project Access Token',\n});\n\nconst notification = await client.notifications.create({\n event: 'job.completed',\n object_id: 'job_A1cce6120E56e7Tu9ioP09Nhjk9',\n webhook_id: 'wh_A1cce6120E56e7Tu9ioP09Nhjk9',\n});\n\nconsole.log(notification);"
},
{
"lang": "Python",
"source": "from chunkify import Chunkify\n\nclient = Chunkify(\n project_access_token=\"My Project Access Token\",\n)\nnotification = client.notifications.create(\n event=\"job.completed\",\n object_id=\"job_A1cce6120E56e7Tu9ioP09Nhjk9\",\n webhook_id=\"wh_A1cce6120E56e7Tu9ioP09Nhjk9\",\n)\nprint(notification)"
},
{
"lang": "php",
"source": "\u003c?php\n\nuse Chunkify\\Client;\n\n$client = new Client(\n projectAccessToken: 'My Project Access Token',\n);\n\n$notification = $client-\u003enotifications-\u003ecreate(\n event: 'job.completed',\n objectID: 'job_A1cce6120E56e7Tu9ioP09Nhjk9',\n webhookID: 'wh_A1cce6120E56e7Tu9ioP09Nhjk9',\n);\n\nvar_dump($notification);"
},
{
"lang": "Go",
"source": "package main\n\nimport (\n \"context\"\n \"fmt\"\n\n \"github.com/chunkifydev/chunkify-go\"\n \"github.com/chunkifydev/chunkify-go/option\"\n)\n\nfunc main() {\n client := chunkify.NewClient(\n option.WithProjectAccessToken(\"My Project Access Token\"),\n )\n notification, err := client.Notifications.New(context.TODO(), chunkify.NotificationNewParams{\n Event: chunkify.NotificationNewParamsEventJobCompleted,\n ObjectID: \"job_A1cce6120E56e7Tu9ioP09Nhjk9\",\n WebhookID: \"wh_A1cce6120E56e7Tu9ioP09Nhjk9\",\n })\n if err != nil {\n panic(err.Error())\n }\n fmt.Printf(\"%+v\\n\", notification)\n}\n"
}
]
}
}
```
```json #/components/schemas/ResponseErrorValidation
{
"properties": {
"error": {
"properties": {
"code": {
"const": 400,
"description": "Code is the HTTP status code",
"examples": [
400
],
"type": "integer"
},
"message": {
"description": "Message is a human-readable error description",
"examples": [
"Invalid request parameters"
],
"type": "string"
},
"type": {
"const": "ValidationError",
"description": "Type indicates the error category",
"enum": [
"ValidationError"
],
"type": "string"
}
},
"required": [
"type",
"code",
"message"
],
"type": "object"
},
"status": {
"const": "error",
"description": "Status indicates the response status \"error\"",
"type": "string"
}
},
"required": [
"status",
"error"
]
}
```
```json #/components/schemas/ResponseErrorAuthentication
{
"description": "Error response",
"properties": {
"error": {
"description": "Error response details",
"properties": {
"code": {
"const": 401,
"description": "Code is the HTTP status code",
"examples": [
401
],
"type": "integer"
},
"message": {
"description": "Message is a human-readable error description",
"examples": [
"Authentication error: invalid token or subscription inactive"
],
"type": "string"
},
"type": {
"const": "AuthenticationError",
"description": "Type indicates the error category",
"enum": [
"AuthenticationError"
],
"type": "string"
}
},
"required": [
"type",
"code",
"message"
],
"type": "object"
},
"status": {
"const": "error",
"description": "Status indicates the response status \"error\"",
"type": "string"
}
},
"required": [
"status",
"error"
],
"type": "object"
}
```
```json #/components/schemas/ResponseErrorTooManyRequests
{
"description": "Error response",
"properties": {
"error": {
"description": "Error response details",
"properties": {
"code": {
"const": 429,
"description": "Code is the HTTP status code",
"examples": [
429
],
"type": "integer"
},
"message": {
"description": "Message is a human-readable error description",
"examples": [
"Rate limit exceeded"
],
"type": "string"
},
"type": {
"const": "TooManyRequestsError",
"description": "Type indicates the error category",
"enum": [
"TooManyRequestsError"
],
"type": "string"
}
},
"required": [
"type",
"code",
"message"
],
"type": "object"
},
"status": {
"const": "error",
"description": "Status indicates the response status \"error\"",
"type": "string"
}
},
"required": [
"status",
"error"
],
"type": "object"
}
```
```json #/components/schemas/NotificationCreateParams
{
"properties": {
"event": {
"$ref": "#/components/schemas/WebhookEvent",
"description": "Event specifies the type of event that triggered the notification."
},
"object_id": {
"description": "ObjectId specifies the object that triggered this notification.",
"examples": [
"job_A1cce6120E56e7Tu9ioP09Nhjk9"
],
"type": "string"
},
"webhook_id": {
"description": "WebhookId specifies the webhook endpoint that will receive the notification.",
"examples": [
"wh_A1cce6120E56e7Tu9ioP09Nhjk9"
],
"type": "string"
}
},
"required": [
"event",
"object_id",
"webhook_id"
],
"type": "object"
}
```
```json #/components/schemas/WebhookEvent
{
"enum": [
"job.completed",
"job.failed",
"job.cancelled",
"upload.completed",
"upload.failed",
"upload.expired"
],
"type": "string"
}
```
```json #/components/schemas/NotificationResponse
{
"properties": {
"data": {
"$ref": "#/components/schemas/Notification",
"description": "Data contains the response object"
},
"status": {
"const": "success",
"description": "Status indicates the response status \"success\"",
"type": "string"
}
},
"required": [
"status",
"data"
],
"type": "object"
}
```
```json #/components/schemas/Notification
{
"properties": {
"created_at": {
"description": "Timestamp when the notification was created",
"examples": [
"2025-01-01T12:00:00Z"
],
"format": "date-time",
"type": "string"
},
"event": {
"$ref": "#/components/schemas/WebhookEvent",
"description": "Type of event that triggered this notification"
},
"id": {
"description": "Unique identifier of the notification",
"examples": [
"notf_2G6MJiNz71bHQGNzGwKx5cJwPFS"
],
"type": "string"
},
"object_id": {
"description": "ID of the object that triggered this notification",
"examples": [
"job_2G6MJiNz71bHQGNzGwKx5cJwPFS"
],
"type": "string"
},
"payload": {
"description": "JSON payload that was sent to the webhook endpoint",
"examples": [
"{\"event\":\"job.completed\",\"job\":{\"id\":\"job_123\"}}"
],
"type": "string"
},
"response_status_code": {
"description": "HTTP status code received from the webhook endpoint",
"examples": [
200
],
"type": "integer"
},
"webhook": {
"allOf": [
{
"$ref": "#/components/schemas/Webhook"
}
],
"description": "Webhook endpoint configuration that received this notification"
}
},
"required": [
"created_at",
"event",
"id",
"object_id",
"payload",
"webhook"
],
"type": "object"
}
```
```json #/components/schemas/WebhookEvent
{
"enum": [
"job.completed",
"job.failed",
"job.cancelled",
"upload.completed",
"upload.failed",
"upload.expired"
],
"type": "string"
}
```
```json #/components/schemas/Webhook
{
"properties": {
"enabled": {
"description": "Whether the webhook is currently enabled",
"examples": [
true
],
"type": "boolean"
},
"events": {
"description": "Array of event types this webhook subscribes to",
"examples": [
[
"job.completed",
"job.failed"
]
],
"items": {
"$ref": "#/components/schemas/WebhookEvent"
},
"type": "array"
},
"id": {
"description": "Unique identifier of the webhook",
"examples": [
"wh_2G6MJiNz71bHQGNzGwKx5cJwPFS"
],
"type": "string"
},
"project_id": {
"description": "ID of the project this webhook belongs to",
"examples": [
"proj_2G6MJiNz71bHQGNzGwKx5cJwPFS"
],
"type": "string"
},
"url": {
"description": "URL where webhook events will be sent",
"examples": [
"https://example.com/webhook"
],
"type": "string"
}
},
"required": [
"enabled",
"events",
"id",
"project_id",
"url"
],
"type": "object"
}
```
```json #/components/schemas/WebhookEvent
{
"enum": [
"job.completed",
"job.failed",
"job.cancelled",
"upload.completed",
"upload.failed",
"upload.expired"
],
"type": "string"
}
```