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

# Environments

> The staging and production base URLs, how to get keys for each, and what a call costs in each.

idto runs two environments. Request and response shapes are the same in both, so code written against staging works against production by changing only the base URL and the key pair. A few behaviours differ, listed in [What differs between environments](#what-differs-between-environments); code that handles them works in both.

| Environment | Base URL | Notes |
| - | - | - |
| Production | `https://prod.idto.ai` | Keys from the dashboard after go-live. Billed. |
| Staging | `https://dev.idto.ai` | Keys on request from your idto account manager. Calls reach live sources, so use identities you are authorised to verify. Staging credits are deducted from your staging account. |

> [!WARNING]
>
> There is no sandbox that returns canned results. Every staging call reaches a live verification source, exactly as in production. Test only with identities you have permission to verify, such as your own team's documents with their consent.

## Keys

Each environment has its own `X-Client-ID` and `X-API-Key` pair, and a pair from one environment does not authenticate against the other.

* **Staging:** ask your idto account manager. Staging keys are issued by hand.
* **Production:** generate them in the dashboard under **API Credentials** once your account has completed go-live. See the [Go-live checklist](https://idto.mintlify.site/go-live-checklist.md).

```bash theme={null}
export IDTO_BASE_URL="https://dev.idto.ai"
export IDTO_CLIENT_ID="your_client_id"
export IDTO_API_KEY="your_api_key"
```

Read the base URL from configuration rather than hardcoding it, so promoting a build to production is a configuration change only.

## Sandbox Mode in the dashboard

A new dashboard account opens in **Sandbox Mode**. In that mode the dashboard's built-in API tester shows sample output in the browser and makes no API call. It is a way to explore response shapes, not a test environment, and nothing it shows reaches either base URL above. See the [Dashboard guide](https://idto.mintlify.site/guides/dashboard.md).

## What differs between environments

| | Staging | Production |
| - | - | - |
| Request and response shapes | Same | Same |
| Verification sources | Live | Live |
| Source per product | Set per account in each environment, so staging can route a product to a different source than production | Set per account |
| Employment history and EPF passbook | Can return `202` with `IDTO_203` and a `reference_id` when the source takes longer than 20 seconds | Always answers in the same request |
| Time allowed for a slow bank source | Up to 10 seconds for some sources | Up to 60 seconds |
| Billing | Same [billing rule](https://idto.mintlify.site/concepts/billing-consent.md#billing). A `202` with `IDTO_203` is not charged; the result is charged once when it completes | Same billing rule |
| Credits | Staging account balance | Production account balance |
| Keys | Issued by your account manager | Generated in the dashboard |
| Webhook secret | Set separately per environment | Set separately per environment |

What this means for your tests:

* **The same input can give a different outcome.** Because the source can differ, a placeholder or edge-case input can come back as `IDTO_001` on one environment and `IDTO_202` on the other. Branch on `error_code` and `billed`, and never hardcode the outcome of a specific input.
* **Handle `202` on the employment and passbook routes.** On staging, `POST /verify/employment_history`, `/verify/uan_passbook_without_otp` and `/verify/pf_employee_passbook` can answer `202` with `status: "pending"`, `error_code: "IDTO_203"`, a `reference_id` and a `Retry-After` header. Fetch the result with `GET /verify/result/{reference_id}` after the number of seconds in `Retry-After`; it returns the same `202` until the result is ready, then the final response with its own status code. A `reference_id` that is unknown, or belongs to another account, returns `404` with `IDTO_207`. Production does not return `202` on these routes today.
* **A slow bank can time out on staging only.** Retry with the same `Idempotency-Key` before treating it as a failure.

## Check connectivity

`GET /health` on either base URL returns `{"status":"ok"}` with HTTP 200 and needs no keys. Use it to confirm that your servers can reach idto, for example from a new network or after a firewall change, before you debug a verification call.

```bash theme={null}
curl -s "$IDTO_BASE_URL/health"
```

## Testing on staging

Because staging reaches live sources, plan your tests so that most of them never need one.

* **Input errors are free.** A malformed PAN, Aadhaar number, IFSC or GSTIN, or missing consent, is rejected with `IDTO_001` or `IDTO_005` and is never billed, so you can test every validation path as often as you like. A number with the right shape that no one holds may instead reach the source and come back as a billed `IDTO_202`.
* **Found and no-record results cost a credit each.** Test them with a small set of identities you are authorised to verify, and reuse the same ones.
* **Retries can be tested without extra charges.** Send a request with an `Idempotency-Key`, then send it again with the same key and body: the second call returns the stored response and is not billed. See [Idempotency](https://idto.mintlify.site/concepts/idempotency.md).
* **Billing is visible in every v2 response.** Assert on the `billed` field in your tests rather than on your balance.

Each endpoint page has a Test scenarios table listing the inputs that produce each outcome.

## Promote to production

1. Complete **Switch to Production** in the dashboard and recharge your production balance.
2. Create a production key pair under **API Credentials**. The secret is shown once, when you create it, so copy it straight into your secret manager.
3. If you use webhooks, set the webhook URL and generate a secret in the production dashboard. Webhook settings from staging do not carry over.
4. Change the base URL and key pair in your production configuration. No code change is needed.
5. Call `GET /health`, then run one real verification and confirm the response carries `billed: true` and a `tranx_id`.

## Rotate keys

You can hold more than one key pair in an environment. To rotate without downtime, create a new pair, deploy it, confirm traffic is flowing on it, then disable or delete the old pair in **API Credentials**. A disabled pair is rejected with HTTP 403 and `Client is inactive`, so you can disable first and delete once you are sure nothing still uses it.

Your webhook URL and secret are held on one of your active key pairs. After you disable or delete a pair, open the webhook settings and confirm the URL and secret are still set. If they are empty, set them again, or deliveries stop.

## Next steps

> [card] [Quickstart](https://idto.mintlify.site/quickstart.md)
>
> Make a first call against staging.

> [card] [Go-live checklist](https://idto.mintlify.site/go-live-checklist.md)
>
> Everything to confirm before you switch the base URL.

Was this page helpful? Email us at [tech@idto.ai](mailto:tech@idto.ai?subject=Docs%20feedback%3A%20Environments) with the page link.


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