Authentication

LIVE

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