Skip to main content

SSH keys

SSH keys of the project​

GET /ssh_keys

Parameters​

NameInTypeRequiredDescription
pagequeryintegerNo(minimum 1, default 1)
per_pagequeryintegerNo(minimum 1, maximum 100, default 25)
namequerystringNoExact name (maximum length 64)
label_selectorquerystringNokey, !key, key==v, key=v, key!=v, key in (a,b), key notin (a,b); comma-separated (and) (maximum length 1024)
sortquerystringNo<field>:asc|desc; fields id, name, created; default created:desc (pattern ^(id|name|created):(asc|desc)$)
qquerystringNoEvery word must match, in any case: part of the name or fingerprint, or label:key, label:key=value (minimum length 2, maximum length 100)
fingerprintquerystringNo(maximum length 128)

Responses​

StatusDescription
200SSH keys
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
ssh_keysarray of SshKeyYes
metaMetaYes

Add an SSH public key​

POST /ssh_keys

Parameters​

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNo16-128 visible ASCII characters; the first response is replayed for 24 hours (pattern ^[\x21-\x7e]{16,128}$)

Request body​

FieldTypeRequiredDescription
namestringYes1-64 printable characters without @ (minimum length 1, maximum length 64)
public_keystringYesssh-ed25519 ... or ssh-rsa ... (OpenSSH format) (maximum length 4096)
labelsmap of stringNoAt most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit

Responses​

StatusDescription
201The key (no action: the operation is immediate)
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
ssh_keySshKeyYes

One SSH key​

GET /ssh_keys/{id}

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Responses​

StatusDescription
200The key
401No valid API key
404No such resource in this project
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
ssh_keySshKeyYes

Rename or relabel an SSH key​

PUT /ssh_keys/{id}

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Request body​

FieldTypeRequiredDescription
namestringNo1-64 printable characters without @ (minimum length 1, maximum length 64)
labelsmap of stringNoAt most 32 keys; keys and values of 1-63 (values may be empty) letters, digits, ., _, -, starting and ending with a letter or digit

Responses​

StatusDescription
200The key
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
409The request conflicts with the resource's state (conflict) or an Idempotency-Key is still being processed (idempotency_in_progress)
422A field is missing or malformed (invalid_input, details.fields) or an Idempotency-Key was reused with a different request (idempotency_key_mismatch)
429The key's allowance is used up

Response body​

FieldTypeRequiredDescription
ssh_keySshKeyYes

Delete an SSH key​

DELETE /ssh_keys/{id}

Parameters​

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Responses​

StatusDescription
204Deleted
401No valid API key
403The key's scope or the organization's subscription does not allow the request (forbidden), or a quota is exhausted (resource_limit_exceeded)
404No such resource in this project
429The key's allowance is used up