Issue a playback OTP
Issues a one-time password (OTP) that lets one viewer play one video, and returns the embed_url to load in an iframe.
Call this from your server each time a signed-in viewer opens a video page, and never expose your library key to the browser. An OTP can be used once and expires after ttl_seconds (5 minutes by default).
Always pass user_id: it makes one person count as one unique viewer across devices.
The video must be ready, otherwise the response is 409 with the code video_not_ready.
AccessKeyAccessKey<token>The private key of a library, starting with ovk_. Copy it from API & embeds in the console, keep it on your server, and rotate it there if it leaks.
AccessKey*stringThe library's private key. Same value as the AccessKey security scheme; listed here so code samples include it.
application/json- body
video_id*stringThe video to play. It must be ready.
uuiduser_id?stringYour own ID for the viewer: printable ASCII, no spaces. Used to count unique viewers across devices.
length <= 128ttl_seconds?integerHow long the OTP stays valid before it is used.
1 <= value <= 86400300The OTP and the embed URL.
application/json- response
data*curl -X POST 'https://api.octavideo.tech/api/v1/playback/otp' \ -H 'AccessKey: ovk_YOUR_LIBRARY_PRIVATE_KEY' \ -H 'Content-Type: application/json' \ -d '{ "video_id": "6f1c2b9e-4a7d-4f3e-9b8a-2d5c7e1f0a34", "user_id": "student-4821", "ttl_seconds": 300}'{ "data": { "otp": "Zx8kQ2mVb7nR4tY1uW9eA3sD6fG0hJ5kL2pO8iU7yT4", "expires_at": "2026-10-25T09:35:00Z", "embed_url": "https://player.octavideo.tech/embed/0b8e5d3a-1c2f-4e6a-8b7d-9f0a1b2c3d4e/6f1c2b9e-4a7d-4f3e-9b8a-2d5c7e1f0a34?otp=Zx8kQ2mVb7nR4tY1uW9eA3sD6fG0hJ5kL2pO8iU7yT4" }}