Skip to content
HelicarrierDevelopers

Create service

Create a service from a Git repository or container image: a web service, background worker, private service, static site, scheduled cron job or function, chosen with runtimeMode (a cron job also takes a schedule). Creation does not deploy unless you pass deploy: true; otherwise call deploy_service with the new id to start the first deployment. Without a planKey, the service goes on the free plan when the account can have one and a free service can run in that project, otherwise on the cheapest paid plan of its type; planNote in the response says which plan it got and why.

POST/api/servicesHTTPS
Request & response examples
Request exampleServer-side
curl --fail-with-body --request POST \
'https://app.helicarrier.xyz/api/services' \
-H "Authorization: Bearer $HELI_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"name": "my-app",
"projectSlug": "my-project",
"environmentSlug": "staging",
"image": "nginx:stable",
"internalPort": 80,
"planKey": "heli-s1"
}'
Response example201
{
"id": "svc_example",
"name": "my-app",
"slug": "my-app",
"sourceType": "image",
"status": "idle",
"planKey": "heli-free",
"projectId": "prj_example",
"environmentId": "env_example",
"nextStep": "Not deployed yet. Call deploy_service (POST /api/services/svc_example/deploy) to start the first deployment.",
"planNote": "my-app is on the free plan (heli-free). It sleeps after 5 minutes without traffic, and the next request wakes it, which takes at least 30 seconds. The account's free services share 500 free hours a month: 498 are left until November 1, and it is using 1 of its 10 free services. To keep it always on, move it to a paid plan with set_plan."
}

Illustrative values · selected fields

Authorization

An account key with access, or a project key with project:write. A service key cannot perform this operation.

Authorization: Bearer <key>Key setup

Request body

namestringrequired

Service name.

projectSlugstringoptional

Target project slug. Set this explicitly for automation; project keys require their own project. An account key that omits it uses the default project, if one exists.

environmentSlugstringoptional

Target environment slug (e.g. dev, staging, production). Optional for a normal key — the project's default environment is used. REQUIRED when your API key is restricted to specific environments; call whoami to see whether yours is.

repoUrlstringoptional

Git repo URL (for source builds).

branchstringoptional

Git branch to track and build (default main).

imagestringoptional

Docker image ref (for image services).

runtimeModestringoptional

web | worker | private | static | cron | function (default web). Use worker for a background process that serves no HTTP (queue consumers, bots, schedulers that loop) and cron for a job that runs on a schedule.

schedulestringoptional

Five-field crontab expression, e.g. "*/15 * * * *". Required when runtimeMode is cron, refused otherwise. startCommand is the command each run executes.

internalPortintegeroptional

Port the app listens on (web/private/function; ignored for worker and cron).

rootDirstringoptional

Git: subdir the app lives in, e.g. apps/api. Empty for the repo root.

builderstringoptional

Git: "" auto | railpack | dockerfile | next.

dockerfilePathstringoptional

Git: path to a Dockerfile relative to the root dir.

installCommandstringoptional

Git: install command override.

buildCommandstringoptional

Git: build command override (for static, the command that produces outputDir).

startCommandstringoptional

For cron (git or image): the command run on each tick. For a git service: the start command override, e.g. "node worker.js" for a worker. An image service otherwise runs the image's own CMD and refuses startCommand.

releaseCommandstringoptional

Command run once before each release (migrations).

outputDirstringoptional

Git static sites only: the directory the build writes the site to (e.g. dist).

healthCheckPathstringoptional

HTTP path that must answer 2xx before a deploy goes live, e.g. /healthz (web services).

planKeystringoptional

Plan key from list_plans (e.g. heli-s1). If omitted: the free plan when the account can have one and a free service can run there, else the cheapest paid plan of the service type.

readonlyRootfsbooleanoptional

Read-only root filesystem; ON by default for new services. /tmp and /run stay writable but are noexec, so pass false for apps that download and run a binary at runtime (puppeteer/playwright Chromium, self-extracting tools) or write to their own files.

deploybooleanoptional

true to also queue the first deployment in the same call (default false: create only). If the deploy is refused the service is still created, and deployRefused and nextStep say why.

Response 201

Creation does not deploy unless deploy is true: otherwise call the deploy operation with the returned id to start the first deployment, which starts a billed resource. Choose a plan before creating the service; without one, the service goes on the free plan where a free service can run, otherwise on the cheapest paid plan of its type. Supply either a Git repository or a container image.

Examples show selected response fields with illustrative values. Your response can contain additional fields.

idstring

Unique identifier of this resource.

namestring

Human-readable resource name.

slugstring

URL-safe resource identifier.

sourceTypestring

Source used to build or run the service.

statusstring

Current state of the resource or operation.

planKeystring

Plan identifier from the plan catalog.

projectIdstring

Project that owns the resource.

environmentIdstring

Environment that contains the service.

nextStepstring
planNotestring

What the plan the new resource landed on means: on the free plan, how it sleeps and wakes and what the account has left; on a paid plan you did not name, why it is not free. Empty otherwise.

Errors

400

Invalid parameters. Check the required fields, types, and resource configuration.

401

The API key is missing, invalid, or revoked.

402

The account must resolve a billing requirement before continuing.

403

The caller or key scope does not permit this operation.

404

The resource does not exist or is not visible to this caller.

Error handling and safe retries
ALSO AVAILABLE VIA MCP

create_service

Required MCP arguments: name, projectSlug. Send path, query, and body fields together as tool arguments.

Connect your agent