|Docs

Manage Services with the Public API

Here are examples to help you manage your services using the Public API.

Get a service

Fetch a service by ID:

Variables

Get a service instance

Get detailed service configuration for a specific environment:

Variables

Create a service

From a GitHub repository

Variables

From a Docker image

Variables

Empty service (no source)

Create an empty service that you can configure later:

Variables

Update a service

Update service name or icon:

Variables

Update service instance settings

Update build/deploy settings for a service in a specific environment. Click "Additional options" to see all available settings:

Variables

Connect a service to a repo

Connect an existing service to a GitHub repository:

Variables

Disconnect a service from a repo

Variables

Deploy a service

Trigger a new deployment for a service. Returns the deployment ID.

Variables

By default this deploys the commit currently associated with the service (the same commit serviceInstanceRedeploy would use). To deploy a specific commit — for example, the latest HEAD of a connected GitHub branch — pass commitSha:

Variables

The commitSha is validated against the connected GitHub repo; an unknown SHA returns a "Commit not found" error and no deployment is created.

Redeploy a service

Redeploy the service's latest deployment using its existing commit. This does not check the connected GitHub repo for new commits — use the commitSha argument on serviceInstanceDeployV2 to deploy a specific commit.

Variables

Get resource limits

Get the resource limits for a service instance (returns a JSON object):

Variables

Delete a service

Variables