Rename API token
/api-token/{id}
Merge-patch of the token’s metadata; `name` is the only mutable field, and omitting it is a no-op that returns the record unchanged. The credential itself is untouched — the raw token, its owner, its permissions and `last_used_at` do not change, so renaming never takes a token out of service (use DELETE for that). Requires `api_token:create` or `api_token:manage` and an interactive human session, then enforces owner OR `api_token:manage`. No step-up is required, unlike POST and DELETE: a rename takes nothing away and mints nothing.
Path Parameters
API token id (atok_…) — not the token itself.
Request Body
New display name.
Response Body
API token id (atok_…).
The single organization this token can address (org_…).
Member (usr_…) the token acts as. It carries that member's permissions, live.
curl -X PATCH 'https://api.elaichi.ai/api-token/<id>' \
-H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"name":"your_name"}'const body = {
"name": "your_name"
};
const response = await fetch('https://api.elaichi.ai/api-token/<id>', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import os
import requests
url = "https://api.elaichi.ai/api-token/<id>"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
payload = {
"name": "your_name"
}
response = requests.patch(url, headers=headers, json=payload)
print(response.json())