# editor.captions.add

Source: https://docs.lightair.app/developers/remote-api/editor.captions.add

> Adds caption lines you give to the captions track, without the speech model.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Editor. Script plugins need the `project.write` permission.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `lines` | `[number, number, string][]` | yes | Each line's start_ms, end_ms and words. |
| `canvas` | `string` | no | A canvas's id or name, shown first. Default: the canvas shown. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `captions` | `number` | no | How many lines were taken. |

## Errors

Invalid params (-32602) without `lines`. A state error (-32005) when no Editor project is open, or the open one is read-only because a newer Lightair made it.

## Events

- `editor.changed`

## From an AI agent

The MCP server's `editor_captions (action: add)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "editor.captions.add", "params": { "lines": [[0, 2400, "Hi, I'm Sam."], [2400, 5200, "Today we build a desk."]] } }
```

Result:

```json
{ "captions": 2 }
```

## Related

- [editor.captions.make](https://docs.lightair.app/developers/remote-api/editor.captions.make.md)
