# Video routes: draft, finalize

URL: /code/api/video/verbs · Id: `page:code/api/video/verbs`

> The Video Verbs draft, finalize as api.sb routes, with inputs, result, refusals and an example.

Reference for [Video](/business/nouns/video), one group of [Video routes](/code/api/video).

### Video.draft
Draft writes a Video’s timeline from a Startup’s records, its Brand and a Template, with a draft mark on every frame. [Verb page](/business/nouns/video/draft?interface=api).

```text
POST /{namespace}/videos/draft
```

Body, as JSON: the inputs. Emits [`Video.drafted`](/business/events/Video.drafted).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `brand` | [Brand](/business/nouns/brand) | Yes | The Brand the Video speaks for. |
| `offer` | [Offer](/business/nouns/offer) | No | The Offer the Video presents. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `video` | [Video](/business/nouns/video) | Yes | The drafted Video, in status `Draft`. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/videos/draft \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"brand":"brand_PluVQrB1HF"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "video": {
    "$id": "https://api.sb/leaseline.app/videos/video_xVlGG2TxBA",
    "$type": "Video",
    "status": "Draft",
    "timeline": {},
    "brand": "brand_PluVQrB1HF"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Video.draft",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Video.finalize
Finalize lifts a Video’s draft mark once every claim it makes reads from a live record, so its cuts can be published. [Verb page](/business/nouns/video/finalize?interface=api).

```text
POST /{namespace}/videos/{video}/finalize
```

Path: `video`. Emits [`Video.finalized`](/business/events/Video.finalized).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `video` | [Video](/business/nouns/video) | Yes | The rendered Video to finalize. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `video` | [Video](/business/nouns/video) | Yes | The Video, in status `Final`. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/videos/video_xVlGG2TxBA/finalize \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "video": {
    "$id": "https://api.sb/leaseline.app/videos/video_xVlGG2TxBA",
    "$type": "Video",
    "status": "Draft",
    "timeline": {},
    "brand": "brand_PluVQrB1HF"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Video.finalize",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```