# Post templates

2 endpoints.

## List post templates

```http
GET https://orbitwrite.com/api/v1/post-templates
```

Ideas to write about, each with a draft to start from: `body` marks what to fill in as `{{label: hint, hint}}` (also parsed into `fields`), and a bracketed line opening with Attach or Add is a note to act on and delete. Replace every field before publishing; one left in is reported as a `template_field` issue on the post. Filter with `category` and `q` (title and description). Any credential is served, whatever its scopes.

**Authentication:** bearer token or session cookie.

### Query parameters

- `category` (string, optional)
- `q` (string, optional)

### Responses

#### 200

The categories, in display order, and the matching templates

- `categories` (object[], required)
  - `id` (string, required, one of `behind-the-scenes`, `story`, `lesson`, `how-to`, `opinion`, `question`, `list`, `promote`)
  - `label` (string, required)
- `templates` (object[], required)
  - `id` (string, required)
  - `emoji` (string, required)
  - `title` (string, required)
  - `description` (string, required)
  - `category` (string, required, one of `behind-the-scenes`, `story`, `lesson`, `how-to`, `opinion`, `question`, `list`, `promote`)
  - `body` (string, required) — The draft. `{{label: hint, hint}}` marks a field to replace; a bracketed line opening with Attach or Add is a note to act on and delete.
  - `fields` (object[], required) — The body's fields, in order.
    - `label` (string, required)
    - `hints` (string[], required)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

## Get one post template

```http
GET https://orbitwrite.com/api/v1/post-templates/{id}
```

One template by id. Same shape as an entry of `GET /post-templates`.

**Authentication:** bearer token or session cookie.

### Path parameters

- `id` (string, required)

### Responses

#### 200

The template

- `template` (object, required)
  - `id` (string, required)
  - `emoji` (string, required)
  - `title` (string, required)
  - `description` (string, required)
  - `category` (string, required, one of `behind-the-scenes`, `story`, `lesson`, `how-to`, `opinion`, `question`, `list`, `promote`)
  - `body` (string, required) — The draft. `{{label: hint, hint}}` marks a field to replace; a bracketed line opening with Attach or Add is a note to act on and delete.
  - `fields` (object[], required) — The body's fields, in order.
    - `label` (string, required)
    - `hints` (string[], required)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 404

The resource does not exist

- `error` (string, required)
- `issues` (any[], optional)
