API Keys
Manage API keys for programmatic access to Meterd.
List keys
GET/v1/api-keys
Returns metadata for all API keys. Never returns the full key.
json
[
{
"id": "01HQXYZ...",
"name": "Production Ingest",
"prefix": "mtd_ink_a",
"scope": "ingest_only",
"created_at": "2024-01-15T10:00:00Z",
"last_used_at": "2024-01-20T15:30:00Z",
"revoked": false
}
]Create a key
POST/v1/api-keys
json
{ "name": "Production Ingest", "scope": "ingest_only" }| Scope | Description |
|---|---|
admin | Full access |
read_only | Read usage, meters, customers |
ingest_only | Ingest events only |
read_write | Read and write events, meters, customers, usage, quotas |
Response
The response includes the full api_key — this is the only time it's shown. Store it securely.
json
{
"id": "01JBX...",
"key": "mtd_adm_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
"prefix": "mtd_abc123",
"name": "Production Ingest",
"scope": "ingest_only",
"created_at": "2026-03-19T14:00:00Z"
}Revoke a key
POST/v1/api-keys/:id/revoke
Immediately invalidates the key. In-flight requests using this key will fail.
Rotate a key
POST/v1/api-keys/:id/rotate
Revokes the existing key and generates a new one. Returns the new key in the response.
json
{
"old_key_id": "01JBX...",
"new_key": {
"id": "01JBY...",
"key": "mtd_adm_newKey...",
"prefix": "mtd_def456",
"name": "Production Ingest",
"scope": "ingest_only",
"created_at": "2026-03-19T16:00:00Z"
}
}