Skip to content
AdCrunch
Esc
↑↓navigate↵open⌘Jpreview

Update a Persona

Updates a Persona. Send the base_revision you read. Omit a section or an age bound to keep it. Send null to clear it. AdCrunch checks the age range on the result of the merge. Therefore a call that sends only age_min can still fail, if the result is inverted. The slug changes only when you send a slug: a new name alone never moves the handle. The answer is 409 with error=revision_mismatch if the Persona changed after you read it. It is 409 with error=slug_conflict if another Persona of this Brand already holds the slug you send.

PATCH/context/brands/{slug}/personas/{personaSlug}
Authorization
AuthorizationBearer token · headerrequired

Send Authorization: Bearer <credential>.

Use an API key (acr_…), from the AdCrunch console under Settings → API keys.

The credential names the organization, and no operation takes an organization parameter.

See https://docs.adcrunch.dev/api/authentication.

Path parameters
personaSlugstringrequired
slugstringrequired
Request body
requiredapplication/json
age_maxinteger | null

Upper age bound; null clears it ("and older").

min 0 · max 120
age_mininteger | null

Lower age bound; null clears it ("and younger").

min 0 · max 120
base_revisionintegerrequired

The revision last read via GET — guards concurrent edits.

min -9007199254740991 · max 9007199254740991
descriptionstring
min length 1 · max length 500
frictionsstring | null

Objections and barriers; null clears it.

min length 1
languagestring | null

The audience's own words — not a locale; null clears it.

min length 1
motivationsstring | null

Jobs, triggers, outcomes; null clears it.

min length 1
namestring
min length 1 · max length 120
profilestring | null

Who they are; null clears it.

min length 1
slugstring

Optional new slug handle (a deliberate rename).

max length 120
Responses
200

The Persona as it now stands, at the next revision. Send that one back on your next edit.

ageMaxnumber | nullrequired
ageMinnumber | nullrequired

Each bound is independently optional, so "35+" is expressible.

brandIdstringrequired
createdAtnumberrequired

Milliseconds since the Unix epoch, UTC.

createdBystringrequired
descriptionstringrequired
frictionsstring | nullrequired

Objections, doubts, what stops them.

idstringrequired
languagestring | nullrequired

The words they use for the problem, in their own register. Not a locale, despite the name.

motivationsstring | nullrequired

What they want, and what triggers them.

namestringrequired
profilestring | nullrequired

Who they are, and their situation.

revisionnumberrequired

Increments on every write. Send it back as base_revision to edit; a stale one answers 409.

slugstringrequired
updatedAtnumber | nullrequired

Milliseconds since the Unix epoch, UTC.

400

The request does not match the schema of this operation: a field is missing or has the wrong type, or the body is not valid JSON. error is invalid_request, and issues names each field. Nothing was changed.

issuesobject[]required

One entry for each field that does not match.

Show properties
Array of object
instringrequired

The part of the request that holds the field.

Allowed:bodycookieheadersparamsquery
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

pathstringrequired

A JSON Pointer into that part of the request, such as /filename. An empty string is the whole part.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:invalid_request
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

401

No API key, or one that does not resolve. See the security scheme. error is unauthorized.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:unauthorized
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

403

The caller does not hold brand:write. error is forbidden.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:forbidden
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

404

No such Brand, or no Persona with that slug inside it. error is not_found.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

409

error tells the two conflicts apart: revision_mismatch and slug_conflict.

Any of:
object
currentRevisionnumberrequired

The revision the row holds now. Re-read, re-apply your edit on top, and send this back as base_revision.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:revision_mismatch
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

object
slugstringrequired

The slug that is already taken.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:slug_conflict
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

422

invalid_slug, or invalid_age_range. The age range is checked against the merged result, so sending only age_min can still be rejected as inverted.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

Request
curl -X PATCH "https://api.pr-701.adcrunch.dev/context/brands/string/personas/string" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "base_revision": 2,
  "frictions": "They fear the new model is worse than the one they know. A change of sole or of last reads to them as a risk, not as progress.",
  "language": "They say \"my daily trainer\" and \"I got 900 out of the last pair\". They ask about the drop and the stack, never about the technology."
}'
Response
{
  "ageMax": 45,
  "ageMin": 28,
  "brandId": "brd_6a9c33",
  "createdAt": 1790000000000,
  "createdBy": "usr_4d8b12",
  "description": "Runners who already own a pair, and who buy the next one without looking at another brand.",
  "frictions": "They fear the new model is worse than the one they know. A change of sole or of last reads to them as a risk, not as progress.",
  "id": "psn_8c4a20",
  "language": "They say \"my daily trainer\" and \"I got 900 out of the last pair\". They ask about the drop and the stack, never about the technology.",
  "motivations": "They want the same shoe again, and proof that it is the same. A resole keeps them running on a pair they trust.",
  "name": "Loyalists",
  "profile": "Runners of 40 to 80 kilometres a week, ten years in, with one pair in rotation and one on the shelf.",
  "revision": 3,
  "slug": "loyalists",
  "updatedAt": 1790086400000
}