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
- Navigate to portal.cloudpirates.io/security
- Click "Create API Key"
- Enter descriptive label
- Save key immediately (shown only once)
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
http
Authorization: ApiKey <YOUR_API_KEY>Examples
curl:
bash
curl -H "Authorization: ApiKey YOUR_KEY" \
https://api.cloudpirates.io/v1/auth/meJavaScript:
javascript
fetch("https://api.cloudpirates.io/v1/auth/me", {
headers: { Authorization: "ApiKey YOUR_KEY" },
});Python:
python
requests.get(
'https://api.cloudpirates.io/v1/auth/me',
headers={'Authorization': 'ApiKey YOUR_KEY'}
)Managing Keys
API Keys are managed at portal.cloudpirates.io/security.
View Keys
There you can see all your API Keys, for each:
- Label
- Key ID
- Creation date
Delete Keys
- Find the correct API Key in list
- Click "Delete"
- Confirm
Keys are immediately invalidated.
Rotate Keys
- Create a new key
- Update your applications with the new key
- Test that the new key works
- Delete the old key
Limitations
API keys can't be used for:
/v1/auth/change-password/v1/auth/challenges/*(MFA)/v1/auth/webauthn/register/v1/auth/api-keys(key management)
Bearer Token Required for Security-Sensitive Operations
Security-sensitive operations require interactive authentication using a Bearer token instead of an API key.
API Reference
For key listing, creation, and deletion requests, see the API Key reference.