Authentication overview

Authentication for the Zapier API is a mechanism to verify the identity of a client attempting to access Zapier's resources. This process ensures that only authorized applications or users can create, modify, or manage Zaps and their associated data. The choice of authentication method depends on the integration's purpose: direct programmatic access often utilizes API keys, while third-party applications integrating with user accounts typically employ OAuth 2.0.

The Zapier developer ecosystem supports building custom integrations that can be published on its platform. These custom integrations interact with Zapier's core services, requiring robust authentication to manage access control and maintain data integrity. Understanding the appropriate method and its implementation is crucial for secure and functional integrations.

Supported authentication methods

The Zapier API supports distinct authentication methods tailored to different integration scenarios. The primary methods are API Keys for direct administrative access and OAuth 2.0 for delegated authorization, particularly when building custom integrations for other users.

API Key

API keys are unique identifiers used to authenticate a project or application with Zapier. When you build a custom integration using the Zapier Platform UI or SDK, an API key is generated to allow your integration to communicate with the Zapier backend. This key is typically included in the request headers or body when making API calls. It serves to identify the calling application and authorize its access to resources within the context of the Zapier developer account. API keys are suitable for server-to-server communication or when the integration operates under a single developer account.

OAuth 2.0

OAuth 2.0 is an authorization framework that enables third-party applications to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf. For Zapier custom integrations that need to connect to other users' accounts, OAuth 2.0 is the recommended authentication method. It allows users to grant permissions to a Zapier integration without sharing their actual credentials. The typical flow involves the Authorization Code Grant type, where the user is redirected to Zapier to authorize the application, receiving an authorization code that is then exchanged for an access token and refresh token.

The OAuth 2.0 framework provides a secure way to delegate authorization, preventing the need for integrations to store user credentials. For more details on the OAuth 2.0 authorization process, refer to the OAuth 2.0 specification.

The following table summarizes the supported authentication methods:

Method When to Use Security Level
API Key Direct application-to-Zapier communication, developer-specific integrations, administrative tasks within your developer account. Moderate (requires careful handling and secure storage, no user consent beyond developer)
OAuth 2.0 Third-party integrations requiring user consent to access their Zapier account data, public custom integrations. High (delegated authorization, token-based, no credential sharing)

Getting your credentials

The process for obtaining credentials varies depending on the chosen authentication method for your Zapier API integration.

API Key

If you are developing a custom integration within the Zapier Platform, your API key is automatically associated with your developer account. You can manage and view your custom integration's API key within the Zapier Platform UI. This key is used to authenticate your custom integration's requests to the Zapier API during development and testing. Access to the Zapier Platform UI is available through your Zapier developer account.

OAuth 2.0 Client Credentials

For custom integrations utilizing OAuth 2.0, you will need a Client ID and Client Secret. These credentials identify your application when it requests authorization from Zapier on behalf of a user. To obtain these:

  1. Log in to your Zapier developer account.
  2. Navigate to your custom integration's settings within the Zapier Platform.
  3. Locate the OAuth Configuration section. Here you can generate your Client ID and Client Secret.
  4. You will also need to configure authorized redirect URIs (Callback URLs) where Zapier will send the authorization code after a user grants permission. These URLs must be precisely matched to those registered in your Zapier app settings for security purposes, as specified in the OAuth 2.0 Authorization Framework.

Authenticated request example

While direct access to the Zapier Internal API using arbitrary API keys is not generally exposed to end-users (authentication is managed by Zapier for connected apps), custom integrations built on the Zapier Platform will internally use their API key for Zapier API calls or manage OAuth 2.0 tokens for connected user accounts. Here's a conceptual example of how an API key might be used in a header for an internal call within a custom Zapier integration:

POST /api/platform/v1/zaps
Host: platform.zapier.com
Content-Type: application/json
Accept: application/json
X-API-Key: YOUR_ZAPIER_PLATFORM_API_KEY

{
  "name": "My New Zap",
  "status": "enabled",
  "trigger_id": "trigger_app_event_id",
  "action_id": "action_app_event_id"
}

For custom integrations that connect to external services via OAuth 2.0, after a user grants permission, your integration would receive an access token. This token is then used to make requests to the external service on the user's behalf. The specific implementation depends on the external service's API, but typically involves including the access token in an Authorization header:

GET /api/user/profile
Host: api.example.com
Authorization: Bearer YOUR_EXTERNAL_SERVICE_ACCESS_TOKEN
Content-Type: application/json

The Zapier Platform SDK handles much of the complexity of authenticating and interacting with Zapier's internal systems when you are building a custom integration, abstracting these direct API calls.

Security best practices

Implementing security best practices is essential to protect your Zapier integrations and the data they handle.

  • Secure API Key Storage: Never hardcode API keys directly into your application code or commit them to version control systems. Store them in environment variables, secure configuration files, or dedicated secret management services.
  • Use Environment Variables: For server-side applications, load API keys and client secrets from environment variables. This prevents them from being exposed in your codebase and makes it easier to manage credentials across different environments (development, staging, production).
  • Restrict API Key Scope: If Zapier offers granular permissions for API keys (which is generally managed at the custom integration level), ensure your key only has the minimum necessary permissions to perform its intended functions.
  • Rotate Credentials Regularly: Periodically rotate your API keys and OAuth client secrets. This reduces the window of opportunity for a compromised credential to be exploited.
  • Secure Redirect URIs: For OAuth 2.0, always use HTTPS for your redirect URIs and ensure they are specific and tightly controlled. Avoid using broad wildcards. Only register authorized redirect URIs in your Zapier app configuration.
  • Validate State Parameter in OAuth: When implementing OAuth 2.0, use the state parameter to protect against Cross-Site Request Forgery (CSRF) attacks. The state parameter should be a unique, unguessable value generated by your application and verified upon callback.
  • Handle Tokens Securely: Store OAuth access tokens and refresh tokens securely. Access tokens are short-lived and should be stored in memory where possible, or in secure, encrypted storage. Refresh tokens, being long-lived, require even stronger protection, often encrypted in a database.
  • Implement Error Handling and Logging: Log authentication failures and other security-related events. Implement robust error handling to prevent sensitive information from being exposed in error messages.
  • Keep Dependencies Updated: Regularly update your SDKs, libraries, and frameworks to patch known vulnerabilities.
  • Follow Principle of Least Privilege: Ensure that your custom Zapier integration only requests the minimum necessary scopes or permissions from users during the OAuth authorization flow.

Adhering to these practices will significantly enhance the security posture of your Zapier API integrations, protecting both your platform and your users' data.