---
title: Read and write data from a script
project: Tables
version: 7.0
section: recipes
language: de
translation: missing
license: Total.js Enterprise
url: https://totaljs.es/docs/de/tables/7-0/recipes/read-data-from-a-script/
updated: 2026-11-20T06:39:57.622Z
---

# Read and write data from a script

> Use an API token to list, find and create records from a shell script or another application.

This recipe uses the [API](../../reference/api/) with `curl`. The same requests work from any language.

## 1. Create a token

Create an [API token](../../guides/api-tokens/) named after your script, and copy it. In the examples, it is in the variable `TOKEN`, and the table IDs are those of your own tables:

```bash
TOKEN='paste-your-token-here'
URL='https://tables.yourdomain.com/api/'
```

## 2. List customers from Spain

```bash
curl -s -X POST "$URL" -H "x-token: $TOKEN" -H 'content-type: application/json' \
	-d '{ "schema": "Data|list?x03=es&sort=name_asc", "data": { "tableid": "t588bi" } }'
```

## 3. Find a record by a value

```bash
curl -s -X POST "$URL" -H "x-token: $TOKEN" -H 'content-type: application/json' \
	-d '{ "schema": "Data|id", "data": { "tableid": "t4193w", "filter": { "x01": "CH-100" } } }'
```

## 4. Create a record

```bash
curl -s -X POST "$URL" -H "x-token: $TOKEN" -H 'content-type: application/json' \
	-d '{ "schema": "Data|save", "data": { "tableid": "t588bi", "data": { "name": "Example Ltd", "x01": "hello@example.com" } } }'
```

The answer has the ID of the new record in `value`.

## 5. Update it

Send the ID in `data.data.id` and only the columns to change:

```bash
curl -s -X POST "$URL" -H "x-token: $TOKEN" -H 'content-type: application/json' \
	-d '{ "schema": "Data|save", "data": { "tableid": "t588bi", "data": { "id": "RECORD_ID", "x04": false } } }'
```
