About Calling Site HTTP Functions

HTTP functions allow you to expose the functionality of a Wix site as a service in the form of REST APIs. If you’ve added functionality to a site with code and want to use it in a Headless site or app, you can expose HTTP functions and call the APIs in your client's code.

Learn more about exposing a site API with HTTP functions.

Authentication context

Authentication context is information about which identity is calling an API.

If a HTTP function on a Wix site doesn't receive authentication context, it treats the call as if it was made by an anonymous site visitor. This restricts the methods you can use in your code without overriding authentication using elevate().

Providing your HTTP functions with authentication context allows you to:

  • Restrict HTTP function usage on your site to admins or site members.
  • Use functions that return different responses based on who calls them, such as getCurrentMember().

Note: Wix app identity isn't supported.

Implementation approaches

You can call site HTTP functions using 2 approaches:

See also

Did this help?