Promote a commit
POST
/api/orgs/{org}/projects/{project}/environments/{env}/promote
const url = 'https://api.wrktr.com/api/orgs/example/projects/example/environments/example/promote';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"commit":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.wrktr.com/api/orgs/example/projects/example/environments/example/promote \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "commit": "example" }'Deploys commit to a promote environment (by default what its from environment has live). An older commit than what’s live is a rollback.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”org
required
string
project
required
string
env
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”RunView
Media typeapplication/json
object
id
required
string
environment
required
string
commit
required
string
title
required
string
trigger
required
string
state
required
string
steps
required
Array<object>
object
name
required
string
run
required
string
state
required
string
tail
required
string
hasLog
required
boolean
verify
workers
Any of:
null
Example
{ "number": "Infinity", "trigger": "land", "createdAt": "Infinity", "startedAt": "Infinity", "finishedAt": "Infinity", "state": "queued", "steps": [ { "state": "pending", "startedAt": "Infinity", "finishedAt": "Infinity", "exitCode": "Infinity" } ], "verify": { "state": "checking", "checkedAt": "Infinity" }}Unauthorized
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Unauthorized"}ProjectNotFound | NotFound
RunRefused
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "RunRefused"}