# Installation

{% hint style="warning" %}
**Studio / JSON API access is required.** Every route of the JSON API, including the status ping, RSS feeds, sitemap, search index, and public item reads, returns `402 Payment Required` unless the site has an active license with JSON API access enabled.
{% endhint %}

### Prerequisites

* PHP 8.4 or later, matching the main [System Requirements](/elements-docs/cms/getting-started/system-requirements.md).
* Elements CMS v2 installed and published on a web host that can serve the CMS bundle.
* An active license with JSON API access registered to the site's domain.

No extra build step is needed. The API ships with the published CMS bundle.

### Where the API lives

The API entry point is served by the site as:

```
https://example.test/api/
```

Most routes live under `/cms/` on that base URL. The base URL shown on the **API** page inside the Online Editor is always the right value to use.

### Verify it is reachable

From a terminal on any machine that can reach the site:

```sh
curl -i https://example.test/api/
```

Useful non-200 responses:

| Status                      | Meaning                                                              | Fix                                                                                                                                                         |
| --------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `402 Payment Required`      | The API is reachable, but this domain does not have JSON API access. | Activate a license with JSON API access, or see [Upgrading and Downgrading Plans](/elements-docs/cms/online-cms-editor/upgrading-and-downgrading-plans.md). |
| `401 Unauthorized`          | The route needs authentication.                                      | Create and send an `api_...` key.                                                                                                                           |
| `500 Internal Server Error` | The server could not run the API route.                              | Check PHP configuration and the server error log.                                                                                                           |

### Request an API key

Keys are created inside the Online Editor by an owner:

1. Sign in to the Online Editor as an owner.
2. Open **API** in the sidebar. This page appears only when JSON API access is included in the plan.
3. Click **Create Key**, name it, and choose the user the key should act as.
4. Copy the plaintext key that is shown once.

The key starts with `api_`. Store it in an environment variable or secret store. Do not commit it to a repository.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.realmacsoftware.com/elements-docs/cms/json-rest-api/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
