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

# Update demo

` PATCH /api/v1/demos/{id} `

Update demo

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

### ` id ` (path, required)

- ` value `: type ` string `

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - ` prompt `: type ` string `

    - minLength: ` 1 `

    - maxLength: ` 500 `

  - ` context `: type ` string `

    - maxLength: ` 2000 `

## Responses

### ` 200 ` — Demo updated

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` id `, ` project_id `, ` prompt `, ` status `, ` title `, ` action_script `, ` ai_plan `, ` snapshots `, ` video_key `, ` gif_key `, ` thumbnail_key `, ` duration_ms `, ` recording_log `, ` format `, ` resolution `, ` duration_target `, ` context `, ` presentation `, ` version `, ` error `, ` created_at `, ` updated_at `

  - ` id `: type ` string `

  - ` project_id `: type ` string `

  - ` prompt `: type ` string `

  - ` status `: type ` string `

  - ` title `: type ` string `; nullable

  - ` action_script `: type ` string `; nullable — JSON-encoded recorder script. Present after planning succeeds.

  - ` ai_plan `: type ` string `; nullable — JSON-encoded action plan generated by AI.

  - ` snapshots `: type ` string `; nullable — JSON-encoded snapshot metadata array.

  - ` video_key `: type ` string `; nullable

  - ` gif_key `: type ` string `; nullable

  - ` thumbnail_key `: type ` string `; nullable

  - ` duration_ms `: type ` number `; nullable

  - ` recording_log `: type ` string `; nullable — JSON-encoded per-step recorder execution log.

  - ` format `: type ` string `

  - ` resolution `: type ` string `

  - ` duration_target `: type ` string `; nullable

  - ` context `: type ` string `; nullable

  - ` context_hash `: type ` string `; nullable

  - ` presentation `: type ` string `; nullable — JSON-encoded presentation config, including recordingTemplate metadata.

  - ` recorder_variants `: type ` string `; nullable — JSON-encoded recorder variant status map.

  - ` version `: type ` number `

  - ` error `: type ` string `; nullable

  - ` source `: type ` string ` — How the video was produced: 'generated' (AI pipeline) or 'upload' (locally recorded, uploaded). Uploaded demos cannot be refreshed or restyled.

    - enum: ` ["generated","upload"] `

  - ` created_at `: type ` string `

  - ` updated_at `: type ` string `

  - ` refreshed_at `: type ` string `; nullable

### ` 400 ` — Validation error

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 404 ` — Not found

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

## Request examples

### cURL

```curl
curl -X PATCH 'https://littledemo.com/api/v1/demos/string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "prompt": "string",
  "context": "string"
}'
```

### JavaScript

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

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

### Python

```python
import requests

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

response = requests.patch('https://littledemo.com/api/v1/demos/string', headers=headers, json={
  "prompt": "string",
  "context": "string"
})
print(response.json())
```