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

# Introduction

> Call SWITCH forecasts, fleet operations, routing and analytics from your own systems.

The SWITCH API is the same engine behind the SWITCH Copilot, available over plain HTTPS and JSON. Use it to:

* **Forecast demand** per zone and time window.
* **Balance your fleet**: find imbalances, get rebalancing suggestions and generated tasks.
* **Plan routes** for one or more fleets, then follow and adjust them as operations happen.
* **Keep your fleet data in sync**: depots, stations, drivers and vehicles.
* **Read analytics** for station-based, free-floating and transit services, plus live status.

Every endpoint in this reference has an interactive playground: paste your API key and send a real request.

## Base URL

```text theme={null}
https://api.getswitch.io
```

## Authentication

Every request carries an API key as a bearer token:

```bash theme={null}
curl https://api.getswitch.io/auth/me \
  -H "Authorization: Bearer $SWITCH_API_KEY"
```

To create a key, open the [SWITCH Copilot](https://copilot.getswitch.io), go to **Settings → API keys** and create a new key. You need the API keys permission in your company; ask your company admin if you don't see the tab. The key is shown **once**: store it in a secret manager, never in source code.

A key acts as the user who created it, with that user's permissions and company data. Revoke a key from the same page (or with [`DELETE /auth/api-keys/{uuid}`](https://docs.getswitch.io/api-reference/api-keys/delete-api-key)) as soon as you no longer need it.

## Errors

The API uses standard HTTP status codes. Error bodies are JSON with a `detail` field, either a message or an object with a machine-readable `code` and a `message`.

| Status | Meaning |
| - | - |
| `400` | The request is valid JSON but cannot be processed as sent. |
| `401` | The API key is missing, invalid or revoked. |
| `403` | The key is valid but its user may not do this, or the feature is off for the company. |
| `404` | The resource does not exist, or is outside your company's data. |
| `422` | Validation failed. `detail` lists each invalid field. |
| `429` | Too many requests. Wait and retry with backoff. |
| `5xx` | Something failed on our side. Retry later; contact us if it persists. |

## Rate limits

Requests are limited per user, by default **30 requests per minute**; some endpoints have tighter limits. Above the limit the API answers `429`. Spread batch jobs over time and retry `429` and `5xx` responses with exponential backoff.

## Using an AI assistant?

You can also ask Myles, the SWITCH assistant, from Claude, ChatGPT, Cursor and other AI tools, without writing code. See [Myles in your AI assistant](https://docs.getswitch.io/guides/myles-mcp.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.