# Environments

## Base URL

All API requests are made to:


```
https://api.apiera.io
```

## API versioning

The API uses URL path versioning. The current version is **v1**:


```
https://api.apiera.io/v1/products
https://api.apiera.io/v1/webhook-subscriptions
https://api.apiera.io/v1/product-families
```

## Authentication endpoint

Token requests are made to a separate authorization server:


```
https://auth.apiera.io
```

See [Authentication](/getting-started/authentication) for the full token request flow.

## Request format

All request and response bodies use JSON:

| Header | Value |
|  --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer {access_token}` |


For PATCH requests, send a standard JSON body with only the fields you want to update.

## Response format

All responses return JSON. Successful responses return the resource directly or a paginated wrapper:

**Single resource:**


```json
{
  "uuid": "a1b2c3d4-...",
  "createdAt": "2026-03-10T12:00:00Z",
  "updatedAt": "2026-03-10T12:00:00Z"
}
```

**Paginated collection:**


```json
{
  "items": [],
  "pagination": {
    "page": 1,
    "size": 25,
    "totalItems": 0,
    "totalPages": 0
  }
}
```

## Error format

All errors follow the [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807) specification:


```json
{
  "type": "https://docs.apiera.io/problems/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "The requested resource could not be found.",
  "instance": "/v1/products/abc123",
  "correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
```

See the [Error Reference](/problems) for all error types.

## Common headers

**Request headers:**

| Header | Required | Description |
|  --- | --- | --- |
| `Authorization` | Yes | Bearer token for authentication. |
| `Content-Type` | Yes (write operations) | Must be `application/json`. |
| `X-Correlation-ID` | No | Your own trace ID. Generated automatically if not provided. |
| `X-Channel-UUID` | No | Channel context for product queries. |


**Response headers:**

| Header | Description |
|  --- | --- |
| `X-Correlation-ID` | Unique request identifier for support and debugging. |
| `Retry-After` | Seconds to wait before retrying (included with 429 and 503 responses). |


## HTTPS

All API traffic must use HTTPS. HTTP requests are redirected to HTTPS automatically.