Authentication overview

ClickUp provides an API that enables programmatic interaction with its platform, allowing developers to integrate ClickUp with other services, automate workflows, and build custom applications. Secure access to this API is managed through established authentication mechanisms designed to verify the identity of the client making a request and to control the scope of actions that client can perform.

The core principle behind ClickUp's authentication strategy is to ensure that only authorized entities can access or modify user data. This is achieved through the use of industry-standard protocols, which offer different levels of security and suitability depending on the integration type.

Understanding these methods is crucial for developers building integrations, whether they are creating a public application or a private script for internal use. Proper authentication setup is the first step in building a reliable and secure integration with the ClickUp platform.

Supported authentication methods

ClickUp supports two primary methods for authenticating requests to its API:

  1. OAuth 2.0: This is the recommended method for third-party applications and integrations where users grant permission for an application to access their ClickUp data without sharing their credentials directly with the application. OAuth 2.0 is an authorization framework that enables an application to obtain limited access to a user's protected resources on an HTTP service, such as ClickUp, by orchestrating an approval interaction between the resource owner, HTTP service, and the client (OAuth 2.0 RFC 6749 defines this interaction).
  2. Personal API Tokens: Also known as API keys, these are suitable for private integrations, scripts, or command-line tools where a single user's access to their own data is required. An API token is a string of characters that authenticates the user or application that presents it. These tokens grant direct access and should be treated with the same level of security as a password.

Comparison of authentication methods

Method When to Use Security Level Key Features
OAuth 2.0 Public third-party applications, integrations requiring user consent, applications managing multiple users' data. High Delegated authorization, refresh tokens, explicit user consent, scope-based permissions.
Personal API Tokens Private scripts, internal tools, single-user integrations, backend services. Moderate (depends on handling) Direct access, simple implementation, single token for all permissions of the generating user.

For most integrations, OAuth 2.0 offers a more secure and flexible approach, especially when dealing with multiple users or publicly accessible applications. Personal API tokens are straightforward for quick, private integrations but require careful management to prevent unauthorized access.

Getting your credentials

The process for obtaining credentials varies depending on the chosen authentication method.

For OAuth 2.0

To use OAuth 2.0, you must register your application with ClickUp. This usually involves:

  1. Creating a Developer Application: Navigate to your ClickUp workspace settings, typically under 'Integrations' or 'API Access', to register a new application.
  2. Obtaining Client ID and Client Secret: Upon registration, ClickUp will provide a unique Client ID and Client Secret. The Client ID is public, but the Client Secret must be kept confidential as it authenticates your application to ClickUp's authorization server.
  3. Setting Redirect URIs: You will need to specify one or more Redirect URIs (or callback URLs) where ClickUp will send the user back after they authorize your application. These URIs must be exact matches to what you configure in your ClickUp developer settings (ClickUp API Authentication and Usage guide).

The OAuth 2.0 workflow typically involves directing users to ClickUp's authorization page, where they log in and grant your application specific permissions (scopes). After authorization, ClickUp redirects the user back to your specified Redirect URI with an authorization code, which your application then exchanges for an access token and optionally a refresh token.

For Personal API Tokens

Generating a personal API token is a simpler process:

  1. Accessing API Settings: Log into your ClickUp account. Go to your personal settings, usually found by clicking your profile avatar, and look for 'Apps' or 'API'.
  2. Generating the Token: Within the API section, there will be an option to generate a new API token. ClickUp will display the token once, so it's critical to copy and store it securely immediately (ClickUp's API documentation for token generation).

Personal API tokens inherit the permissions of the user who generated them. If the user has full access to a workspace, the token will also have full access. It is advisable to generate tokens from accounts with the least necessary privileges.

Authenticated request example

Once you have an access token (from OAuth 2.0) or a personal API token, you can include it in your API requests. Typically, this is done by including an Authorization header with the Bearer scheme.

Using a Personal API Token

Here's an example of a cURL request to list all teams the authenticated user belongs to, using a personal API token:

curl -X GET \
  'https://api.clickup.com/api/v2/team' \
  -H 'Authorization: YOUR_PERSONAL_API_TOKEN' \
  -H 'Content-Type: application/json'

Replace YOUR_PERSONAL_API_TOKEN with the actual token you generated.

Using an OAuth 2.0 Access Token

If you've obtained an OAuth 2.0 access token, the request structure is similar:

curl -X GET \
  'https://api.clickup.com/api/v2/team' \
  -H 'Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

Here, YOUR_OAUTH_ACCESS_TOKEN represents the token obtained after a user has authorized your application through the OAuth 2.0 flow. The Bearer prefix is standard for OAuth 2.0 access tokens (OAuth 2.0 Bearer Token Usage).

Security best practices

Adhering to security best practices is essential when handling ClickUp API credentials and making authenticated requests.

  • Secure Storage of Credentials: Never hardcode API tokens or client secrets directly into your application's source code. Store them in environment variables, secure configuration files, or a dedicated secret management service (e.g., AWS Secrets Manager, Google Secret Manager, Azure Key Vault).
  • Use HTTPS: Always ensure all API communications are sent over HTTPS to encrypt data in transit and prevent eavesdropping. ClickUp's API inherently enforces HTTPS.
  • Least Privilege Principle: When creating personal API tokens or configuring OAuth 2.0 scopes, grant only the minimum necessary permissions required for your application or script to function. Avoid giving broad access if only specific actions are needed.
  • Rotate API Tokens: Regularly rotate personal API tokens. If a token is compromised, rotating it minimizes the window of exposure. ClickUp's API documentation provides guidance on managing tokens.
  • Error Handling and Logging: Implement robust error handling for authentication failures. Avoid logging sensitive credentials or access tokens in plaintext. Log only necessary information for debugging, such as status codes or error messages.
  • Validate Redirect URIs: For OAuth 2.0, ensure that your registered Redirect URIs are precise and secure. This prevents malicious actors from intercepting authorization codes via open redirect vulnerabilities.
  • Token Expiration and Refresh: Leverage OAuth 2.0's access token expiration and refresh token mechanisms. Short-lived access tokens reduce the risk if compromised, and refresh tokens allow your application to obtain new access tokens without requiring the user to re-authorize frequently.
  • Input Validation: Sanitize and validate all user inputs to prevent injection attacks that could exploit your application's interaction with the ClickUp API.
  • Monitor API Usage: Keep an eye on your API usage patterns. Unusual activity might indicate a compromise or misconfiguration.

By following these guidelines, developers can significantly enhance the security posture of their ClickUp integrations and protect sensitive data.