Livepush Developers

Videos

Create an upload session

POST https://vod-uploads-middleware-api.livepush.io/uploads/new

Base URL https://vod-uploads-middleware-api.livepush.io — Livepush Video Upload Middleware

Opens a one-time upload session for one file. The request body is the response from Create a video upload URL, sent unchanged. The response's uploadUrl is where the file goes next, with Upload a file to a session.

Sessions expire after 24 hours and accept a single upload attempt.

This host authenticates the same bearer token as the rest of the API; the token must belong to the account the upload URL was created for. See the Uploading videos guide.

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://vod-uploads-middleware-api.livepush.io/uploads/new — This call changes live data on your account.

Request body

application/json required

  • id string
    Video id allocated for this upload.
  • Key string
    Object key the file will be written to.
  • uploadUrl string
    Storage endpoint the upload middleware writes to. Do not upload to it yourself.
  • uploadType string
    How storage expects the file. The upload middleware handles every type, so clients do not need to branch on it.
    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, and direct uploads receive nothing. The upload middleware consumes these; clients pass them through unchanged.
    • 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 request body response.json
{
  "id": "Xk2fP9qLm",
  "Key": "nsAbC123xY_/Xk2fP9qLm.mp4",
  "uploadUrl": "https://s3.fr-par.scw.cloud/pre-recorded-live-10",
  "uploadType": "formdata",
  "uploadCredentials": {
    "key": "nsAbC123xY_/Xk2fP9qLm.mp4",
    "acl": "public-read",
    "X-Amz-Credential": "…",
    "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
    "X-Amz-Date": "20261202T093242Z",
    "Policy": "…",
    "X-Amz-Signature": "…",
    "success_action_status": "204",
    "x-amz-meta-uuid": "…"
  },
  "zone": "zn_35hk0gxy_pr"
}

Code samples

request.sh
curl -X POST 'https://vod-uploads-middleware-api.livepush.io/uploads/new' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "Xk2fP9qLm",
    "Key": "nsAbC123xY_/Xk2fP9qLm.mp4",
    "uploadUrl": "https://s3.fr-par.scw.cloud/pre-recorded-live-10",
    "uploadType": "formdata",
    "uploadCredentials": {
      "key": "nsAbC123xY_/Xk2fP9qLm.mp4",
      "acl": "public-read",
      "X-Amz-Credential": "…",
      "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
      "X-Amz-Date": "20261202T093242Z",
      "Policy": "…",
      "X-Amz-Signature": "…",
      "success_action_status": "204",
      "x-amz-meta-uuid": "…"
    },
    "zone": "zn_35hk0gxy_pr"
  }'
const response = await fetch('https://vod-uploads-middleware-api.livepush.io/uploads/new', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "id": "Xk2fP9qLm",
    "Key": "nsAbC123xY_/Xk2fP9qLm.mp4",
    "uploadUrl": "https://s3.fr-par.scw.cloud/pre-recorded-live-10",
    "uploadType": "formdata",
    "uploadCredentials": {
      "key": "nsAbC123xY_/Xk2fP9qLm.mp4",
      "acl": "public-read",
      "X-Amz-Credential": "…",
      "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
      "X-Amz-Date": "20261202T093242Z",
      "Policy": "…",
      "X-Amz-Signature": "…",
      "success_action_status": "204",
      "x-amz-meta-uuid": "…"
    },
    "zone": "zn_35hk0gxy_pr"
  }),
});

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 = {
    "id": "Xk2fP9qLm",
    "Key": "nsAbC123xY_/Xk2fP9qLm.mp4",
    "uploadUrl": "https://s3.fr-par.scw.cloud/pre-recorded-live-10",
    "uploadType": "formdata",
    "uploadCredentials": {
        "key": "nsAbC123xY_/Xk2fP9qLm.mp4",
        "acl": "public-read",
        "X-Amz-Credential": "…",
        "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
        "X-Amz-Date": "20261202T093242Z",
        "Policy": "…",
        "X-Amz-Signature": "…",
        "success_action_status": "204",
        "x-amz-meta-uuid": "…"
    },
    "zone": "zn_35hk0gxy_pr"
}

response = requests.post('https://vod-uploads-middleware-api.livepush.io/uploads/new', headers=headers, json=payload, timeout=30)
response.raise_for_status()
data = response.json()

Responses

Session created.

application/json

  • uploadUrl string
    Where to send the file, with PUT and your bearer token. Accepts exactly one upload attempt; create a new session to retry.
Example 200 response response.json
{
  "uploadUrl": "https://vod-uploads-middleware-api.livepush.io/uploads/Qe8rT2pZx"
}

Missing or invalid bearer token.

application/json

Example 401 response response.json
{
  "error": "unauthorized"
}

The session could not be stored. Safe to retry.

application/json

Example 500 response response.json
{
  "error": "could not create upload session"
}