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 an app, you can expose HTTP functions and call the APIs in your app’s code. Learn more about Exposing a Site API with HTTP Functions.

Calling the HTTP Functions API using access tokens or API Keys sends authentication context to your site’s HTTP functions.

Authentication context

Authentication context is information about who is calling an API.

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

Providing your HTTP functions with authentication context allows you to:

  • Authorize only users with the right permissions for each Velo function, such as admins or site members.
  • Use functions that return different responses based on the user who calls them, such as getCurrentMember().
Did this help?