# Build a help center page for a theme preview

Builds one page of the help center with its live content, as a theme would render it, without rendering it. The dimmi CLI renders the page in the theme on the developer's computer. Returns the page's status, its redirect when it has one, and the template and variables it renders.

```http
GET https://trydimmi.com/api/v1/help-centers/{help_center}/theme-preview
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `settings:write`.

## Path parameters

- `help_center` (string, required): Id of the help center, starting with hc_, such as hc_01jx2m8k4t. Find it with GET /help-centers.

## Query parameters

- `path` (string): The page's path, such as /articles/install or /fr.

## Response 200 (OK)

- `data` (object, required)
  - `location` (string): Where the page sends the reader instead, for a redirect. Left out otherwise.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `status` (integer, required): The HTTP status the page answers with, such as 200, 302 or 404.
  - `template` (string): The theme template the page renders, such as article. Left out for a redirect.
  - `variables` (object): The variables the template reads, by name. HTML and times are one-key objects, {"$html": ...} and {"$time": ...}.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request GET \
  --url 'https://trydimmi.com/api/v1/help-centers/{help_center}/theme-preview' \
  --header 'Authorization: Bearer <token>'
```

## Example response

```json
{
  "data": {
    "location": "<string>",
    "object": "<string>",
    "status": 123,
    "template": "<string>",
    "variables": {
      "<key>": null
    }
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
