> ## Documentation Index
> Fetch the complete documentation index at: https://docs.littledemo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload local demo video

Uploads a locally-recorded MP4 or WebM file and publishes it as a ready demo using the same share, embed, and media URLs as generated demos.

` POST /api/v1/demos/local-upload `

Upload local demo video

Uploads a locally-recorded MP4 or WebM file and publishes it as a ready demo using the same share, embed, and media URLs as generated demos.

## Servers

- ` https://littledemo.com ` — Production

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` bearerAuth `: ` http `

  - HTTP scheme: ` bearer `

  - Live API key, for example `Authorization: Bearer ld_live_...`.

### Alternative 2

- ` cookieAuth `: ` apiKey `

  - Credential: ` better-auth.session_token ` in ` cookie `

  - Dashboard session cookie.

## Parameters

### ` project_id ` (query, required)

- ` value `: type ` string `

  - minLength: ` 1 `

### ` prompt ` (query, required)

- ` value `: type ` string `

  - minLength: ` 1 `

  - maxLength: ` 500 `

### ` title ` (query, optional)

- ` value `: type ` string `

  - minLength: ` 1 `

  - maxLength: ` 200 `

### ` duration_ms ` (query, optional)

- ` value `: type ` integer `; nullable

  - minimum: ` 0 `

  - maximum: ` 3600000 `

### ` format ` (query, optional)

- ` value `: type ` string `

  - enum: ` ["mp4","webm"] `

## Request body (optional)

Content type: ` video/mp4 `

- ` value `: type ` string `; format ` binary `

## Responses

### ` 201 ` — Local demo uploaded

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` id `, ` status `, ` jobId `, ` shareUrl `, ` embedUrl `, ` videoUrl `

  - ` id `: type ` string `

  - ` status `: type ` string `

    - enum: ` ["ready"] `

  - ` jobId `: type ` string `

  - ` shareUrl `: type ` string `

  - ` embedUrl `: type ` string `

  - ` videoUrl `: type ` string `

### ` 400 ` — Validation error

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 401 ` — Unauthorized

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 403 ` — Publishable keys cannot upload, or plan does not allow this format

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 404 ` — Project not found

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 411 ` — Content-Length required

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 413 ` — Upload too large

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 415 ` — Unsupported media type or body is not a valid video file

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 429 ` — Rate limit or quota exceeded

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

## Request examples

### cURL

```curl
curl -X POST 'https://littledemo.com/api/v1/demos/local-upload?project_id=string&prompt=string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '"string"'
```

### JavaScript

```javascript
const response = await fetch('https://littledemo.com/api/v1/demos/local-upload?project_id=string&prompt=string', {
  method: 'POST',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify("string")
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.post('https://littledemo.com/api/v1/demos/local-upload?project_id=string&prompt=string', headers=headers, json="string")
print(response.json())
```