Uprails
Getting Started/Authentication

Authentication

Secure your API requests using API keys.

API Keys

Uprails uses API keys to authenticate requests. You can manage your API keys in the Dashboard under Developer Settings.

Your API keys carry many privileges, so be sure to keep them secure. Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, etc.

API Key Types

TypePrefixUsage
Sandbox Keysnd_For development and testing. No real charges.
Production Keyprd_For production. Processes real transactions.

Using Your API Key

Include your API key in the api-key header of every request:

Request with API Keybash
curl https://api.uprails.com/payments \
  -H "api-key: snd_YOUR_API_KEY" \
  -H "Content-Type: application/json"

Required Headers

HeaderRequiredDescription
api-keyYesYour API key for authentication
Content-TypeYesMust be application/json
X-Idempotency-KeyOptionalUnique key for idempotent requests

Authentication Errors

If authentication fails, you will receive a 401 Unauthorized response:

Authentication Error Responsejson
{
  "error": {
    "type": "authentication_error",
    "code": "AU_01",
    "message": "Invalid API key provided"
  }
}
Common Causes
  • Missing or invalid API key
  • Using a test key in production (or vice versa)
  • API key has been revoked
  • API key has expired

Best Practices

Store keys securely

Use environment variables or a secrets manager. Never commit API keys to version control.

Use different keys for environments

Use test keys during development and live keys only in production.

Rotate keys regularly

Create new API keys and revoke old ones periodically for security.

Server-side only

Always make API calls from your server. Never expose keys in client-side code.