Create API token
/api-token
Mints an org-scoped bearer token of the form `elch_{org_id}_{64 hex}`. The raw `token` appears in THIS response only and cannot be retrieved again — store it now; if it is lost, revoke it and mint another. The token acts as you, with your permissions resolved live, in this organization only. Requires `api_token:create` and an interactive human session (a token cannot mint another token), plus a fresh step-up reauthentication (`X-Step-Up-Token`, obtained from `/auth/step-up`) — minting a credential is what a stolen session would otherwise do to walk around every other step-up gate. Without one the call answers `428 step_up_required`.
Request Body
Response Body
API token id (atok_…).
The single organization this token can address (org_…).
Raw token — shown once.
Member (usr_…) the token acts as. It carries that member's permissions, live.
curl -X POST 'https://api.elaichi.ai/api-token' \
-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', {
method: 'POST',
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"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
payload = {
"name": "your_name"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())