> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Call HTTP Functions on a Wix Site

## Article: Call HTTP Functions on a Wix Site

## Article Link: https://dev.wix.com/docs/go-headless/authentication/admin/call-http-functions-on-a-wix-site.md

## Article Content:

# Call HTTP Functions on a Wix Site
[HTTP functions](https://dev.wix.com/docs/velo/velo-only-apis/wix-http-functions/introduction.md) 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](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/integrations/exposing-services/about-custom-site-apis.md). 

## Authentication context
Authentication context is information about which [identity](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities.md) is calling an API.

If an 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()`](https://dev.wix.com/docs/velo/apis/wix-auth/elevate.md).

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()`](https://dev.wix.com/docs/velo/apis/wix-members-v2/members/get-current-member.md).

> **Note:** [Wix app identity](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities.md) isn't supported.

## Implementation approaches

You can call site HTTP functions using 2 approaches:

- The [JavaScript SDK](https://dev.wix.com/docs/api-reference/assets/http-functions/introduction.md), using the [http-functions module](https://dev.wix.com/docs/api-reference/assets/http-functions/sdk/introduction.md) to call your site's endpoints. The SDK client's [authorization strategy](https://dev.wix.com/docs/sdk/articles/set-up-a-client/authorization-strategies.md) associates each call with the site that hosts your HTTP functions and with the authentication context of who is making the call.

- The [REST API](https://dev.wix.com/docs/velo/velo-only-apis/wix-http-functions/introduction.md), using [access tokens](https://dev.wix.com/docs/go-headless/authentication/setup/make-rest-api-calls-with-oauth.md) or [API keys](https://dev.wix.com/docs/go-headless/authentication/admin/generate-an-api-key.md) to send authentication context to your site's HTTP functions.

## See also

- [Set Up a Headless Client](https://dev.wix.com/docs/go-headless/authentication/setup/set-up-a-headless-client.md)
- [Authenticate Visitors (REST)](https://dev.wix.com/docs/go-headless/authentication/visitors/authenticate-visitors-rest.md)
- [Generate an API Key](https://dev.wix.com/docs/go-headless/authentication/admin/generate-an-api-key.md)