Rename a tag in every case that carries it
const url = 'https://beta-api.plune.ai/v1/settings/tags/rename';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"from":"Smoke","to":"smoke"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/settings/tags/rename \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "from": "Smoke", "to": "smoke" }'Every case carrying from has its title rewritten with to in place of from — the clean title, then the tags, each once, as the case form writes it — so each case gets its own audit entry with a diff and its text version does not move (AC-09, AC-10). One transaction for all of them. to is checked against the tag rule first (400). If to already exists the outcome is a merge of from into to: a case carrying both ends up with one. A from nobody carries affects nothing and is not an error. For an automated case the title in the code stays as it was — the dashboard warns before confirming. One call rewrites at most 1 000 cases: more is a 413, refused before anything is written.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Example
{ "from": "Smoke", "to": "smoke"}Responses
Section titled “ Responses ”How many cases were rewritten
object
Cases whose title was rewritten.
Example generated
{ "affected": 1}The new name is not a valid tag, or the body is invalid
object
Example
{ "error": "invalid tag 'regression suite' — a tag is 1 to 119 characters from \\w = - _ ( ) . : &"}No / invalid token or session
The rename or merge would rewrite more cases than one call may (limit, 1 000), and nothing was written. carriers is how many it would take: the distinct cases that carry any of the steps or tags named, each counted once. Asking again changes nothing until carriers is down to limit, and there is no batched rewrite to ask for instead — the sentence in error says what to do: edit some of those cases yourself to carry the new step or tag, then call again for the rest. (A body over the size limit of the API is also a 413; it is answered before the route and carries error alone.)
The refusal of a rename or a merge of steps or tags that would rewrite more cases than one call may (#1142).
object
How many cases it would take, the ceiling, and what to do about it.
The cases the call would rewrite — each once, whichever of the steps or tags it carries.
The most cases one call rewrites.
Example
{ "error": "1001 cases would be rewritten, and one rename or merge of tags rewrites at most 1000. Edit some of those cases yourself to carry the new tag, then run it again for the rest.", "carriers": 1001, "limit": 1000}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over