Make an API key
create_api_keyMakes a key for CodeGene's public REST API, for the person's own scripts and integrations. It can do only what its scopes allow (projects:read (see the workspace's projects), tasks:read (see the workspace's tasks and where each one stands), reports:read (see the workspace's reports)), as the person who made it, in this workspace only; give it the fewest scopes the job needs. The answer has the key, the API's address and a curl example. It is shown once and CodeGene keeps only a fingerprint of it, so give it to the person straight away and never write it anywhere else. It lasts 30 days unless days says otherwise (1 to 365). revoke_api_key ends it, and so does the person leaving the workspace. Only owners and admins.
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": {
"name": "<name>",
"scopes": "<scopes>",
"reason": "<reason>"
},
"name": "create_api_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | How many days the key lasts (1 to 365; 30 if left out). | |
| name | Yes | What the key is for, such as Nightly export: how the person finds it in the list later. | |
| reason | Yes | Why, in a sentence: kept in the workspace's activity. | |
| scopes | Yes | What the key may do: one or more scopes. | |
| workspace_id | No | Workspace id from whoami; omit when there is one. |