Api-Key header.
Create your first API key
You can create API keys in the developer dashboard. Once youβve created a key, you can view its value or revoke it if needed. These manually created keys, known as primary keys, never expire unless manually revoked.API key roles
When creating an API key via the API or dashboard, you can select a role to control access:If a role is not provided, it defaults to
admin.Custom permissions
Thecustom role requires a permissions array. Each permission uses the resource:action format.
Available resources:
applications- User and company applicationsautomations- Payment routesbalances- Balance informationcardsAndShipping- Card creation and shippingcompanies- Company managementusers- User managementcontractsAndSignatures- Smart contracts and signaturespayments- Payment operationspaymentAccounts- Payment accountsquotes- Transfer quotestransfers- Transferskeys- API key managementraindrops- Raindrops balance, activity, and redemptionsraindrops-travel- Raindrops travel redemptionsreports- Report accessstatements- Monthly statement downloadssubtenants- Subtenant managementtransactionsAndDisputes- Transactions and disputeswebhooks- Webhook configuration
read- View resourceswrite- Create and update resourcesdelete- Delete resources
Create API keys programmatically
For managing API keys at scale, you can create API keys programmatically. These secondary keys must have:- A name for identification.
- An expiry date in the future.
IP address restrictions
You can restrict API key usage to specific IP addresses by providing anipAddresses array when creating a key. This is optional. If you donβt specify any IP addresses, the key works from any location. You can specify up to 100 IP addresses per key.
When IP address restrictions are configured:
- Requests from allowed IP addresses succeed normally
- Requests from non-allowed IP addresses receive a
401 Unauthorizederror with the message βAddress invalid for API keyβ
- IPv4 addresses (for example,
192.168.1.1) - IPv6 addresses (for example,
2001:db8::1) - CIDR ranges (for example,
10.0.0.0/24or2001:db8::/32)
Making authenticated API requests
To authenticate API requests, include your API key in theApi-Key header:
Client-side considerations
Never expose API keys in client-side code, such as JavaScript or mobile apps. Always use HTTPS when making API calls to prevent keys from being intercepted.See also
- Rain API overview: rate limits, response headers, and the full list of endpoint groups.
- Create an API key: provision and rotate keys programmatically.
- Idempotency for APIs: safely retry requests without duplicating operations.