SSH keys
SSH keys of the project
GET /ssh_keys
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | No | (minimum 1, default 1) |
per_page | query | integer | No | (minimum 1, maximum 100, default 25) |
name | query | string | No | Exact name (maximum length 64) |
label_selector | query | string | No | key, !key, key==v, key=v, key!=v, key in (a,b), key notin (a,b); comma-separated (and) (maximum length 1024) |
sort | query | string | No | <field>:asc|desc; fields id, name, created; default created:desc (pattern ^(id|name|created):(asc|desc)$) |
q | query | string | No | Every word must match, in any case: part of the name or fingerprint, or label:key, label:key=value (minimum length 2, maximum length 100) |
fingerprint | query | string | No | (maximum length 128) |
Responses
| Status | Description |
|---|---|
200 | SSH keys |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
ssh_keys | array of SshKey | Yes | |
meta | Meta | Yes |
Add an SSH public key
POST /ssh_keys
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | No | 16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$) |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | 1-64 printable characters without @ (minimum length 1, maximum length 64) |
public_key | string | Yes | ssh-ed25519 ... or ssh-rsa ... (OpenSSH format) (maximum length 4096) |
labels | map of string | No | At most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit |
Responses
| Status | Description |
|---|---|
201 | The key (no action: the operation is immediate) |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
409 | The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
ssh_key | SshKey | Yes |
One SSH key
GET /ssh_keys/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | Yes |
Responses
| Status | Description |
|---|---|
200 | The key |
401 | No valid API key |
404 | No such resource in this project |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
ssh_key | SshKey | Yes |
Rename or relabel an SSH key
PUT /ssh_keys/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | Yes |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | 1-64 printable characters without @ (minimum length 1, maximum length 64) |
labels | map of string | No | At most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit |
Responses
| Status | Description |
|---|---|
200 | The key |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
404 | No such resource in this project |
409 | The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress) |
422 | A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch) |
429 | The key's allowance is used up |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
ssh_key | SshKey | Yes |
Delete an SSH key
DELETE /ssh_keys/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | Yes |
Responses
| Status | Description |
|---|---|
204 | Deleted |
401 | No valid API key |
403 | The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded) |
404 | No such resource in this project |
429 | The key's allowance is used up |