Host Platform (djaodjin.com) API reference

Authentication

Authenticate your account by including your API key in API requests. You can manage your API keys on your profile page. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such GitHub, client-side code, and so forth.

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail.

Example request

curl https://api.djaodjin.com/api/ \
    -u BQokikJOvBiI2HlWgH4olfQ24ret3awZ:

curl uses the -u flag to pass basic auth credentials. (Adding a colon after your API key prevents curl from asking for a password.)

Containers

GET /containers/{organization}/apps/

TODO should there be a containers namespace, considering that we are dealing with apps here. Also container should be -> image List all containers that serve application business logic for you Software-as-a-Service (SaaS).

Query parameters
page
integer

A page number within the paginated result set.

Responses

200

count
integer
next
string
previous
string
results
array of Container
slug
string
unique identifier for the site (also serves as subdomain)
version
string
The version of DjaoApp templates to use with this app
location
string
Docker repository on AWS
role_name
string
AWS Role ARN that grants DjaoDjin read access to your Docker repository
env
array of Variable
name
string
Name of the environment variable to pass to the container.
value
string
Value of the environment variable to pass to the container.
dataset
string
dataset used for accounts and billing (i.e. production or testing)
external_id
string

Examples

GET https://api.djaodjin.com/api/containers/cowork/apps HTTP/1.1
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "cowork-master",
      "dataset": "testing",
      "location": "https://01.dk.ecr.us-west-2.amazon.com/cowork:master",
      "role_name": "arn:aws:iam::01:cowork-deploy"
      "env": [
          {"name": "DEBUG", "value": "0"},
      ],
      "domain": "cowork.djaoapp.com",
      "from_email": "support@djaoapp.com"
    }
  ]
}

POST /containers/{organization}/apps/

Creates a new container to serve application business logic for you Software-as-a-Service (SaaS).

Request body
slug
string required
unique identifier for the site (also serves as subdomain)
location
string
Docker repository on AWS
role_name
string
AWS Role ARN that grants DjaoDjin read access to your Docker repository
env
array of Variable
name
string required
Name of the environment variable to pass to the container.
value
string required
Value of the environment variable to pass to the container.
dataset
string
dataset used for accounts and billing (i.e. production or testing)
Responses

201

slug
string
unique identifier for the site (also serves as subdomain)
version
string
The version of DjaoApp templates to use with this app
location
string
Docker repository on AWS
role_name
string
AWS Role ARN that grants DjaoDjin read access to your Docker repository
env
array of Variable
name
string
Name of the environment variable to pass to the container.
value
string
Value of the environment variable to pass to the container.
dataset
string
dataset used for accounts and billing (i.e. production or testing)
external_id
string

400

detail
string
describes the reason for the error in plain text

Examples

POST https://api.djaodjin.com/api/containers/cowork/apps/ HTTP/1.1
{
 "slug": "cowork",
 "dataset": "production",
 "location": "https://01.dk.ecr.us-west-2.amazon.com/cowork:master",
 "role_name": "arn:aws:iam::01:cowork-deploy"
 "env": [
     {"name": "DEBUG", "value": "0"},
 ],
 "domain": "cowork.djaoapp.com",
 "from_email": "support@djaoapp.com"
}

GET /containers/{organization}/apps/{app}/

Retrieves information about a container

Responses

200

slug
string
unique identifier for the site (also serves as subdomain)
version
string
The version of DjaoApp templates to use with this app
location
string
Docker repository on AWS
role_name
string
AWS Role ARN that grants DjaoDjin read access to your Docker repository
env
array of Variable
name
string
Name of the environment variable to pass to the container.
value
string
Value of the environment variable to pass to the container.
dataset
string
dataset used for accounts and billing (i.e. production or testing)
external_id
string

Examples

GET https://api.djaodjin.com/api/containers/cowork/apps/cowork-master/ HTTP/1.1
{
  "slug": "cowork-master",
  "dataset": "testing",
  "location": "https://01.dk.ecr.us-west-2.amazon.com/cowork:master",
  "role_name": "arn:aws:iam::01:cowork-deploy"
  "env": [
      {"name": "DEBUG", "value": "0"},
  ]
}

POST /containers/{organization}/apps/{app}/

Update a container to serve backend business logic on your SaaS website. The container will be forcibly restarted.

Request body
version
string
The version of DjaoApp templates to use with this app
location
string
Docker repository on AWS
role_name
string
AWS Role ARN that grants DjaoDjin read access to your Docker repository
env
array of Variable
name
string required
Name of the environment variable to pass to the container.
value
string required
Value of the environment variable to pass to the container.
dataset
string
dataset used for accounts and billing (i.e. production or testing)
external_id
string
Responses

201

slug
string
unique identifier for the site (also serves as subdomain)
version
string
The version of DjaoApp templates to use with this app
location
string
Docker repository on AWS
role_name
string
AWS Role ARN that grants DjaoDjin read access to your Docker repository
env
array of Variable
name
string
Name of the environment variable to pass to the container.
value
string
Value of the environment variable to pass to the container.
dataset
string
dataset used for accounts and billing (i.e. production or testing)
external_id
string

Examples

POST https://api.djaodjin.com/api/containers/cowork/apps/cowork-master/ HTTP/1.1

Forcibly restart an already configured `cowork-master` container.

PUT /containers/{organization}/apps/{app}/

Update information on a container. If the location, role_name or any environment variables have been changed, the container will be restarted.

Request body
version
string
The version of DjaoApp templates to use with this app
location
string
Docker repository on AWS
role_name
string
AWS Role ARN that grants DjaoDjin read access to your Docker repository
env
array of Variable
name
string required
Name of the environment variable to pass to the container.
value
string required
Value of the environment variable to pass to the container.
dataset
string
dataset used for accounts and billing (i.e. production or testing)
external_id
string
Responses

200

slug
string
unique identifier for the site (also serves as subdomain)
version
string
The version of DjaoApp templates to use with this app
location
string
Docker repository on AWS
role_name
string
AWS Role ARN that grants DjaoDjin read access to your Docker repository
env
array of Variable
name
string
Name of the environment variable to pass to the container.
value
string
Value of the environment variable to pass to the container.
dataset
string
dataset used for accounts and billing (i.e. production or testing)
external_id
string

Examples

PUT https://api.djaodjin.com/api/containers/cowork/apps/cowork-master/ HTTP/1.1
{
 "dataset": "testing",
 "location": "https://01.dk.ecr.us-west-2.amazon.com/cowork:master",
 "role_name": "arn:aws:iam::01:cowork-deploy"
 "env": [
   {"name": "DEBUG", "value": "0"},
 ]
}

DELETE /containers/{organization}/apps/{app}/

Delete a container.

Responses

204

Examples

DELETE /api/containers/cowork/apps/cowork-master/ HTTP/1.1

GET /containers/{organization}/apps/{app}/logs/

Read the lastest log entries from a container.

Responses

200

content
string
Last log entries from a containerthat were printed on stdout/stderr.

Examples

Domains

GET /domains/

List all domains

Query parameters
page
integer

A page number within the paginated result set.

Responses

200

count
integer
next
string
previous
string
results
array of Domain
slug
string
unique identifier for the container.
domain
string
url
string
ssl_certificate
string
The public fullchain cert content for the TLS certificate
cert_type
string
The type of certificate ('default' when generated by DjaoDjin and 'custom' when uploaded by a user)
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
authentication
string
billing
string
state
string
account
string
plan
string
subscription_days_left
string

Examples

GET https://api.djaodjin.com/api/domains/ HTTP/1.1

Response

{
  "count": 1,
  "results": [{
    "domain": "cowork.djaoapp.com",
    "ssl_certificate": "...",
    "ssl_certificate_key": "...",
  }]
}

POST /domains/

Create a new domain.

Request body
domain
string
ssl_certificate_key
string
The private key content for the TLS certificate
ssl_certificate
string
The public fullchain cert content for the TLS certificate
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
email_host_password
string
password to authenticate with the stmp server
Responses

201

slug
string
unique identifier for the container.
domain
string
url
string
ssl_certificate
string
The public fullchain cert content for the TLS certificate
cert_type
string
The type of certificate ('default' when generated by DjaoDjin and 'custom' when uploaded by a user)
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
authentication
string
billing
string
state
string
account
string
plan
string
subscription_days_left
string

Examples

POST https://api.djaodjin.com/api/domains/ HTTP/1.1
{
  slug: ""
}

Response

{
  "domain": "cowork.djaoapp.com",
  "ssl_certificate": "...",
}

GET /domains/{organization}/

List all domains

Responses

200

slug
string
unique identifier for the container.
domain
string
url
string
ssl_certificate
string
The public fullchain cert content for the TLS certificate
cert_type
string
The type of certificate ('default' when generated by DjaoDjin and 'custom' when uploaded by a user)
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
authentication
string
billing
string
state
string
account
string
plan
string
subscription_days_left
string

Examples

GET https://api.djaodjin.com/api/domains/ HTTP/1.1

Response

{
  "count": 1,
  "results": [{
    "domain": "cowork.djaoapp.com",
    "ssl_certificate": "...",
    "ssl_certificate_key": "...",
  }]
}

POST /domains/{organization}/

Create a new domain.

Request body
domain
string
ssl_certificate_key
string
The private key content for the TLS certificate
ssl_certificate
string
The public fullchain cert content for the TLS certificate
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
email_host_password
string
password to authenticate with the stmp server
Responses

201

slug
string
unique identifier for the container.
domain
string
url
string
ssl_certificate
string
The public fullchain cert content for the TLS certificate
cert_type
string
The type of certificate ('default' when generated by DjaoDjin and 'custom' when uploaded by a user)
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
authentication
string
billing
string
state
string
account
string
plan
string
subscription_days_left
string

Examples

POST https://api.djaodjin.com/api/domains/ HTTP/1.1
{
  slug: ""
}

Response

{
  "domain": "cowork.djaoapp.com",
  "ssl_certificate": "...",
}

GET /domains/{organization}/{domain}/

Get the domain name at which your SaaS application is available on the Internet and the public SSL certificate used to serve requests securely.

Responses

200

slug
string
unique identifier for the container.
domain
string
url
string
ssl_certificate
string
The public fullchain cert content for the TLS certificate
cert_type
string
The type of certificate ('default' when generated by DjaoDjin and 'custom' when uploaded by a user)
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
authentication
string
billing
string
state
string
account
string
plan
string
subscription_days_left
string

Examples

GET https://api.djaodjin.com/api/domains/cowork/ HTTP/1.1

Response

{
  "domain": "cowork.djaoapp.com"
}

PUT /domains/{organization}/{domain}/

Update the domain name and SSL certificate that present the site on the Internet.

Request body
domain
string
ssl_certificate_key
string
The private key content for the TLS certificate
ssl_certificate
string
The public fullchain cert content for the TLS certificate
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
email_host_password
string
password to authenticate with the stmp server
Responses

200

slug
string
unique identifier for the container.
domain
string
url
string
ssl_certificate
string
The public fullchain cert content for the TLS certificate
cert_type
string
The type of certificate ('default' when generated by DjaoDjin and 'custom' when uploaded by a user)
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
authentication
string
billing
string
state
string
account
string
plan
string
subscription_days_left
string

Examples

PUT https://api.djaodjin.com/api/domains/cowork/ HTTP/1.1
{
  "domain": "cowork.djaoapp.com",
  "ssl_certificate": "...",
  "ssl_certificate_key": "...",
}

Response

{
  "domain": "cowork.djaoapp.com",
  "ssl_certificate": "...",
}

DELETE /domains/{organization}/{domain}/certificates/

Delete custom certificates

Responses

204

Examples

DELETE /api/domains/cowork/cowork-master/certificates/ HTTP/1.1

POST /domains/{organization}/{domain}/newcert/

Create a private key for a SSL certificate and return the CSR content to upload to the 3rd party SSL certificate issuer.

Responses

201

csr
string
The CSR content to upload to the 3rd party SSL issuer.

Examples

POST https://api.djaodjin.com/api/domains/cowork/cowork-master/newcert/ HTTP/1.1

Response

{
  "csr": "..."
}

PUT /domains/{organization}/{domain}/reset/

Resets the database for a domain.

Responses

200

slug
string
unique identifier for the container.
domain
string
url
string
ssl_certificate
string
The public fullchain cert content for the TLS certificate
cert_type
string
The type of certificate ('default' when generated by DjaoDjin and 'custom' when uploaded by a user)
from_email
string
email_host
string
host name for the stmp server.
email_port
integer
port for the stmp server.
email_host_user
string
username to authenticate with the stmp server.
authentication
string
billing
string
state
string
account
string
plan
string
subscription_days_left
string

Examples

PUT https://api.djaodjin.com/api/domains/cowork/reset/ HTTP/1.1

Response

{
  "domain": "cowork.djaoapp.com"
}

POST /domains/{organization}/{domain}/test-email/

Send yourself a test e-mail using the mail server setup for the site.

Responses

201

Examples

POST https://api.djaodjin.com/api/notifications/cowork/test-email/ HTTP/1.1