> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using your app's API page

> Browse your app's ready-made API reference, copy code for your data, functions, and agents, and download the OpenAPI spec from the API page in your dashboard.

Your app's API lets other tools work with your app's data. For example, you can send new form entries to a spreadsheet, have a script update records every night, or give an AI coding assistant everything it needs to build an integration for you. The **API** page in your app dashboard explains your app's API and gives you code you can copy, so you don't need to write it from scratch.

![The API Documentation page with the JS SDK drop-down, Authentication and Entity Endpoints sections](https://mintcdn.com/base44/5CIT9C7wGqDn1-BS/images/app-api-page.png?fit=max\&auto=format\&n=5CIT9C7wGqDn1-BS\&q=85\&s=9534a7fd9f0f4322d83c5b7c7497a520)

The API page in your app's dashboard

> [!TIP]
>
> Want to connect your app to other tools without writing code? Try [workflows](https://docs.base44.com/Building-your-app/Creating-workflows.md) or [connectors](https://docs.base44.com/Integrations/Connectors.md) instead.

***

## Opening the API page

The API page lives in your app dashboard, next to your app's data and logs.

**To open the API page:**

1. Click **Dashboard** in your app editor.
2. Click **API**.
3. Choose a language from the drop-down at the top of the page: **JS SDK**, **JS Fetch**, **cURL**, or **Python**.

***

## What's on the page

The page is split into sections, and each code sample updates when you change the language:

* **Authentication:** How other tools sign in to your app. Requests use a [personal access token](https://docs.base44.com/Workspaces/Personal-access-tokens.md). If you don't have one yet, click **Create access token** in this section. If you chose **JS SDK**, this section also shows how to install the Base44 SDK and set it up with your app's ID and your token.
* **Entity Endpoints:** Each table in your app, with its **Schema** and **Endpoints** side by side. Click **Copy entity** to copy one table's reference, or **Copy all** to copy every table. To copy code for reading or updating one table, see [connecting your data to another app](https://docs.base44.com/Building-your-app/Managing-your-app-data.md#connecting-your-data-to-another-app).
* **Backend Functions:** How to run your app's backend functions from another tool. To have a service like Stripe call a function when something happens, see [receiving webhooks](#receiving-webhooks).
* **App Agent:** How to talk to your app's in-app agent, such as starting a conversation, sending messages, and getting replies.

> [!NOTE]
>
> **Terms on this page:**
>
> * An entity is a table of data in your app, such as Tasks or Orders.
> * An endpoint is the address another tool sends a request to.
> * An access token works like a password for your app's API.
> * OpenAPI is a standard file format that API tools understand.

***

## Getting help from AI

The easiest way to use your app's API is to let an AI coding assistant write the code for you. **Copy for LLM** copies your app's full API reference in a format AI tools understand, so the code it writes matches your app.

**To get an AI assistant to write code for your app's API:**

1. Click **Dashboard** in your app editor.

2. Click **API**.

3. Click **Copy for LLM**.

4. Paste it into your AI coding assistant, then describe what you want to build. For example:

   ```text theme={null}
   Using this API reference, write a script that adds a new row to my Tasks table every time I run it.
   ```

5. When the code is ready, click **Create access token** on the API page and add the token where the code asks for it.

> [!WARNING]
>
> Your access token gives access to your app's data. Keep it private: don't paste it into an AI chat, a shared document, or a screenshot. If a token is exposed, delete it and create a new one.

***

## Downloading the OpenAPI spec

Download your app's API reference as an OpenAPI file to use it in an API client or documentation tool.

**To download the OpenAPI spec:**

1. Click **Dashboard** in your app editor.
2. Click **API**.
3. Click the **More actions** icon .
4. Click **Download OpenAPI Spec**.

> [!NOTE]
>
> The API page shows your app as it is when you open it. After you add or change tables, backend functions, or agents, refresh the page to see the change in the reference and in any files you export.

***

## Receiving webhooks

A webhook is a message another service sends to your app when something happens, such as Stripe telling you a payment went through. To receive webhooks, you give the service the URL of one of your app's backend functions, and the function runs each time a message arrives.

You don't need to set up webhooks for Base44's built-in payments. If you set up Stripe from the AI chat, it registers Stripe's webhook and saves the signing secret for you when your payment flow needs one. Learn more in [Setting up Stripe](https://docs.base44.com/documentation/setting-up-your-app/setting-up-payments.md).

Each backend function has its own public URL, in this format:

```text theme={null}
https://your-app-name.base44.app/functions/yourFunctionName
```

The function name is the name of its folder in **Code**, under `base44/functions`. Use your app's base44.app address here, even if you've connected a custom domain.

Services send webhooks without logging in to your app, so the function can't rely on a logged-in user. Anyone who has the URL can call it, so the function should check each message's signature before it does anything. Your function gets the original request body and headers, which is what most services, including Stripe, need for this check.

**To receive webhooks from a service:**

1. Ask the AI chat in your app editor to create a function for the webhook, and name the events it should handle. For example:

   ```text theme={null}
   Create a backend function called stripeWebhook that receives Stripe webhooks. First verify the Stripe-Signature header against the raw request body using the STRIPE_WEBHOOK_SECRET secret, and reject the request if it doesn't match. When a checkout.session.completed event arrives, mark the matching order as paid. Stripe calls this function without a logged-in user, so use service role access for any data.
   ```

2. Copy the function's URL. The AI chat gives it to you, or you can build it from the format above.

3. Add the URL as a webhook endpoint in the service's dashboard, and choose the same events. For Stripe, see [Stripe's webhooks guide](https://docs.stripe.com/webhooks).

4. Copy the signing secret the service shows for the endpoint.

5. Add it to your app as a [secret](https://docs.base44.com/Integrations/managing-app-secrets.md#adding-secrets), using the name your function expects, such as `STRIPE_WEBHOOK_SECRET`.

> [!NOTE]
>
> Publish your app when you're done. Webhooks always run your published app's version of the function, with the secrets it had when you last published, so publish again whenever you change either one.

***

## Troubleshooting webhooks

Most webhook problems come from the function's secret, its login checks, or an app that isn't published yet.

If webhooks aren't reaching your function, find your situation below.

> [accordion] My Stripe webhook gets a 401 error
>
> Base44 checks every Stripe webhook against the Stripe signing secrets saved in your app before your function runs. It rejects the request if no signing secret is saved, or if none of them match.
>
> Add the signing secret for this endpoint as a secret in your app, then publish your app. Each Stripe endpoint has its own signing secret, starting with `whsec_`, and test and live endpoints have different ones.

> [accordion] My webhook gets a 403 error
>
> The function checks for a logged-in user or an API key, which services that send webhooks can't provide. Ask the AI chat to change the function so it doesn't require login, and checks the webhook's signature instead.
>
> Learn more in [troubleshooting backend functions](https://docs.base44.com/documentation/building-your-app/developer-tools.md#troubleshooting-backend-functions).

> [accordion] My webhook gets a 404 error, or my changes don't show
>
> Webhooks only reach functions in your published app. Check that the URL uses the function's exact name, then publish your app so your latest version of the function is live.

> [!NOTE]
>
> If webhooks still don't work, [contact Customer Care](https://docs.base44.com/Community-and-support/Contacting-support.md). Include your app link, the function's name, and the service that sends the webhooks.

***

## Going further

If you're a developer, the developer docs cover your app's API and the Base44 SDK in depth.

> [card] [Base44 SDK overview](https://docs.base44.com/developers/references/sdk/getting-started/overview.md)
>
> Set up the SDK and learn how it works with your app.

> [card] [Working with data](https://docs.base44.com/developers/references/sdk/getting-started/work-with-data.md)
>
> Read, create, update, and delete records in your app's tables from code.

> [card] [Entities](https://docs.base44.com/developers/backend/resources/entities/overview.md)
>
> Define and secure the tables behind your app's API.

> [card] [Personal access tokens](https://docs.base44.com/Workspaces/Personal-access-tokens.md)
>
> Create and manage the tokens your scripts and tools use to sign in.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.