# Create an upload session
`POST https://vod-uploads-middleware-api.livepush.io/uploads/new`
Opens a one-time upload session for one file. The request body is the response from [Create a video upload URL](/videos/create-a-video-upload-url/), sent unchanged. The response's `uploadUrl` is where the file goes next, with [Upload a file to a session](/videos/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](/guides/uploading-videos/) guide.
- **Tag:** Videos
- **Operation ID:** `createUploadSession`
- **Authentication:** Bearer token required
- **Docs:** https://developers.livepush.io/videos/create-an-upload-session/

### 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.
- `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.


```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"
}
```


### Example request

```bash
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"
  }'
```


### Responses


#### 200 — Session created.

- `uploadUrl` (string) — Where to send the file, with PUT and your bearer token. Accepts exactly one upload attempt; create a new session to retry.


```json
{
  "uploadUrl": "https://vod-uploads-middleware-api.livepush.io/uploads/Qe8rT2pZx"
}
```


#### 401 — Missing or invalid bearer token.


```json
{
  "error": "unauthorized"
}
```


#### 500 — The session could not be stored. Safe to retry.


```json
{
  "error": "could not create upload session"
}
```

