Authentication
Learn how to authenticate your API requests with Caibo.
API Keys
Caibo uses API keys to authenticate requests. You can view and manage your API keys in the Caibo Dashboard. Your API keys carry many privileges, so be sure to keep them secure.
Warning: Never share your API keys in publicly accessible areas such as GitHub, client-side code, or anywhere else that can be publicly viewed.
Test vs Live Keys
Caibo provides two types of API keys:
| Key Type | Prefix | Purpose |
|---|---|---|
| Test | sk_test_ | Use for development and testing |
| Live | sk_live_ | Use for production transactions |
Making Authenticated Requests
Include your API key in the Authorization header:
curl
curl https://api.caibopay.com/v1/transfers \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json"Using the SDK
When using our SDKs, pass your API key during initialization:
JavaScript
import CaiboPay from '@caibopay/sdk';
const caibo = new CaiboPay({
apiKey: 'sk_test_your_api_key'
});Python
import caibopay
client = caibopay.Client(api_key='sk_test_your_api_key')Environment Variables
We recommend storing your API key in an environment variable:
.env
CAIBOPAY_API_KEY=sk_test_your_api_keyapp.js
const caibo = new CaiboPay({
apiKey: process.env.CAIBOPAY_API_KEY
});API Key Permissions
You can create restricted API keys with specific permissions:
- Read - View resources only
- Write - Create and update resources
- Full Access - All permissions