Authentication & rate limiting
API key authentication
Business API routes under/v1/biz are protected with an API‑key–based middleware (APIKeyAuth) that verifies requests using a hashed key and encrypted digest stored in the developer_app_details (or equivalent) table.
Send your key using the X-D3-API-Key header:
- Looks up the stored record by API key prefix or mapping.
- Decrypts the stored digest using AES.
- Recomputes the hash using
(digest + provided_api_key). - Compares it with the stored hash and verifies
ExpireAt/IsActive.
Rate limiting
The Business API uses a token‑bucket rate limiter backed by Redis:- Each API key has an associated rate limit (e.g.
1000/m). - Tokens are periodically refilled in Redis.
- Each request consumes one or more tokens.
- If there are not enough tokens, the request is rejected with a 429 status.