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

# Environments & Status Codes

> Staging and production service URLs and standard HTTP error responses for the SightX API.

## Environments

SightX provides staging and production environments. The API is distributed across multiple microservices — each endpoint specifies its own base URL in the OpenAPI spec and API playground.

### Authentication

| Environment | Base URL                               |
| ----------- | -------------------------------------- |
| Production  | `https://auth.admin.sightx.io`         |
| Staging     | `https://auth.staging-admin.sightx.io` |

### Platform services

Production services use the `*.sightx.io` domain. Staging equivalents use `*.staging.sightx.io`. Key services include:

| Service       | Production URL                              | Purpose                                     |
| ------------- | ------------------------------------------- | ------------------------------------------- |
| Projects      | `https://project.sightx.io`                 | Project and survey build operations         |
| Campaigns     | `https://campaigns.sightx.io`               | Campaign and recipient list management      |
| Responses     | `https://responses.sightx.io`               | Response capture, stats, and cleaning       |
| Survey        | `https://survey-service.sightx.io`          | Respondent-facing survey render and capture |
| External data | `https://external-data-service.sightx.io`   | Audiences and datasheet processing          |
| Export/import | `https://responses-export-import.sightx.io` | Data export (Excel, JSON, SPSS)             |

Analysis endpoints use dedicated microservices (for example `https://scale-analysis.sightx.io`, `https://multiple-question-analysis.sightx.io`). Each endpoint page in the API reference shows the correct server URL in the playground.

<Tip>
  Complete end-to-end testing in staging before going live. Staging mirrors production behavior without affecting live project data.
</Tip>

***

## API responses

Most endpoints return JSON-encoded responses and standard HTTP status codes.

### Common status codes

| Code | Meaning                                        |
| ---- | ---------------------------------------------- |
| 200  | Success                                        |
| 204  | Success with no response body                  |
| 400  | Bad request — missing or invalid parameters    |
| 401  | Unauthorized — invalid or expired access token |
| 404  | Resource not found                             |
| 409  | Conflict — for example, duplicate JWT request  |
| 422  | Unprocessable — invalid token format           |
| 500  | Internal server error                          |

### Authentication errors

The token exchange endpoint (`POST /v1/m2m-token`) returns specific error messages:

```json theme={null}
{ "message": "No active public Key is present with id" }
```

```json theme={null}
{ "message": "Token has no valid format" }
```

```json theme={null}
{ "message": "Duplicated request, revoked permissions for existing token" }
```

Error descriptions for individual endpoints are documented in each endpoint's API reference page.

***

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication Flow" icon="lock" href="/sightx/guides/01-authentication-flow">
    Set up JWT signing and token exchange.
  </Card>

  <Card title="API Reference" icon="code" href="/sightx/endpoints/post-v1-m2m-token">
    Browse endpoints with per-service server URLs.
  </Card>
</CardGroup>
