Skip to main content
Dcycle supports multiple authentication methods depending on how you’re integrating:

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
Never put an API key in code that runs in a browser or a mobile app, in a URL or in your logs: whoever reads it can act as you.

Get an API Key

1

Log in to Dcycle

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).
The key acts as you: everything sent with it is recorded as yours, and it reaches what you reach. Create the key of an integration from an admin who will stay in the organization: when its creator leaves, the key stops working.
The API key is only shown once. Save it immediately: Dcycle stores only a hash of it, so nobody can show it to you again.
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 401 with API_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 write access it can call every GET and the queries sent as POST (downloads, reports, total impacts), and any other write answers 403 with API_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.
Keys start with dck_. Keys created before 22 October 2026 keep their format, work the same way and expire on 20 January 2027.

User Attribution & Accountability

Important: When you create an API key, you are authorizing it to perform actions on your behalf. All data uploaded using that key will be attributed to you (the API key creator) for audit and compliance purposes.
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
A key has the access of the person who created it, in the organization and in the subsidiaries where they are a member, and only their read access when it is read-only. It follows its creator:
  • The creator leaves the organization, or their user is disabled: the key stops working there and answers 403 with LOGGED_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 403 with VIEWER_CANNOT_WRITE.
Test an integration on your own organization, as Testing an integration explains.

Using your API Key

Send your API key in the x-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:

Required Headers


CLI Authentication

Early Access - The Dcycle CLI is currently available for enterprise customers. Contact us to learn more about access.
The CLI (dcy command) supports two authentication methods: interactive login and environment variables.

Interactive Login

The simplest way to authenticate:
This opens your browser to the Dcycle sign-in page. You complete the full authentication flow in the browser (email, password, MFA, SSO) and the CLI receives the session automatically. Use --no-browser to authenticate directly in the terminal instead:
Your session persists until you explicitly log out.

Environment Variables

For automated scripts and CI/CD pipelines, use environment variables:
Environment variables take precedence over interactive login. This is useful for running scripts with different credentials than your personal account.

Configuration File

The CLI stores configuration in ~/.config/dcycle/v2/config.yaml:
You can manage configuration via commands:
Learn more about CLI authentication →

MCP Authentication

Coming Soon - The Dcycle MCP Server is in private beta. Contact us for early access.
The MCP (Model Context Protocol) server is hosted at 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

For Claude Desktop, ChatGPT and other clients, see the MCP quickstart.
dcycle-mcp is not published by Dcycle on PyPI: do not install it with pip or run it with uvx, since whatever that name installs is not Dcycle’s.
Learn more about MCP setup →

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 the Authorization header, with the organization in x-organization-id:
A token expires: the API then answers 401 and the app signs in again.

Security Best Practices

  • ❌ 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.)
All API requests must use HTTPS. HTTP requests will be rejected.
  • 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
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:
  1. Go to Company settings → API Keys
  2. Find the API key in the list
  3. Click its trash icon and confirm
Once revoked, the API key stops working immediately. This action cannot be undone.
Webhook endpoints belong to the organization, not to a key: they keep receiving events after the key that registered them is revoked. Review them in Company settings → Webhooks or with List Webhook Endpoints.

Troubleshooting

Error 401: Unauthorized

Possible causes:
  • No credentials (AUTHENTICATION_REQUIRED): send the key in x-api-key
  • Invalid or revoked API key, or an x-organization-id that 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-id must 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: Bearer instead of x-api-key, or an Authorization header without a valid token sent along with x-api-key: it is checked first, so the request fails even with a valid key
  • Expired JWT token
Solution:
A 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 in x-organization-id, left it, or their user was disabled: use a key created by a member who stays
  • ORG_ADMIN_REQUIRED: the action needs an organization admin, for example managing webhook endpoints
  • API_KEY_SCOPE_DENIED: a read-only key sent a write
  • VIEWER_CANNOT_WRITE: the key sent a write, and the person who created it is a Viewer in the organization in x-organization-id

Error 400: Bad Request

  • ORGANIZATION_ID_REQUIRED: the x-organization-id header 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