Deployments
How your Bash is set up, in versions: apply a whole vestra.yaml, promote, roll back, and the interview that drafts the file.
POST/v1/deployments/{deployment_id}/rollbackPut an earlier version back live, instantly.
Request3 fields
Path
deployment_idstringrequiredThe deployment's id (dep_...). The /v1/deployments routes also take its name.
- Type
string
Headers
Idempotency-KeystringSend the same key to retry this call safely for 24 hours.
- Type
string
Body, if you send one
versionintegerThe earlier version to put back live. Absent: the one live before this.
- Limits
- At least 1.
Answers 2003 fields
deploymentobjectThe deployment, after the promotion.
idstringThe deployment's id.
- Example
dep_8f2k
object"deployment"Always deployment.
- Type
"deployment"
namestringIts name, as people read it.
- Type
string
slugstringIts name in URLs and refs: send it where a route takes {deployment_id}.
- Example
trip-rescue
descriptionstringWhat it is for; empty when none was given.
- Type
string
base"bash"What it is built on: always bash.
- Type
"bash"
status"active" | "archived"active, or archived (put away: no new conversation or version reaches it).
- Type
"active" | "archived"
draft_versionintegerThe version test keys run. A new save moves it there; a promote with a test key moves it to the version named, older ones included.
- Type
integer
live_versioninteger | nullThe version live keys run; null until one is promoted.
- Type
integer | null
created_atstringWhen it was made, as an ISO 8601 date and time in UTC.
- Type
string
updated_atstringWhen it last changed, as an ISO 8601 date and time in UTC.
- Type
string
promotionobject | nullWhat moved; null when the version was already live, so nothing did.
object"deployment_promotion"Always deployment_promotion.
- Type
"deployment_promotion"
deployment_idstringThe deployment's id.
- Example
dep_8f2k
action"promote" | "rollback"promote (a version went live) or rollback (an earlier one went back live).
- Type
"promote" | "rollback"
from_versioninteger | nullThe version live before; null when none was.
- Type
integer | null
to_versionintegerThe version live now.
- Type
integer
verdict"passed" | "failed" | "none" | "rollback"The version's tests when it went live: passed, none (there were none to run), or rollback.
- Type
"passed" | "failed" | "none" | "rollback"
created_atstringWhen it went live, as an ISO 8601 date and time in UTC.
- Type
string
became_defaultbooleanTrue when this made the deployment the company's default: an ask that names no deployment now reaches it.
- Type
boolean
const live = new Vestra({ apiKey: process.env.VESTRA_LIVE_KEY });await live.deploy.rollback('travel-help');live = Vestra(api_key=os.environ["VESTRA_LIVE_KEY"])live.deploy.rollback("travel-help")VESTRA_API_KEY=$VESTRA_LIVE_KEY vestra deploy --rollback travel-help# Publish a change. Send the whole file as JSON, by its name. The first call creates the deployment, and a# file that changes nothing makes no new version. Its tests run, and when they pass the version goes live in# your key's mode: test traffic with a test key, real users with a live key. A test plays your own tools with# tool_results. The first deployment you promote becomes the default, and every ask that names no deployment# goes to it. became_default is true when this call made it the default. If the call waits for tests, that# happens when they pass.curl -X PUT "$VESTRA_BASE_URL/v1/deployments/trip-rescue?promote=after_tests" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "trip-rescue", "instructions": "You help Tripnest travellers fix broken trips. Always offer two options.", "apps": ["gmail", "google-calendar"], "tools": [{ "function": "get_booking", "description": "A booking by its PNR", "input": { "pnr": "string" }, "read_only": true }], "approvals": ["payment", "booking", "cancellation"], "tests": [{ "name": "Bag allowance", "ask": "How many kilos can I take on booking TN-48213?", "expect": "Says 7 kg of cabin baggage.", "tool_results": { "get_booking": { "cabin_kg": 7 } } }] }' # Read the file and its versions. The file comes back as YAML.curl "$VESTRA_BASE_URL/v1/deployments/trip-rescue?format=yaml" \ -H "Authorization: Bearer $VESTRA_API_KEY" curl "$VESTRA_BASE_URL/v1/deployments/dep_4kq/versions" \ -H "Authorization: Bearer $VESTRA_API_KEY" # Roll back to the previous version. The version that was live before comes back at once. This needs a live key.curl -X POST "$VESTRA_BASE_URL/v1/deployments/dep_4kq/rollback" \ -H "Authorization: Bearer $VESTRA_LIVE_KEY"No sample in your language for this route, so here it is over HTTP.
# Publish a change. Send the whole file as JSON, by its name. The first call creates the deployment, and a# file that changes nothing makes no new version. Its tests run, and when they pass the version goes live in# your key's mode: test traffic with a test key, real users with a live key. A test plays your own tools with# tool_results. The first deployment you promote becomes the default, and every ask that names no deployment# goes to it. became_default is true when this call made it the default. If the call waits for tests, that# happens when they pass.curl -X PUT "$VESTRA_BASE_URL/v1/deployments/trip-rescue?promote=after_tests" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "trip-rescue", "instructions": "You help Tripnest travellers fix broken trips. Always offer two options.", "apps": ["gmail", "google-calendar"], "tools": [{ "function": "get_booking", "description": "A booking by its PNR", "input": { "pnr": "string" }, "read_only": true }], "approvals": ["payment", "booking", "cancellation"], "tests": [{ "name": "Bag allowance", "ask": "How many kilos can I take on booking TN-48213?", "expect": "Says 7 kg of cabin baggage.", "tool_results": { "get_booking": { "cabin_kg": 7 } } }] }' # Read the file and its versions. The file comes back as YAML.curl "$VESTRA_BASE_URL/v1/deployments/trip-rescue?format=yaml" \ -H "Authorization: Bearer $VESTRA_API_KEY" curl "$VESTRA_BASE_URL/v1/deployments/dep_4kq/versions" \ -H "Authorization: Bearer $VESTRA_API_KEY" # Roll back to the previous version. The version that was live before comes back at once. This needs a live key.curl -X POST "$VESTRA_BASE_URL/v1/deployments/dep_4kq/rollback" \ -H "Authorization: Bearer $VESTRA_LIVE_KEY"