Skip to main content
Guide
An API source takes data that no connector reads: your app’s records, or what an agent produces. Your apps and agents send it pieces of data, JSON objects each with an id, over HTTP or the Helix MCP. Foundry keeps every piece, merges them by id into one table, events, and learns its fields from what arrives. Ontologies read that table through mappings, or read each piece’s text by entity extraction. API sources are on every plan.

Create an API source

1

Choose API source

In Connectors, select Add data, then API source under From your app or agent.
2

Name and describe it

Give it a name, such as “Order lines”, and say what each piece is. Foundry’s agent reads the description when it drafts an ontology from the source.
The API source form with the name Order lines and a description of what each piece is
3

Make a send token

Select Create API source, then Create a send token for an app or agent that sends on its own. Copy it at once, and put it in the sender’s environment as HELIX_EVENT_TOKEN.
Order lines is ready: a new send token to copy, the send tokens list, Copy prompt for the agent, and Send over HTTP with its curl command and pieces.json
An agent can create one too, with the MCP’s create_event_source action, after your confirmation.

Send tokens

A send token, hx_ev_…, lets whoever holds it add pieces to one source and replace any piece in it by its id; it reads nothing. Foundry shows it once and keeps only its hash. The source’s Send tokens list names each by its prefix, with when it was made and last used. Revoke turns a token off for good: senders using it are refused from then on, so make a new one for them. A source holds up to 10 live tokens. Give each app or agent that sends on its own a source of its own. Owners and admins make and revoke tokens. They can also send as themselves through the signed-in Helix MCP, without a token.

Send pieces

The source’s Send pieces panel has what a sender needs. Copy prompt copies instructions for Claude Code, Codex or another agent: how to connect, how to send and what each answer means.
POST https://ingest.helix-db.com/v1/sources/{id}/pieces, with the send token as its bearer, from a server: never from a browser or an app on someone else’s device, which would hand them the token. The panel’s curl reads the token from HELIX_EVENT_TOKEN and sends pieces.json:
pieces.json
The body is JSON in UTF-8, uncompressed, and client_token is required.

What a piece is

A field keeps the JSON type it first had: string, number, boolean, object or array, and null is always allowed. A send that changes a field’s type is refused and names both types. client_token is a new random value, such as a UUID, for each send: 16 to 64 printable ASCII characters. To retry a send, send it again with the same token and the same pieces; Foundry stores nothing new and answers replayed: true.

Answers

A send that is stored answers 200, with the source’s capacity, any warning and when its next sync is due (next). One bad piece refuses the whole send, and none of it is stored.

Read an API source

Pieces reach the source’s table at its next sync, about a minute after they arrive, on every plan. The source’s page lists its recent sends, its fields with the type each first had, its table and its documents, and how full it is.
The Order lines API source: its recent sends, its details with capacity, and its fields order_id, customer, product, quantity, unit_price and currency
A source holds at most 2,000,000 rows or 2 GiB. Its page and each answer warn from 80%; once it is full, sends are refused, so send new pieces to a new source before then. Foundry keeps every piece until you delete the source.

How ontologies read it

On New ontology and in Generate, API sources lists the sources that have synced pieces. Choose one, and how it is read:
  • Structured mappings suit strictly structured JSON: ids, amounts, statuses, times. Its fields map to types and properties, as a synced table’s columns do, and every piece is kept.
  • Entity extraction suits pieces whose body is text, such as an agent’s reply or a note: Foundry’s agent reads the text and finds the entities and facts it describes. Choose the source’s text field, the top-level field holding each piece’s text, which must stay a string in every piece. Its newest 500 pieces become Markdown documents in a set of the source’s own, which loads read like any document.
Generate's API sources section with Order lines chosen and read through Structured mappings
Extraction suits a few hundred pieces a month, not a steady stream. It costs about 1 cent a piece for each ontology that reads it. Extraction no person started, as pieces arrive and at refreshes, spends at most $5 a month per source and $20 a month across the workspace’s sources; past that, new pieces wait for next month. A load you start spends the loads’ budget instead. When new pieces sync, ontologies that read the source refresh by themselves.

Limits

Next steps

Helix MCP

Connect your agent to Foundry.

Generate an ontology

Draft an ontology from your API sources.