Back

Webflow API Essential Guide

Jul 31, 20246 minute read

What type of API does Webflow provide?

Webflow offers several types of APIs, including REST APIs and GraphQL APIs.

REST APIs

Webflow provides a set of REST APIs that allow developers to interact with various aspects of Webflow sites and content. These include:

  • Sites API
  • Pages API
  • Assets API
  • CMS API
  • Ecommerce API
  • User Accounts API
  • Forms API
  • Custom Code API
  • Designer APIs

GraphQL API

In addition to REST APIs, Webflow also offers a GraphQL API. GraphQL provides a more flexible way to query and manipulate data compared to REST, allowing developers to request exactly the data they need.

Key Points

  • Webflow provides both REST and GraphQL API options
  • The REST APIs cover a wide range of Webflow functionality
  • The GraphQL API offers more flexibility in querying data
  • Developers can choose the API type that best fits their needs

Does the Webflow API have webhooks?

Yes, the Webflow API has webhooks. Here are the key points about Webflow's webhook functionality:

Webhook Support

Webflow officially supports webhooks as part of their API.

Event Types

You can subscribe to the following types of events with Webflow webhooks:

  • Form submission
  • Site publish
  • Ecommerce order created
  • Collection item created
  • Collection item updated
  • Collection item deleted

Creating Webhooks

To create a webhook:

  1. Authenticate with the Webflow API using an access token.

  2. Send a POST request to the Create Webhook endpoint with the following payload:

{ "triggerType": "form_submission", "url": "YOUR_DESTINATION_URL" }
  1. Specify the trigger type (e.g. "form_submission") and the destination URL where you want to receive the webhook data.

Webhook Management

You can list, create, get details of, and remove webhooks via the API.

Best Practices

  • Use webhooks for real-time updates rather than constantly polling the API.
  • Authenticate via an App if you plan to verify webhook signatures.
  • Store your API tokens securely as they are sensitive.

Summary

Webflow's webhook support allows you to receive real-time notifications for key events like form submissions, site publishes, and CMS updates. This enables building integrations and automations with external services.

Rate Limits and other limitations

Based on the search results, here are the key points about the API rate limits for the Webflow API:

Default Rate Limit

The default rate limit for the Webflow API is 60 requests per minute. This means you can make up to 60 API calls within a 60-second window.

Tracking Usage

Webflow provides two HTTP response headers to help track API usage:

  • X-RateLimit-Remaining: Contains the number of available requests remaining in the current minute
  • X-RateLimit-Limit: Contains your current overall rate limit per minute

Exceeding Rate Limits

If you exceed the rate limit, you will receive an HTTP 429 error, indicating that you need to slow down the rate of your requests. The error response will look like this:

{ "message": "Too Many Requests", "code": "too_many_requests", "externalReference": null, "details": [] }

Best Practices

To avoid hitting rate limits, consider the following best practices:

  1. Implement rate limiting in your application to ensure you don't exceed 60 requests per minute.
  2. Use webhooks instead of aggressive polling when waiting for resources to be created.
  3. Avoid making a large number of highly concurrent API calls.
  4. Monitor the X-RateLimit-Remaining header to track your remaining requests.

Handling Rate Limits

For developers working with large datasets or needing to make many API calls, there are a few strategies to consider:

  1. Implement a queuing system to spread out requests over time.
  2. Use libraries like "bottleneck" to automatically handle rate limiting.
  3. Consider using automation platforms like Byteline that automatically handle API rate limits.

Key Considerations

  • The 60 requests per minute limit is separate from the number of CMS items allowed on your plan.
  • If you need to create many collection items (e.g., 150+), you'll need to implement a solution to handle the rate limit, such as pausing between batches of requests.

In summary, while the Webflow API has a relatively low rate limit of 60 requests per minute, there are ways to work within this constraint by implementing proper rate limiting in your application and using tools or libraries to help manage API calls.

Latest API Version

Based on the search results provided, here are the key points regarding the most recent version of the Webflow API:

Current API Version

The most recent version of the Webflow API is v2.

Key Points

  1. Webflow API v1 is being deprecated:

    • The v1 API will be deprecated on January 1, 2025.
    • Developers are encouraged to migrate to v2.
  2. Major changes in v2:

    • Introduction of 'scopes' for more precise control over app permissions.
    • Significant updates to the Data API, including changes to endpoints.
    • Previous v1 Apps are now called 'Data Clients' in v2.
  3. Migration process:

    • Developers need to create a new v2 app to utilize v2 resources.
    • The JavaScript SDK is being revamped to support v2 APIs.
    • Developers are advised to update to the most recent SDK version and modify their code to call APIs directly.
  4. Recent issues:

    • Some developers have reported issues with rate limiting and 429 errors when using the v2 API, particularly with CMS item updates and publishing.
    • These issues seem to be affecting multiple users, especially those using integration platforms like Make.com.

Best Practices

  1. When migrating to v2, carefully review the changes in endpoints and new features like scopes.
  2. Use the updated Webflow Developer App to test API calls.
  3. Be aware of potential rate limiting issues and implement appropriate error handling and retry logic.
  4. Stay updated with the latest documentation and developer resources provided by Webflow.

In conclusion, the most recent version of the Webflow API is v2, with v1 being deprecated in 2025. Developers should focus on migrating to v2 and be aware of the significant changes and potential issues that have been reported by some users.

How to get a Webflow developer account and API Keys?

To get a developer account for Webflow to create an API integration:

  1. Create a Webflow account at webflow.com.

  2. Create at least one Webflow site.

  3. Generate an API token:

    • Go to your Webflow site settings
    • Click on the "Integrations" tab
    • Scroll down to the "API Access" section
    • Click "Generate API Token"
    • Copy and save the API token (shown only once)
  4. Choose API permissions when generating the token.

  5. Use the official Webflow API documentation at developers.webflow.com to learn how to use the available APIs.

Key points:

  • Each Webflow site gets one API token
  • API tokens expire after 365 days of inactivity
  • For public integrations, use OAuth 2.0 instead of API tokens
  • Available APIs include Webflow CMS API, Sites API, Assets API, and Ecommerce API

Best practices:

  • Store your API token securely
  • Use separate tokens for different integrations if needed
  • Regenerate tokens if you suspect they've been compromised
  • For public apps, use OAuth 2.0 authentication instead of API tokens

What can you do with the Webflow API?

Based on the search results provided, here is a summary of the data models you can interact with using the Webflow API, along with what is possible for each:

CMS API

  • Add items to CMS collections
  • Update items in CMS collections
  • Delete items from CMS collections
  • Retrieve CMS collection data

Forms API

  • Send data submitted via Webflow forms to external sources

Assets API

  • Integrate site assets and files directly with Webflow's Asset manager

Ecommerce API

  • Manage ecommerce data such as:
    • Products
    • SKUs
    • Inventory
    • Order information

Site API

  • Publish a site
  • Query a site's custom domains

Webhooks

  • Create webhooks to be notified when Webflow resources change (e.g. when a page is created)

Key points:

  • The Webflow Data API allows for comprehensive management of site resources, including create, read, update, and delete (CRUD) actions for many endpoints
  • API access requires generating an API token for authentication
  • The API uses HTTP JSON format
  • There are some limitations on what can be done via the API compared to more robust ecommerce platforms

Best practices:

  • Review the detailed API documentation provided by Webflow for each endpoint
  • Consider using SDKs or developer tools provided by Webflow to streamline API usage
  • Be aware of any rate limits or restrictions when making API calls
  • For complex ecommerce needs, evaluate if Webflow's current API capabilities meet your requirements

The Webflow API provides a good foundation for interacting with key site data and resources programmatically, but may have some limitations for very large-scale or complex ecommerce operations compared to dedicated ecommerce platforms.