Overview
The Composer API uses API key authentication. Every request must include your API key in the X-API-KEY header.
import requests
response = requests.get(
"https://composer.api.aampe.com/api/formulas",
headers={"X-API-KEY": "YOUR_API_KEY"},
)
Getting Your API Key
- In the Aampe dashboard, navigate to System setup → Integrations → API Keys
- Click + Create new
- Copy the generated key immediately — it will not be shown again
Store your API key somewhere safe as soon as you create it. The dashboard will not show the full key again after you leave the page.
Using the Key
Pass the key in the X-API-KEY request header on every call:
headers = {
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json", # required for POST/PUT requests with a body
}
Requests without a valid key, or with a key that has been revoked, receive a 401 Unauthorized response.
Best Practices
- Store keys in environment variables or a secrets manager — never hard-code them in source files
- Use a separate key for each environment (production, staging, local development)
- Rotate keys immediately if you suspect compromise
- Contact support@aampe.com to revoke or regenerate a key