# Add a call script to a page

Writes version 1 of a call script for one target on the LEADS page. `scope` is workspace, status (with `statusValue` and no row) or row (with `rowId` and no status); `name` is required and `spine` must carry at least one section, while `brief` and `branches` hold the opening notes and the objection handling. Workspace admin — a workspace- or status-scoped script is words every rep on the page will read; the door a REP uses for one lead is `post_definitions_key_rows_rowId_script_generate`.

Access class: `def:admin`.

## Endpoint

`POST /v1/definitions/{key}/scripts`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "branches": [
      {
        "children": "string",
        "exit": "string",
        "id": "",
        "next": "string",
        "say": "string",
        "tag": "string",
        "trigger": "string"
      }
    ],
    "brief": {
      "headline": "string",
      "hooks": [
        "string"
      ],
      "key_facts": [
        "string"
      ],
      "watch_outs": [
        "string"
      ]
    },
    "name": "string",
    "rowId": "",
    "scope": "string",
    "spine": [
      {
        "key": "string",
        "label": "string",
        "purpose": "string",
        "say": "string"
      }
    ],
    "statusValue": "string"
  },
  "params": {
    ":key": "string"
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "branches": [
      "string"
    ],
    "brief": {
      "headline": "string"
    },
    "createdAt": "string",
    "definitionKey": "string",
    "generator": "string",
    "id": 1.5,
    "kind": "string",
    "name": "string",
    "scope": "string",
    "spine": [
      {
        "key": "string",
        "label": "string",
        "purpose": "string",
        "say": "string"
      }
    ],
    "updatedAt": "string",
    "version": 1.5
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
