API keys
All DevHelm API requests require a Bearer token in theAuthorization header. API keys use the dh_live_ prefix and are scoped to your organization.
Creating an API key
- Open the DevHelm Dashboard
- Navigate to Settings → API Keys
- Click Create API Key and give it a descriptive name
- Copy the key immediately — it won’t be shown again
Required headers
Every REST API request needs two headers:| Header | Description | Example |
|---|---|---|
Authorization | Bearer token with your API key | Bearer dh_live_abc123... |
x-phelm-org-id | Your organization ID | 1 |
The CLI and SDKs handle the organization header automatically when you configure them. You only need to pass it when calling the REST API directly.
Per-surface setup
CLI
The CLI resolves your API token from (in order of priority):--api-tokenflagDEVHELM_API_TOKENenvironment variable- Saved context in
~/.devhelm/contexts.json(set viadevhelm auth login)
TypeScript SDK
Python SDK
Terraform Provider
GitHub Action
MCP Server
Security best practices
Use environment variables, never hardcode tokens
Use environment variables, never hardcode tokens
Store API keys in your CI/CD secrets manager or
.env files that are gitignored. Never commit tokens to version control.Rotate keys periodically
Rotate keys periodically
Create a new API key, update your environment, then revoke the old one. This can be done with zero downtime.
Use separate keys for CI and local development
Use separate keys for CI and local development
Create dedicated API keys for each environment. This makes it easier to audit usage and revoke keys if compromised.
Use separate keys per environment
Use separate keys per environment
Create dedicated API keys for production and staging. This makes it easier to audit usage and revoke keys if one is compromised.
Error responses
| Status | Meaning | Common cause |
|---|---|---|
401 Unauthorized | Missing, invalid, or revoked API key | Check that your token starts with dh_live_ and hasn’t been revoked |
403 Forbidden | Valid key but insufficient permissions | The key doesn’t have access to the requested organization |
Next steps
API keys management
Create, rotate, and scope API keys.
Quickstart
Create your first monitor in under 5 minutes.