API Authentication Guide

Learn how to authenticate with the ChangeCrab API using API keys and manage your credentials.

All Articles

API Authentication Guide

Learn how to authenticate with the ChangeCrab API using API keys. Secure your API access and manage your credentials effectively.

Prerequisites

To use API authentication, you need:

Authentication Method

ChangeCrab uses API key authentication. Include your API key in the request header:

X-API-Key: your-api-key-here

Getting Your API Key

To get an API key:

  1. Log in to ChangeCrab
  2. Go to API Keys section
  3. Click "Create New API Key"
  4. Copy the key (you'll only see it once!)
  5. Store it securely

Learn more about managing API keys.

Using API Keys

cURL Example

curl -X GET https://changecrab.com/api/changelogs \
  -H "X-API-Key: your-api-key-here"

JavaScript Example

fetch('https://changecrab.com/api/changelogs', {
  method: 'GET',
  headers: {
    'X-API-Key': 'your-api-key-here'
  }
})

Python Example

import requests

headers = {
    'X-API-Key': 'your-api-key-here'
}

response = requests.get(
    'https://changecrab.com/api/changelogs',
    headers=headers
)

Security Best Practices

  • Keep Keys Secret - Never commit keys to version control
  • Use Environment Variables - Store keys securely
  • Rotate Regularly - Regenerate keys periodically
  • Revoke Unused Keys - Delete keys you're not using
  • Use HTTPS - Always use HTTPS for API requests

Error Responses

If authentication fails, you'll receive:

{
    "success": false,
    "error": "Invalid API key"
}

HTTP Status: 401 Unauthorized

Next Steps