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

# Extend tables

> Key → record lookup tables for enriching events inside a pipeline, with no query cost.

An **extend table** is a small key → record lookup table maintained in MoleSignal and joined against
from a [pipeline](/en-US/pipelines) transform. Use one to enrich events with reference data — map a
`service` to the owning team, an account ID to a plan tier, an IP range to a region — without calling
out to an external store on the hot path.

## Create a table and add rows

Open **Extend tables** and create a table. Each row is a **key** plus a record of named fields.
The API also supports extend-table management:

```bash theme={null}
# upsert a row keyed by "checkout"
curl -X PUT http://localhost:5080/api/v1/extend_tables/service_meta/rows/checkout \
  -H "authorization: Bearer $MS_JWT" \
  -H 'content-type: application/json' \
  -d '{"team":"payments","tier":"gold"}'
```

| Action              | Endpoint                                          |
| ------------------- | ------------------------------------------------- |
| List tables         | `GET /api/v1/extend_tables`                       |
| List a table's rows | `GET /api/v1/extend_tables/{table}`               |
| Upsert a row        | `PUT /api/v1/extend_tables/{table}/rows/{key}`    |
| Delete a row        | `DELETE /api/v1/extend_tables/{table}/rows/{key}` |

## Perform a lookup from a transform

Inside a [VRL transform](/en-US/functions), call `lookup(table, key)` and read a
field off the returned record:

```ruby theme={null}
# enrich each event with the service's owning team
.team = lookup("service_meta", .service).team
```

Lookups run **in memory** and add no query or storage cost to a pipeline run. The table loads on
startup and stays current as rows are upserted or deleted.

<Tip>
  Extend tables are scoped to the active organization and shared across all pipelines — define a mapping
  once for reuse across all pipelines.
</Tip>

`functions.read` lists tables and usage. Creating a table requires `functions.create`; row changes
require `functions.edit`; deleting a table requires `functions.delete`.

<Card title="Pipelines" icon="diagram-project" href="/en-US/pipelines">
  Build the transform chain that calls the extend tables.
</Card>
