> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spirii.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conventions

> The rules every Spirii API endpoint shares — base URL, versioning, methods, and data formats.

A handful of conventions hold across every endpoint in the Spirii API. Learn them once and you can read any endpoint's reference without relearning the basics.

## Base URL and format

All requests go to the production API:

```
https://api.spirii.com
```

Requests and responses are JSON (`application/json`).

## Versioning

The major version is part of the path — current endpoints sit under `/v2`:

```
https://api.spirii.com/v2/chargeboxes
```

See [Versioning](/developers/versioning) for the current version and how changes are managed. The earlier Spirii legacy API remains available for existing integrations; new work should use the current version.

## Authentication

Every request is authenticated with an API key, sent as a bearer token in the `Authorization` header. See [Authentication](/developers/authentication) for how to create and send it.

## Methods

The API follows REST conventions:

| Method   | Use                                                      | Success |
| -------- | -------------------------------------------------------- | ------- |
| `GET`    | Read a resource or list resources                        | `200`   |
| `POST`   | Create a resource                                        | `201`   |
| `PATCH`  | Update a resource — send only the fields you're changing | `200`   |
| `DELETE` | Remove a resource                                        | `200`   |

A resource's ID goes in the path, for example `PATCH /v2/tokens/{id}`.

## Naming and casing

Property names and query parameters are **camelCase** — `nextPageCursor`, `locationIds`, `startedAt`.

Enum values are the exception: their casing varies between fields, so copy each value exactly as the endpoint's reference lists it rather than assuming a style.

## Data formats

* **Timestamps** are ISO 8601, in UTC — `2025-12-31T23:59:59.999Z`. Parse them with a standard date-time parser rather than by hand.
* **Numbers** are JSON numbers with a dot decimal separator, such as `100.5`. This is the wire format, distinct from how a value is displayed to a person.
* **Money** is a numeric amount alongside an ISO 4217 `currency` code — `EUR`, not a symbol.
* **Quantities** are numeric, with the unit given in the field's description — energy in kWh, power in kW, current in A, voltage in V, durations in seconds.
* **Identifiers** are numbers or strings depending on the resource, and several encode structured information. See [Identifiers](/developers/identifiers) for the formats and what they mean.

## Null and optional fields

Optional values may come back as `null` or be left out of the response entirely. Some fields are returned only when you request them. Treat the reference for each field as the source of truth.

<Info>
  Where this page and an endpoint's reference disagree, the reference is authoritative for that endpoint.
</Info>

## Related

<CardGroup cols={2}>
  <Card title="Authentication" icon="key-round" href="/developers/authentication">
    Create and send your API key.
  </Card>

  <Card title="Versioning" icon="git-branch" href="/developers/versioning">
    The current version and how changes are managed.
  </Card>

  <Card title="Identifiers" icon="fingerprint" href="/developers/identifiers">
    The ID formats each resource uses.
  </Card>

  <Card title="Pagination" icon="layers" href="/developers/pagination">
    Page through list results.
  </Card>

  <Card title="Filtering" icon="filter" href="/developers/filtering">
    Narrow and sort list results.
  </Card>

  <Card title="Errors" icon="circle-alert" href="/developers/errors">
    Status codes and how to handle them.
  </Card>
</CardGroup>
