Developers
Read and update brand memory
Ground automation in a brand's identity and voice, update facts with optimistic locking, import owned post history, and start a brand genome.
Updated
Read what Krevaya knows before drafting
GET /v1/brand-memory?brand_id=… requires read and returns doc, version, confidence, gaps, updated_at, and brand_id. The document describes identity, audience, positioning, voice rules, preferred lengths, banned words, content pillars, and model-after accounts. Facts carry their source and confidence; an inferred preference is different from something the user explicitly stated.
curl --fail-with-body --get https://api.krevaya.com/v1/brand-memory \
-H "Authorization: Bearer $KREVAYA_API_KEY" \
--data-urlencode "brand_id=$KREVAYA_BRAND_ID"Change only facts the user supplied
PATCH /v1/brand-memory requires generate. Send the version you just read as expected_version and up to 40 operations. An API edit is recorded as the user's own word and locks the fact against later inferred changes. Do not use it to store an assistant's guess about the business.
{
"brand_id": "YOUR_BRAND_ID",
"expected_version": 1,
"ops": [
{"op": "set", "path": "identity.what", "value": "A neighborhood bicycle repair workshop"},
{"op": "append", "path": "voice.banned_words", "value": "revolutionary"}
]
}Replace version 1 with the current version. set replaces a value; append adds a list fact; remove removes a list item identified by fact_id; unset clears a path. Supported paths include identity.what, audience.pains, voice.rules, voice.banned_words, pillars, and voice.length_bands.instagram. Unknown paths are refused.
A version mismatch returns 409 with detail: stale. Re-read the memory, compare the intervening changes, and reapply the user's intended operation. The successful response includes refused, so inspect it rather than assuming every submitted operation was accepted.
Learn from your own published posts
POST /v1/brand-memory/import accepts optional brand_id and platforms. It returns 202 with job_id and status. MCP import_history provides the same workflow. Supported history sources include Instagram, Facebook, Threads, and Bluesky. The import uses the account's own connected publishing history, not another account's private posts.
History import makes no AI call and imported posts do not consume the monthly post allowance. Re-importing the same external post deduplicates it. Poll job_status with a read-scoped key, then re-read brand memory and inspect any changes.
Start a brand genome
POST /v1/brand-memory/genome accepts optional brand_id, url, and run. It starts website and voice research and returns 202 with a job_id and a five-credit charge indicator. A non-public URL is rejected before a job is created. run can select web, voice, and competitors; omitting it runs all three components.
Select the brand deliberately and review what the research learned afterward. An extracted claim from a website is source material, not evidence that a user approved every phrasing or inference.
Frequently asked questions
Why do brand memory updates need expected_version?
A learner or another editor may update memory between your read and write. expected_version prevents your older document from overwriting those changes.
Can an agent save an inferred voice preference as a user fact?
It should not. API edits are recorded as user-stated and locked, so the agent should write only what the user actually supplied or approved.