Documentation / API Reference / Create a notification
Create a notification Send an event notification to a webhook endpoint. Recorded events replay their original payload.
Authorization Authorization
header
string
required
Enter the project access token with the Bearer prefix, e.g. "Bearer project_access_token"
Body application/json
Notification creation parameters
Event specifies the type of event that triggered the notification.
Available options:
job.createdjob.completedjob.failedjob.cancelledsource.createdsource.deletedupload.createdupload.completedupload.failedupload.expiredasset.createdasset.readyasset.playback_readyasset.failedasset.expiredasset.deletedasset.output.createdasset.output.readyasset.output.failedasset.output.deletedworkflow_run.createdworkflow_run.completedworkflow_run.failedworkflow_run.cancelledtranscoding.createdtranscoding.readytranscoding.failedtranscoding.cancelledtranscoding.expiredtranscoding.deletedthumbnail.createdthumbnail.readythumbnail.failedthumbnail.expiredthumbnail.deleted
Examples:
asset.playback_ready
ID of the resource that triggered the event. Use the caption, static rendition, or thumbnail ID for their Asset child events. Replaying asset events, job.created, or source.created requires a retained snapshot. Resource deletion does not prevent replay.
Examples:
ast_A1cce6120E56e7Tu9ioP09Nhjk9
WebhookId specifies the webhook endpoint that will receive the notification.
Examples:
wh_A1cce6120E56e7Tu9ioP09Nhjk9
Responses 201 400 401 429
application/json Data contains the response object
Show data properties
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.createdjob.completedjob.failedjob.cancelledsource.createdsource.deletedupload.createdupload.completedupload.failedupload.expiredasset.createdasset.readyasset.playback_readyasset.failedasset.expiredasset.deletedasset.output.createdasset.output.readyasset.output.failedasset.output.deletedworkflow_run.createdworkflow_run.completedworkflow_run.failedworkflow_run.cancelledtranscoding.createdtranscoding.readytranscoding.failedtranscoding.cancelledtranscoding.expiredtranscoding.deletedthumbnail.createdthumbnail.readythumbnail.failedthumbnail.expiredthumbnail.deleted
Examples:
asset.playback_ready
Unique identifier of the notification
Examples:
notf_2G6MJiNz71bHQGNzGwKx5cJwPFS
ID of the object that triggered this notification
Examples:
ast_2G6MJiNz71bHQGNzGwKx5cJwPFS
JSON payload that was sent to the webhook endpoint
Examples:
{"id":"notf_2G6MJiNz71bHQGNzGwKx5cJwPFS""event":"asset.playback_ready""date":"2025-01-01T12:00:00Z""data":{"asset":{"id":"ast_2G6MJiNz71bHQGNzGwKx5cJwPFS""status":"preparing""playback_ready":true}}}
Webhook endpoint configuration that received this notification
Show webhook properties
Whether the webhook is currently enabled
Array of event types this webhook subscribes to
Available options:
job.createdjob.completedjob.failedjob.cancelledsource.createdsource.deletedupload.createdupload.completedupload.failedupload.expiredasset.createdasset.readyasset.playback_readyasset.failedasset.expiredasset.deletedasset.output.createdasset.output.readyasset.output.failedasset.output.deletedworkflow_run.createdworkflow_run.completedworkflow_run.failedworkflow_run.cancelledtranscoding.createdtranscoding.readytranscoding.failedtranscoding.cancelledtranscoding.expiredtranscoding.deletedthumbnail.createdthumbnail.readythumbnail.failedthumbnail.expiredthumbnail.deleted
Examples:
[asset.playback_ready asset.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
Originating event ID, when recorded by the event log.
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/json Show error properties
Code 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/json Error response details
Show error properties
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/json Error response details
Show error properties
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
> Send an event notification to a webhook endpoint. Recorded events replay their original payload.
```json
{
"path": "/notifications",
"method": "post",
"schema": {
"description": "Send an event notification to a webhook endpoint. Recorded events replay their original payload.",
"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: 'asset.playback_ready',\n object_id: 'ast_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=\"asset.playback_ready\",\n object_id=\"ast_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: 'asset.playback_ready',\n objectID: 'ast_A1cce6120E56e7Tu9ioP09Nhjk9',\n webhookID: 'wh_A1cce6120E56e7Tu9ioP09Nhjk9',\n);\n\nvar_dump($notification);"
},
{
"lang": "Go",
"source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/chunkifydev/chunkify-go\"\n\t\"github.com/chunkifydev/chunkify-go/option\"\n)\n\nfunc main() {\n\tclient := chunkify.NewClient(\n\t\toption.WithProjectAccessToken(\"My Project Access Token\"),\n\t)\n\tnotification, err := client.Notifications.New(context.TODO(), chunkify.NotificationNewParams{\n\t\tEvent: chunkify.NotificationNewParamsEventAssetPlaybackReady,\n\t\tObjectID: \"ast_A1cce6120E56e7Tu9ioP09Nhjk9\",\n\t\tWebhookID: \"wh_A1cce6120E56e7Tu9ioP09Nhjk9\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", notification)\n}\n"
}
]
}
}
```
```json #/components/schemas/NotificationCreateParams
{
"properties": {
"event": {
"$ref": "#/components/schemas/WebhookEvent",
"description": "Event specifies the type of event that triggered the notification."
},
"object_id": {
"description": "ID of the resource that triggered the event. Use the caption, static rendition, or thumbnail ID for their Asset child events. Replaying asset events, job.created, or source.created requires a retained snapshot. Resource deletion does not prevent replay.",
"examples": [
"ast_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.created",
"job.completed",
"job.failed",
"job.cancelled",
"source.created",
"source.deleted",
"upload.created",
"upload.completed",
"upload.failed",
"upload.expired",
"asset.created",
"asset.ready",
"asset.playback_ready",
"asset.failed",
"asset.expired",
"asset.deleted",
"asset.output.created",
"asset.output.ready",
"asset.output.failed",
"asset.output.deleted",
"workflow_run.created",
"workflow_run.completed",
"workflow_run.failed",
"workflow_run.cancelled",
"transcoding.created",
"transcoding.ready",
"transcoding.failed",
"transcoding.cancelled",
"transcoding.expired",
"transcoding.deleted",
"thumbnail.created",
"thumbnail.ready",
"thumbnail.failed",
"thumbnail.expired",
"thumbnail.deleted"
],
"examples": [
"asset.playback_ready"
],
"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"
},
"event_id": {
"description": "Originating event ID, when recorded by the event log.",
"type": "string"
},
"id": {
"description": "Unique identifier of the notification",
"examples": [
"notf_2G6MJiNz71bHQGNzGwKx5cJwPFS"
],
"type": "string"
},
"object_id": {
"description": "ID of the object that triggered this notification",
"examples": [
"ast_2G6MJiNz71bHQGNzGwKx5cJwPFS"
],
"type": "string"
},
"payload": {
"description": "JSON payload that was sent to the webhook endpoint",
"examples": [
"{\"id\":\"notf_2G6MJiNz71bHQGNzGwKx5cJwPFS\",\"event\":\"asset.playback_ready\",\"date\":\"2025-01-01T12:00:00Z\",\"data\":{\"asset\":{\"id\":\"ast_2G6MJiNz71bHQGNzGwKx5cJwPFS\",\"status\":\"preparing\",\"playback_ready\":true}}}"
],
"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.created",
"job.completed",
"job.failed",
"job.cancelled",
"source.created",
"source.deleted",
"upload.created",
"upload.completed",
"upload.failed",
"upload.expired",
"asset.created",
"asset.ready",
"asset.playback_ready",
"asset.failed",
"asset.expired",
"asset.deleted",
"asset.output.created",
"asset.output.ready",
"asset.output.failed",
"asset.output.deleted",
"workflow_run.created",
"workflow_run.completed",
"workflow_run.failed",
"workflow_run.cancelled",
"transcoding.created",
"transcoding.ready",
"transcoding.failed",
"transcoding.cancelled",
"transcoding.expired",
"transcoding.deleted",
"thumbnail.created",
"thumbnail.ready",
"thumbnail.failed",
"thumbnail.expired",
"thumbnail.deleted"
],
"examples": [
"asset.playback_ready"
],
"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": [
[
"asset.playback_ready",
"asset.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.created",
"job.completed",
"job.failed",
"job.cancelled",
"source.created",
"source.deleted",
"upload.created",
"upload.completed",
"upload.failed",
"upload.expired",
"asset.created",
"asset.ready",
"asset.playback_ready",
"asset.failed",
"asset.expired",
"asset.deleted",
"asset.output.created",
"asset.output.ready",
"asset.output.failed",
"asset.output.deleted",
"workflow_run.created",
"workflow_run.completed",
"workflow_run.failed",
"workflow_run.cancelled",
"transcoding.created",
"transcoding.ready",
"transcoding.failed",
"transcoding.cancelled",
"transcoding.expired",
"transcoding.deleted",
"thumbnail.created",
"thumbnail.ready",
"thumbnail.failed",
"thumbnail.expired",
"thumbnail.deleted"
],
"examples": [
"asset.playback_ready"
],
"type": "string"
}
```
```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"
}
```