Raff Apps

Create app service

Changed on

Create an app service. Provisioning is asynchronous — the service is created in status pending and moves through building and deploying to live; poll GET /api/v1/apps/services/{service_id} for progress.

Choose a service_type: web (public HTTPS URL), private (in-cluster only), worker (long-running, no URL), cron (scheduled), or job (one-off). Pick a source_type: git (a connected GitHub repo), image (a prebuilt image), template (a starter), or compose. Deploy code afterwards with a source upload and a deployment, or set deploy_now for image sources.

post/api/v1/apps/services

Request

  • Base URL
    https://api.rafftechnologies.com
  • URL
    https://api.rafftechnologies.com/api/v1/apps/services
  • Auth
    API key in header X-API-Key

Headers

X-Project-IDstring uuid required

Project ID. Required for all mutating operations (create, delete, power actions, resize).

Request body

namestring required
descriptionstring
service_type'web' | 'private' | 'worker' | 'cron' | 'job' required
source_type'image' | 'git' | 'console' | 'template' | 'compose'

image runs image_ref (the builder is image); use it for a Docker image and for a template, with the template's image_ref, http_port, env and health_check_path from List app templates. git builds a GitHub repository. console builds source you upload (Request source upload, then create a deployment). template and compose are labels only and build like console.

builder'buildpacks' | 'dockerfile' | 'image'
image_refstring

Prebuilt image reference (for source_type image)

repo_full_namestring

GitHub repo (owner/name) for source_type git

github_installation_idstring uuid

For source_type git: the id of a GitHub connection, from List GitHub connections. The API key's owner must have used Continue with GitHub on the Raff create page in the last 7 days, and their GitHub account must see the repository; otherwise the create is refused.

repo_branchstring
repo_root_dirstring
dockerfile_pathstring
start_commandstring
tier_idinteger
replicasinteger

Fixed number of instances. An app can have at most 6 instances.

autoscaling_enabledboolean
min_replicasinteger

Fewest instances when autoscaling. Cannot be more than max_replicas.

max_replicasinteger

Most instances when autoscaling. An app can have at most 6 instances.

scale_to_zeroboolean

Stop every instance when idle. Only for web and private apps.

http_portinteger
health_check_pathstring
cron_schedulestring
cron_timezonestring
cron_concurrency'forbid' | 'allow' | 'replace'

Cron services only

regionstring
deploy_nowboolean

Deploy right away. For apps from an image or GitHub; refused for an app built from uploaded source (upload, then create a deployment).

link_database_idstring

A managed Postgres of this account (its short ID or UUID) to link before the first deploy. The app waits until the database runs (waiting_for_database), links it and then deploys, so DATABASE_URL is set from the start.

Response

App service created (status pending while provisioning)

successboolean
deployment_idstring uuid

Set when a deployment was queued at create time

Changes

    • breaking

      the / response's property format changed from uuid to no format for status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new console enum value to the request property

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • warning

      the request property's max was set to 6.00

    • warning

      the request property's max was set to 6.00

    • warning

      the request property's min was set to 1.00