Reference
Create key
Creates an API key. It can reach only namespaces the caller can reach.
POST
bearerheader
AuthorizationBearer <token>application/json- body
name*stringLength
1 <= length <= 100role*RoleWhat a caller may do. read: files and history. write: also fork, commit and merge. admin: also keys, namespaces, protected branches and the audit log.
Value in
"read""write""admin"environment?|The environment it works in. A key made by a key of one environment gets that one. Null makes a key for every environment, which only an organization admin may make.
Match
^[A-Za-z0-9_-][A-Za-z0-9._-]{0,99}$only?array<>Which disks in its environment it reaches: names, prefixes ending in *, or * for all, the default.
Items
1 <= items <= 50namespaces?stringDeprecated: one pattern of full names, such as prod/*. Use environment and only.
Length
length <= 200expires_in_days?integerWhole days, 1 to 3650. Without it, the key does not expire. A key never outlives the key that makes it: it expires then at the latest.
Range
1 <= value <= 3650The new key.
application/json- response
id*stringkey*stringThe key. It is shown only this once.
curl -X POST 'https://example.com/v1/keys' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "role": "read"}'Example Response
{ "id": "string", "key": "string"}