TOC Navbar
Webflow logo vector black

CMS API Reference

The Webflow CMS API is a HTTP JSON API and allows you to programatically add, update, and delete items from the Webflow CMS, allowing you to connect external data sources to your Webflow sites.

You can access the API directly via HTTP, via the official JavaScript API client, or via any third-party integrations for your language of choice.

Data Models

Content in Webflow is built around three resources: Sites, Collections, and Items.

Sites map to Webflow websites. You can retrieve basic information about the sites a user is able to manage, but currently creating new sites or updating metadata about existing sites is restricted to the web interface and is not accessible via the API.

Collections are groupings of Items. All of the Items in a given Collection share the same set of custom fields, or schema. Defining Collections is restricted to the web interface, but the API allows you to query basic details about Collections and fetch paginated items from those Collections.

Items represent the individual pieces of content within a Collection. Items have a set schema of fields, determined by the Collection which they are a part of. The API allows for reading, creating, updating, and deleting content Items.

CMS Structure

HTTP Verbs

Our API attempts to use the most appropriate HTTP verb for each endpoint. We make use of the following verbs:

VERB DESCRIPTION
GET Fetch resource(s)
POST Create a new resource
PUT Update a resource
DELETE Delete a resource

Parameters

Requests may have both required and/or optional parameters.

Depending on the HTTP verb, the parameters may be in either the URL itself, or in the request body.

Route Param

Route params will be defined as part of the path for a given API endpoint. They will be highlighted in a separate color, and prefixed with a colon (:) for easy visibility.

For example:

GET /sites/:site_id/collections

In this example, site_id is the route param.

Query String

GET requests will have their parameters passed in via the query string.

For example:

/info?foo=bar&abc=123

In this example, the query string contains two parameters, foo and abc.

curl https://api.webflow.com/ \
  -H "Content-Type: application/json" \
  --data-binary $'{ "key": "value" }'

Request Body

All other requests will have their parameters passed in as part of the JSON-formatted request body. POST and PUT requests including JSON-formatted request bodies should ensure the Content-Type header is set to application/json.

Authentication

In order to access the API, you will need to provide an access token to authenticate with the API server. That token will be required for all API requests. You can acquire that token in one of two ways.

  • Utilize OAuth to allow your application’s users to authorize your app to access their Webflow account and data.
  • Issue a personal API key that grants your application full access to your personal account.

Once you have acquired the API token, it may be provided preferably via an HTTP header or in a query string parameter.

HTTP Header

curl https://api.webflow.com/info \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32"
const Webflow = require('webflow-api')
const webflow = new Webflow({ token: 'd59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32' })

webflow.info()
  .then(info => console.log(info))

The following header should be used:

Authorization: Bearer <token>

Query String

If you cannot set the access token in a header, it also may be passed in as part of the query string with the parameter access_token.

curl https://api.webflow.com/info?access_token=d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32

Meta

Get Current Authorization Info

Example request

curl https://api.webflow.com/info \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
  -H 'accept-version: 1.0.0'
const webflow = new Webflow({ token: api_token });

// Promise <{}>
const info = webflow.info();

info.then(x => console.log(x));

Example JSON response

{
  "_id": "55818d58616600637b9a5786",
  "createdOn": "2016-10-03T23:12:00.755Z",
  "grantType": "authorization_code",
  "lastUsed": "2016-10-10T21:41:12.736Z",
  "sites": [ ],
  "orgs": [
    "551ad253f0a9c0686f71ed08"
  ],
  "users": [
    "545bbecb7bdd6769632504a7"
  ],
  "rateLimit": 60,
  "status": "confirmed",
  "application": {
    "_id": "55131cd036c09f7d07883dfc",
    "description": "OAuth Testing Application",
    "homepage": "https://webflow.com",
    "name": "Test App",
    "owner": "545bbecb7bdd6769632504a7",
    "ownerType": "Person"
  }
}
  • Basic information about the authorization currently being used.

Request

  • GET https://api.webflow.com/info
PARAMETER DESCRIPTION
None -

Sites

Model


{
  "_id": "580e63e98c9a982ac9b8b741",
  "createdOn": "2016-10-24T19:41:29.156Z",
  "name": "api_docs_sample_json",
  "shortName": "api-docs-sample-json",
  "lastPublished": "2016-10-24T19:43:17.271Z",
  "previewUrl": "https://d1otoma47x30pg.cloudfront.net/580e63e98c9a982ac9b8b741/201610241243.png",
  "timezone": "America/Los_Angeles",
  "database": "580e63fc8c9a982ac9b8b744"
}

FIELD TYPE DESCRIPTION
_id ObjectId Unique identifier for site
createdOn Date Date the site was created
name String Name given to site
shortName String Slugified version of name
lastPublished Date Date site was last published
previewUrl String URL of a generated image for the given site
timezone String Site timezone set under Site Settings

List Sites

Example request

curl https://api.webflow.com/sites \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise <[ Site ]>
const sites = webflow.sites();

sites.then(s => console.log(s));

Example JSON response

[
  {
    "_id": "580e63e98c9a982ac9b8b741",
    "createdOn": "2016-10-24T19:41:29.156Z",
    "name": "api_docs_sample_json",
    "shortName": "api-docs-sample-json",
    "lastPublished": "2016-10-24T23:06:51.251Z",
    "previewUrl": "https://d1otoma47x30pg.cloudfront.net/580e63e98c9a982ac9b8b741/201610241603.png",
    "timezone": "America/Los_Angeles",
    "database": "580e63fc8c9a982ac9b8b744"
  },
  {
    "_id": "580ff8c3ba3e45ba9fe588bb",
    "createdOn": "2016-10-26T00:28:54.191Z",
    "name": "Copy of api_docs_sample_json",
    "shortName": "api-docs-sample-json-086c6538f9b0583762",
    "lastPublished": null,
    "previewUrl": "https://d1otoma47x30pg.cloudfront.net/580e63e98c9a982ac9b8b741/201610241603.png",
    "timezone": "America/Los_Angeles",
    "database": "580ff8c3ba3e45ba9fe588bf"
  },
  {
    "_id": "580ff8d7ba3e45ba9fe588e9",
    "createdOn": "2016-10-26T00:29:13.634Z",
    "name": "Copy of api_docs_sample_json",
    "shortName": "api-docs-sample-json-ce077aa6c5cd3e0177",
    "lastPublished": null,
    "previewUrl": "https://d1otoma47x30pg.cloudfront.net/580e63e98c9a982ac9b8b741/201610241603.png",
    "timezone": "America/Los_Angeles",
    "database": "580ff8d7ba3e45ba9fe588ed"
  }
]
  • List of all sites the provided access token is able to access.

Request

  • GET https://api.webflow.com/sites
PARAMETER DESCRIPTION
None -

Response

PARAMETER DESCRIPTION
None -

Get Specific Site

Example request

curl https://api.webflow.com/sites/580e63e98c9a982ac9b8b741 \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise <Site>
const site = webflow.sites({ siteId: '580e63e98c9a982ac9b8b741' });

site.then(s => console.log(s));

Example JSON response

{
  "_id": "580e63e98c9a982ac9b8b741",
  "createdOn": "2016-10-24T19:41:29.156Z",
  "name": "api_docs_sample_json",
  "shortName": "api-docs-sample-json",
  "lastPublished": "2016-10-24T19:43:17.271Z",
  "previewUrl": "https://d1otoma47x30pg.cloudfront.net/580e63e98c9a982ac9b8b741/201610241243.png",
  "timezone": "America/Los_Angeles",
  "database": "580e63fc8c9a982ac9b8b744"
}

Request

GET /sites/:site_id

PARAMETER DESCRIPTION
site_id Unique identifier for the site

Response

PARAMETER DESCRIPTION
site [site]

Publish Site

Example request

curl https://api.webflow.com/sites/580e63e98c9a982ac9b8b741 \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0' \
    -H "Content-Type: application/json" \
    --data-binary $'{
      "domains": ["test-api-domain.com"]
    }'

const webflow = new Webflow({ token: api_token });

// Promise <{ queued: Boolean }>
const published = webflow.publishSite({ siteId: '580e63e98c9a982ac9b8b741', domains: ['test-api-domain.com'] });

published.then(p => console.log(p));

Example JSON response

{
  "queued": true
}

Request

POST /sites/:site_id/publish

PARAMETER DESCRIPTION
site_id Unique identifier for the site
domains Array of domains that should be published

Response

PARAMETER DESCRIPTION
queued Boolean

Domains

Model


{
  "_id": "580e63e98c9a982ac9b8b741",
  "name": "test-api-domain.com"
}

FIELD TYPE DESCRIPTION
_id ObjectId Unique identifier for the domain
name String The domain name

List Domains

Example request

curl https://api.webflow.com/sites/580e63e98c9a982ac9b8b741/domains \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise <[ Domain ]>
const domains = webflow.domains({ siteId: '580e63e98c9a982ac9b8b741' });

domains.then(d => console.log(d));

Example JSON response

[
  {
    "_id": "589a331aa51e760df7ccb89d",
    "name": "test-api-domain.com"
  },
  {
    "_id": "589a331aa51e760df7ccb89e",
    "name": "www.test-api-domain.com"
  }
]
  • List of all custom domains added to the given site

Request

GET /sites/:site_id/domains

PARAMETER DESCRIPTION
site_id Unique identifier for the site

Response

PARAMETER DESCRIPTION
None -

Collections

Collections in Webflow are groupings of Items and define the schema or structure of the custom data stored in those Items. A Webflow site can have multiple attached Collections. A Collection’s fields define the structure of the Items within it.

Model

{
  "_id": "580e63fc8c9a982ac9b8b745",
  "lastUpdated": "2016-10-24T19:42:38.929Z",
  "createdOn": "2016-10-24T19:41:48.349Z",
  "name": "Blog Posts",
  "slug": "post",
  "singularName": "Blog Post",
  "fields": [
    {
      "id": "7f62a9781291109b9e428fb47239fd35",
      "editable": true,
      "required": false,
      "type": "RichText",
      "slug": "post-body",
      "name": "Post Body"
    },
    {
      "validations": {
        "singleLine": false
      },
      "id": "ac4ffead755a78c710c44042f528b073",
      "helpText": "A summary of the blog post that appears on blog post grid",
      "editable": true,
      "required": false,
      "type": "PlainText",
      "slug": "post-summary",
      "name": "Post Summary"
    },
    {
      "id": "ba1cfbdaa6b38b8e95e9b5063da8a5bd",
      "editable": true,
      "required": false,
      "type": "ImageRef",
      "slug": "main-image",
      "name": "Main Image"
    },
    {
      "id": "a8c6ea29b08cc5b5ef966908fa1deae2",
      "helpText": "Smaller version of main image that is used on blog post grid",
      "editable": true,
      "required": false,
      "type": "ImageRef",
      "slug": "thumbnail-image",
      "name": "Thumbnail image"
    },
    {
      "id": "1e54974d97181032d3206ea021668e5f",
      "editable": true,
      "required": false,
      "type": "Bool",
      "slug": "featured",
      "name": "Featured?"
    },
    {
      "id": "648463cbc042ab079c2b99430a398ae5",
      "editable": true,
      "required": false,
      "type": "Color",
      "slug": "color",
      "name": "Color"
    },
    {
      "validations": {
        "collectionId": "580e64088c9a982ac9b8b766"
      },
      "id": "ea9067c48edee510de71fe503fa2fb51",
      "editable": true,
      "required": false,
      "type": "ItemRef",
      "slug": "author",
      "name": "Author"
    },
    {
      "validations": {
        "maxLength": 256
      },
      "id": "60c0667e27b6d5a6daedec3a641265f6",
      "editable": true,
      "required": true,
      "type": "PlainText",
      "slug": "name",
      "name": "Name"
    },
    {
      "validations": {
        "messages": {
          "maxLength": "Must be less than 256 characters",
          "pattern": "Must be alphanumerical and not contain any spaces or special characters"
        },
        "pattern": {},
        "maxLength": 256
      },
      "id": "8f0c953df91d10b767d66e1d7d00d631",
      "unique": true,
      "editable": true,
      "required": true,
      "type": "PlainText",
      "slug": "slug",
      "name": "Slug"
    },
    {
      "default": false,
      "id": "e4e92e700d70faffac6fa82ff2bfaece",
      "editable": true,
      "required": true,
      "type": "Bool",
      "slug": "_archived",
      "name": "Archived"
    },
    {
      "default": false,
      "id": "f2675b2ac4fcef746b24d4a320887ef8",
      "editable": true,
      "required": true,
      "type": "Bool",
      "slug": "_draft",
      "name": "Draft"
    },
    {
      "id": "0913a35d92208bdf8fbf3ed1e39b771e",
      "editable": false,
      "required": false,
      "type": "Date",
      "slug": "created-on",
      "name": "Created On"
    },
    {
      "id": "3de04889465fe6d718e47b152ef5bb4d",
      "editable": false,
      "required": false,
      "type": "Date",
      "slug": "updated-on",
      "name": "Updated On"
    },
    {
      "id": "2a3cd866d5dbb294896130b233218626",
      "editable": false,
      "required": false,
      "type": "Date",
      "slug": "published-on",
      "name": "Published On"
    },
    {
      "id": "62c18561b9e89517751c6d8712d48f91",
      "editable": false,
      "required": false,
      "type": "User",
      "slug": "created-by",
      "name": "Created By"
    },
    {
      "id": "50918093b4e4d4eca1e83c25bcdc06a4",
      "editable": false,
      "required": false,
      "type": "User",
      "slug": "updated-by",
      "name": "Updated By"
    },
    {
      "id": "5c4587f18b32ef245daeaadfcba7860b",
      "editable": false,
      "required": false,
      "type": "User",
      "slug": "published-by",
      "name": "Published By"
    }
  ]
}
FIELD TYPE DESCRIPTION
_id ObjectId The unique identifier for the Collection
lastUpdated Date Date Collection was last updated
createdOn Date Date Collection was created
name String Name given to Collection
slug String Slug of Collection in Site URL structure
singularName String The name of one Item in Collection (e.g. “post” if the Collection is called “Posts”)
fields Array See full Fields section

Default Fields

Each collection has a number of fields that are always present. Some of these fields are editable and some of them cannot be changed by users.

FIELD NAME FIELD TYPE EDITABLE DESCRIPTION
_archived Bool true Items set to archived will not be published
_draft Bool true Items set to draft will not be published
created-on Date false Date when an Item was originally created
published-on Date false Date when the Item was last published
updated-on Date false Date when the Item was last updated
created-by User false User who created the Item
updated-by User false User who last updated the Item
published-by User false User who last published the Item

List Collections

Example request

curl https://api.webflow.com/sites/580e63e98c9a982ac9b8b741/collections \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise <[ Collection ]>
const collections = webflow.collections({ siteId: '580e63e98c9a982ac9b8b741' });

collections.then(c => console.log(c));

Example JSON response

[
  {
    "_id": "580e63fc8c9a982ac9b8b745",
    "lastUpdated": "2016-10-24T19:42:38.929Z",
    "createdOn": "2016-10-24T19:41:48.349Z",
    "name": "Blog Posts",
    "slug": "post",
    "singularName": "Blog Post"
  },
  {
    "_id": "580e64088c9a982ac9b8b766",
    "lastUpdated": "2016-10-24T19:42:00.799Z",
    "createdOn": "2016-10-24T19:42:00.777Z",
    "name": "Authors",
    "slug": "author",
    "singularName": "Author"
  }
]

Request

GET /sites/:site_id/collections

PARAMETER DESCRIPTION
site_id Unique identifier for the site

Response

[ Collections ]

Get Collection with Full Schema

Example request

curl https://api.webflow.com/collections/580e63fc8c9a982ac9b8b745 \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise <Collection>
const collection = webflow.collection({ collectionId: '580e63fc8c9a982ac9b8b745' });

collection.then(c => console.log(c));

Example JSON response


{
  "_id": "580e63fc8c9a982ac9b8b745",
  "lastUpdated": "2016-10-24T19:42:38.929Z",
  "createdOn": "2016-10-24T19:41:48.349Z",
  "name": "Blog Posts",
  "slug": "post",
  "singularName": "Blog Post",
  "fields": [
    {
      "id": "7f62a9781291109b9e428fb47239fd35",
      "editable": true,
      "required": false,
      "type": "RichText",
      "slug": "post-body",
      "name": "Post Body"
    },
    {
      "validations": {
        "singleLine": false
      },
      "id": "ac4ffead755a78c710c44042f528b073",
      "helpText": "A summary of the blog post that appears on blog post grid",
      "editable": true,
      "required": false,
      "type": "PlainText",
      "slug": "post-summary",
      "name": "Post Summary"
    },
    {
      "id": "ba1cfbdaa6b38b8e95e9b5063da8a5bd",
      "editable": true,
      "required": false,
      "type": "ImageRef",
      "slug": "main-image",
      "name": "Main Image"
    },
    {
      "id": "a8c6ea29b08cc5b5ef966908fa1deae2",
      "helpText": "Smaller version of main image that is used on blog post grid",
      "editable": true,
      "required": false,
      "type": "ImageRef",
      "slug": "thumbnail-image",
      "name": "Thumbnail image"
    },
    {
      "id": "1e54974d97181032d3206ea021668e5f",
      "editable": true,
      "required": false,
      "type": "Bool",
      "slug": "featured",
      "name": "Featured?"
    },
    {
      "id": "648463cbc042ab079c2b99430a398ae5",
      "editable": true,
      "required": false,
      "type": "Color",
      "slug": "color",
      "name": "Color"
    },
    {
      "validations": {
        "collectionId": "580e64088c9a982ac9b8b766"
      },
      "id": "ea9067c48edee510de71fe503fa2fb51",
      "editable": true,
      "required": false,
      "type": "ItemRef",
      "slug": "author",
      "name": "Author"
    },
    {
      "validations": {
        "maxLength": 256
      },
      "id": "60c0667e27b6d5a6daedec3a641265f6",
      "editable": true,
      "required": true,
      "type": "PlainText",
      "slug": "name",
      "name": "Name"
    },
    {
      "validations": {
        "messages": {
          "maxLength": "Must be less than 256 characters",
          "pattern": "Must be alphanumerical and not contain any spaces or special characters"
        },
        "pattern": {},
        "maxLength": 256
      },
      "id": "8f0c953df91d10b767d66e1d7d00d631",
      "unique": true,
      "editable": true,
      "required": true,
      "type": "PlainText",
      "slug": "slug",
      "name": "Slug"
    },
    {
      "default": false,
      "id": "e4e92e700d70faffac6fa82ff2bfaece",
      "editable": true,
      "required": true,
      "type": "Bool",
      "slug": "_archived",
      "name": "Archived"
    },
    {
      "default": false,
      "id": "f2675b2ac4fcef746b24d4a320887ef8",
      "editable": true,
      "required": true,
      "type": "Bool",
      "slug": "_draft",
      "name": "Draft"
    },
    {
      "id": "0913a35d92208bdf8fbf3ed1e39b771e",
      "editable": false,
      "required": false,
      "type": "Date",
      "slug": "created-on",
      "name": "Created On"
    },
    {
      "id": "3de04889465fe6d718e47b152ef5bb4d",
      "editable": false,
      "required": false,
      "type": "Date",
      "slug": "updated-on",
      "name": "Updated On"
    },
    {
      "id": "2a3cd866d5dbb294896130b233218626",
      "editable": false,
      "required": false,
      "type": "Date",
      "slug": "published-on",
      "name": "Published On"
    },
    {
      "id": "62c18561b9e89517751c6d8712d48f91",
      "editable": false,
      "required": false,
      "type": "User",
      "slug": "created-by",
      "name": "Created By"
    },
    {
      "id": "50918093b4e4d4eca1e83c25bcdc06a4",
      "editable": false,
      "required": false,
      "type": "User",
      "slug": "updated-by",
      "name": "Updated By"
    },
    {
      "id": "5c4587f18b32ef245daeaadfcba7860b",
      "editable": false,
      "required": false,
      "type": "User",
      "slug": "published-by",
      "name": "Published By"
    }
  ]
}

Request

GET /collections/:collection_id

PARAMETER DESCRIPTION
collection_id Unique identifier for the Collection

Response

PARAMETER DESCRIPTION
_id           The unique identifier for the Collection
lastUpdated Date Collection was last updated
createdOn Date Collection was created
name Name given to Collection
slug Slug of Collection in Site URL structure
singularName The name of one Item in Collection (e.g. “post” if the Collection is called “Posts”)
fields See full Fields section

Fields

Fields are what define the schema of a Collection - and ultimately all your dynamic data - but how are fields themselves defined? Fields are simply objects with a number of special properties modifying their behavior and how the data can interact with your site. Most importantly, every field has a Field Type describing what kind of field it is.

Schema

Example fields object from a Collection

[
  {
    "id": "95f8ddc086128a309d227e08f9df3e53",
    "editable": true,
    "required": false,
    "type": "RichText",
    "slug": "bio",
    "name": "Bio"
  },
  {
    "validations": {
      "singleLine": false
    },
    "id": "f3fee428d8c0458e16b927128415322c",
    "editable": true,
    "required": false,
    "type": "PlainText",
    "slug": "bio-summary",
    "name": "Bio Summary"
  },
  {
    "id": "c247d51aa9d9e17c41fd9e518264ad6f",
    "editable": true,
    "required": false,
    "type": "ImageRef",
    "slug": "picture",
    "name": "Picture"
  },
  {
    "validations": {
      "singleLine": true
    },
    "id": "0b71fa766c6d2c8791f167cfbb9b4a99",
    "editable": true,
    "required": false,
    "type": "PlainText",
    "slug": "email",
    "name": "Email"
  },
  {
    "id": "fc51d004e735aa93bbb111f745c3ee37",
    "editable": true,
    "required": false,
    "type": "Link",
    "slug": "twitter-profile-link",
    "name": "Twitter Profile Link"
  },
  {
    "id": "53b5592c93a7a833ba82e2a1be9f87c6",
    "editable": true,
    "required": false,
    "type": "Link",
    "slug": "facebook-profile-link",
    "name": "Facebook Profile Link"
  },
  {
    "validations": {
      "maxLength": 256
    },
    "id": "cd3f236ac2ebdf048106f45dda4b8bbe",
    "editable": true,
    "required": true,
    "type": "PlainText",
    "slug": "name",
    "name": "Name"
  },
  {
    "validations": {
      "messages": {
        "maxLength": "Must be less than 256 characters",
        "pattern": "Must be alphanumerical and not contain any spaces or special characters"
      },
      "pattern": {},
      "maxLength": 256
    },
    "id": "2d829c8278655f2cd5f1299566990432",
    "unique": true,
    "editable": true,
    "required": true,
    "type": "PlainText",
    "slug": "slug",
    "name": "Slug"
  },
  {
    "default": false,
    "id": "758226597df23581f2f01d3554a4bd09",
    "editable": true,
    "required": true,
    "type": "Bool",
    "slug": "_archived",
    "name": "Archived"
  },
  {
    "default": false,
    "id": "20046b7e8a36f45c2cebc5ff446d5474",
    "editable": true,
    "required": true,
    "type": "Bool",
    "slug": "_draft",
    "name": "Draft"
  },
  {
    "id": "9702a0fe00c7a77de1a9a4cecc1b71c6",
    "editable": false,
    "required": false,
    "type": "Date",
    "slug": "created-on",
    "name": "Created On"
  },
  {
    "id": "9226e32368be6d2c8c5140dbf6930110",
    "editable": false,
    "required": false,
    "type": "Date",
    "slug": "updated-on",
    "name": "Updated On"
  },
  {
    "id": "d99acf383e56370e4b2f6691c412877a",
    "editable": false,
    "required": false,
    "type": "Date",
    "slug": "published-on",
    "name": "Published On"
  },
  {
    "id": "8c0ad485a6f6e8f3fb3de92c61a60a08",
    "editable": false,
    "required": false,
    "type": "User",
    "slug": "created-by",
    "name": "Created By"
  },
  {
    "id": "b216246047fb6a733b7ed871e3c75f02",
    "editable": false,
    "required": false,
    "type": "User",
    "slug": "updated-by",
    "name": "Updated By"
  },
  {
    "id": "4ad807325546c62d76e453bf18addc77",
    "editable": false,
    "required": false,
    "type": "User",
    "slug": "published-by",
    "name": "Published By"
  }
]
FIELD TYPE DESCRIPTION
id ObjectId Unique identifier for the field
type String See Field Types below
slug String Slug of the field in the URL structure of your site for template pages
name String Name given to the field
required Boolean Determines if field is required
editable Boolean Boolean determining if the Field can be edited (some fields are automatically created and cannot be edited)
validations Object See Validations below

Field Types

Some field types use slightly different names in the Designer and Editor. For these fields, they have an “alt name” listed here which is the name of the field we publicly display. (For the API however, we only use the actual name of the field type)

FIELD TYPE ALT NAME DATA TYPE DESCRIPTION
Bool Switch Boolean Yes/no switch used for filtering data that’s displayed in your site, ex: featured
Color - String CSS Color value (ie: 'red' or '#e3e3e3')
Date Date/Time Date Date field used to display any combination of month, day, year, and time
ImageRef Image String Unique id for images in CMS
ItemRef Reference ObjectId Field containing item referenced from another Collection
ItemRefSet Multi-Reference Array Field containing multiple items referenced from another Collection
Link - String URL field where the value can be used as a link destination for buttons, link text, and link blocks
Number - Number Single line input field used only for numbers
Option - String Dropdown field with multiple options
PlainText - String Unformatted text (no images, styles, etc.)
RichText - String Formatted text (with headers, hyperlinks, images, etc.)
Video - String Video link field used to embed videos from YouTube and Vimeo
User - String Cannot be set by a user.
Only used for created-by type fields.

Validations

Each field also may have a validations object which defines all of the validations which have been set for the given field. The “TYPE” column defines the data type of the validations.

VALIDATION NAME TYPE
maxLength Number
minLength Number
minimum Number
maximum Number
maxSize Number
decimalPlaces Number
singleLine Boolean
options Array
format String
precision Number
allowNegative Boolean
collectionId String

Items

Model

The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items:

FIELD TYPE DESCRIPTION
_archived Boolean Boolean determining if the Item is set to archived
_draft Boolean Boolean determining if the Item is set to draft
_id String Unique identifier for the Item
_cid String Unique identifier for the Collection the Item belongs within
name String Name given to the Item
slug String URL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug.
updated-on Date Date Item was last updated
created-on Date Date Item was created
published-on Date Date Item was last published
updated-by Date User who made last change to Item
created-by Date User who created Item
published-by Date User who last published Item

Get All Items For a Collection

Example request

curl https://api.webflow.com/collections/580e63fc8c9a982ac9b8b745/items?limit=1 \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise <[ Item ]>
const items = webflow.items({ collectionId: '580e63fc8c9a982ac9b8b745' }, { limit: 1 });

items.then(i => console.log(i));

Example JSON response


{
  "items": [
    {
      "_archived": false,
      "_draft": false,
      "color": "#4CAF50",
      "featured": false,
      "name": "5 Principles Of Effective Web Design",
      "post-body": "<h2>Earum laboriosam ab velit.</h2><p>Et aliquam fuga corporis sit assumenda culpa minima nostrum. Rerum corrupti cum quod laborum a. Non voluptatum ipsam ut et nostrum. Omnis deleniti hic est velit nemo et.</p><h3>Ut recusandae eveniet cum fugit.</h3><blockquote>Sed consectetur nulla dolorem explicabo temporibus aut. Assumenda ea reprehenderit voluptatem quis odit. Sequi sunt vel et dolorem qui dolorum ex. Omnis qui debitis eaque.</blockquote><p>Cumque et reiciendis sit ipsa. Odit sint dolor aliquam. Autem est odio voluptates deleniti. Voluptas quod dolorem minus natus necessitatibus. Autem ea iusto sunt repudiandae. Voluptatem ut et distinctio vero aliquid.</p><p>Aut ut eius. Sit quia labore nesciunt enim nemo eius pariatur odio inventore. Dolorem sapiente maxime laudantium vero praesentium. Fuga neque ipsam doloremque officia accusamus beatae ut occaecati aut. Aperiam perferendis et.</p><h2>Incidunt dolores assumenda tenetur ut recusandae officiis inventore modi quia.</h2><p>Aut necessitatibus qui nesciunt dolores dolores delectus nostrum occaecati odit. Quia optio et enim. Illo ipsa omnis quia quo ducimus voluptas placeat. Voluptatum consequatur id rem aut dolorem nesciunt. Est occaecati vero. Velit magni amet dignissimos.</p><h3>Voluptatem magni dolor quis hic quia iusto aut rerum quasi.</h3><blockquote>Repudiandae laborum necessitatibus dolorem accusamus sit et amet doloremque. Rerum illum rerum officia dolorum perferendis soluta aut incidunt autem. Rerum ut non corrupti maiores architecto vitae rerum quaerat ab. Est sint dolores quia repudiandae et eveniet. Et tenetur similique non ad. Quibusdam qui dolores dignissimos vitae reiciendis nulla aut necessitatibus.</blockquote><p>Voluptatem quia enim quos laudantium est. Dolorem earum est. Ut autem nemo accusamus quibusdam et dignissimos ut. Similique quia cumque. Aut pariatur repellendus voluptates error fugit illo. Neque pariatur impedit accusantium sed aut ea fuga magni ex.</p><p>Iusto accusamus quia nisi rerum reiciendis minus quam debitis. Sit illo eos qui. Nisi et autem sequi.</p>",
      "post-summary": "Quo eligendi nihil quia voluptas qui.\nNon distinctio voluptatu",
      "thumbnail-image": {
        "fileId": "580e63ff8c9a982ac9b8b74d",
        "url": "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63ff8c9a982ac9b8b74d_1477338111010-image3.jpg"
      },
      "main-image": {
        "fileId": "580e63fe8c9a982ac9b8b749",
        "url": "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg"
      },
      "slug": "5-principles-of-effective-web-design",
      "updated-on": "2016-10-24T19:42:46.957Z",
      "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
      "created-on": "2016-10-24T19:41:52.325Z",
      "created-by": "Person_5660c5338e9d3b0bee3b86aa",
      "published-on": "2016-10-24T19:43:15.745Z",
      "published-by": "Person_5660c5338e9d3b0bee3b86aa",
      "author": "580e640c8c9a982ac9b8b77a",
      "_cid": "580e63fc8c9a982ac9b8b745",
      "_id": "580e64008c9a982ac9b8b754"
    }
  ],
  "count": 1,
  "limit": 1,
  "offset": 0,
  "total": 5
}

Request

GET /collections/:collection_id/items

PARAMETER DESCRIPTION
collection_id Unique identifier for the Collection you are querying
limit Maximum number of Items to be returned (max limit: 100)
offset Offset used for pagination if collection has more than limit items

Response

PARAMETER TYPE DESCRIPTION
items Array List of Items within the Collection
count Number Number of items returned
limit Number The limit specified in the request (default: 100)
offset Number The offset specified for pagination (default: 0)
total Number Total number of items in the collection

Get Single Item

Example request

curl https://api.webflow.com/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754 \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise <Item>
const item = webflow.item({ collectionId: '580e63fc8c9a982ac9b8b745', itemId: '580e64008c9a982ac9b8b754' });

item.then(i => console.log(i));

Example JSON response


{
  "items": [
    {
      "_archived": false,
      "_draft": false,
      "color": "#4CAF50",
      "featured": false,
      "name": "5 Principles Of Effective Web Design",
      "post-body": "<h2>Earum laboriosam ab velit.</h2><p>Et aliquam fuga corporis sit assumenda culpa minima nostrum. Rerum corrupti cum quod laborum a. Non voluptatum ipsam ut et nostrum. Omnis deleniti hic est velit nemo et.</p><h3>Ut recusandae eveniet cum fugit.</h3><blockquote>Sed consectetur nulla dolorem explicabo temporibus aut. Assumenda ea reprehenderit voluptatem quis odit. Sequi sunt vel et dolorem qui dolorum ex. Omnis qui debitis eaque.</blockquote><p>Cumque et reiciendis sit ipsa. Odit sint dolor aliquam. Autem est odio voluptates deleniti. Voluptas quod dolorem minus natus necessitatibus. Autem ea iusto sunt repudiandae. Voluptatem ut et distinctio vero aliquid.</p><p>Aut ut eius. Sit quia labore nesciunt enim nemo eius pariatur odio inventore. Dolorem sapiente maxime laudantium vero praesentium. Fuga neque ipsam doloremque officia accusamus beatae ut occaecati aut. Aperiam perferendis et.</p><h2>Incidunt dolores assumenda tenetur ut recusandae officiis inventore modi quia.</h2><p>Aut necessitatibus qui nesciunt dolores dolores delectus nostrum occaecati odit. Quia optio et enim. Illo ipsa omnis quia quo ducimus voluptas placeat. Voluptatum consequatur id rem aut dolorem nesciunt. Est occaecati vero. Velit magni amet dignissimos.</p><h3>Voluptatem magni dolor quis hic quia iusto aut rerum quasi.</h3><blockquote>Repudiandae laborum necessitatibus dolorem accusamus sit et amet doloremque. Rerum illum rerum officia dolorum perferendis soluta aut incidunt autem. Rerum ut non corrupti maiores architecto vitae rerum quaerat ab. Est sint dolores quia repudiandae et eveniet. Et tenetur similique non ad. Quibusdam qui dolores dignissimos vitae reiciendis nulla aut necessitatibus.</blockquote><p>Voluptatem quia enim quos laudantium est. Dolorem earum est. Ut autem nemo accusamus quibusdam et dignissimos ut. Similique quia cumque. Aut pariatur repellendus voluptates error fugit illo. Neque pariatur impedit accusantium sed aut ea fuga magni ex.</p><p>Iusto accusamus quia nisi rerum reiciendis minus quam debitis. Sit illo eos qui. Nisi et autem sequi.</p>",
      "post-summary": "Quo eligendi nihil quia voluptas qui.\nNon distinctio voluptatu",
      "thumbnail-image": {
        "fileId": "580e63ff8c9a982ac9b8b74d",
        "url": "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63ff8c9a982ac9b8b74d_1477338111010-image3.jpg"
      },
      "main-image": {
        "fileId": "580e63fe8c9a982ac9b8b749",
        "url": "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg"
      },
      "slug": "5-principles-of-effective-web-design",
      "updated-on": "2016-10-24T19:42:46.957Z",
      "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
      "created-on": "2016-10-24T19:41:52.325Z",
      "created-by": "Person_5660c5338e9d3b0bee3b86aa",
      "published-on": "2016-10-24T19:43:15.745Z",
      "published-by": "Person_5660c5338e9d3b0bee3b86aa",
      "author": "580e640c8c9a982ac9b8b77a",
      "_cid": "580e63fc8c9a982ac9b8b745",
      "_id": "580e64008c9a982ac9b8b754"
    }
  ],
  "count": 1,
  "limit": 100,
  "offset": 0,
  "total": 5
}

Request

GET /collections/:collection_id/items/:item_id

PARAMETER DESCRIPTION
collection_id Unique identifier for the Collection you are querying
item_id Unique identifier for the Item you are querying

Response

PARAMETER TYPE DESCRIPTION
items Array List of the Item you are querying
count Number Number of items returned
limit Number The limit specified in the request (default: 100)
offset Number The offset specified for pagination (default: 0)
total Number Total number of items in the collection

Create New Collection Item

Example request

curl 'https://api.webflow.com/collections/580e63fc8c9a982ac9b8b745/items' \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
  -H 'accept-version: 1.0.0' \
  -H "Content-Type: application/json" \
  --data-binary $'{
      "fields": {
        "name": "Exciting blog post title",
        "slug": "exciting-post",
        "_archived": false,
        "_draft": false,
        "color": "#a98080",
        "author": "580e640c8c9a982ac9b8b778",
        "post-body": "<p>Blog post contents...</p>",
        "post-summary": "Summary of exciting blog post",
        "main-image": "580e63fe8c9a982ac9b8b749"
      }
    }'

const webflow = new Webflow({ token: api_token });

// Promise <Item>
const item = webflow.createItem({
  collectionId: '580e63fc8c9a982ac9b8b745',
  fields: {
    'name': 'Exciting blog post title',
    'slug': 'exciting-post',
    '_archived': false,
    '_draft': false,
    'color': '#a98080',
    'author': '580e640c8c9a982ac9b8b778',
    'post-body': '<p>Blog post contents...</p>',
    'post-summary': 'Summary of exciting blog post',
    'main-image': '580e63fe8c9a982ac9b8b749',
  },
});

item.then(i => console.log(i));

Example JSON response

{
  "_archived": false,
  "_draft": false,
  "color": "#a98080",
  "name": "Exciting blog post title",
  "post-body": "<p>Blog post contents...</p>",
  "post-summary": "Summary of exciting blog post",
  "main-image": {
    "fileId": "580e63fe8c9a982ac9b8b749",
    "url": "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg"
  },
  "slug": "exciting-post-b",
  "author": "580e640c8c9a982ac9b8b778",
  "updated-on": "2016-11-15T22:45:32.647Z",
  "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
  "created-on": "2016-11-15T22:45:32.647Z",
  "created-by": "Person_5660c5338e9d3b0bee3b86aa",
  "published-on": null,
  "published-by": null,
  "_cid": "580e63fc8c9a982ac9b8b745",
  "_id": "582b900cba19143b2bb8a759"
}

Request

POST /collections/:collection_id/items

PARAMETER DESCRIPTION
collection_id Unique identifier for the Collection you are adding an Item to
fields The fields and data of the Item you are adding to the Collection

Response

Item

Create New Live Collection Item

When adding new CMS items with the API, the default behavior is only to add the item as “staged” but not to include it in the published site. The primary reason for this is because it’s possible to update your collection schema in a manner that conflicts with what is published making it possible to add items which would break the published site.

To get around this, you have to explicitly request the item be published to the live site - however this request will fail under a number of conditions:

  • If you have multiple domains published at different times
  • If your staging collection schema has been modified since your last published

The fix is the same for all cases however: re-publish your site to ensure all domains have the latest collection schema associated with them.

The API request is identical to the normal “add item” request, with one additional querystring parameter: ?live=true

Example request

curl 'https://api.webflow.com/collections/580e63fc8c9a982ac9b8b745/items?live=true' \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
  -H 'accept-version: 1.0.0' \
  -H "Content-Type: application/json" \
  --data-binary $'{
      "fields": {
        "name": "Exciting blog post title",
        "slug": "exciting-post",
        "_archived": false,
        "_draft": false,
        "color": "#a98080",
        "author": "580e640c8c9a982ac9b8b778",
        "post-body": "<p>Blog post contents...</p>",
        "post-summary": "Summary of exciting blog post",
        "main-image": "580e63fe8c9a982ac9b8b749"
      }
    }'

Example JSON response

{
  "_archived": false,
  "_draft": false,
  "color": "#a98080",
  "name": "Exciting blog post title",
  "post-body": "<p>Blog post contents...</p>",
  "post-summary": "Summary of exciting blog post",
  "main-image": {
    "fileId": "580e63fe8c9a982ac9b8b749",
    "url": "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg"
  },
  "slug": "exciting-post-b",
  "author": "580e640c8c9a982ac9b8b778",
  "updated-on": "2016-11-15T22:45:32.647Z",
  "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
  "created-on": "2016-11-15T22:45:32.647Z",
  "created-by": "Person_5660c5338e9d3b0bee3b86aa",
  "published-on": null,
  "published-by": null,
  "_cid": "580e63fc8c9a982ac9b8b745",
  "_id": "582b900cba19143b2bb8a759"
}

Request

POST /collections/:collection_id/items

PARAMETER DESCRIPTION
live Boolean string indicating if the item should be published to the live site
collection_id Unique identifier for the Collection you are adding an Item to
fields The fields and data of the Item you are adding to the Collection

Response

Item

Update Collection Item

Example request

 curl -X PUT 'https://api.webflow.com/collections/580e63fc8c9a982ac9b8b745/items/582bbba8dae4fb7a75bd30e8' \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
  -H 'accept-version: 1.0.0' \
  -H "Content-Type: application/json" \
  --data-binary $'{
      "fields": {
        "name": "Updated Exciting blog post title",
        "slug": "exciting-post",
        "_archived": false,
        "_draft": false,
        "color": "#a98080",
        "author": "580e640c8c9a982ac9b8b778",
        "post-body": "<p>Blog post contents...</p>",
        "post-summary": "Summary of exciting blog post",
        "main-image": "580e63fe8c9a982ac9b8b749"
      }
    }'

const webflow = new Webflow({ token: api_token });

// Promise <Item>
const item = webflow.updateItem({
  collectionId: '580e63fc8c9a982ac9b8b745',
  itemId: '58338a5735ca4f023b9f1847',
  fields: {
    'name': 'Updated Exciting blog post title',
    'slug': 'exciting-post',
    '_archived': false,
    '_draft': false,
    'color': '#a98080',
    'author': '580e640c8c9a982ac9b8b778',
    'post-body': '<p>Blog post contents...</p>',
    'post-summary': 'Summary of exciting blog post',
    'main-image': '580e63fe8c9a982ac9b8b749',
  }
});

item.then(i => console.log(i));

Example JSON response

{
  "_archived": false,
  "_draft": false,
  "color": "#a98080",
  "name": "Updated Exciting blog post title",
  "post-body": "<p>Blog post contents...</p>",
  "post-summary": "Summary of exciting blog post",
  "main-image": {
    "fileId": "580e63fe8c9a982ac9b8b749",
    "url": "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg"
  },
  "slug": "exciting-post-9",
  "author": "580e640c8c9a982ac9b8b778",
  "updated-on": "2016-11-17T00:12:06.727Z",
  "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
  "created-on": "2016-11-16T01:51:36.121Z",
  "created-by": "Person_5660c5338e9d3b0bee3b86aa",
  "published-on": null,
  "published-by": null,
  "_cid": "580e63fc8c9a982ac9b8b745",
  "_id": "582bbba8dae4fb7a75bd30e8"
}

Request

PUT /collections/:collection_id/items/:item_id

PARAMETER DESCRIPTION
collection_id Unique identifier for the Collection of the Item you are updating
item_id Unique identifier for the Item you are updating
fields The fields and data of the Item you are updating

Response

Item

Remove Collection Item

Example request

curl -X DELETE 'https://api.webflow.com/collections/580e63fc8c9a982ac9b8b745/items/581d2d8256e14ea22daf82df' \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
  -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise <{}>
const removed = webflow.removeItem({ collectionId: '580e63fc8c9a982ac9b8b745', itemId: '582bbba8dae4fb7a75bd30e8' })

removed.then(x => console.log(x));

Example JSON response

{
  "deleted": 1
}

Request

DELETE /collections/:collection_id/items/:item_id

PARAMETER DESCRIPTION
collection_id Unique identifier for the Collection of the Item you are removing
item_id Unique identifier for the Item you are removing

Response

PARAMETER DESCRIPTION
deleted Number of items deleted

Images

List all Images for a Site

Example request

curl https://api.webflow.com/sites/580e63e98c9a982ac9b8b741/images \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
  -H 'accept-version: 1.0.0'

Example JSON response


  • Listing of all images a site has uploaded

Request

GET /sites/:site_id/images

PARAMETER DESCRIPTION
site_id Unique identifier for the site

Response

[ Images ]

Upload New Image

Uploading an image consists of two steps. First, a signing request is made to our API, and then second, the actual upload directly to Amazon S3.

Create Signing Request

Upload directly to S3

Webhooks

Model

{ "_id": "578d85cce0c47cd2865f4cf2",
  "triggerType": "form_submission",
  "triggerId": "562ac0395358780a1f5e6fbd",
  "site": "562ac0395358780a1f5e6fbd",
  "filter": { "name": "Email Form" },
  "lastUsed": "2016-09-06T21:12:22.142Z",
  "createdOn": "2016-07-19T01:43:40.585Z"
}
FIELD TYPE DESCRIPTION
_id ObjectId Unique identifier for field
triggerType String Which action the webhook is listening for. See Trigger Types
triggerId ObjectId Unique identifier for trigger
site ObjectId Unique identifier for site
filter Object See additional docs for specified triggerType on what values can be filtered on
lastUsed Date Date trigger was last used
createdOn Date Date trigger was created

Trigger Types

  • form_submission
  • site_publish

List Webhooks

Example request

curl https://api.webflow.com/sites/562ac0395358780a1f5e6fbd/webhooks \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'
const webflow = new Webflow({ token: api_token });

// Promise <[ Webhook ]>
const webhooks = webflow.webhooks({ siteId: '582266e0cd48de0f0e3c6d8b' });

webhooks.then(hook => console.log(hook));

Example JSON response

[
  {
    "_id": "57ca0a9e418c504a6e1acbb6",
    "triggerType": "form_submission",
    "triggerId": "562ac0395358780a1f5e6fbd",
    "site": "562ac0395358780a1f5e6fbd",
    "filter": {
      "name": "Email Form"
    },
    "lastUsed": "2016-09-06T21:12:22.148Z",
    "createdOn": "2016-09-02T23:26:22.241Z"
  },
  {
    "_id": "578d85cce0c47cd2865f4cf2",
    "triggerType": "form_submission",
    "triggerId": "562ac0395358780a1f5e6fbd",
    "site": "562ac0395358780a1f5e6fbd",
    "filter": {
      "name": "Email Form"
    },
    "lastUsed": "2016-09-06T21:12:22.142Z",
    "createdOn": "2016-07-19T01:43:40.585Z"
  },
  {
    "_id": "578d85cce0c47cd2865f4cf3",
    "triggerType": "form_submission",
    "triggerId": "562ac0395358780a1f5e6fbd",
    "site": "562ac0395358780a1f5e6fbd",
    "filter": {
      "name": "Email Form"
    },
    "lastUsed": "2016-09-06T21:12:22.192Z",
    "createdOn": "2016-07-19T01:43:40.605Z"
  }
]

Request

GET /sites/:site_id/webhooks

PARAMETER DESCRIPTION
site_id Unique identifier for the site

Response

[Webhooks]

Get Specific Webhook

Example request

curl https://api.webflow.com/sites/562ac0395358780a1f5e6fbd/webhooks/582266e0cd48de0f0e3c6d8b \
    -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
    -H 'accept-version: 1.0.0'
const webflow = new Webflow({ token: api_token });

// Promise <Webhook>
const webhook = webflow.webhook({ siteId: '562ac0395358780a1f5e6fbd', webhookId: '578d85cce0c47cd2865f4cf2' });

webhook.then(hook => console.log(hook));

Example JSON response

{
  "_id": "578d85cce0c47cd2865f4cf2",
  "triggerType": "form_submission",
  "triggerId": "562ac0395358780a1f5e6fbd",
  "site": "562ac0395358780a1f5e6fbd",
  "filter": {
    "name": "Email Form"
  },
  "lastUsed": "2016-09-06T21:12:22.142Z",
  "createdOn": "2016-07-19T01:43:40.585Z"
}

  • Get specific webhook

Request

GET /sites/:site_id/webhooks/:webhook_id

PARAMETER DESCRIPTION
site_id Unique identifier for the site
webhook_id Unique identifier for the webhook

Response

Webhook

Create New Webhook

Example request

curl 'https://api.webflow.com/sites/562ac0395358780a1f5e6fbd/webhooks' \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
  -H 'accept-version: 1.0.0' \
  -H "Content-Type: application/json" \
  --data-binary $'{"triggerType":"form_submission", "url":"https://api.mydomain.com/webhook"}'

const webflow = new Webflow({ token: api_token });

// Promise <Webhook>
const webhook = webflow.createWebhook({
  siteId: '562ac0395358780a1f5e6fbd',
  triggerType: 'form_submission',
  url: 'https://api.mydomain.com/webhook',
});

webhook.then(hook => console.log(hook));

Example JSON response

{
  "_id": "582266e0cd48de0f0e3c6d8b",
  "triggerType": "form_submission",
  "triggerId": "562ac0395358780a1f5e6fbd",
  "site": "562ac0395358780a1f5e6fbd",
  "createdOn": "2016-11-08T23:59:28.572Z"
}

  • Create a new webhook

Request

POST /sites/:site_id/webhooks

PARAMETER DESCRIPTION
site_id Unique identifier for the site
triggerType Which action the webhook is listening for. See Trigger Types
url The https URL on your server the webhook will send a request to when the webhook is triggered
filter Optional filter for selecting which events you want webhooks to be triggered for.

Response

Webhook

Remove Webhook

Example request

curl -X DELETE 'https://api.webflow.com/sites/562ac0395358780a1f5e6fbd/webhooks/582266e0cd48de0f0e3c6d8b' \
  -H "Authorization: Bearer d59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32" \
  -H 'accept-version: 1.0.0'

const webflow = new Webflow({ token: api_token });

// Promise < { deleted: Number } >
const deletedHook = webflow.removeWebhook({ siteId: '562ac0395358780a1f5e6fbd', webhookId: '582266e0cd48de0f0e3c6d8b' })

deletedHook.then(x => console.log(x))

Example JSON response

{
  "deleted": 1
}
  • Removes a specific webhook

Request

DELETE /sites/:site_id/webhooks/:webhook_id

PARAMETER DESCRIPTION
site_id Unique identifier for the site
webhook_id Unique identifier for the webhook

Response

PARAMETER DESCRIPTION
deleted Number of items deleted

Errors

Sample error response

{
  "msg": "Cannot access resource",
  "code": 401,
  "name": "Unauthorized",
  "path": "/sites/invalid_site",
  "err": "Unauthorized: Cannot access resource"
}

Error Response Format

PARAMETER DESCRIPTION
code HTTP error code
msg Error message
name Name of error
path Path of request resulting in error
err Full error string
problems Array of errors (commonly on ValidationErrors)

Standard Errors

The following are the standard API codes returned by our API.

STATUS NAME DESCRIPTION
400 SyntaxError Request body was incorrectly formatted. Likely invalid JSON being sent up.
400 InvalidAPIVersion Requested an invalid API version
400 UnsupportedVersion Requested an API version that in unsupported by the requested route
400 NotImplemented This feature is not currently implemented
400 ValidationError Validation failure
(see problems field in the response)
400 Conflict Request has a conflict with existing data.
401 Unauthorized Provided access token is invalid or does not have access to requested resource
404 NotFound Requested resource not found
429 RateLimit The rate limit of the provided access_token has been reached. Please have your application respect the X-RateLimit-Remaining header we include on API responses.
500 ServerError We had a problem with our server. Try again later.
400 UnknownError An error occurred which is not enumerated here, but is not a server error.

Rate Limits

The default rate limit is 60 requests / minute. Every request has two rate limit related headers on it:

  • 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

Example rate limit error

{
  "msg": "Rate limit hit",
  "code": 429,
  "name": "RateLimit",
  "path": "/sites",
  "err": "RateLimit: Rate limit hit"
}

Exceeding Rate Limits

To protect the quality of our service, exceeding your rate limit will result in a HTTP 429 error requesting you slow down the rate you are making requests at.

If you are seeing these errors, you should ensure your application is built to limit the rate of requests it is performing. It could, for example, be triggered by polling aggressively when waiting for resources to be created (instead of using webhooks) or making a large number of highly concurrent API calls.

API Versions

In addition to an access token, requests also must specify which API version they should use.

curl https://api.webflow.com/info \
  -H 'Accept-Version: 1.0.0'
// The package version will default to the latest API version at release:
const webflow = new Webflow({ token: api_token });

// You can also specify an API version as the 'version' option:
const webflow = new Webflow({ token: api_token, version: '1.0.0' });

HTTP Header

The version can be specified with the Accept-Version header

Querystring

curl https://api.webflow.com/info?api_version=1.0.0

Additionally, the version can be specified in the query string as api_version

Semver

Semver (Semantic Versioning)

Changelog

February 2, 2017

  • Added endpoint for publishing a site
  • Added endpoint for querying a site’s custom domains

November 30, 2016

Initial release