Keys

Key entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the key.

author_id

int

ID of the user who created the key.

user_id

int

ID of the user who owns the key.

namespace_id

int

ID of the namespace the invite was sent for.

name

string

The name of the key.

config

string

The key's configuration.

created_at

timestamp

The RFC3339 formatted string at which the key was created.

updated_at

timestamp

The RFC3339 formatted string at which the key was updated.

url

string

The API URL to the key entity itself.

author

object

nullable

The user who authored the key.

user

object

nullable

The user who owns the key.

namespace

object

nullable

The namespace who owns the key.

ENTITIES
ENDPOINTS

List keys

List the keys for the currently authenticated user. The following parameters can be given as query parameters to the URL. This requires the key:read permission.

Parameters
NAMETYPEDESCRIPTION

search

string

Get the keys with names like the given value.

Returns

This will return a list of keys. The list will be paginated to 25 keys per page, and will be ordered lexically. If the crons were paginated, then the pagination information will be in the response header Link.

Link: <https://api.djinn-ci.com/keys?page=1>; rel="prev",
      <https://api.djinn-ci.com/keys?page=3>; rel="next"

GET /keys
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/keys

Create key

This will create a key for the currently authenticated user. This requires the key:write permission.

Parameters
NAMETYPEREQUIREDDESCRIPTION

namespace

string

No

The namespace to store the key in.

name

string

Yes

The name of the key.

key

string

Yes

The private key.

config

string

No

The SSH configuration for the key.

Returns

Returns the created key. It returns an error if any of the parameters are invalid, or if an internal error occurs.

POST /keys
$ curl -X POST \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"name": "id_rsa", "key": "-----BEGIN..."}' \
	https://api.djinn-ci.com/keys/1

Get key

This will get the key by the given :id. This requires the key:read permission.

Returns

This will return the key.

GET /keys/:id
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/keys/1

Update key

This will update the given key. This requies the key:write permission.

Parameters
NAMETYPEREQUIREDDESCRIPTION

namespace

string

No

The namespace to store the key in.

name

string

No

The name of the key.

config

string

No

The SSH configuration for the key.

Returns

This will return the updated key.

PATCH /keys/:id
$ curl -X PATCH \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"config": "UserKnownHostsFile /dev/null"}' \
	https://api.djinn-ci.com/keys/1

Delete key

This will delete the key by the given :id. This requires the key:delete permission.

Returns

This returns no content in the response body.

DELETE /key/:id
$ curl -X DELETE \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/keys/1