md-platform

video-slug-changes.md
View raw Back to list

Video Slug Feature - API Changes


Summary

Videos now support slugs (handles). Slugs are auto-generated on video creation and can be updated on video edit. A new endpoint is available to check slug availability before submitting.


New Endpoints

GET /studio/v1/slugs/check/{slug}

Auth: Creator authorization required

Checks if a slug is available and returns a suggested alternative if taken.

Response (available):

{
  "slug": "my-video-slug",
  "isAvailable": true,
  "suggestedSlug": null
}

Response (taken):

{
  "slug": "my-video-slug",
  "isAvailable": false,
  "suggestedSlug": "my-video-slug-1"
}

Errors: Returns 400 if slug format is invalid or exceeds 150 characters.

GET /admin/v1/slugs/check/{slug}

Auth: Admin authorization required — same behavior as studio endpoint.


Updated Requests

PUT /studio/v1/videos/{id}

New optional field: handle (string, nullable)

{
  "videoId": "string",
  "eventId": "string?",
  "name": "string",
  "handle": "string?",       // NEW
  "shortDescription": "string?",
  "description": "object?",
  "thumbnail": "string?",
  "visibility": 0,
  "scheduledAt": "datetime",
  "isPremium": false,
  "payToViewProductId": "string?"
}

PUT /admin/v1/videos/{id}

New optional field: handle (string, nullable)

{
  "videoId": "string",
  "channelId": "string",
  "eventId": "string?",
  "name": "string",
  "handle": "string?",       // NEW
  "shortDescription": "string?",
  "description": "object?",
  "thumbnail": "string?",
  "visibility": 0,
  "scheduledAt": "datetime",
  "isPremium": false,
  "payToViewProductId": "string?"
}

Updated Responses

A new handle field (string, nullable) is now included in all video response DTOs:

DTO Context
VideoDto Video detail (studio/client)
ListVideoDto Video listing (client)
SearchListVideoDto Video search results (client)
SearchStudioListVideoDto Video search results (studio)
AdminVideoDto Video detail (admin)
AdminListVideoDto Video listing (admin)
AdminListLiveVideoDto Live video listing (admin)
AdminLiveVideoDto Live video detail (admin)
StudioLiveVideoDto Live video detail (studio)
SearchStudioListLiveVideoDto Live video search results (studio)

Example:

{
  "id": "encoded-id",
  "name": "My Video",
  "handle": "my-video"
}

Slug Validation Rules


Slug Behavior