Skip to main content
Every request to the Strails API must include a valid API key. You pass your key in the x-api-key request header. All requests must be made over HTTPS to either the test or production base URL. Contact the Strails team to obtain your key before you begin.

Base URLs

Use the test environment while building and validating your integration. Switch to the production URL only when you are ready to go live. Test environment
Production environment

API Key Authentication

Include your API key in every request as the x-api-key header alongside a Content-Type header:
Here is a minimal curl example that lists your transactions:

Obtaining Your API Key

To get access to the Strails API, email support@strails.co to begin your onboarding. The team will reply with your x-api-key and step-by-step setup instructions. Once you receive your key, store it immediately as a server-side environment variable - never hard-code it in your application source or commit it to version control.

Rate Limits

Every endpoint enforces a per-window request limit to ensure platform stability and fair use. The tables below list the configured limit and its equivalent in requests per minute (rpm) for each endpoint. Endpoints with no explicit limit inherit the service default of 30 rpm.
If your backend hits rate limits frequently, move high-volume operations behind an async queue so requests are processed in an eventually consistent way. If your use case genuinely requires higher limits, contact the Strails team with your application details and traffic patterns.
When you exceed a limit, the API returns 429 Too Many Requests:
Respect the retry_after value (in seconds) before re-attempting the request.

User Management & Authentication

Virtual Accounts & Wallet

Wallet Management

Transactions & Asset Management

FX Orderbook & Trading

Error Handling

All errors follow a standard response shape:
response_code is always one of the two-digit envelope codes (00-05) documented in Payload Formats - it is never the HTTP status code. Branch your error handling on response_code plus the HTTP status, and treat the status string as display text only: its casing varies between endpoint families (Success/success, Error/error/Failed).
The table below lists the global error codes that apply across all endpoints:
For a full list of status codes, state transitions, and domain-specific errors (e.g. orderbook or trading errors), see the API Status & Error Reference.

Security Best Practices

  1. Store your API key securely. Never commit it to version control or embed it in client-side code.
  2. Use environment variables. Load your key from process.env.STRAILS_API_KEY (Node.js) or equivalent - not from a hard-coded string.
  3. Rotate your key regularly. Use the /regenerateapikey endpoint to issue a new key and revoke the old one on a regular schedule.
  4. Always use HTTPS. The Strails API does not accept plain HTTP connections. Every request must go over a secure TLS connection.

Registering Your Public Key

Strails supports optional payload encryption for production integrations that handle PII, wallet addresses, or financial data. To opt in, generate an X25519 keypair and register your 64-character hex public key with Strails using the /storepublickey endpoint. Once registered, Strails will use your public key to encrypt all response payloads and webhook bodies - only your server can decrypt them.
/storepublickey accepts { "data": "<64-hex-character X25519 public key>" } or the AES-encrypted legacy envelope whose decrypted data is the same 64-hex key. A 200 OK response confirms your key has been stored. See the Encryption guide for full details on key generation, request encryption, and response decryption.

Platform public key

Retrieve the Strails X25519 public key via GET /getplatformpublickey. Use it to seal requests to Strails with libsodium crypto_box_seal.

AES key (legacy)

Call GET /getaeskey to retrieve your raw, unmasked AES key. You can use it to decrypt legacy AES-GCM payloads and to verify webhook signatures when no dedicated webhook secret is configured.