deployment_service_create
Create a service inside an environment.
Create a service inside an environment from a git branch, a container image, a compose stack, or a static build. Returns: `{ service, deployment_id }`; the new service starts in an Initializing state. Typical sequence: deployment_service_create → deployment_deployment_get (poll until status is ready or error). Fails when: the environment does not exist, or the source repository or branch is unreachable.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| environmentId | uuid | • | Environment the service is created in. |
| name | string | • | Human-readable service name (1–80 chars). |
| source | object | • | Where the service builds from: a git branch, a container image, a compose stack, or a static build. |
| slug | string | — | URL slug (1–40 chars). Derived from the name when omitted. |
| containerPort | integer | — | Port the container listens on. default: 8080 |
| replicas | integer | — | Number of running replicas (0–50). default: 1 |
Try it
Create a service called api in my staging environment from the main branch of my repo.