Livepush Developers

Videos

Create a video upload URL

POST https://octopus.livepush.io/streams/{stream_id}/videos/uploadurl

Base URL https://octopus.livepush.io — Core Streams & Media APIs

Returns a URL to upload a video file to. Use this for a single-request upload; for large files use the multipart flow instead.

The response tells you how to upload via uploadType: direct is a plain PUT to uploadUrl, formdata posts the file with the fields in uploadCredentials. Keep id and Key — registering the video afterwards needs them.

Requires a token with the streams.videos.write scope.

Authorization

Send a valid access token in the Authorization header.

  • bearerAuth — Bearer token (JWT)
headers.txt
Authorization: Bearer YOUR_API_TOKEN

Try it

POST https://octopus.livepush.io/streams/{stream_id}/videos/uploadurl — This call changes live data on your account.

Parameters

Path parameters

  • stream_id string required
    Unique identifier of the stream.
    example: st_xxxxxxxxxxxxx

Request body

application/json required

  • type string required
    MIME type of the file.
  • size integer required
    File size in bytes.
  • originalFilename string required
  • zone string required
    Storage zone to upload into.
  • partNumber integer
    Only used by the signed single-part variant.
Example request body response.json
{
  "type": "video/mp4",
  "size": 734003200,
  "originalFilename": "service-12-jan.mp4",
  "zone": "eu-central",
  "partNumber": 0
}

Code samples

request.sh
curl -X POST 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/videos/uploadurl' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "video/mp4",
    "size": 734003200,
    "originalFilename": "service-12-jan.mp4",
    "zone": "eu-central",
    "partNumber": 0
  }'
const response = await fetch('https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/videos/uploadurl', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "type": "video/mp4",
    "size": 734003200,
    "originalFilename": "service-12-jan.mp4",
    "zone": "eu-central",
    "partNumber": 0
  }),
});

if (!response.ok) {
  throw new Error(`Livepush API error ${response.status}`);
}

const data = await response.json();
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
}

payload = {
    "type": "video/mp4",
    "size": 734003200,
    "originalFilename": "service-12-jan.mp4",
    "zone": "eu-central",
    "partNumber": 0
}

response = requests.post('https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/videos/uploadurl', headers=headers, json=payload, timeout=30)
response.raise_for_status()
data = response.json()

Responses

Create a video upload URL.

application/json

  • id string
    Video ID allocated for this upload.
  • Key string
    Object key the file will be written to.
  • uploadUrl string
    URL to send the file to.
  • uploadType string
    How to perform the upload. direct is a plain PUT to uploadUrl; formdata posts the file with the fields in uploadCredentials; multipart uses the multipart endpoints.
    directformdatamultipart
  • uploadCredentials VideoUploadCredentials
    Vendor-specific credentials the client needs to perform the upload. The shape depends on uploadType: multipart uploads receive pool and chunking parameters, formdata uploads receive the signed form fields to post alongside the file, and direct uploads receive nothing — everything is carried in uploadUrl.
    • bucketName string
    • region string
    • poolId string
      Identity pool used to authorise the multipart upload.
    • concurrency integer
      How many parts the client should upload in parallel.
    • chunkSize integer
      Part size in bytes.
    • keyPrefix string
    • useAccelerateEndpoint boolean
  • zone string
    Storage zone the object is being written to.
Example 200 response response.json
{
  "id": "vd_xxxxxxxxxxxx",
  "Key": "string",
  "uploadUrl": "string",
  "uploadType": "direct",
  "uploadCredentials": {
    "bucketName": "string",
    "region": "eu-west-1",
    "poolId": "string",
    "concurrency": 4,
    "chunkSize": 8388608,
    "keyPrefix": "string",
    "useAccelerateEndpoint": false
  },
  "zone": "zn_35hk0gxy_pr"
}

No response body.

Not found for this account.