Reference

Create key

Creates an API key. It can reach only namespaces the caller can reach.

POST
/keys

Authorization

bearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
name*string
Length1 <= length <= 100
role*Role

What 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.

Items1 <= items <= 50
namespaces?string

Deprecated: one pattern of full names, such as prod/*. Use environment and only.

Lengthlength <= 200
expires_in_days?integer

Whole 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.

Range1 <= value <= 3650

Response Body

The new key.

application/json
  1. response
id*string
key*string

The key. It is shown only this once.

Example Request
curl -X POST 'https://example.com/v1/keys' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "role": "read"}'
Example Response
{  "id": "string",  "key": "string"}