30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Update Declared Cookie

consent/update-cookie changes a declared cookie: its name, its category, its description, its duration, the domain.

Only the fields you send are touched — and, within a field, only the languages you send.

At a glance

Abilityconsent/update-cookie
ToolsetCookieYes — toolset/cookieyes
GroupCookieYes › Declared Cookies
RequiresCookieYes, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Abilities Manager 0.0.34 and later

Per-language, per-field

Descriptions and durations are stored per language. Sending a map keyed by language code updates exactly those languages and leaves the rest as they were, which is what you want when you are correcting one translation.

Sending a plain string is the other behaviour: it applies to every language at once. Both are useful and they are very different, so the shape of what you send is the instruction.

The banner a visitor receives is not assembled on the fly. It is cached HTML, built from the declared cookies, the consent categories and the settings, and rebuilt only when the consent plugin’s own save hooks fire. Write the consent tables any other way — through the database abilities, through another plugin — and the row reads back correctly while every visitor still sees the previous banner, with no error anywhere to say so.

After the write the banner is refreshed and the result is checked against what the banner now holds. The response carries that check, rather than reporting success on the strength of the row having been written.

Moving a cookie between categories is a category change, not a text change, and it takes effect for every visitor on the next banner — including those who already consented under the old arrangement.

Input

NameTypeRequiredWhat it is
idintegerYesCookie ID, from consent/list-cookies.
namestringNoNew cookie name.
category_idintegerNoMove it to this consent category.
descriptionstring | objectNoA plain string is applied to every language. A map keyed by language code sets them individually, and languages you leave out keep the text they already had.
durationstring | objectNoA plain string is applied to every language. A map keyed by language code sets them individually, and languages you leave out keep the text they already had.
domainstringNoThe domain that sets it.
typeintegerNoThe consent plugin’s own numeric cookie type.
url_patternstringNoRestrict to pages matching this pattern.

What comes back

NameTypeWhat it is
cookieobjectThe cookie after the write.
banner_refreshedbooleanWhether the cached banner was rebuilt after the write. This is the field that says the change actually reached visitors.
languagesarrayThe languages the banner is built for.
renderedobjectThe size of the built banner, per language.
pending_rebuildbooleanWhether the banner is still waiting to be rebuilt. True after a write means the change is stored but not yet being served.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Fix the German description for cookie 41.

It resolves to one call:

{
  "ability": "consent/update-cookie",
  "parameters": {
    "id": 41,
    "description": {
      "de": "Unterscheidet Besucher, damit wir sie zählen können, ohne sie zu identifizieren."
    }
  }
}

Worth knowing

  • A string overwrites every language. A map touches only the languages in it.
  • Read the cookie first when you are editing one language — the admin shows one at a time and the gaps are easy to miss.
  • Check banner_refreshed. Stored is not the same as served.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading