# Recalculate equations through the API

> Queue a recalculation of a table's equations, or of one equation field, through the REST API, and choose how equations run when you save records.

Source: https://tadabase.com/docs/developers/formulas-and-equations  
Status: Verified Nov 17, 2026. Checked against the current product

Equation fields normally recalculate when a record is saved. When values change without that, for example after a batch update or a load that skipped equations, ask the API to recalculate a whole table or one field.

## The recalculation endpoints

The API key needs **Allow Formula Runs**; without it the call answers HTTP 412.

| Method and path | Recalculates |
| --- | --- |
| `POST /update-all-formula/{tableId}` | Every equation field in the table |
| `POST /update-all-formula` | Every equation field in every table of the app |
| `POST /update-field-formula-by-slug/{fieldSlug}` | One field, by its slug (such as `field_45`) |
| `POST /update-field-formula-by-id/{fieldId}` | One field, by its field ID |

`/update-formulas` and `/update-formulas/{tableId}` are older names for the first two and work the same way.

```bash
curl -X POST "https://api.tadabase.io/api/v1/update-all-formula/{tableId}" \
  -H "X-Tadabase-App-id: YOUR_APP_ID" \
  -H "X-Tadabase-App-Key: YOUR_API_KEY" \
  -H "X-Tadabase-App-Secret: YOUR_API_SECRET"
```

```js
const BASE = 'https://api.tadabase.io/api/v1';
const headers = {
  'X-Tadabase-App-id': 'YOUR_APP_ID',
  'X-Tadabase-App-Key': 'YOUR_API_KEY',
  'X-Tadabase-App-Secret': 'YOUR_API_SECRET',
};

const res = await fetch(`${BASE}/update-field-formula-by-slug/field_45`, { method: 'POST', headers });
const { type } = await res.json(); // "success" once the recalculation is queued
```

Each call answers `{"type":"success"}` as soon as the recalculation is queued. The values update in the background, so read the records again a little later rather than right away.

## Force a field to recalculate

Add `/force` to the path of a one-field call, such as `POST /update-field-formula-by-slug/field_45/force`. A forced run uses the field's full original calculation and runs even when the field is set to be skipped.

## When to use it

- After a [batch update](https://tadabase.com/docs/developers/batch-operations), which does not recalculate equations.
- After saving many records with `X-Tadabase-Update-Equation: 0`: load the records, then recalculate the table once.
- After you change how an equation is calculated and want existing records to show the new result.

> **Note:** On an app that still runs the older equation engine, these calls answer success without recalculating anything. Contact support if your equations do not update after a call.

## Choose how equations run when you save a record

A create or update through the API recalculates the record's equations before it answers. These headers on the save request change that:

| Header | Effect |
| --- | --- |
| `X-Tadabase-Update-Equation: 0` | Saves without recalculating equations. Recalculate later with the endpoints above. |
| `X-Tadabase-Table-Rules: 0` | Only with `X-Tadabase-Update-Equation: 0`: also skips the table's legacy rules. |
| `X-Tadabase-Queue-Equation: 1` | Answers once the record is saved and recalculates its equations in the background. |
| `X-Tadabase-Update-Table-Equation: 1` | Also recalculates every record's equations in the table, in the background. |

See [Create, read, update and delete records](https://tadabase.com/docs/developers/working-with-records) for the save requests these headers go on.
