POST
Teach the assistant a source

Authorizations

Authorization
string
header
required

A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.

Headers

Idempotency-Key
string
required

A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.

Body

application/json

ONE ROUTE FOR BOTH KINDS, where the dashboard has two. The bodies were always identical and only the ingest pipeline differed. THE TEXT IS NOT STORED. It is embedded into chunks the assistant answers from, and the row that comes back keeps a title and a chunk count. There is no text property on the resource and no way to read it back, so keep your own copy. THE EMBED RUNS BEFORE THE ROW LANDS, which is why chunk_count in the 201 is the real number rather than a promise. A store whose AI stack is not enabled answers 503 agent_disabled; that is not your fault and a retry after the merchant enables it succeeds.

kind
enum<string>
required

faq is chunked as question and answer pairs, doc as prose under its title. REQUIRED WITH NO DEFAULT: guessing would chunk a policy document as question and answer pairs, and the merchant would find out months later from the answers the assistant gives.

Available options:
faq,
doc
title
string
required

How the merchant will recognise this source. At most 200 characters.

text
string
required

The source material, at most 100000 characters. Ingest input rather than a stored field.

Response

Created

data
object