backend: Added recording webhooks in openapi spec

This commit is contained in:
Carlos Santos 2025-04-08 18:15:34 +02:00
parent 8d92ad3533
commit cf21cc7233

View File

@ -3,28 +3,18 @@ recordingStarted:
summary: Recording started summary: Recording started
description: > description: >
This webhook is triggered when a recording starts. This webhook is triggered when a recording starts.
The API provider will send a POST request to this endpoint with the recording details.
The JSON payload includes information such as the recording identifier, room, and its status. > The recording can be in the `STARTING` status for a few seconds before it becomes `ACTIVE`.
operationId: recordingStartedWebhook operationId: recordingStartedWebhook
parameters: parameters:
- name: X-Timestamp - $ref: ../components/parameters/x-timestamp.yaml
in: header - $ref: ../components/parameters/x-signature.yaml
description: Timestamp of the webhook event (in Unix Epoch seconds)
example: 1678901234
schema:
type: string
- name: X-Signature
in: header
description: HMAC signature for webhook verification
example: 1234567890abcdef
schema:
type: string
requestBody: requestBody:
required: true required: true
content: content:
application/json: application/json:
schema: schema:
# $ref: '#/components/schemas/RecordingStartedWebhook'
properties: properties:
creationDate: creationDate:
type: number type: number
@ -35,127 +25,148 @@ recordingStarted:
description: Event type identifier. description: Event type identifier.
example: recordingStarted example: recordingStarted
data: data:
type: object
properties: properties:
recordingId: recordingId:
type: string type: string
description: The unique identifier of the recording that started. description: The unique identifier of the recording.
example: room-123--EG_XYZ--XX445 example: room-123--EG_XYZ--XX445
roomId: roomId:
type: string type: string
description: The unique identifier of the room for which the recording started. description: The ID of the room where the recording was made.
example: room-123 example: room-123
status: status:
type: string type: string
description: The status of the recording. description: The status of the recording.
example: STARTING example: STARTING
filename:
type: string
description: The name of the recording file.
example: room-123--XX445.mp4
startDate:
type: number
description: The date when the recording started (milliseconds since the Unix epoch).
example: 1620000000000
responses: responses:
'200': '200':
description: Webhook received successfully description: Webhook received successfully
# recordingUpdated: recordingUpdated:
# post: post:
# summary: Recording updated summary: Recording updated
# description: > description: >
# This webhook is triggered when a recording update occurs. This webhook is triggered when a recording update occurs.
# The API provider sends a POST request with the updated details of the recording.
# operationId: recordingUpdatedWebhook
# parameters:
# - name: X-Timestamp
# in: header
# description: Timestamp of the webhook event (in Unix Epoch seconds)
# example: 1678901234
# schema:
# type: string
# - name: X-Signature
# in: header
# description: HMAC signature for webhook verification
# example: 1234567890abcdef
# schema:
# type: string
# requestBody:
# required: true
# content:
# application/json:
# schema:
# type: object
# properties:
# creationDate:
# type: number
# description: The date when the event was created (milliseconds since the Unix epoch).
# example: 1620000000000
# event:
# type: string
# description: Event type identifier.
# example: recordingUpdated
# data:
# type: object
# properties:
# recordingId:
# type: string
# description: The unique identifier of the recording being updated.
# example: room-123--EG_XYZ--XX445
# roomId:
# type: string
# description: The unique identifier of the room for which the recording is updated.
# example: room-123
# status:
# type: string
# description: The updated status of the recording.
# example: ACTIVE
# responses:
# '200':
# description: Webhook received successfully
# recordingEnded: > This update can be due to a change in the recording status (e.g., from `STARTING` to `ACTIVE`).
# post: operationId: recordingUpdatedWebhook
# summary: Recording ended parameters:
# description: > - $ref: ../components/parameters/x-timestamp.yaml
# This webhook is triggered when a recording ends. - $ref: ../components/parameters/x-signature.yaml
# The API provider will send a POST request containing the final details of the recording. requestBody:
# operationId: recordingEndedWebhook required: true
# parameters: content:
# - name: X-Timestamp application/json:
# in: header schema:
# description: Timestamp of the webhook event (in Unix Epoch seconds) type: object
# example: 1678901234 properties:
# schema: creationDate:
# type: string type: number
# - name: X-Signature description: The date when the event was created (milliseconds since the Unix epoch).
# in: header example: 1620000000000
# description: HMAC signature for webhook verification event:
# example: 1234567890abcdef type: string
# schema: description: Event type identifier.
# type: string example: recordingUpdated
# requestBody: data:
# required: true properties:
# content: recordingId:
# application/json: type: string
# schema: description: The unique identifier of the recording.
# type: object example: room-123--EG_XYZ--XX445
# properties: roomId:
# creationDate: type: string
# type: number description: The ID of the room where the recording was made.
# description: The date when the event was created (milliseconds since the Unix epoch). example: room-123
# example: 1620000000000 status:
# event: type: string
# type: string enum: [ACTIVE, ENDING]
# description: Event type identifier. description: The status of the recording.
# example: recordingEnded example: ACTIVE
# data: filename:
# type: object type: string
# properties: description: The name of the recording file.
# recordingId: example: room-123--XX445.mp4
# type: string startDate:
# description: The unique identifier of the recording that ended. type: number
# example: room-123--EG_XYZ--XX445 description: The date when the recording started (milliseconds since the Unix epoch).
# roomId: example: 1620000000000
# type: string responses:
# description: The unique identifier of the room for which the recording ended. '200':
# example: room-123 description: Webhook received successfully
# status: recordingEnded:
# type: string post:
# description: The final status of the recording. summary: Recording ended
# example: COMPLETE description: >
# responses: This webhook is triggered when a recording ends.
# '200':
# description: Webhook received successfully > The recording can end due to various reasons, such as the user stopping the recording or the recording reaching its maximum duration.
operationId: recordingEndedWebhook
parameters:
- $ref: ../components/parameters/x-timestamp.yaml
- $ref: ../components/parameters/x-signature.yaml
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
creationDate:
type: number
description: The date when the event was created (milliseconds since the Unix epoch).
example: 1620000000000
event:
type: string
description: Event type identifier.
example: recordingEnded
data:
properties:
recordingId:
type: string
description: The unique identifier of the recording.
example: room-123--EG_XYZ--XX445
roomId:
type: string
description: The ID of the room where the recording was made.
example: room-123
status:
type: string
enum: [COMPLETE, FAILED, ABORTED, LIMITED_REACHED]
description: The status of the recording.
example: COMPLETE
filename:
type: string
description: The name of the recording file.
example: room-123--XX445.mp4
startDate:
type: number
description: The date when the recording started (milliseconds since the Unix epoch).
example: 1620000000000
endDate:
type: number
description: The date when the recording ended (milliseconds since the Unix epoch).
example: 1620000003600
duration:
type: number
description: The duration of the recording in seconds.
example: 3.6
size:
type: number
description: The size of the recording file in bytes.
example: 1024
details:
type: string
description: Additional details about the recording.
example: Stopped using API
responses:
'200':
description: Webhook received successfully