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

# Send knowledge updates

> Send release notes, price changes and product changes from your systems to Caretta’s Brain.

Use the knowledge updates API to send facts from your systems to Caretta. Examples are release notes, price changes and product changes. Caretta learns each update as organisation knowledge and uses it in calls and chat.

When an update contradicts a fact that Caretta already knows, Caretta replaces that fact if the `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`.

> [!NOTE]
>
> **Base URL:** `https://gateway.caretta.app`

## Quickstart

**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 with `ck_live_`. Each key belongs to one organisation, and every request with that key acts on that organisation.

> [!WARNING]
>
> Do not put a key in source code, logs or URLs. A person who has the key can send, list and retract updates for your 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 the `Authorization` header of every request:

```text theme={"system"}
Authorization: Bearer ck_live_...
```

For a missing, unknown or revoked key, Caretta returns `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.

| Field | Type | Required | Rules |
| - | - | - | - |
| `id` | string | Yes | Your id for this update. 1 to 200 characters. No `/`, no control characters, and no space at the start or end. It must be unique in your organisation. |
| `text` | string | Yes | The facts, in plain sentences. At most 1,000,000 characters. It must not be empty. No NUL character (`\u0000`) and no unpaired UTF-16 surrogate. |
| `title` | string | No | A short title. No NUL character and no unpaired UTF-16 surrogate. Caretta removes other control characters. If you do not send a title, Caretta uses the first line of `text`. |
| `published_at` | string | No | The date of the facts, in ISO 8601 with a time zone, for example `2026-10-29T09:30:00Z`. At most 5 minutes in the future. If you do not send it, Caretta uses the time that it gets the first request with this `id`. |
| `url` | string | No | An `https://` link to the source page. At most 2,048 characters. No user name or password in the link. |

```bash theme={"system"}
curl -sS -X POST "https://gateway.caretta.app/v1/knowledge/updates" \
  -H "Authorization: Bearer $CARETTA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "release-2026-10-29",
    "title": "H3 GPUs retired",
    "text": "From 1 November 2026, H3 GPUs are no longer available. Use H4 GPUs instead.",
    "published_at": "2026-10-29T09:30:00Z",
    "url": "https://example.com/changelog/2026-10-29"
  }'
```

For a new update, Caretta returns `201 Created`:

```json theme={"system"}
{
  "id": "6f1c2a8e-3b4d-4e5f-9a0b-1c2d3e4f5a6b",
  "external_id": "release-2026-10-29",
  "title": "H3 GPUs retired",
  "published_at": "2026-10-29T09:30:00.000Z",
  "status": "learning",
  "source": "webhook",
  "url": "https://example.com/changelog/2026-10-29",
  "created_at": "2026-10-29T09:30:02.114Z"
}
```

* `id` is the Caretta id of the update. `external_id` is the `id` that you sent.
* `published_at` is always in UTC.
* `status` is `learning`, `learned` or `failed`. `failed` means that Caretta could not learn the update. Send the facts again as a new update with a new `id`. If it fails again, contact [Support](https://www.caretta.so/docs/support.md).

### Retries are safe

If a request fails on the network, send the same body again. If the `id`, `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`:

```json theme={"system"}
{
  "error": "duplicate_id",
  "id": "6f1c2a8e-3b4d-4e5f-9a0b-1c2d3e4f5a6b",
  "external_id": "release-2026-10-29",
  "message": "An update with this id exists. Updates are append only: send a correction as a new update with a new id."
}
```

### Send a correction

You cannot edit an update. To correct it, send a new update with a new `id` and a newer `published_at`:

```bash theme={"system"}
curl -sS -X POST "https://gateway.caretta.app/v1/knowledge/updates" \
  -H "Authorization: Bearer $CARETTA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "release-2026-10-29-fix-1",
    "text": "Correction: H3 GPUs stay available until 1 December 2026.",
    "published_at": "2026-10-30T08:00:00Z"
  }'
```

## 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.

```bash theme={"system"}
curl -sS -X DELETE "https://gateway.caretta.app/v1/knowledge/updates/release-2026-10-29" \
  -H "Authorization: Bearer $CARETTA_KEY"
```

Caretta returns `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](https://www.caretta.so/docs/caretta-mcp.md) (`"source": "mcp"`).

| Query | Rules |
| - | - |
| `limit` | 1 to 200. The default is 50. |
| `cursor` | The `next_cursor` value from the previous page. Leave it out for the first page. |

```bash theme={"system"}
curl -sS "https://gateway.caretta.app/v1/knowledge/updates?limit=2" \
  -H "Authorization: Bearer $CARETTA_KEY"
```

```json theme={"system"}
{
  "updates": [
    {
      "id": "...",
      "external_id": "release-2026-10-29-fix-1",
      "title": "Correction: H3 GPUs stay available until 1 December 2026.",
      "published_at": "2026-10-30T08:00:00.000Z",
      "status": "learned",
      "source": "webhook",
      "url": null,
      "created_at": "2026-10-30T08:00:01.520Z"
    },
    {
      "id": "...",
      "external_id": "release-2026-10-29",
      "title": "H3 GPUs retired",
      "published_at": "2026-10-29T09:30:00.000Z",
      "status": "learned",
      "source": "webhook",
      "url": "https://example.com/changelog/2026-10-29",
      "created_at": "2026-10-29T09:30:02.114Z"
    }
  ],
  "next_cursor": "WyIyMDI2LTEwLTI5VDA5OjMwOjAyLjExNDAwMFoiLCIuLi4iXQ"
}
```

When `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 Requests` with a `Retry-After` header 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 `text` field is at most 1,000,000 characters.

## Errors

Each error has a JSON body with `error` (a fixed code) and `message` (text for people). Use `error` in your code, because the `message` text can change.

| Status | `error` | Cause |
| - | - | - |
| 400 | `invalid_request` | The body is not valid JSON. |
| 400 | `invalid_request` | A field has the wrong type. |
| 400 | `invalid_request` | `text` is empty. |
| 400 | `invalid_request` | `text` or `title` has a NUL character or an unpaired UTF-16 surrogate. |
| 400 | `invalid_request` | `limit` is out of range. |
| 400 | `invalid_id` | `id` is missing or breaks the `id` rules. |
| 400 | `invalid_published_at` | `published_at` is not ISO 8601 with a time zone. |
| 400 | `published_at_in_future` | `published_at` is more than 5 minutes in the future. |
| 400 | `invalid_url` | `url` is not an `https://` link, or it has a user name or password. |
| 400 | `invalid_cursor` | `cursor` is not a value from a previous page. |
| 401 | `unauthorized` | The key is missing, unknown or revoked. |
| 404 | `not_found` | No update has this `id` (`DELETE`). |
| 409 | `duplicate_id` | A different update already uses this `id`. |
| 413 | `body_too_large` | The request body is larger than 4 MiB. |
| 413 | `text_too_large` | `text` is longer than 1,000,000 characters. |
| 429 | `rate_limited` | The key sent more than 120 requests in one minute. |
| 500 | `internal_error` | A Caretta error. Send the request again later. Retries are safe. |

## What to send

Send facts about your products, prices and policies that your team must know in calls.

> [!WARNING]
>
> Do not send secrets, passwords or personal data. Caretta can use the facts that it learns in answers for every member of your organisation.

## Get help

If you need help, see [Support](https://www.caretta.so/docs/support.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.