Skip to main content
POST
/
v2
/
memory
/
knowledge
/
update
Update Knowledge
curl --request POST \
  --url https://api.velt.dev/v2/memory/knowledge/update \
  --header 'Content-Type: application/json' \
  --header 'x-velt-api-key: <x-velt-api-key>' \
  --header 'x-velt-auth-token: <x-velt-auth-token>' \
  --data '
{
  "data": {
    "sourceId": "<string>",
    "newContent": "<string>"
  }
}
'
{
  "result": {
    "diff": {
      "added": ["..."],
      "removed": ["..."],
      "unchanged": 12
    },
    "newVersion": 2
  }
}
Use this API to replace a knowledge source’s content. The pipeline re-runs (conversion, rule extraction, embedding) and the source’s version is bumped.

Endpoint

POST https://api.velt.dev/v2/memory/knowledge/update

Headers

x-velt-api-key
string
required
Your API key.
x-velt-auth-token
string
required

Body

Params

data
object
required

Example Requests

Replace a source’s content

{
  "data": {
    "sourceId": "src_9a8...",
    "newContent": "# Brand Guidelines v2\n\n- Always cite medical claims..."
  }
}

Response

The response reports a diff of extracted rules (added, removed, unchanged) and the new version number.

Success Response

{
  "result": {
    "diff": {
      "added": ["..."],
      "removed": ["..."],
      "unchanged": 12
    },
    "newVersion": 2
  }
}

Failure Response

{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
{
  "result": {
    "diff": {
      "added": ["..."],
      "removed": ["..."],
      "unchanged": 12
    },
    "newVersion": 2
  }
}