About API Keys

API keys are authentication tools that account owners and co-owners can create and provide to external developers, enabling them to make API calls at the account and site level while bypassing OAuth authentication.

Note: Currently only account owners and co-owners can create API keys.

API keys are created and managed in the API Keys Manager where you can assign a set of permissions that determine the types of APIs the key can access.

Create and use API keys

  1. Create or request an API key:

    • If you have direct access to the site, create a key with the relevant permissions in the API Keys Manager. Collect the key and the account ID.
    • If you don't have direct access to the site, request the key and the account ID from the site owner.
  2. Call the Site API's Query Sites endpoint to collect all the account's associated site IDs.

    Note: The site ID for a current site can be obtained from the site URL in your browser. For example, the site ID appears after the '/dashboard/' part of this URL:

    1. Enter the API key in the authorization header. Note that the API key does not need to be refreshed.
    2. Enter the account ID in the account ID header, as shown below. (In other calls, the site ID header may be required. Refer to the documentation for each specific call.)

    A complete header for an API request looks like this:

    Copy
  3. Make all following calls using the account ID and/or site ID, as required.

Account-level and site-level API requests

Depending on the call, an account ID and/or site ID must be included in the header of the API request.

For requests made exclusively at the account level, you must include the account ID in the header along with the API key for authentication. Some endpoints will require the site ID as well. This is indicated in the documentation for each account-level API.

With site-level API requests, the account ID can be ommitted.

Sample request: Site Folders API - Create Folder

This API creates a new folder that can hold Wix sites.

Request:

Copy

Response:

Copy

Sample Request: Query Products API

This API retrieves a list of products from one of the account's sites. To make this call, you'll need an API key and the ID of the site you want to query.

Request:

Copy

Response:

Copy
Did this help?