Authentication
LIVEQuick Summary
All API requests require authentication using a Bearer token. You can get your API key from your Pairgate dashboard. Include it in every request header to access your wallet, make purchases, and manage transactions.
How Authentication Works
Get Your API Key
Log in to your Pairgate dashboard and navigate to Settings > API Keys to generate your key.
Add to Headers
Include Authorization: Bearer YOUR_API_KEY in every request header.
Access Granted
Once authenticated, you can call any API endpoint available to your account type.
Authorization Header
Add the following header to every API request. This is the only required authentication method.
| Header | Value | Required |
|---|---|---|
Authorization |
Bearer YOUR_API_KEY
|
Yes |
Content-Type |
application/json
|
Recommended |
Example Request
Here's how to include authentication in a balance check request. Notice the Authorization header
contains the word Bearer followed by your API key.
curl -X GET "https://pairgate.com/api/v1/wallet/balance" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache"
Security Best Practices
Keep Your Key Secret
Never expose your API key in client-side code, public repositories, or share it with others.
Use Server-Side Requests
Always make API calls from your backend server. Use environment variables to store your key.
Rotate Keys Regularly
Generate new API keys periodically from your dashboard to maintain security.
Always Use HTTPS
All API requests should be made over HTTPS to encrypt your data in transit.
Authentication Errors
If authentication fails, you will receive one of these error responses.
| Status | Code | Description |
|---|---|---|
| 401 | Missing API key |
No Authorization header provided |
| 401 | Invalid API key |
The provided API key is wrong or expired |
| 403 | Insufficient permissions |
Your key doesn't have access to this endpoint |
Pro Tip
Use test mode to try endpoints without spending real money. Simply add /test
before any purchase endpoint (e.g., /test/airtime/purchase). No balance is deducted and no real
transaction occurs. Your API key works the same way in test mode.