Uprails
API Keys/Create

Create API Key

Create a new API key for authentication.

POSThttps://api.uprails.com/api-keys

Creates a new API key with the specified permissions. The actual key value is only returned in this response and cannot be retrieved later.

Save Your Key
The API key value is only shown once. Make sure to copy and securely store it before leaving this page.

Request Example

curl -X POST https://api.uprails.com/api-keys \
  -H "Content-Type: application/json" \
  -H "api-key: snd_YOUR_API_KEY" \
  -d '{
    "name": "Production API Key",
    "type": "secret",
    "permissions": ["payments:write", "refunds:write"]
  }'

Request Body

namestringrequired

A descriptive name for the API key

typestringrequired

The type of API key

Enum:secretpublishable
permissionsarray

List of permissions for this key (defaults to all)

expires_atstring

Expiration date for the key (ISO 8601). Null for no expiration.

Response

200OK
{
  "key_id": "key_1234567890abcdef",
  "api_key": "snd_51abc...xyz",
  "merchant_id": "mer_xyz789",
  "name": "Production API Key",
  "prefix": "snd_",
  "type": "secret",
  "permissions": [
    "payments:write",
    "refunds:write"
  ],
  "created": "2024-01-15T10:00:00Z",
  "expires_at": null
}
api_key Field
The api_key field contains the full API key value. This is the only time you will see this value.