Create access token
mint_tokenMint an API token for turnzero or a CI job.
A person's signed-in connection is required. A connection presenting an account-wide minted token is refused session_credential_required.
The first command runs on the target computer: turnzero authorize, turnzero token request or turnzero tzmesh register. It prints code_challenge. completion is passed only where that command prints it. awaiting_command returns a completing line, without a token value.
That line runs once, unchanged, on the same computer before expires_at. A token claim line carries a one-time credential. Only the owner runs it, outside AI tools. Authorization and tzMesh registration run in the signed-in AI tool's shell. After authorization, you tell the owner the token's label, expiry and that revoke_token ends it. Token values stay out of the conversation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"scope_kind": "<scope_kind>",
"code_challenge": "<code_challenge>"
},
"name": "mint_token"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Shown by `list_tokens`. Required and printable for `issues`, `test_end_users`, `tzmesh` or `tztrack`. Unique among unrevoked `issues` labels in the space, or `test_end_users` labels in scope. `tzmesh` and `tztrack` labels may repeat. | |
| level | No | `issues`: `report`: file, follow, check, read, watch, unwatch; `contribute` adds update, comment, relate, next, give back, wait, `cache` archive, task close/reopen. `owner` admits all; `read_space`, other close/reopen need it. `tzmesh`/`tztrack`: no levels; minted `admin` bounds no product call. | |
| space | No | With `issues`, an account-held issue space from `list_issue_spaces`. | |
| grants | No | Extra grants. `destructive` and `super_admin` require the session to hold them, the latter granted by an operator. `issues`, `tzmesh`, `tztrack` and `test_end_users` need only the session. Application scope permits only `destructive` and `test_end_users`, else `grant_scope_refused`. | |
| completion | No | Only when printed by `authorize` or, for grants `["tzmesh"]` alone, `tzmesh register`. Other mints refuse it. With `authorized_computer`, the line is `turnzero authorize --mint <id>`, without a code, whether or not `completion` is supplied. | |
| scope_kind | Yes | Account-wide or bounded to one application. | |
| application | No | Required only for application scope: the application id the token is bounded to. Refused with account scope. | |
| code_challenge | Yes | From the first command on the target computer. `--origin` must match the connection, or `--tzmesh-estate` for tzMesh, defaulting from `--origin`. Same options reuse a pending challenge. After expiry, the first command runs again. | |
| expires_in_days | No | With `tzmesh`, `tztrack` or `test_end_users`, 1–180 days, default 180. Without those grants or `authorized_computer`, omission means no expiry. | |
| authorized_computer | No | True authorizes that computer: account scope, at most 30 days, default 30. The signed-in tool then tells the owner the token's label, expiry and that `revoke_token` ends it. |