---
title: "Edit agent notes"
method: POST
path: "/websiteKnowledge/agentNotes/edit"
tags: ["Project Context"]
---

# Edit agent notes

`POST /websiteKnowledge/agentNotes/edit`

## Request

- Base URL: `https://api.cactal.ai/v1`
- URL: `https://api.cactal.ai/v1/websiteKnowledge/agentNotes/edit`
- Auth: HTTP bearer

Applies exact-match text edits to the agent notes, in order; an empty `oldStr` appends. Record only durable facts, decisions, rejected directions, and constraints, one short line each, never progress logs or anything derivable from the website source. A passage that no longer matches fails with `validation` and returns the current notes.

## Request body

- object
  - `websiteId` string, required
  - `edits` object[], required: Edits applied in order against the evolving text.
    - `oldStr` string, required: Exact text to find. Must match exactly once unless `replaceAll` is `true`. Empty appends `newStr` to the end.
    - `newStr` string, required: Replacement text.
    - `replaceAll` boolean: Replace every occurrence instead of requiring a unique match.

## Response `200`

The full updated project knowledge and agent notes.

- object
  - `content` string, required
  - `updatedAt` string, date-time, nullable, required
  - `agentNotes` string, required
  - `agentNotesUpdatedAt` string, date-time, nullable, required

## Other responses

- `400`: Validation failed. The response `message` names the first invalid field.
- `401`: Missing, invalid, expired, or revoked API key.
- `403`: The authenticated principal lacks the required capability.
- `404`: The resource does not exist or is outside the principal’s access scope.
- `429`: Rate limit exceeded. Retry after the number of seconds in the `Retry-After` header.

---

[API](https://skmtc.dev/cactal/apis/cactal-api.md) · [All operations](https://skmtc.dev/cactal/apis/cactal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cactal/apis/cactal-api/revisions/9cd0fb5eacdd?raw)
