# Introducing Analysis Endpoints

> Analysis Endpoints let Luau scripts answer HTTP requests with JSON, HTML, CSV, or text. Test in Admin and use them in Custom Dashboards and TagoRUN.

![Introducing Analysis Endpoints](https://tago.io/og/blog/introducing-analysis-endpoints.png)

An Analysis can already process your data. With Analysis Endpoints, it can also answer the application that called it. Give a Luau Analysis its own HTTP URL, send it a request, and receive the script's result in the same call.

A dashboard form can ask whether a temperature setting is valid before saving it. A device can fetch its configuration, or another service can send a webhook and receive confirmation. That request-and-response logic stays inside TagoIO, alongside your device data and access rules, with no separate web service to deploy.

## Your Analysis, at its own URL

![A Luau Analysis with its own HTTP URL, Public or Token access, and JSON, CSV, HTML, and redirect responses](https://tago.io/images/blog/introducing-analysis-endpoints/endpoint.svg)

Return JSON to a device, send a CSV export to a spreadsheet, or serve an HTML page. Your script controls the response, including redirects.

Use Public access for requests without a token, or Token access for authenticated callers. [Access Management](https://docs.tago.io/docs/tagoio/analysis/endpoints/using-endpoints#choose-who-can-call) controls which Run users and analyses can call your code. Your script can use the caller's identity to decide what to return.

## Let your dashboard show the answer

![A dashboard setpoint of 50 °C is rejected: the Analysis returns a field error, the form shows the allowed range of 5 to 30, and nothing is saved](https://tago.io/images/blog/introducing-analysis-endpoints/dashboard-validation.svg)

Custom Dashboards in Admin and TagoRUN call Endpoints with the viewer's session. No token needs to be embedded in the dashboard's HTML.

Reject an out-of-range thermostat setting and show the error beside the field before saving anything. The [dashboard validation recipe](https://docs.tago.io/docs/tagoio/analysis/endpoints/recipes/validate-dashboard-form) shows how to connect the form to your Analysis.

## Receive webhooks and build middleware

![A weather service sends 23.5 °C and 64% humidity to a Luau Analysis, which validates the input, converts the temperature to 74.3 °F, saves the readings, and returns confirmation in the same call](https://tago.io/images/blog/introducing-analysis-endpoints/webhook-flow.svg)

Receive events from external systems without deploying a webhook server. A weather service, for example, can send temperature and humidity in one request. Your Analysis can validate the readings, convert Celsius to Fahrenheit, save the results to the matching device, and return confirmation.

Use an Endpoint as middleware when another application sends a different data format or expects a custom response. Your script can validate and transform the input, work with TagoIO resources, and return the format that application needs. The [webhook recipe](https://docs.tago.io/docs/tagoio/analysis/endpoints/recipes/receive-webhook) includes a complete receiver.

## Publish a form without hosting a website

![A feedback form served by an Endpoint submits a message, saves it to device data, and receives a thank-you page](https://tago.io/images/blog/introducing-analysis-endpoints/feedback-form.svg)

An Endpoint can return an HTML form, accept its submission, save the data, and return a thank-you page. The [feedback form recipe](https://docs.tago.io/docs/tagoio/analysis/endpoints/recipes/serve-form) includes everything you need to build it.

Other recipes show how to [serve device configuration](https://docs.tago.io/docs/tagoio/analysis/endpoints/recipes/device-configuration) and [export readings as CSV](https://docs.tago.io/docs/tagoio/analysis/endpoints/recipes/export-csv).

## Build and test in Admin

![Admin's Try it sends a JSON request to /orders and displays a 200 OK response echoing the request body](https://tago.io/images/blog/introducing-analysis-endpoints/try-it.svg)

Test requests in Admin and inspect the response your application will receive before connecting it. TagoAI can help write the Luau script and enable its Endpoint.

## Get started

Analysis Endpoints are available on every plan. Luau executions do not count toward your [Analysis Service limit](https://docs.tago.io/docs/tagoio/profiles/services/analysis-service); device and other resource operations still follow their normal limits.

See the [call and payload limits](https://docs.tago.io/docs/tagoio/analysis/endpoints/using-endpoints#limits-and-errors) when sizing your application.

Read the [Analysis Endpoints guide](https://docs.tago.io/docs/tagoio/analysis/endpoints), then open a Luau Analysis in [Admin](https://admin.tago.io) to enable your Endpoint.

[llms.txt](https://tago.io/llms.txt)
