# Make your first API request

> List your app's tables and then the records of one table with the REST API, in curl and JavaScript, and read the response.

Source: https://tadabase.com/docs/developers/first-api-request  
Status: Verified Nov 17, 2026. Checked against the current product

This walk-through lists the tables in your app, then reads records from one of them. It takes a few minutes and needs an API key with **Allow Reads** on.

> **Prefer not to write code yet?:** The [API Playground](https://tadabase.com/docs/developers/api-playground) in **Settings** > **API Keys** sends these same requests with your key and shows the responses.

## Before you start

Create a key with **Allow Reads** on and copy its **App ID**, **API Key** and **API Secret** (see [Create and manage API keys](https://tadabase.com/docs/developers/getting-api-keys)). The examples read them from environment variables:

```bash
export TADABASE_APP_ID="your app ID"
export TADABASE_APP_KEY="your API key"
export TADABASE_APP_SECRET="your API secret"
```

## 1. List your tables

```bash
curl https://api.tadabase.io/api/v1/data-tables \
  -H "X-Tadabase-App-id: $TADABASE_APP_ID" \
  -H "X-Tadabase-App-Key: $TADABASE_APP_KEY" \
  -H "X-Tadabase-App-Secret: $TADABASE_APP_SECRET"
```

The response lists each table with its ID and name:

```json
{
  "type": "success",
  "data_tables": [
    { "id": "o6WQb5NnBZ", "name": "Customers" },
    { "id": "4MXQJdrZ6v", "name": "Jobs" }
  ],
  "total_items": 2
}
```

Copy the `id` of the table you want to read. To see its fields and their slugs (such as `field_36`), call `GET /api/v1/data-tables/{tableId}/fields`; see [Tables and fields API](https://tadabase.com/docs/developers/tables-and-fields-api).

## 2. Read records from a table

Put the table ID in the URL. `limit` sets how many records come back per page, up to 100:

```bash
curl "https://api.tadabase.io/api/v1/data-tables/4MXQJdrZ6v/records?limit=10" \
  -H "X-Tadabase-App-id: $TADABASE_APP_ID" \
  -H "X-Tadabase-App-Key: $TADABASE_APP_KEY" \
  -H "X-Tadabase-App-Secret: $TADABASE_APP_SECRET"
```

The same request in JavaScript, run on your server (Node.js 18 or later):

```javascript
const res = await fetch('https://api.tadabase.io/api/v1/data-tables/4MXQJdrZ6v/records?limit=10', {
  headers: {
    'X-Tadabase-App-id': process.env.TADABASE_APP_ID,
    'X-Tadabase-App-Key': process.env.TADABASE_APP_KEY,
    'X-Tadabase-App-Secret': process.env.TADABASE_APP_SECRET,
  },
});
const data = await res.json();
if (data.type !== 'success') throw new Error(data.msg);
console.log(data.total_items, 'records;', data.items);
```

## 3. Read the response

```json
{
  "type": "success",
  "items": [
    {
      "id": "DVWQWRNZ49",
      "field_36": "Replace boiler valve",
      "field_37": "Open",
      "field_41": ["o6WQb5NnBZ"],
      "field_41_val": [{ "id": "o6WQb5NnBZ", "val": "Harbor Bakery" }]
    }
  ],
  "total_items": 42,
  "total_pages": 5,
  "current_page": 1,
  "limit": 10
}
```

| Key | What it holds |
| --- | --- |
| `items` | The records on this page. Each has its `id` and one key per field, named by the field's slug. |
| `total_items` | How many records match, on all pages. |
| `total_pages` | How many pages there are at this `limit`. |
| `current_page` | The page you got. Ask for another with `page=2`, `page=3` and so on. |
| `limit` | Records per page. |

A connection field comes back twice: under its slug with the connected record IDs, and with `_val` added with the IDs and their display values. How every other field type looks is in the [Field types reference](https://tadabase.com/docs/developers/field-types-reference).

The response headers carry your remaining rate limit: `X-RateLimit-Remaining` for this minute and `X-RateLimit-Daily-Remaining` for today. See [Rate limiting](https://tadabase.com/docs/developers/rate-limiting).

## If it fails

A refused call returns `"type": "error"` with a `msg` that says why. The most common first-call errors:

- 401 "The credentials supplied are missing or invalid.": a header is missing or empty.
- 403 "The API was not found.": the key or secret is wrong.
- 412 "The method being used is disabled for this API key.": turn on **Allow Reads** for the key.

The full list is in [Create and manage API keys](https://tadabase.com/docs/developers/getting-api-keys#when-a-key-is-refused) and [Error handling](https://tadabase.com/docs/developers/error-handling).

## Next steps

- Find only some records: [Filtering records](https://tadabase.com/docs/developers/filtering-records).
- Sort and page through results: [Sorting and pagination](https://tadabase.com/docs/developers/sorting-and-pagination).
- Create, update and delete records: [Working with records](https://tadabase.com/docs/developers/working-with-records).
- Act as one of the app's users: [Sign in app users through the API](https://tadabase.com/docs/developers/authentication-methods).
