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

# Introduction

> Build server side automations for your own Stabyl account.

The Stabyl API lets your team automate the same money movement and trading workflows you already perform inside Stabyl. Use it for backend jobs, internal tools, reconciliation systems, and trading automation that operate on your own Stabyl account.

<Info>
  Create your staging API keys in the
  [Stabyl staging app](https://app-staging.stabyl.com). Staging keys work only
  with `https://api-staging.stabyl.com/v1`. Staging access does not grant
  production access.
</Info>

Production API access requires completed KYB and an explicit invitation from
Stabyl. The invitation provides the production onboarding instructions. Do not
send requests to the production API until your organization has received that
invitation and provisioned production credentials.

## What You Can Automate

| Area             | What the API gives you                                                                                     |
| ---------------- | ---------------------------------------------------------------------------------------------------------- |
| Wallet discovery | Supported wallet currencies, stablecoin rails, and blockchain routes                                       |
| Deposits         | Fiat deposit account details and one crypto deposit address per requested chain                            |
| Balances         | NGN and USD wallet balances, including available and locked amounts                                        |
| Recipients       | Saved fiat and crypto recipient records used by Stabyl Pro workflows                                       |
| Withdrawals      | Signed NGN or stablecoin withdrawal quotes and direct submission                                           |
| Transactions     | Cursor-paginated wallet activity for deposits, fees, adjustments, refunds, and withdrawals                 |
| Market data      | Markets, tickers, order books, candles, trades, and fills                                                  |
| Orders           | Create, list, read, cancel, and replace exchange orders                                                    |
| Sandbox          | Non-production simulation endpoints for testing deposits, withdrawal records, KYB state, and notifications |

Partner withdrawals are authorized by an API key with the `wallets:withdraw`
scope and an Ed25519 request signature. They do not require an emailed
verification code or a separate withdrawal token after submission.

## Base URLs

| Environment | URL                                 |
| ----------- | ----------------------------------- |
| Production  | `https://api.stabyl.com/v1`         |
| Staging     | `https://api-staging.stabyl.com/v1` |

The production URL is available only to organizations that have completed KYB
and been invited by Stabyl.

## API Conventions

All requests use HTTPS. JSON writes require `Content-Type: application/json`. Authenticated routes require `X-Api-Key`.

Successful JSON responses use a response envelope:

```json theme={null}
{
  "status": "success",
  "data": {}
}
```

Errors use the same envelope shape:

```json theme={null}
{
  "status": "error",
  "error": {
    "code": "UNAUTHORIZED",
    "message": "missing X-Api-Key header"
  }
}
```

Timestamps are RFC3339 strings in UTC. Monetary amounts are strings to avoid floating point rounding issues. Stablecoins (`USDT`, `USDC`) are settlement rails for the USD wallet, not separate wallet currencies.

## Design Principles

1. Keep API keys server-side and grant each key only the access it needs.
2. Discover wallet routes from the API instead of hardcoding chain availability.
3. Treat order writes as asynchronous; read the order after submission for canonical status.
4. Use `Idempotency-Key` on create, cancel, and replace order requests.
5. Reuse a withdrawal body idempotency key only for retries of the same request.
6. Reconcile from transaction and order reads, not from manual exports or UI state.
7. Remove simulation calls from production code paths.
