# Content routes: draft, publish

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

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

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

### Content.draft
Draft writes Content of one kind from a brief, such as an article for a question the help center could not answer. [Verb page](/business/nouns/content/draft?interface=api).

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | `string` | Yes | What to write. |
| `brief` | `text` | Yes | The question or brief it answers. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `content` | [Content](/business/nouns/content) | Yes | The 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/content/draft \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"article","brief":"Example brief"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "content": {
    "$id": "https://api.sb/leaseline.app/content/content_HYlnoorBdP",
    "$type": "Content",
    "title": "Leaseline Pro"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Content.draft",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Content.publish
Publish puts a Content draft live on its Site and every Interface, once it passes the Evals for its kind. [Verb page](/business/nouns/content/publish?interface=api).

```text
POST /{namespace}/content/{content}/publish
```

Path: `content`. Emits [`Content.published`](/business/events/Content.published).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `content` | [Content](/business/nouns/content) | Yes | The draft to publish. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `content` | [Content](/business/nouns/content) | Yes | The published Content. |

**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/content/content_HYlnoorBdP/publish \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "content": {
    "$id": "https://api.sb/leaseline.app/content/content_HYlnoorBdP",
    "$type": "Content",
    "title": "Leaseline Pro"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Content.publish",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```