Namespaces

Namespace entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the namespace.

user_id

int

ID of the user who owns the namespace.

root_id

int

ID of the top-level namespace for the current namespace. This will match the id for the root namespace.

parent_id

int

nullable

ID of the namespace's parent, if any.

name

string

The name of the current namespace.

path

string

The fulle path of the namespace, this will include the parent namespace names.

description

string

The description of the current namespace.

visibility

enum

The visibility level of the namespace, will be one of:

  • private
  • internal
  • public

created_at

timestamp

The RFC3339 formatted string at which the namespace was created.

url

string

The API URL to the namespace entity itself.

builds_url

string

The API URL to the namespace's builds.

namespaces_url

string

The API URL to the namespace's children.

images_url

string

The API URL to the namespace's images.

objects_url

string

The API URL to the namespace's objects.

variables_url

string

The API URL to the namespace's variables.

keys_url

string

The API URl to the namespace's keys.

collaborators_url

string

The API URL to the namespace's collaborators.

webhooks_url

string

The API URL to the namespace's webhooks.

user

object nullable

The user of the namespace.

parent

object nullable

The parent of the namespace, if any.

build

object nullable

The build that was most recently submitted to the namespace, if any.

Webhook entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the webhook.

author_id

int

ID of the user who authored the webhook.

user_id

int

ID of the user who owns the webhook.

namespace_id

int

ID of the namespace the webhook belongs to.

payload_url

string

URL to send the event payload to.

ssl

bool

Whether or not the event will be sent over TLS.

events

string[]

The events the webhook will activate on. See the Event payloads section for details on the different webhook events.

namespace

object

The namespace of the webhook.

last_response

object

nullable

The last response received from the webhook, if any.

last_response.code

int

The HTTP status code of the delivery

last_response.duration

int

The duration of the request delivered to the URL in nanoseconds.

last_response.error

string

nullable

The error that occurred if the event failed to be delivered. This will be null if no error occurred.

last_response.created_at

timestamp

The RFC3339 formatted string at which the delivery was made.

Collaborator entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the user.

email

string

The email of the user.

username

string

The username of the user.

created_at

timestamp

The RFC3339 formatted string for when the user created their account.

url

string

The API URL to the collaborator entity itself.

List namespaces

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

Parameters
NAMETYPEDESCRIPTION

search

string

Get the namespaces with paths like the given value.

Returns

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

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

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

Create namespace

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

Parameters
NAMETYPEREQUIREDDESCRIPTION

parent

string

No

The name of the parent namespace to create the new namespace under.

name

string

Yes

The name of the new namespace.

description

string

No

The deescription of the namespace.

visibility

enum

No

The visibility level of the namespace, will be one of:

  • private
  • internal
  • public

This will default to private, if not otherwise specified.

Returns

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

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

Get namespace

This will get the namespace by the given :username, with the given :path. This requires the namespace:read permission.

Returns

This will return the namespace.

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

Get namespace badge

This will return an SVG badge of the namespace by the given :username, with the given :path. This SVG will show the status of the most recently submitted build to the namespace. This requires no permission for the user.

Returns

This will return one of the following SVG badges.

Badges
BADGEDESCRIPTION

Djinn CI: unknown Djinn CI unknown

No build has been submitted to the namespace, or the namespace is set to private or internal and therefore the status cannot be seen.

Djinn CI: queued Djinn CI queued

The build is queued.

Djinn CI: running Djinn CI running

The build is running.

Djinn CI: passed Djinn CI passed

The build passed.

Djinn CI: passed Djinn CI passed

The build bassed but encountered failures.

Djinn CI: failed Djinn CI failed

The build failed.

Djinn CI: killed Djinn CI killed

The build was killed.

Djinn CI: timed out Djinn CI timed out

The build timed out.

GET /n/:username/:path/-/badge.svg
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/badge.svg

Get namespace builds

List the builds for the given namespace. The following parameters can be given as query parameters to the URL. This requires the namespace:read permission for the user.

Parameters
NAMETYPEREQUIREDDESCRIPTION

tag

string

No

Get the builds with the given tag name.

search

string

No

Get the builds with tags like the given value.

status

enum

No

Get the builds with the given status, will be one of:

  • queued
  • running
  • passed
  • passed_with_failures
  • failed
  • killed
  • timed_out

Returns

This will return a list of builds. The list will be paginated to 25 builds per page, and will be ordered by the most recently submitted builds first. If the builds were paginated, then the pagination information will be in the response header Link.

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

GET /n/:username/:path/-/images
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/builds

Get namespace children

This will get the child namespaces in the given namespace. This requires the namespace:read permission.

Parameters
NAMETYPEDESCRIPTION

search

string

Get the namespaces with paths like the given value.

Returns

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

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

GET /n/:username/:path/-/namespaces
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/namespaces

Get namespace images

List the images for the given namespace. The following parameters can be given as query parameters to the URL. This requires the namespace:read permission for the user.

Parameters
NAMETYPEDESCRIPTION

search

string

Get the images with names like the given value.

Returns

This will return a list of images. The list will be paginated to 25 images per page, and will be ordered by the most recently created images first. If the images were paginated, then the pagination information will be in the response header Link.

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

GET /n/:username/:path/-/images
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/images

Get namespace objects

List the objects for the given namespace. The following parameters can be given as query parameters to the URL. This requires the namespace:read permission for the user.

Parameters
NAMETYPEDESCRIPTION

search

string

Get the objects with names like the given value.

Returns

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

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

GET /n/:username/:path/-/objects
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/objects

Get namespace variables

List the variables for the given namespace. The following parameters can be given as query parameters to the URL. This requires the namespace:read permission for the user.

Parameters
NAMETYPEDESCRIPTION

search

string

Get the variables with names like the given value.

Returns

This will return a list of variable. The list will be paginated to 25 variables 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/n/me/djinn/-/variables?page=1>; rel="prev",
      <https://api.djinn-ci.com/n/me/djinn/-/variables?page=3>; rel="next"

GET /n/:username/:path/-/variables
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/variables

Get namespace keys

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

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/n/me/djinn/-/keys?page=1>; rel="prev",
      <https://api.djinn-ci.com/n/me/djinn/-/keys?page=3>; rel="next"

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

Get namespace invites

List the invites for the given namespace. This requires the namespace:read permission for the user.

Returns

This will return a list of invites.

GET /n/:username/:path/-/invites
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/invites

Get namespace collaborators

List the collaborators for the given namespace. This requires the namespace:read permission for the user.

Returns

This will return a list of collaborators.

GET /n/:username/:path/-/collaborators
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/collaborators

Get namespace webhooks

List the webhooks for the given namespace. This requires the namespace:read permission for the user.

Returns

This will return a list of webhooks.

GET /n/:username/:path/-/webhooks
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/webhooks

Create namespace webhook

This will create a webhook for the given namespace. This requires the namespace:write permission for the user.

Parameters
NAMETYPEREQUIREDDESCRIPTION

payload_url

string

Yes

The URL to send the event payload to.

secret

string

No

The secret to sign the event payload with.

ssl

bool

No

Whether or not to use TLS when sending the event. The https scheme needs to be specified when this option is enabled.

active

bool

No

Whether or not the webhook should be active.

events

string[]

No

The list of events to activate on. If no events are given, then the webhook will activate on all events.

Returns

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

POST /n/:username/:path/-/webhooks
$ curl -X POST \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"payload_url": "https://example.com/hook/djinn-ci", "ssl": true, "active": true}' \
	https://api.djinn-ci.com/n/me/djinn/-/webhooks

Update namespace webhook

This will update the webhook by the given :id, for the given namespace. This requires the namespace:write permission.

Parameters
NAMETYPEREQUIREDDESCRIPTION

payload_url

string

Yes

The URL to send the event payload to.

secret

string

No

The secret to sign the event payload with.

ssl

bool

No

Whether or not to use TLS when sending the event. The https scheme needs to be specified when this option is enabled.

active

bool

No

Whether or not the webhook should be active.

events

string[]

No

The list of events to activate on. If no events are given, then the webhook will activate on all events.

Returns

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

PATCH /n/:username/:path/-/webhooks/:id
$ curl -X POST \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"secret": "some_secret_password"}' \
	https://api.djinn-ci.com/n/me/djinn/-/webhooks/1

Delete namespace webhook

This will delete the webhook by the given :id, for the given namespace. This requires the namespace:delete permission.

Returns

This returns no content in the response body.

DELETE /n/:username/:path/-/webhooks/:id
$ curl -X DELETE \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn/-/webhooks/1

Update namespace

This will update the given namespace. This requires the namespace:write permission.

Parameters
NAMETYPEREQUIREDDESCRIPTION

description

string

No

The new description for the namespace.

visibility

enum

No

The new visibility level for the namespace, will be one of:

  • private
  • internal
  • public

This will default to private, if not otherwise specified.

Returns

Returns the updated namespace.

PATCH /n/:username/:path
$ curl -X PATCH \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"visibility": "public"}'\
	https://api.djinn-ci.com/n/me/djinn

Delete namespace

This will delete the given namespace. This requires the namespace:delete permission.

Returns

This returns no content in the response body.

DELETE /n/:username/:path
$ curl -X DELETE \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/n/me/djinn