API Key Management
Programmatic access to CloudPirates API for automated systems and applications.
Overview
API keys enable:
- Authentication without interactive login
- CI/CD pipeline integration
- Service accounts for applications
- Multiple keys for different environments
Creating API Keys
- Login to portal.cloudpirates.io
- Navigate to security page
- Click "Create API Key"
- Enter descriptive label
- Save key immediately (shown only once)
Danger: API Key Shown Only Once
The API key is shown only once during creation. You must store it securely. If the key is lost, you will need to create a new key.
Labeling
Use clear labels:
- Purpose: "Production Server", "CI/CD"
- Service: "GitHub Actions", "Jenkins"
- Environment: "Production", "Staging"
Using API Keys
Authorization Header
Authorization: ApiKey <YOUR_API_KEY>Examples
curl:
curl -H "Authorization: ApiKey YOUR_KEY" \
https://api.cloudpirates.io/v1/auth/meJavaScript:
fetch("https://api.cloudpirates.io/v1/auth/me", {
headers: { Authorization: "ApiKey YOUR_KEY" },
});Python:
requests.get(
'https://api.cloudpirates.io/v1/auth/me',
headers={'Authorization': 'ApiKey YOUR_KEY'}
)Managing Keys
View Keys
Access security page to see:
- Label
- Key ID
- Creation date
- Last used
Delete Keys
- Navigate to security page
- Find key to delete
- Click "Delete"
- Confirm
Keys are immediately invalidated.
Rotate Keys
- Create new key
- Update applications with new key
- Test new key
- Delete old key
Limitations
API keys cannot be used for:
/v1/auth/change-password/v1/auth/challenges/*(MFA)/v1/auth/webauthn/register/v1/auth/api-keys(key management)
Info: Bearer Token Required for Security-Sensitive Operations
Security-sensitive operations require interactive authentication using a Bearer token instead of an API key.
API Reference
List Keys
GET /v1/auth/api-keys
Authorization: Bearer <access-token>Create Key
POST /v1/auth/api-keys
Authorization: Bearer <access-token>
Content-Type: application/json
{
"label": "My Application"
}Delete Key
DELETE /v1/auth/api-keys/{apiKeyId}
Authorization: Bearer <access-token>Info: Full API Documentation Available
These are example requests. For complete API documentation including all parameters, response schemas, and authentication details, visit api.cloudpirates.io/docs.