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 keys) and choose:
- Name: a label to tell the key apart in the list, for example the integration that uses it.
- Access: Read and write, or Read only for an integration that only exports data.
- Expires in: 30, 90, 180 or 365 days (90 unless you choose another).
4
Copy your organization ID
In Company settings → Organization info, click Copy organization ID. Every request sends it in
x-organization-id.Expiry, read-only keys and last use
- Every key expires, 90 days after it is created unless a shorter or longer life (a year at most) is chosen when
creating it. After that it answers
401withAPI_KEY_EXPIRED. The Expires column of Company settings → API Keys shows when each key stops working, and Dcycle emails the person who created the key 14 and 3 days before, and once it has expired. Before that date, create a new key, replace it in your integration, then revoke the old one. - A key can be read-only. Without the
writeaccess it can call everyGETand the queries sent asPOST(downloads, reports, total impacts), and any other write answers403withAPI_KEY_SCOPE_DENIED. Give a read-only key to integrations that only export data. - The list of keys shows when each one was last used (to within five minutes), so a key nobody uses any more is easy to spot and revoke.
dck_. Keys created before 22 October 2026 keep their format, work the same way and expire on
20 January 2027.
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
- The creator leaves the organization, or their user is disabled: the key stops working there and answers
403withLOGGED_USER_NOT_MEMBER. Create a new key from a member who stays. - The creator becomes a Viewer: the key still reads, and its writes answer
403withVIEWER_CANNOT_WRITE.
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. Every request acts as the person who created the API key. To act as another member,
use an API key that member created.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 before they expire
Rotate your API keys before they expire
- Keys expire (90 days by default): check the Expires column of Company settings → API Keys, or act on the email the key’s creator receives 14 and 3 days before, and create the new key before that date, not after
- Revoke old API keys as soon as your integrations use the new ones
Test on your own organization
Test on your own organization
A key has the access of the person who created it, or only their read access for a read-only key. Create the key
of an integration from a member of only the organizations it should reach, and revoke the
key used while developing it once the integration runs. Test the integration on the organization it will send its
data to: validate your batches with
?dry_run=true, which writes nothing, then send a small real batch and delete
its records afterwards. See Testing an integration.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 its name, the first characters of the key, its access, when it expires, when it was last used, and who created it. 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:- No credentials (
AUTHENTICATION_REQUIRED): send the key inx-api-key - Invalid or revoked API key, or an
x-organization-idthat is not a UUID (INVALID_API_KEY) - Expired API key (
API_KEY_EXPIRED): create a new one - A key of another organization (
API_KEY_ORG_MISMATCH):x-organization-idmust be the key’s organization or one of its subsidiaries - A key without an owner (
API_KEY_NO_OWNER): create a new one - 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-id, left it, or their user was disabled: use a key created by a member who staysORG_ADMIN_REQUIRED: the action needs an organization admin, for example managing webhook endpointsAPI_KEY_SCOPE_DENIED: a read-only key sent a writeVIEWER_CANNOT_WRITE: the key sent a write, and the person who created it is a Viewer in the organization inx-organization-id
Error 400: Bad Request
ORGANIZATION_ID_REQUIRED: thex-organization-idheader is missing or empty
Next Steps
API Quickstart
Make your first API call
CLI Overview
Get started with the CLI
MCP Setup
Configure AI assistant integration