An HTTP endpoint is a backend route that handles HTTP requests and returns a response, such as JSON data for your site's frontend code.
Follow the instructions below to:
Note: You can also ask Aria, Wix's AI assistant, to create and customize the extension.
To add an HTTP endpoint:
In the Studio Two editor, open the Code tab.
In the VS Code sidebar, open Wix Extension Builder.

Under Create an Extension, choose Backend, then HTTP Endpoint.
Fill in the form:
stock/levels.Click Generate.
You can find the new file at src/api/<name>.ts, where <name> is the name you entered. Wix serves it at the route <name>. Frontend code calls the route at a full URL on the domain that serves your code, not on your site's domain. Step 3 shows how to build that URL.
Unlike other extension types, an HTTP endpoint isn't registered in extensions.ts and doesn't appear under My Extensions. Wix finds it from its location in src/api/.
The file exports two handlers:
GET handler that returns a JSON message.POST handler that returns the JSON body it receives.For how the file's path maps to a route and what each handler receives, see HTTP Endpoint Extension Files and Code.
You can edit the generated file to match the request handling you need. When you're happy with the endpoint, move on to the next step.
For the full workflow, from routes and handlers to caller checks and calls from your frontend code, see Build an HTTP Endpoint in Studio Two.
For example, to change the message that the GET handler returns:
src/api/<name>.ts.GET handler, replace the message 'Hello from /<name>' with 'Hello world!'.When you call the endpoint, the response body is {"message":"Hello world!"}.
To check the endpoint, call it from a dashboard page. A dashboard page is the quickest place to see the response, because it opens in the site dashboard without placing anything on a site page.
To check the endpoint from a dashboard page:
If your site doesn't have a dashboard page, add one. For instructions, see Add a Dashboard Page Extension in Studio Two.
Open src/extensions/dashboard/pages/<page-route>/<page-route>.tsx, where <page-route> is the dashboard page's route.
Inside the page component, call the endpoint with httpClient.fetchWithAuth() from @wix/essentials, and store the message it returns. In the following code, replace my-endpoint with the name you entered in Step 1, without a leading /.
fetchWithAuth() attaches the caller's access token, which every endpoint request needs. The URL starts with the origin of import.meta.url because Wix serves endpoints from a different domain than your site's pages. WIX_SERVER_BASE_PATH is the path that endpoints are served under, and it ends with /. A request without a token fails with a 401 response.
In the page's EmptyState component, replace the subtitle value with {message}, so that the prop reads subtitle={message}. Keep the other props as they are.
Save the file.
In the site dashboard, in the Custom Pages section of the sidebar, click your dashboard page's title.
If the endpoint is working, the page shows Hello world! in place of the placeholder subtitle.
When you're ready, click Publish in the Studio Two editor to ship the endpoint with your site.
Last updated: 2 November 2026