Meterd

Authentication

Meterd supports three authentication methods. Choose the one that fits your use case.

Bearer Token (API Key)

The simplest method. Include your API key in the Authorization header:

bash
curl -H "Authorization: Bearer mtd_adm_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345" \
  https://api.meterd.io/v1/meters

Key format

API keys follow the pattern mtd_<scope>_<32 random chars>:

PrefixScopePermissions
mtd_adm_AdminAll operations
mtd_rw_Read/WriteRead and write events, meters, customers, usage, quotas
mtd_ro_Read OnlyRead usage, meters, customers
mtd_ink_Ingest OnlyIngest events only

Key lifecycle

OperationEndpointNotes
CreatePOST /v1/api-keysFull key shown once — store securely
ListGET /v1/api-keysReturns metadata only (prefix, scope)
RevokePOST /v1/api-keys/:id/revokeImmediate invalidation
RotatePOST /v1/api-keys/:id/rotateRevokes old, returns new

HMAC-SHA256 Signature

For service-to-service communication with request integrity verification.

HeaderDescription
AuthorizationHMAC v1:<base64_signature>
X-TimestampUnix timestamp (within 300s of server time)
X-Request-IdUnique request identifier
X-Tenant-IdYour tenant ID

The signature is computed over <timestamp>:<request_id>:<body> using HMAC-SHA256 with your shared secret.

The server rejects requests where the X-Timestamp is more than 5 minutes from the server clock. Keep your systems' clocks synced via NTP.

Roles & Permissions

RoleDescription
OwnerFull access including tenant management. One per tenant.
AdminEverything except tenant settings
DeveloperIngest events, manage meters/customers/webhooks/alerts
BillingRead access + manage billing
ViewerRead-only access to usage, meters, and customers

Error responses

Authentication failures return RFC 7807 Problem Details:

json
{
  "type": "https://meterd.io/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or expired API key"
}
StatusMeaning
401Missing or invalid credentials
403Valid credentials but insufficient permissions