Skip to main content

Chapters

Manage video chapters to enable navigation within your video content.

Add Video Chapters

To create chapters for an existing video asset, send an HTTP POST request to the API endpoint with the authentication header.

Endpoint

https://app.tpstreams.com/api/v1/<organization_id>/assets/<asset_id>/chapters/

Request Fields

FieldTypeDescriptionRequired
chaptersarray<ChapterObject>List of chapter definitionsYes

ChapterObject Schema

FieldTypeDescriptionRequired
titlestringTitle of the chapterYes
start_timestringHH:MM:SS timestamp within the video durationYes

Examples

curl -X POST \
"https://app.tpstreams.com/api/v1/<organization_id>/assets/<asset_id>/chapters/" \
-H "Authorization: token <API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"chapters": [
{"title": "Intro", "start_time": "00:00:02"},
{"title": "Overview", "start_time": "00:01:30"}
]
}'

Sample Response

{
"count": 2,
"next": null,
"previous": null,
"results": [
{"id": 6427, "title": "Intro", "start_time": "00:00:02"},
{"id": 6428, "title": "Overview", "start_time": "00:01:30"}
]
}

View Video Chapters

To retrieve chapters for a specific video asset, send an HTTP GET request to the API endpoint with the authentication header.

Endpoint

https://app.tpstreams.com/api/v1/<organization_id>/assets/<asset_id>/chapters/

Examples

curl -X GET \
"https://app.tpstreams.com/api/v1/<organization_id>/assets/<asset_id>/chapters/" \
-H "Authorization: token <API_TOKEN>"

Sample Response

{
"count": 2,
"next": null,
"previous": null,
"results": [
{"id": 6427, "title": "Intro", "start_time": "00:00:02"},
{"id": 6428, "title": "Overview", "start_time": "00:01:30"}
]
}

Delete a Video Chapter

To delete a specific chapter from a video asset, send an HTTP DELETE request to the API endpoint with the authentication header.

Endpoint

https://app.tpstreams.com/api/v1/<organization_id>/assets/<asset_id>/chapters/<chapter_id>/

Examples

curl -X DELETE \
"https://app.tpstreams.com/api/v1/<organization_id>/assets/<asset_id>/chapters/<chapter_id>/" \
-H "Authorization: token <API_TOKEN>"

Success Response

Status: 204 No Content

Status Codes

Status CodeDescription
200 OKChapters retrieved successfully
201 CreatedChapters created successfully
204 No ContentChapter deleted successfully
400 Bad RequestInvalid data or timestamp format
401 UnauthorizedMissing or invalid authentication
404 Not FoundAsset or chapter does not exist
500 Internal Server ErrorUnexpected server issue