Api Development

Building API Endpoints

If you're using Xano as your backend, your frontend application communicates with it through API endpoints. Understanding how those endpoints work — and how to build them — is one of the most fundamental skills you'll need. Here's a practical walkthrough of everything you need to get started.

What Is an API Endpoint?

Every task your application performs — logging in, fetching data, creating a record, deleting something — typically maps to its own API endpoint. Each endpoint has a method (also called a verb) that describes what kind of action it performs. The five you'll use most often in Xano are:

  • GET – retrieve data
  • POST – add new data
  • PATCH – selectively update existing data
  • PUT – replace an entire record
  • DELETE – remove data

When your app calls an endpoint, it sends a request that includes headers (metadata like auth tokens or content type) and either parameters (for GET/DELETE) or a JSON request body (for POST/PUT/PATCH). The endpoint then returns a response — usually JSON — that your frontend displays to the user.

Auto-Generated Endpoints and Starting from Scratch

Xano makes it easy to get up and running quickly. When you create a new database table, Xano can automatically generate a full set of CRUD endpoints — GET all records, GET a single record, POST, PATCH, and DELETE. You can also generate these later by selecting "CRUD database operations" when adding a new endpoint.

Beyond CRUD, Xano offers default endpoints for authentication (login, signup, token verification) and file uploads. Or, you can build a custom endpoint from scratch, choosing your verb, adding a description and tags, and deciding whether authentication is required.

The Three Components of Every Endpoint

Every API endpoint in Xano is made up of three parts:

  • Inputs – the data your endpoint needs to run. You configure each input's data type, whether it's required, if it allows null values, and any validation rules like min/max length.
  • Function Stack – the logic that executes when the endpoint is called. You add steps like database operations, and Xano will attempt to map your inputs to the right fields automatically.
  • Response – what the endpoint returns after the function stack completes. Xano auto-populates this based on the output of your first function step, but you can customize it however you need.

Testing, Debugging, and Publishing

You can test any endpoint directly inside Xano by clicking Run, providing your inputs, and reviewing the result. If something goes wrong, activate the debugger to step through each function and inspect variable values at every stage.

Xano also maintains request history, which you can use to replay a user's exact request and troubleshoot issues. When you're happy with your changes, click Publish to push them live instantly.

Reusing Logic with Custom Functions

If you have logic that needs to appear in multiple endpoints, put it in a Custom Function. Custom functions have the same structure as endpoints — inputs, function stack, and response — but they're callable from any other endpoint or custom function. Update the logic once, and every endpoint using it updates automatically.

Sign up for Xano

Join 100,000+ people already building with Xano.
Start today and scale to millions.