Skip to content

Create an app

POST/v1/apps

Installs an app from a template. The app and all of its component deployments are created at once and every component starts in parallel. The app's status moves from provisioning_database (templates with backing services) or provisioning_app to active once every component is ready, and public_url is then set.

If a component fails, the app becomes failed with the reason in last_failure, and the components that were started are deleted, including their volumes, so nothing keeps billing.

This is asynchronous. It returns 202 Accepted with the operation_id of the app_provision operation, which is running from the start. Follow it with Get an operation or poll Get an app.

Things to know:

  • You must accept the acceptable use policy first. Until then this endpoint returns 428 with action: accept_acceptable_use_policy.
  • Each component is billed as its own deployment, plus its volume. Apps cannot use the Free plan, because they must stay always on.
  • Component deployments are named after the app, with the template's suffix for backing services (for example blog and blog-db).
  • Open the app soon after it is live and follow setup_note: many apps let the first visitor create the admin account.
  • Send X-Idempotency to make retries safe. Repeating a create with the same key returns the original app_provision operation with 200 OK and is_replay: true, and no second app is created. The key is checked before anything else, including the past-due check. Reusing it for a different action returns 409 with action: idempotency_key_reused.

Authentication

Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

X-Idempotencystring

Optional key that makes retries safe. Repeating a request with a key already used for the same action returns the original result with 200 OK and is_replay: true. Reusing it for a different action or app returns 409 with action: idempotency_key_reused.

Request body

templatestringRequired

Slug of an enabled template from List app templates. Case-insensitive.

namestringRequired

Name of the app. Leading and trailing spaces are trimmed. The slug is derived from it, with a short suffix added if it is taken in the workspace.

plan_slugstring

Plan for the web component (and for any component without a pinned plan), from List deployment plans. Defaults to the template's default_plan_slug. Free plans are rejected.

db_plan_slugstring

Plan for the primary database component (suffix db). Defaults to the template's db_default_plan_slug. Other backing services always use their pinned plan.

Response

202

The app was created and provisioning started.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
operation_idstring

UID of the app_provision operation. Omitted on delete.

appobjectRequired
Show attributes
uidstringRequired

Unique identifier of the app.

namestringRequired

Display name.

slugstringRequired

URL-safe name, unique among the workspace's apps.

templatestringRequired

Slug of the template the app was created from.

statusstringRequired

provisioning_database while backing services start, provisioning_app once they are ready and the web component is starting, active when every component is ready, failed if provisioning failed (see last_failure), deleted after deletion.

One ofprovisioning_databaseprovisioning_appactivefaileddeleted

public_urlstring

URL of the app, taken from the web component (including a verified custom domain).

last_failurestring

Why provisioning failed. Omitted when there is no failure.

created_atstring (date-time)Required

When the app was created.

componentsarray of objects

The app's component deployments, in deploy order.

Show item attributes
rolestringRequired

Role of the component.

One ofdatabaseweb

deployment_uidstringRequired

UID of the component's deployment. Use it with the deployment endpoints.

namestring

Name of the component deployment. Omitted once the component is deleted.

statusstring

Status of the component deployment (see status on Get a deployment). Omitted once deleted.

plan_slugstring

Plan of the component deployment. Omitted once deleted.

setup_notestring

First-run instructions from the template, with the app's URL filled in.

env_docs_urlstring

Link to the software's configuration reference.

statusstringRequired

running (the provisioning operation's status) on create, deleted on delete. On a replayed create, the operation's current status (running, succeeded or failed).

events_urlstring

Path of the server-sent events stream with provisioning progress. Omitted on delete.

is_replaybooleanRequired

true when an X-Idempotency key was reused and the original result is returned.

is_completedboolean

true when a replayed operation has already finished (always on a replayed delete). Omitted unless true.

Response

200

Replay. The X-Idempotency key was already used for a create, so the original app_provision operation is returned and nothing new is created. status is the operation's current status.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
operation_idstring

UID of the app_provision operation. Omitted on delete.

appobjectRequired
Show attributes
uidstringRequired

Unique identifier of the app.

namestringRequired

Display name.

slugstringRequired

URL-safe name, unique among the workspace's apps.

templatestringRequired

Slug of the template the app was created from.

statusstringRequired

provisioning_database while backing services start, provisioning_app once they are ready and the web component is starting, active when every component is ready, failed if provisioning failed (see last_failure), deleted after deletion.

One ofprovisioning_databaseprovisioning_appactivefaileddeleted

public_urlstring

URL of the app, taken from the web component (including a verified custom domain).

last_failurestring

Why provisioning failed. Omitted when there is no failure.

created_atstring (date-time)Required

When the app was created.

componentsarray of objects

The app's component deployments, in deploy order.

Show item attributes
rolestringRequired

Role of the component.

One ofdatabaseweb

deployment_uidstringRequired

UID of the component's deployment. Use it with the deployment endpoints.

namestring

Name of the component deployment. Omitted once the component is deleted.

statusstring

Status of the component deployment (see status on Get a deployment). Omitted once deleted.

plan_slugstring

Plan of the component deployment. Omitted once deleted.

setup_notestring

First-run instructions from the template, with the app's URL filled in.

env_docs_urlstring

Link to the software's configuration reference.

statusstringRequired

running (the provisioning operation's status) on create, deleted on delete. On a replayed create, the operation's current status (running, succeeded or failed).

events_urlstring

Path of the server-sent events stream with provisioning progress. Omitted on delete.

is_replaybooleanRequired

true when an X-Idempotency key was reused and the original result is returned.

is_completedboolean

true when a replayed operation has already finished (always on a replayed delete). Omitted unless true.

Errors

StatusMeaning
400Validation failed: invalid request (malformed JSON, or template or name missing), unknown app template, name is required, invalid deployment plan, deployment plan is not available, or one-click apps cannot use the Free plan; choose Tiny or a larger plan so the app stays always on.
401The API key is missing, invalid, expired or revoked.
402The account is past due, so new paid resources cannot be created.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
409The X-Idempotency key was already used for a different action or a different app. Send a new key.
428You have not accepted the acceptable use policy yet.

Errors use the standard error format.