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 key yet).
The API key is only shown once. Save it immediately.
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

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 same access as the person who created it, in the organization and in the subsidiaries where they are a member: there are no read-only or limited keys, and keys have no name. To test an integration, use a key of a test organization rather than one of your production organization.

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.
  • Generate new API keys every 3-6 months
  • Revoke old API keys as soon as your integrations use the new ones
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:
  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:
  • Invalid or revoked API key (INVALID_API_KEY)
  • A key of another organization (API_KEY_ORG_MISMATCH): x-organization-id must be the key’s organization or one of its subsidiaries
  • 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
  • ORG_ADMIN_REQUIRED: the action needs an organization admin, for example managing webhook endpoints

Error 400: Bad Request

  • ORGANIZATION_ID_REQUIRED: the x-organization-id header is missing

Next Steps

API Quickstart

Make your first API call

CLI Overview

Get started with the CLI

MCP Setup

Configure AI assistant integration