Skip to content
Skip to Content

Deploy a service

POST
/services/{serviceId}/deployments

Deploys the service as it is set now: an image at once; a Git source once it is built (status queued, then building). Variables and settings are taken as they are at this moment.

Authorization

bearer
headerAuthorizationBearer <token>

An API key (opk_…) or a CLI token (opc_…).

Path parameters

serviceId*string

The service's id.

Header parameters

Idempotency-Key?string

Any unique string up to 255 characters. Sending the same request again with it returns the first answer instead of creating twice.

Lengthlength <= 255

Request body

application/json
  1. body
commit?string

For a Git source: the commit to build. Default the branch's latest.

Lengthlength <= 64

Response body

Deploy a service

application/json
  1. response
id*string
Formatuuid
serviceId*string
Formatuuid
projectId*string
Formatuuid
status*string
Value in"queued""building""deploying""running""failed""superseded""cancelled"
commit*string|null
image*string|null
config*

The service's settings when this deployment was made, and where each replica runs.

rollbackOf*|null
error*string|null
createdBy*string|null
createdAt*string
Formatdate-time
finishedAt*|null
Example request
curl -X POST "https://openpanel.sh/api/v1/services/$SERVICE_ID/deployments" \  -H "Authorization: Bearer $OPENPANEL_TOKEN" \  -H "Content-Type: application/json" \  -d '{}'
Example response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "serviceId": "8f8bb40f-b96b-40fe-9064-5031fbe483f9",  "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",  "status": "queued",  "commit": "string",  "image": "string",  "config": {    "property1": null,    "property2": null  },  "rollbackOf": "65f4f6e9-31b7-43b4-9674-5c6963c953c2",  "error": "string",  "createdBy": "string",  "createdAt": "2019-08-24T14:15:22Z",  "finishedAt": "2019-08-24T14:15:22Z"}