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 operation, which can also set the text field, after your confirmation. Owners and admins rename, describe or delete a source from its page’s menu: Edit API source, Delete API source.

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 replayed, the fields it added (new_fields), the source’s capacity, any warning, and next, a note that pieces reach the table at its next sync. One bad piece refuses the whole send, and none of it is stored. A source whose sync fails for good is paused and refuses sends until an owner or admin selects Resume on its page.

Read an API source

Pieces reach the source’s table at its next sync, about a minute after they arrive, on every plan. Each sync rewrites the whole table, so syncs are at least a minute plus 10 minutes per million rows apart: a source of 2,000,000 rows syncs at most every 21 minutes. 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.

Recall pieces

A source with a text field can be read back through the Helix MCP: helix_foundry_recall returns its pieces as Markdown notes, newest first or those holding some words, from the moment they are sent. Any member of the workspace can recall while signed in, unless source grants restrict them. Send tokens can only send. See Agent memory.

How ontologies read it

On New ontology and in Generate, API sources lists your API sources. Each can be chosen once its first pieces have synced. 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, or null, in every piece. Its newest 500 pieces become Markdown documents in a set of the source’s own, which loads read like any document.
A generation reads at most 50 tables and 20 document sets. A source read through structured mappings counts as one of the tables, and one read by entity extraction as one of the sets. Owners and admins choose the text field, here or in Documents on the source’s page. Saving asks you to confirm and queues one full sync, and the field can’t be changed while a sync of the source is running. Clearing it removes the source’s pieces as documents at its next sync.
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, at most once per the plan’s interval. Founder answers from the current load, so it sees new pieces once a refresh has written them.

Limits

Next steps

Helix MCP

Connect your agent to Foundry.

Generate an ontology

Draft an ontology from your API sources.