Aller au contenu

set_variant

Upsert ONE variant override for (key, language, surface) for ANY surface active on the project (task 928) - device (desktop / mobile / tablet / custom like watch / tv) OR a11y (aria_label / alt_text / screen_reader / plain_language). Address by key_uuid + locale CODE + surface slug (the fields get_variants / list_keys already give you). Stored as a draft. 422 unless the surface is OFFERED for this key - an active device surface (see list_surfaces) OR an a11y treatment relevant to the key's TYPE (e.g. no aria_label on a text key; see get_variants for the key's offered surfaces); 409 if the cell is already reviewed/approved (never overwritten). Returns {key_uuid, surface, language_code, value, status}. (For a11y specifically you can also use set_a11y_variant.)

NomTypeDescription
project_uuidstringoptionnelProject UUID. Required when multiple projects are configured (SONENTA_PROJECTS); defaults to the single configured project otherwise.
key_uuidstringrequisKey UUID (from list_keys / get_variants).
language_codestringrequisTarget locale CODE, e.g. 'fr'. Backend resolves it; 404 if unknown.
surfacestringrequisSurface slug - any surface ACTIVE for the project (device or a11y). See list_surfaces.
valuestringrequisThe variant text value for this (key, language, surface).
{
"tool": "set_variant",
"arguments": {
"key_uuid": "<key_uuid>",
"language_code": "<language_code>",
"surface": "<surface>",
"value": "<value>"
}
}