Skip to content

Authentication

How to authenticate with the UnCash API

API Token Authentication

The UnCash API uses API token authentication. All requests must include your API token in the Authorization header.

Header Format

http
Authorization: Bearer uc_your_api_token_here

Token Format

API tokens are prefixed with uc_ followed by a 40-character string:

uc_1234567890abcdef1234567890abcdef12345678

Security Notice

Keep your API tokens secure and never expose them in client-side code or public repositories.

Getting Your API Token

You can generate and manage your API tokens from your dashboard:

  1. Go to https://uncash.io/dashboard/developer
  2. Click "Create New Token"
  3. Give your token a descriptive name
  4. Copy the token immediately (it won't be shown again)

Making Authenticated Requests

bash
curl -X GET https://api.uncash.io/api/v1/health \
  -H "Authorization: Bearer uc_your_api_token_here"
javascript
const response = await fetch('https://api.uncash.io/api/v1/health', {
  headers: {
    'Authorization': 'Bearer uc_your_api_token_here'
  }
});
python
import requests

headers = {
    'Authorization': 'Bearer uc_your_api_token_here'
}

response = requests.get('https://api.uncash.io/api/v1/health', headers=headers)

Error Responses

If authentication fails, you'll receive a 401 error:

json
{
  "success": false,
  "message": "Unauthorized",
  "error": "Invalid or missing API token"
}

UnCash API Documentation