/v1/appsInstalls 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
428withaction: 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
blogandblog-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-Idempotencyto make retries safe. Repeating a create with the same key returns the originalapp_provisionoperation with200 OKandis_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 returns409withaction: 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-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
X-IdempotencystringOptional 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
templatestringRequiredSlug of an enabled template from List app templates. Case-insensitive.
namestringRequiredName 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_slugstringPlan 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_slugstringPlan 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
The app was created and provisioning started.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
operation_idstringUID of the app_provision operation. Omitted on delete.
appobjectRequiredShow attributesHide attributes
uidstringRequiredUnique identifier of the app.
namestringRequiredDisplay name.
slugstringRequiredURL-safe name, unique among the workspace's apps.
templatestringRequiredSlug of the template the app was created from.
statusstringRequiredprovisioning_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_urlstringURL of the app, taken from the web component (including a verified custom domain).
last_failurestringWhy provisioning failed. Omitted when there is no failure.
created_atstring (date-time)RequiredWhen the app was created.
componentsarray of objectsThe app's component deployments, in deploy order.
Show item attributesHide item attributes
rolestringRequiredRole of the component.
One ofdatabaseweb
deployment_uidstringRequiredUID of the component's deployment. Use it with the deployment endpoints.
namestringName of the component deployment. Omitted once the component is deleted.
statusstringStatus of the component deployment (see status on Get a deployment). Omitted once deleted.
plan_slugstringPlan of the component deployment. Omitted once deleted.
setup_notestringFirst-run instructions from the template, with the app's URL filled in.
env_docs_urlstringLink to the software's configuration reference.
statusstringRequiredrunning (the provisioning operation's status) on create, deleted on delete. On a replayed create, the operation's current status (running, succeeded or failed).
events_urlstringPath of the server-sent events stream with provisioning progress. Omitted on delete.
is_replaybooleanRequiredtrue when an X-Idempotency key was reused and the original result is returned.
is_completedbooleantrue when a replayed operation has already finished (always on a replayed delete). Omitted unless true.
Response
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.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
operation_idstringUID of the app_provision operation. Omitted on delete.
appobjectRequiredShow attributesHide attributes
uidstringRequiredUnique identifier of the app.
namestringRequiredDisplay name.
slugstringRequiredURL-safe name, unique among the workspace's apps.
templatestringRequiredSlug of the template the app was created from.
statusstringRequiredprovisioning_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_urlstringURL of the app, taken from the web component (including a verified custom domain).
last_failurestringWhy provisioning failed. Omitted when there is no failure.
created_atstring (date-time)RequiredWhen the app was created.
componentsarray of objectsThe app's component deployments, in deploy order.
Show item attributesHide item attributes
rolestringRequiredRole of the component.
One ofdatabaseweb
deployment_uidstringRequiredUID of the component's deployment. Use it with the deployment endpoints.
namestringName of the component deployment. Omitted once the component is deleted.
statusstringStatus of the component deployment (see status on Get a deployment). Omitted once deleted.
plan_slugstringPlan of the component deployment. Omitted once deleted.
setup_notestringFirst-run instructions from the template, with the app's URL filled in.
env_docs_urlstringLink to the software's configuration reference.
statusstringRequiredrunning (the provisioning operation's status) on create, deleted on delete. On a replayed create, the operation's current status (running, succeeded or failed).
events_urlstringPath of the server-sent events stream with provisioning progress. Omitted on delete.
is_replaybooleanRequiredtrue when an X-Idempotency key was reused and the original result is returned.
is_completedbooleantrue when a replayed operation has already finished (always on a replayed delete). Omitted unless true.
Errors
| Status | Meaning |
|---|---|
400 | Validation 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. |
401 | The API key is missing, invalid, expired or revoked. |
402 | The account is past due, so new paid resources cannot be created. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
409 | The X-Idempotency key was already used for a different action or a different app. Send a new key. |
428 | You have not accepted the acceptable use policy yet. |
Errors use the standard error format.