Skip to content
HelicarrierDevelopers

Create a service from an upload

Create a new service from a base64-encoded source archive. Use reupload to update an existing upload service.

POST/api/projects/{projectSlug}/services/upload-b64HTTPS
Request & response examples
Request exampleServer-side
curl --fail-with-body --request POST \
'https://app.helicarrier.xyz/api/projects/my-project/services/upload-b64?env=staging' \
-H "Authorization: Bearer $HELI_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"name": "my-service",
"archiveBase64": "BASE64_ENCODED_SOURCE_ARCHIVE"
}'
Response example201
{
"service": {
"id": "svc_example",
"name": "my-app",
"slug": "my-app",
"sourceType": "upload",
"status": "running",
"planKey": "heli-s1",
"projectId": "prj_example",
"environmentId": "env_example"
},
"deploymentId": "dep_example"
}

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

Path parameters

projectSlugstringrequired

Target project slug.

Query parameters

envstringoptional

Target environment slug (e.g. dev, staging, production). This route takes the environment as a query argument, not in the body. 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.

Request body

namestringrequired

Service name.

runtimeModestringoptional

web | worker | private | static | cron | function (default web). worker = a background process with no port or URL; cron = runs startCommand on schedule.

schedulestringoptional

Five-field crontab expression, e.g. "*/15 * * * *". Required when runtimeMode is cron, refused otherwise.

archiveBase64stringrequired

The build context as a base64-encoded .tar.gz (or .zip) of your project folder.

rootDirstringoptional

Subdir the app lives in (optional).

installCommandstringoptional

Install override (optional).

buildCommandstringoptional

Build override (optional).

startCommandstringoptional

Start command (optional). For cron, the command run on each tick.

outputDirstringoptional

Static only: the directory the build writes the site to (e.g. dist).

internalPortintegeroptional

Port the app listens on (optional).

planKeystringoptional

Plan key from list_plans (e.g. heli-static). 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.

Response 201

This creates a new service each time. To ship a new version to an existing upload service, use Reupload service instead. Exclude dependencies and repository metadata from the archive.

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

serviceobject
Child 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.

deploymentIdstring

Identifier to use when reading deployment history or logs.

Errors

400

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

401

The API key is missing, invalid, or revoked.

403

The caller or key scope does not permit this operation.

409

The current resource state prevents the operation. Inspect it before retrying.

500

The operation could not be completed. Check resource state before retrying a write.

Error handling and safe retries
ALSO AVAILABLE VIA MCP

deploy_upload

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

Connect your agent