Notification events
Updated
Learn about notification service events.
When you set up a server to receive webhook, notifications, Agora notifies your server of the following Cloud Transcoding events:
| Event Type | Event Name | Description |
|---|---|---|
| 110 | cloud_transcoder_started | Cloud transcoder has started successfully |
| 111 | cloud_transcoder_stopped | Cloud transcoder has been destroyed |
| 112 | cloud_transcoder_status | Cloud transcoder runtime state has changed |
| 113 | cloud_transcoder_updated | Cloud transcoder configuration has been updated |
Common payload structure
All cloud transcoding webhook events share this structure:
taskId: String. Cloud transcoding task ID.instanceId: String. Instance ID from your Create request.sequence: Number. Event sequence number.sendts: Number. Timestamp when event was sent (Unix milliseconds).serviceScene: String. Service identifier, always"rtsc/cloud-transcoder".details: JSON Object. Event-specific details (varies by event type).
110 cloud_transcoder_started
When you successfully call Create to create a Cloud Transcoder task, your server receives this event notification.
Sample payload:
{
"taskId":"1234",
"instanceId":"123",
"sequence":123,
"sendts":1656573243385,
"serviceScene":"rtsc/cloud-transcoder",
"details":{
"event":"cloud_transcoder_started",
"state":"Transcoder success",
"createTs":1658112464000,
"transcoder":{
"inputs":[
{
"rtcChannel":"test01",
"rtcUid":123,
"audio":true,
"video":false
},
{
"rtcChannel":"test01",
"rtcUid":456,
"audio":true,
"video":true
}
],
"outputs":[
{
"rtcChannel":"test01",
"rtcUid":1000,
"audio":true,
"video":true
}
],
"userConfigDetail":"{XXXX}"
}
}
}Payload parameters:
event: String. Callback event type. For this event, it's"cloud_transcoder_started", indicating successful creation of a cloud transcoder.state: String. Cloud transcoding status. For this event, it's"Transcoder success", indicating successful creation and start of cloud transcoding.createTs: Number. Unix timestamp (seconds) when the cloud transcoder was created.transcoder: JSON Object. Input and output configuration of the cloud transcoder.inputs: JSON Array. Audio/video input source configuration.rtcChannel: String. RTC channel name for the audio/video input source.rtcUid: Number. UID corresponding to the audio/video input source.audio: Boolean. Whether audio input source exists (true: has audio input,false: no audio input).video: Boolean. Whether video input source exists (true: has video input,false: no video input).
outputs: JSON Array. Audio/video output configuration.rtcChannel: String. RTC channel name for the output audio/video.rtcUid: Number. UID corresponding to the output audio/video.audio: Boolean. Whether audio output exists (true: has audio output,false: no audio output).video: Boolean. Whether video output exists (true: has video output,false: no video output).
userConfigDetail: String. ThecloudTranscoder.configvalue from the Create request.
111 cloud_transcoder_stopped
This event is sent when the Cloud Transcoder is destroyed, either manually or due to an error.
Sample payload:
{
"taskId": "1234",
"instanceId": "123",
"sequence": 123,
"sendts": 1656573243385,
"serviceScene": "rtsc/cloud-transcoder",
"details": {
"event": "cloud_transcoder_stopped",
"stopReason": "Stop request",
"createTs": 1658112464000,
"updateTs": 1658112464000
}
}Payload parameters:
event: String. Callback event type. For this event, it's"cloud_transcoder_stopped", indicating successful destruction of a cloud transcoder.stopReason: String. Reason for cloud transcoding stoppage. Could be due to calling the Delete API or other exceptional reasons. You can use this field to troubleshoot abnormal cloud transcoding stops.createTs: Number. Unix timestamp (seconds) when the cloud transcoder was created.updateTs: Number. Unix timestamp (seconds) when the cloud transcoder was destroyed.
112 cloud_transcoder_status
This event is triggered when the Cloud Transcoder's runtime state changes after it is created.
Sample payload:
{
"taskId": "1234",
"instanceId": "123",
"sequence": 123,
"sendts": 1656573243385,
"serviceScene": "rtsc/cloud-transcoder",
"details": {
"event": "cloud_transcoder_status",
"state": "running",
"createTs": 1658112464000,
"updateTs": 1658112464000
}
}Payload parameters:
event: String. Callback event type. For this event, it's"cloud_transcoder_status", indicating cloud transcoder runtime status change.state: String. Cloud transcoding status. Possible values:"connecting": Connecting to Agora business servers."running": Operating normally, performing cloud transcoding."failed": Cloud transcoding failed.createTs: Number. Unix timestamp (seconds) when the cloud transcoder was created.updateTs: Number. Unix timestamp (seconds) when the cloud transcoder status was updated.
113 cloud_transcoder_updated
This event is triggered after you successfully call Update to update the Cloud Transcoder configuration.
Sample payload:
{
"taskId": "1234",
"instanceId": "123",
"sequence": 123,
"sendts": 1656573243385,
"serviceScene": "rtsc/cloud-transcoder",
"details": {
"event": "cloud_transcoder_updated",
"state": "running",
"createTs": 1658112464000,
"updateTs": 1658112464000,
"transcoder": {
"inputs": [
{
"rtcChannel": "test01",
"rtcUid": 123,
"audio": true,
"video": false
},
{
"rtcChannel": "test01",
"rtcUid": 456,
"audio": true,
"video": true
}
],
"outputs": [
{
"rtcChannel": "test01",
"rtcUid": 1000,
"audio": true,
"video": true
}
],
"userConfigDetail": "json_string"
}
}
}Payload parameters:
event: String. Callback event type. For this event, it's"cloud_transcoder_updated", indicating cloud transcoder configuration update.state: String. Cloud transcoding status."running"means the cloud transcoder is operating normally and performing cloud transcoding.createTs: Number. Unix timestamp (seconds) when the cloud transcoder was created.updateTs: Number. Unix timestamp (seconds) when the cloud transcoder configuration was updated.userConfigDetail: String. Configuration content from the request body (cloudTranscoder.config).transcoder: JSON Object. Input and output configuration of the cloud transcoder.inputs: JSON Array. Audio/video input source configuration.rtcChannel: String. RTC channel name for the audio/video input source.rtcUid: Number. UID corresponding to the audio/video input source.audio: Boolean. Whether audio input source exists (true: has audio input,false: no audio input).video: Boolean. Whether video input source exists (true: has video input,false: no video input).
outputs: JSON Array. Audio/video output configuration.rtcChannel: String. RTC channel name for the output audio/video.rtcUid: Number. UID corresponding to the output audio/video.audio: Boolean. Whether audio output exists (true: has audio output,false: no audio output).video: Boolean. Whether video output exists (true: has video output,false: no video output).
