Create Service
Create a service inside an environment. The service is registered with the provisioner and persisted, service level secrets are optionally seeded, and an immediate first deployment is optionally triggered.
The service subdomain is generated by LocalOps and cannot be supplied.
deploy_now triggers a deployment right after creation with an empty target - the latest commit on the configured branch for git sources, and the latest tag for docker_image. No chart version is passed for helm_chart, so prefer deploy_now: false plus an explicit deploy call with helm_chart_version. deploy_now does not return a deployment id. If creation succeeds but the deployment fails, the service still exists and the call returns 500 with Service created successfully, but failed to deploy the service.
Authorizations
Your account API token, sent as Authorization: Bearer <api_token>. Owners and admins can read the token from the LocalOps console.
Path Parameters
The unique identifier of the environment
Body
Letters and spaces only. Digits, hyphens and underscores are rejected on create.
3 - 50github, gitlab, docker_image, helm_chart Optional, but drives other requirements
web, internal, worker, cron, job Required when type is web or internal
1 <= x <= 65535Required when type is cron
100Required unless source is helm_chart
x >= 0Required unless source is helm_chart
Required unless source is helm_chart
Pins the service to a node group
When true, the service cannot be deleted until protection is removed
Trigger a first deployment immediately after creation
Service level secrets, written to the provisioner after creation
GitHub App installation record id for github. For gitlab this field carries the GitLab connection id.
Required for github and gitlab, in org/repo form
Required for github and gitlab
Deploy on push. Git sources only, and rejected when type is job.
Git sources only. Trimmed server side.
Docker build context directory, relative to the repository root. Git sources only. Surrounding whitespace is trimmed and a blank value is treated as unset.
100Git and docker_image sources
Git sources only. Trimmed server side.
Inline ops JSON. Supported only when source is docker_image.
GitHub only, and allowed only when type is web. Required before PR preview deployments can be triggered.
GitHub only
Registry to pull the image from. docker_image source.
Required when source is docker_image
Required when source is helm_chart
Required when source is helm_chart
Contents of values.yaml as a single string