API Keys
For REST API and programmatic integrations
CLI Login
For command-line tool access
MCP Setup
For AI assistant integrations
API Key Authentication
API keys are the primary method for authenticating with the Dcycle REST API.When to Use API Keys
- Server-to-server integrations
- Automated scripts and CI/CD pipelines
- Backend applications
- Any programmatic access
Get an API Key
1
Log in to Dcycle
Go to app.dcycle.io
2
Open Company settings → API Keys
Click your name at the bottom of the sidebar, then Company settings, then API Keys. Only an admin of the
organization can create keys. If API Keys is not there, the API is not enabled for your organization yet: ask
your Dcycle contact.
3
Generate a new key
Click Generate new key (or Create one to get started if the organization has no key yet).
4
Copy your organization ID
In Company settings → Organization info, click Copy organization ID. Every request sends it in
x-organization-id.User Attribution & Accountability
This means:- ✅ All records created via your API key are linked to your user account
- ✅ Audit logs will show you as the creator of the data
- ✅ This ensures proper data governance and traceability
- ✅ You are responsible for the data uploaded using your API keys
Using your API Key
Send your API key in thex-api-key header and your organization ID in x-organization-id, on /v1 and /v2
alike. On api.dcycle.io, Authorization: Bearer is only for JWT tokens: an API key sent
there is rejected, except on the legacy /api/v1/... routes. (The MCP server is a separate
service and takes the key as a Bearer token.)
This call lists the ingest jobs of your organization and its group, so it is a safe
way to check your credentials:
- x-api-key (v1 and v2, recommended)
- Legacy /api/v1 routes (not for new integrations)
Idempotency-Key header. The Quickstart walks through a
complete write: create a facility, send it a waste and follow its ingest job.Required Headers
- x-api-key (v1 and v2, recommended)
- Legacy /api/v1 routes (not for new integrations)
Simpler authentication - Only 2 required headers:
Don’t send
x-user-id. Without it, every request acts as the person who created the API key. With it, the
request can act as another member of the organization.CLI Authentication
Early Access - The Dcycle CLI is currently available for enterprise customers.
Contact us to learn more about access.
dcy command) supports two authentication methods: interactive login and environment variables.
Interactive Login
The simplest way to authenticate:--no-browser to authenticate directly in the terminal instead:
Environment Variables
For automated scripts and CI/CD pipelines, use environment variables:Configuration File
The CLI stores configuration in~/.config/dcycle/v2/config.yaml:
MCP Authentication
Coming Soon - The Dcycle MCP Server is in private beta.
Contact us for early access.
https://mcp.dcycle.io/mcp. AI assistants like Claude sign in
with your Dcycle account (OAuth, in the browser), or send an API key as Authorization: Bearer dcy_<your_api_key> (the
dcy_ prefix is required).
Claude Code
JWT Tokens (Dcycle Apps)
JWT tokens are what Dcycle’s own apps and the CLI use: a token comes from a person signing in to Dcycle, and the requests made with it act as that person. Integrations use API keys instead. A JWT goes in theAuthorization header, with the organization in x-organization-id:
401 and the app signs in again.
Security Best Practices
Never expose your API key
Never expose your API key
- ❌ DON’T save API keys in source code
- ❌ DON’T commit them to Git/GitHub
- ❌ DON’T share them via email or Slack
- ❌ DON’T put them in code that runs in a browser or a mobile app, in URLs or in logs
- ✅ DO use environment variables
- ✅ DO use secret managers (AWS Secrets Manager, etc.)
Always use HTTPS
Always use HTTPS
All API requests must use HTTPS. HTTP requests will be rejected.
Rotate your API keys regularly
Rotate your API keys regularly
- Generate new API keys every 3-6 months
- Revoke old API keys as soon as your integrations use the new ones
Keep test and production apart
Keep test and production apart
Every key of an organization has the full access of the person who created it: there are no read-only or limited
keys. To test an integration, use a key of a test organization, never one of your production organization:For CI/CD, store secrets in your pipeline’s secret management (GitHub Secrets, GitLab CI Variables, etc.).
API Key Management
List your API Keys
The active API keys of your organization are listed in Company settings → API Keys. A key is never shown again after it is created: the list shows a short reference for each one (the end of its id, not of the key), when it was created and by whom. If you don’t know which key leaked, revoke them all and create a new one.Revoke an API Key
If an API key has been compromised or you no longer need it:- Go to Company settings → API Keys
- Find the API key in the list
- Click its trash icon and confirm
Troubleshooting
Error 401: Unauthorized
Possible causes:- Invalid or revoked API key (
INVALID_API_KEY) - A key of another organization (
API_KEY_ORG_MISMATCH):x-organization-idmust be the key’s organization or one of its subsidiaries - API key sent in
Authorization: Bearerinstead ofx-api-key, or anAuthorizationheader without a valid token sent along withx-api-key: it is checked first, so the request fails even with a valid key - Expired JWT token
401 caused by the API key names its cause in code (see Errors). A rejected
Authorization header answers {"detail": "..."} instead, for example INVALID_OR_EXPIRED_TOKEN (see
Errors that are not problem details).
Error 403: Forbidden
Possible causes:LOGGED_USER_NOT_MEMBER: the person who created the key is not a member of the organization inx-organization-idORG_ADMIN_REQUIRED: the action needs an organization admin, for example managing webhook endpoints
Error 400: Bad Request
ORGANIZATION_ID_REQUIRED: thex-organization-idheader is missing
Next Steps
API Quickstart
Make your first API call
CLI Overview
Get started with the CLI
MCP Setup
Configure AI assistant integration