Skip to main content
POST

Authorizations

Authorization
string
header
required

Your account API token, sent as Authorization: Bearer <api_token>. Owners and admins can read the token from the LocalOps console.

Path Parameters

envId
string<uuid>
required

The unique identifier of the environment

Body

application/json
name
string
required

Letters and spaces only. Digits, hyphens and underscores are rejected on create.

Required string length: 3 - 50
source
enum<string>
required
Available options:
github,
gitlab,
docker_image,
helm_chart
type
enum<string>

Optional, but drives other requirements

Available options:
web,
internal,
worker,
cron,
job
port
integer

Required when type is web or internal

Required range: 1 <= x <= 65535
cron_schedule
string

Required when type is cron

Maximum string length: 100
replica_count
integer

Required unless source is helm_chart

Required range: x >= 0
cpu_count_min
number

Required unless source is helm_chart

cpu_count_max
number
memory_mb_min
integer

Required unless source is helm_chart

memory_mb_max
integer
prov_node_group_id
string<uuid>

Pins the service to a node group

is_protected
boolean

When true, the service cannot be deleted until protection is removed

deploy_now
boolean

Trigger a first deployment immediately after creation

secrets
object[]

Service level secrets, written to the provisioner after creation

installation_id
string<uuid>

GitHub App installation record id for github. For gitlab this field carries the GitLab connection id.

git_repo_full_name
string

Required for github and gitlab, in org/repo form

git_repo_branch
string

Required for github and gitlab

auto_deploy
boolean

Deploy on push. Git sources only, and rejected when type is job.

dockerfile_path
string

Git sources only. Trimmed server side.

build_context
string

Docker build context directory, relative to the repository root. Git sources only. Surrounding whitespace is trimmed and a blank value is treated as unset.

Maximum string length: 100
run_command
string

Git and docker_image sources

ops_json_path
string

Git sources only. Trimmed server side.

ops_json
string

Inline ops JSON. Supported only when source is docker_image.

enable_previews
boolean

GitHub only, and allowed only when type is web. Required before PR preview deployments can be triggered.

enable_code_review
boolean

GitHub only

docker_registry
string

Registry to pull the image from. docker_image source.

docker_image
string

Required when source is docker_image

helm_chart_repo
string

Required when source is helm_chart

helm_chart_name
string

Required when source is helm_chart

helm_values_yml
string

Contents of values.yaml as a single string

Response

Service created

message
string
data
object