API Key Types
Metlo supports different types of API keys for different purposes:- GENERIC: General-purpose API access
- ONBOARDING: Used for initial setup and onboarding
- GCP: Integration with Google Cloud Platform
- AWS: Integration with Amazon Web Services
Obtaining an API Key
Create a New API Key
Request Body
Unique name for your API key
Type of API key:
GENERIC, ONBOARDING, GCP, or AWSResponse
The full API key. Save this securely - it won’t be shown again!
The name you assigned to the key
A public identifier in the format
metlo.<key_identifier>ISO 8601 timestamp of when the key was created
The type of API key
Response Example
Using Your API Key
Include your API key in theAuthorization header of every request:
Authentication Flow
When you make a request:- Metlo hashes the API key from your
Authorizationheader - Checks if the hashed key exists in the database (with 5-second Redis caching)
- If valid, processes your request
- If invalid, returns
401 Unauthorized
Managing API Keys
List All API Keys
Retrieve all API keys for your instance:cURL
Response
The list endpoint returns key metadata only. The actual API key values are never retrievable after creation.
Get Onboarding Keys
Retrieve keys specifically for onboarding purposes:cURL
Delete an API Key
Remove an API key by its name:cURL
Response
API Key Limits
Your Metlo instance has a maximum limit on the number of API keys you can create. If you reach this limit, you’ll receive an error:Security Best Practices
Store API keys securely
Store API keys securely
Never commit API keys to source code. Use environment variables or a secrets management system.
Rotate keys regularly
Rotate keys regularly
Create new API keys and delete old ones periodically to minimize risk if a key is compromised.
Use specific key types
Use specific key types
Create keys with specific purposes (e.g., separate keys for different integrations) to make rotation easier.
Delete unused keys
Delete unused keys
Regularly audit and remove API keys that are no longer needed.
Error Responses
401 Unauthorized
Returned when:- No API key is provided
- The API key is invalid
- The API key has been deleted
400 Bad Request
Returned when creating a key with:- Duplicate name
- Missing name
- Invalid key type