Make API Calls with an API Key

Once you have generated an API key and obtained the IDs for your Wix account and Wix site, you can use your API to authenticate your calls to the REST API.

Prerequisites

Set authorization headers

To make an API call using an API key, include the key from the API Key Manager in the Authorization header. You must also include one of the following headers, depending on the type of call:

  • wix-account-id: The ID of the Wix account that owns the API key. Required for account-level API calls.
  • wix-site-id: The ID of the Wix site or project you're working with. Required for site-level API calls.

Notes:

  • API calls require either the wix-account-id header or the wix-site-id header, but not both. Most APIs are site-level, while account-level APIs are specified as such in the reference documentation.
  • Site-level calls only work with API keys generated from the site owner's account.

A complete header for an account-level API request looks like this:

Copy

A complete header for a site-level API request looks like this:

Copy

Example request

This API call retrieves a list of products from a specific site. To make this call, you need an API key and the ID of the site you are querying.

Copy
Did this help?