Authentication
Overview
The Corgea API uses API key authentication to secure access to all endpoints. Authentication is done via a custom header that must be included with every API request.Authentication Method
API Key Header
All API requests require authentication using theCORGEA-TOKEN header:
- Header Name:
CORGEA-TOKEN - Type: API Key
- Location: Request Header
- Required: Yes (for all endpoints)
Getting Your API Token
You can obtain your API token from the Corgea web application:- Log in to your Corgea account at https://www.corgea.app
- Navigate to Settings → API Keys
- Generate a new API key or copy an existing one
- Store it securely - treat it like a password
Never share your API token or commit it to version control. Use environment variables or secure secret management systems to store your tokens.
Making Authenticated Requests
Include your API token in theCORGEA-TOKEN header with every request:
Verify Token
Endpoint
Verify the validity of your API token and optionally retrieve user information.- URL:
https://www.corgea.app/api/v1/verify - Method:
GET - Authentication: Required (CORGEA-TOKEN header)
Query Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| user_info | boolean | No | false | Whether to include user information in response |
Request Examples
Response Examples
Response Codes
| Status Code | Description |
|---|---|
| 200 | Token is valid |
| 401 | Invalid or missing authentication token |
Common Authentication Errors
Missing Token
If you don’t include theCORGEA-TOKEN header, you’ll receive a 401 Unauthorized response:
Invalid Token
If your token is invalid or expired, you’ll receive a401 Unauthorized response:
Best Practices
Secure Storage
Store API tokens in environment variables or secure secret management systems, never in code.
Token Rotation
Regularly rotate your API tokens to maintain security.
Least Privilege
Create separate tokens for different applications or environments.
Monitor Usage
Regularly review API token usage and revoke unused tokens.
Testing Your Token
Use the verify endpoint to test your token before making other API calls:- ✅ Your token is valid
- ✅ Your token is properly formatted in the header
- ✅ You can proceed with other API requests
