Once you've generated an API key and obtained the IDs for your Wix account or site, you can authenticate and perform admin operations.
To make an API call using an API key, include the key from the API Keys 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 you're working with. Required for site-level API calls.Notes:
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.A complete header for an account-level API request looks like this:
A complete header for a site-level API request looks like this:
With your headers set up, call Wix APIs. The following example calls Query Product and retrieves a list of visible products from a specific site:
Important: To implement this flow, you must install Node.js version 18 or higher.
Install @wix/sdk and the packages for the domain-specific APIs you wish to work with. Domain-specific packages follow the naming convention @wix/{domain}. For example:
Or, with Yarn:
To use the APIs you have installed, import createClient and ApiKeyStrategy from the @wix/sdk package, and import functionality from the desired domain-specific packages. For example:
Use the createClient() method to connect an external client with a Wix site:
The createClient() method returns a new Wix client.
modules parameter contains key pairs. Each value is an imported module, and the key defines the name to use when working with that module.auth parameter contains the authentication method and credentials. Pass ApiKeyStrategy() with an object containing:
apiKey: An API key generated in the API Keys Manager.siteId: ID of the Wix site you are working with. Required for site-level calls.accountId: ID of the Wix account the API key belongs to. Required for account-level calls.The following code example retrieves a list of visible products from a specific site:
If you receive a 403 Forbidden error, check that you have:
Authorization header with your API key.wix-site-id header for site-level methods, or a wix-account-id header for account-level methods.If you receive a 403 Forbidden error, check that you have:
siteId value in ApiKeyStrategy for site-level calls, or an accountId value for account-level calls.If you don't receive an SMS for 2-step verification when generating a key, contact Wix Support.
Last updated: 1 September 2026