Organization API: Organization apps
The organization's apps on the Apps API, which App Deployment replaces: use Organization deployments.
The organization's apps on the Apps API, which App Deployment replaces: use Organization deployments. It keeps answering under /api/v1/orgs/{org_slug}/apps.
Base URL: https://api.coritan.com/api/v1. Paths below are complete.
To try these requests in the browser, open the interactive Organization API reference.
Operations
Section titled Operations| Method | Path | Summary |
|---|---|---|
| GET | /api/v1/orgs/{org_slug}/apps |
List apps |
| POST | /api/v1/orgs/{org_slug}/apps |
Create an app and, unless deploy is false, its first release |
| GET | /api/v1/orgs/{org_slug}/apps/regions |
Regions |
| GET | /api/v1/orgs/{org_slug}/apps/{app_uuid} |
Get one app with its domains, recent releases and live replicas |
| PATCH | /api/v1/orgs/{org_slug}/apps/{app_uuid} |
Change an app's settings |
| DELETE | /api/v1/orgs/{org_slug}/apps/{app_uuid} |
Delete app |
| GET | /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments |
List an app's releases, newest first, a page at a time |
| POST | /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments |
Deploy a branch or an image, which starts a release |
| GET | /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments/{deployment_uuid} |
Get one release of an app, with each of its replicas |
| POST | /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments/{deployment_uuid}/cancel |
Cancel a release that is still queued, building or deploying |
| GET | /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments/{deployment_uuid}/log |
The end of the release's build log (secrets redacted as it was written) |
| POST | /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments/{deployment_uuid}/rollback |
Rollback app |
| GET | /api/v1/orgs/{org_slug}/apps/{app_uuid}/domains |
List an app's domains: its platform name first, then its custom domains |
| POST | /api/v1/orgs/{org_slug}/apps/{app_uuid}/domains |
Add a custom domain |
| DELETE | /api/v1/orgs/{org_slug}/apps/{app_uuid}/domains/{hostname} |
Remove a custom domain from an app |
| POST | /api/v1/orgs/{org_slug}/apps/{app_uuid}/domains/{hostname}/verify |
Look for the domain's TXT record |
| GET | /api/v1/orgs/{org_slug}/apps/{app_uuid}/env |
List an app's environment variables without their values |
| PUT | /api/v1/orgs/{org_slug}/apps/{app_uuid}/env |
Set many variables; a variable given without value keeps its saved one |
| PUT | /api/v1/orgs/{org_slug}/apps/{app_uuid}/env/{key} |
Set one environment variable, creating it when it is new |
| DELETE | /api/v1/orgs/{org_slug}/apps/{app_uuid}/env/{key} |
Delete one environment variable |
| POST | /api/v1/orgs/{org_slug}/apps/{app_uuid}/redeploy |
Start a release from the live release or from the branch again |
| POST | /api/v1/orgs/{org_slug}/apps/{app_uuid}/webhook/rotate |
A new secret for the push webhook, shown once; the old one stops verifying at once |
List apps
Section titled List appsGET /api/v1/orgs/{org_slug}/apps
The caller's apps, newest first, each with its live release (the
current_deployment key), replica counts and domains.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path | string | yes | |
status |
query | string or null | no | |
limit |
query | integer | no | Default: 50. |
offset |
query | integer | no | Default: 0. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Create an app and, unless deploy is false, its first release
Section titled Create an app and, unless deploy is false, its first releasePOST /api/v1/orgs/{org_slug}/apps
Create an app and, unless deploy is false, its first release.
An app whose first release cannot start yet is still created, with
the reason in deploy_error.
A web app needs no plan and no size: instance_size is optional
and sets only the memory limit the app starts with. The app is billed
by use from the moment it is created, on memory, CPU, requests, data
out, builds and logs, by the account that owns it (an organization's
owner for an organization's app). A prepaid account needs the $10
deposit that unlocks hourly billing before its first instance:
without it the answer is 403 deposit_required with the
minimum, and nothing is created. An account billed by invoice
needs no deposit and gets the use on its monthly invoice. A size no
product can carry is refused with 409 size_not_offered.
This route makes git and image apps. A static site has no instance,
so it needs no deposit and bills only builds and logs past the
amounts included each month. Order one with POST /api/v1/services/order and kind static.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | |
repo_url |
string or null | no | |
repo_branch |
string or null | no | |
repo_subdir |
string or null | no | |
repo_token |
string or null | no | Write only; an empty string removes it |
image_ref |
string or null | no | |
framework |
string or null | no | |
install_command |
string or null | no | |
build_command |
string or null | no | |
start_command |
string or null | no | |
dockerfile_path |
string or null | no | |
port |
integer or null | no | |
health_check_path |
string or null | no | |
instance_size |
string or null | no | Optional. small (512 MB), medium (1 GB) or large (2 GB) sets the memory, CPU and disk limit the app starts with, and small applies when it is left out. There is no plan to pick: the bill follows what the app uses, not this size. An app billed by use keeps the size it started with, and another size answers 409 |
regions |
array of string or null | no | |
min_replicas |
integer or null | no | |
max_replicas |
integer or null | no | |
slug |
string or null | no | The name on the platform; derived from name when left out |
source_type |
string | no | git builds a repository and image runs a container image. This route makes web apps with an instance. A static site is ordered with POST /api/v1/services/order (kind static), not created here |
env |
array of EnvVarIn or null | no | |
env[].key |
string | yes | |
env[].value |
string or null | no | Left out: the saved value is kept |
env[].secret |
boolean or null | no | Redacted from build logs; new variables default to true |
env[].target |
string or null | no | |
deploy |
boolean | no | Start the first release at once |
Responses
Section titled Responses| Status | Meaning |
|---|---|
201 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Regions
Section titled RegionsGET /api/v1/orgs/{org_slug}/apps/regions
What the create form offers: the regions that can run apps now, the instance sizes, the replica bounds and the owner's app limit.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Get one app with its domains, recent releases and live replicas
Section titled Get one app with its domains, recent releases and live replicasGET /api/v1/orgs/{org_slug}/apps/{app_uuid}
Get one app with its domains, recent releases and live replicas.
deployments holds the five newest releases and deployments_total
counts them all; replicas are those of the live release, failed
ones left out. Another owner's app answers 404, as one that does
not exist does.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Change an app's settings
Section titled Change an app's settingsPATCH /api/v1/orgs/{org_slug}/apps/{app_uuid}
Change an app's settings. redeploy_required and
rebuild_required say whether running replicas pick the change up
only with a new release or a new build. regions,
min_replicas and max_replicas reach the live release at
once, as its placements. On an app a service bills, another
instance_size is refused with 409 plan_change_required: the
size is the plan's, changed with POST /api/v1/services/{service_id}/change-plan.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
name |
string or null | no | |
repo_url |
string or null | no | |
repo_branch |
string or null | no | |
repo_subdir |
string or null | no | |
repo_token |
string or null | no | Write only; an empty string removes it |
image_ref |
string or null | no | |
framework |
string or null | no | |
install_command |
string or null | no | |
build_command |
string or null | no | |
start_command |
string or null | no | |
dockerfile_path |
string or null | no | |
port |
integer or null | no | |
health_check_path |
string or null | no | |
instance_size |
string or null | no | Optional. small (512 MB), medium (1 GB) or large (2 GB) sets the memory, CPU and disk limit the app starts with, and small applies when it is left out. There is no plan to pick: the bill follows what the app uses, not this size. An app billed by use keeps the size it started with, and another size answers 409 |
regions |
array of string or null | no | |
min_replicas |
integer or null | no | |
max_replicas |
integer or null | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Delete app
Section titled Delete appDELETE /api/v1/orgs/{org_slug}/apps/{app_uuid}
Delete the app: releases on their way are canceled, its routes and domains removed, its replicas drained and their servers removed, its environment and secrets erased. It cannot be undone.
An app a service bills is deleted by ending that service now, as a
cancellation from the services page does: the answer has deleted
false, ending true and the service, and the app goes when the
service's terminate job runs. An app whose service is already ending
answers 409 already_ending.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
app_uuid |
path | string (uuid) | yes | |
org_slug |
path | string | yes | |
confirm |
query | string | yes | The app's name on the platform, typed to confirm |
reason |
query | string or null | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
List an app's releases, newest first, a page at a time
Section titled List an app's releases, newest first, a page at a timeGET /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments
List an app's releases, newest first, a page at a time. This API
names a release deployment, and the deployments array holds
them. limit takes 1 to 100 (20 when left out) and total counts
every release. Each one carries its status, source, trigger, build and
replica counts. trigger says what started it: push (a push to
the connected branch), manual (Deploy a branch or an image, an
upload, a promotion or a Redeploy), rebuild (Rebuild, or Pull again
for an image), rollback or deploy_hook. is_current is true
for the live release.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
app_uuid |
path | string (uuid) | yes | |
org_slug |
path | string | yes | |
limit |
query | integer | no | Default: 20. |
offset |
query | integer | no | Default: 0. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Deploy a branch or an image, which starts a release
Section titled Deploy a branch or an image, which starts a releasePOST /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments
Deploy a branch or an image, which starts a release. A git app
builds git_ref, a branch, tag or commit (its branch when left
out); an image app runs image_ref (its own when left out). A branch
or commit for an image app, or an image for a git app, is refused with
source_mismatch rather than ignored. The release has the trigger
manual.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
git_ref |
string or null | no | Branch, tag or commit; the app's branch when left out |
git_sha |
string or null | no | |
image_ref |
string or null | no | An image app's reference; the app's when left out |
Responses
Section titled Responses| Status | Meaning |
|---|---|
201 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Get one release of an app, with each of its replicas
Section titled Get one release of an app, with each of its replicasGET /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments/{deployment_uuid}
Get one release of an app, with each of its replicas.
replica_list gives each replica's region, state, failed health checks
in a row and last error. A release of another app answers 404.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
deployment_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Cancel a release that is still queued, building or deploying
Section titled Cancel a release that is still queued, building or deployingPOST /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments/{deployment_uuid}/cancel
Cancel a release that is still queued, building or deploying. Its build stops and its replicas are removed, and the live release goes on serving. A release that has finished answers 409.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
deployment_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
The end of the release's build log (secrets redacted as it was written)
Section titled The end of the release's build log (secrets redacted as it was written)GET /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments/{deployment_uuid}/log
The end of the release's build log (secrets redacted as it was written). A release of an image has none.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
deployment_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Rollback app
Section titled Rollback appPOST /api/v1/orgs/{org_slug}/apps/{app_uuid}/deployments/{deployment_uuid}/rollback
Roll back: a new release of this earlier ready release's image; its
replicas that still have servers are started again instead of placed.
The new release has the trigger rollback.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
deployment_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
201 |
Success. |
422 |
The request is not valid. detail lists each problem. |
List an app's domains: its platform name first, then its custom domains
Section titled List an app's domains: its platform name first, then its custom domainsGET /api/v1/orgs/{org_slug}/apps/{app_uuid}/domains
List an app's domains: its platform name first, then its custom domains.
Each says whether it is verified and whether its certificate is issued,
and an unverified one carries the TXT record to publish in
verification.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Add a custom domain
Section titled Add a custom domainPOST /api/v1/orgs/{org_slug}/apps/{app_uuid}/domains
Add a custom domain. It gets no route until the TXT record in
verification is published and checked.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
hostname |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
201 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Remove a custom domain from an app
Section titled Remove a custom domain from an appDELETE /api/v1/orgs/{org_slug}/apps/{app_uuid}/domains/{hostname}
Remove a custom domain from an app. The hostname stops reaching the
app, and its route and certificate are deleted. The platform name cannot
be removed (409 platform_domain), and a hostname the app does not
have answers 404.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
hostname |
path | string | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Look for the domain's TXT record
Section titled Look for the domain's TXT recordPOST /api/v1/orgs/{org_slug}/apps/{app_uuid}/domains/{hostname}/verify
Look for the domain's TXT record. Found: the domain is verified, its route is created and, once replicas serve it, its certificate ordered.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
hostname |
path | string | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
List an app's environment variables without their values
Section titled List an app's environment variables without their valuesGET /api/v1/orgs/{org_slug}/apps/{app_uuid}/env
List an app's environment variables without their values.
Each key comes with its target, whether it is secret and, for a
value of eight characters or more, its last four as hint.
readable is false when a saved value can no longer be read; set it
again.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Set many variables; a variable given without value keeps its saved one
Section titled Set many variables; a variable given without value keeps its saved onePUT /api/v1/orgs/{org_slug}/apps/{app_uuid}/env
Set many variables; a variable given without value keeps its
saved one. With replace every variable not listed is deleted.
Changes reach replicas with the next release.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
vars |
array of EnvVarIn | yes | |
vars[].key |
string | yes | |
vars[].value |
string or null | no | Left out: the saved value is kept |
vars[].secret |
boolean or null | no | Redacted from build logs; new variables default to true |
vars[].target |
string or null | no | |
replace |
boolean | no | Delete every variable not in vars |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Set one environment variable, creating it when it is new
Section titled Set one environment variable, creating it when it is newPUT /api/v1/orgs/{org_slug}/apps/{app_uuid}/env/{key}
Set one environment variable, creating it when it is new.
A new variable needs a value and is secret unless secret is
false; leave value out to keep the saved one while secret or
target change. A key the platform sets itself, such as PORT or
one starting CORITAN_, is refused with 422, except
CORITAN_ORG_API_KEY, CORITAN_WEBHOOK_SECRET and
CORITAN_MICROSOFT_ADS_FEED_URL, which your app reads at runtime.
Replicas get the change with the next release.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
key |
path | string | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
value |
string or null | no |
secret |
boolean or null | no |
target |
string or null | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Delete one environment variable
Section titled Delete one environment variableDELETE /api/v1/orgs/{org_slug}/apps/{app_uuid}/env/{key}
Delete one environment variable. Running replicas keep it until the next release. A key the app does not have answers 404.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
key |
path | string | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Start a release from the live release or from the branch again
Section titled Start a release from the live release or from the branch againPOST /api/v1/orgs/{org_slug}/apps/{app_uuid}/redeploy
Start a release from the live release or from the branch again.
{"rebuild": false}, the default, is Redeploy: the live release
runs again with the environment, size, region and replica changes
saved now, and nothing is built or pulled (source redeploy,
trigger manual). {"rebuild": true} is Rebuild: it builds
the newest commit on the app's branch again, or for an image app pulls
the saved image again (Pull again), and the new release replaces the
live one once it is healthy. Its trigger is rebuild. An app
with nothing live yet builds or pulls afresh either way, as Deploy a
branch does. Answers 201 with the new release under deployment;
409 while the app is not active.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json
| Field | Type | Required | Description |
|---|---|---|---|
rebuild |
boolean | no | false is Redeploy: the live release runs again with the environment, size and locations saved now, and nothing is built or pulled. true is Rebuild: the newest commit on the app's branch is built again, or for an image app the saved image is pulled again (Pull again), and the new release replaces the live one once it is healthy. A rebuild is recorded with the trigger rebuild |
Responses
Section titled Responses| Status | Meaning |
|---|---|
201 |
Success. |
422 |
The request is not valid. detail lists each problem. |
A new secret for the push webhook, shown once; the old one stops verifying at once
Section titled A new secret for the push webhook, shown once; the old one stops verifying at oncePOST /api/v1/orgs/{org_slug}/apps/{app_uuid}/webhook/rotate
A new secret for the push webhook, shown once; the old one stops verifying at once.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
app_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |