An authentication method is the mechanism a caller uses to prove their identity to Wix. Different methods suit different identities, contexts, and development paths. Sometimes Wix takes care of authentication automatically. Other times, you handle it explicitly.
Wix supports three authentication methods:
Some projects use more than one method. For example, an app may rely on host auth in its frontend extensions and OAuth in its backend code.
Always choose the least-privileged method that still supports the requirements shown in the API Reference. If an API method requires more authorization than the caller has, you may be able to elevate that call in backend code instead of switching to a more privileged authentication method.
This article covers the three methods at a conceptual level. For the REST-specific details, see REST API Authentication. For the SDK-specific details, see Set Up a Wix Client.
OAuth is the method for code running outside the Wix dashboard, editor, or site. Your code presents an OAuth token to call Wix APIs as a specific identity.
OAuth supports three identities, each obtained with its own grant type:
anonymous grant. For code acting as an anonymous individual, such as browsing public content.authorization_code grant, issued after a login redirect. For code acting as a logged-in individual.client_credentials grant, using a client ID and secret. For an installed app acting with its granted scopes, or a headless project's OAuth client acting as itself.OAuth tokens are short-lived and sent in the Authorization header of REST requests. The JavaScript SDK handles token acquisition and refresh automatically through its OAuthStrategy (visitor and member) and AppStrategy (Wix app) authorization strategies.
OAuth access tokens are short-lived, valid for 4 hours whether obtained via REST or the SDK. How a token is renewed depends on its type:
client_credentials) have no refresh token. A new token is minted from the same client ID and secret when the old one expires.For the REST-specific renewal steps, see REST API Authentication.
An API key is a long-lived credential for site-level or account-level administrative access, without an app or user session. It stays valid until you revoke or rotate it in the Wix dashboard. A key's permissions combine two independent dimensions:
As a best practice, restrict each key to the narrowest set of sites its integration needs.
Every call made with a key must identify its target: an account ID for account-level operations, or a site ID for site-level operations. Account owners and co-owners can create keys.
Important: Site-level calls only work with keys generated from the account that owns the site. If you work with multiple accounts, make sure you're using the right key.
Use API keys for administrative access that isn't tied to a user session, such as:
For admin operations scoped to a headless project's own site, use the OAuth client_credentials flow instead.
Note: API keys aren't available for third-party Wix apps. To authenticate API calls in an app, use OAuth instead.
For REST implementation details, see Generate an API Key and Make API Calls with an API Key. The JavaScript SDK implements API key authentication through its ApiKeyStrategy.
Host auth is the method for code running inside a Wix host: the dashboard, editor, or a Wix site. The host authenticates its calls for you, so you never fetch tokens or manage credentials. Your identity comes from where the code runs.
How you connect depends on how you build:
dashboard, editor, or site) to pass the host's identity to your calls.Either way, the host manages the tokens, not your code.
How you set up authentication depends on your development path:
client_credentials flow with a client secret, or an API key.Last updated: 2 August 2026