published_at of the update is later than the date of each source of the fact. The date of a file or a taught text is the time that it was added to Caretta.
You cannot edit an update. You can only send a new update or retract an old one. To correct an update, send a new update with a new id and a newer published_at. To retract an update, send DELETE.
Base URL:
https://gateway.caretta.appQuickstart
1
Create a key
As an organisation administrator, open Brain → Update feeds in Caretta. Select Create key. Give the key a name, for example “Release notes feed”.
2
Save the key
When Caretta shows the key, copy it. Caretta shows the key one time only. Keep it in a secrets manager.
3
Send an update
Send
POST /v1/knowledge/updates with the key in the Authorization header.4
Check the status
Send
GET /v1/knowledge/updates. Find your update in the list. Its status starts as learning and changes to learned or to failed.Keys
A key starts withck_live_. Each key belongs to one organisation, and every request with that key acts on that organisation.
An administrator can revoke a key at any time in Brain → Update feeds. Caretta rejects a revoked key at once, with 401 Unauthorized.
Authentication
Send the key in theAuthorization header of every request:
401 Unauthorized with the header WWW-Authenticate: Bearer realm="caretta".
Send an update
POST /v1/knowledge/updates
The body is JSON, at most 4 MiB.
201 Created:
idis the Caretta id of the update.external_idis theidthat you sent.published_atis always in UTC.statusislearning,learnedorfailed.failedmeans that Caretta could not learn the update. Send the facts again as a new update with a newid. If it fails again, contact Support.
Retries are safe
If a request fails on the network, send the same body again. If theid, text and published_at are the same as a stored update, Caretta returns 200 OK with the stored update. Caretta does not store the update two times. If the retry has no published_at, Caretta compares only the id and the text.
If a different update already uses the id, Caretta returns 409 Conflict:
Send a correction
You cannot edit an update. To correct it, send a new update with a newid and a newer published_at:
Retract an update
DELETE /v1/knowledge/updates/{id}
Use the id that you sent, encoded for a URL path (for example, a space is %20). Caretta removes the update and the facts that it learned from the update.
204 No Content. If no update has this id, Caretta returns 404 Not Found.
List your updates
GET /v1/knowledge/updates?limit=50&cursor=...
This request lists the updates of your organisation by the time that Caretta got each one (created_at), newest first. The list also includes updates that AI agents sent through the Caretta MCP ("source": "mcp").
next_cursor is null, there are no more pages.
Limits
- You can send 120 requests each minute with each key. Above this limit, Caretta returns
429 Too Many Requestswith aRetry-Afterheader that gives the wait time in seconds. Wait for that number of seconds. Then send the request again. - The request body is at most 4 MiB. The
textfield is at most 1,000,000 characters.
Errors
Each error has a JSON body witherror (a fixed code) and message (text for people). Use error in your code, because the message text can change.