Skip to content

Start a new preview for each stack part of a review request

POST
/v1/previews/{org_uuid}

Create a new preview for each stack that is part of the preview run.

Stacks that are not yet known in the database identified by (repository, meta_id) will be created.
If new stacks are created, they will be assigned the status ok if no status is available in the payload.

The response contains a preview_id for the preview run.

The response contains stack_preview_id and meta_id for each stack that was submitted in the request payload.

Access

  • Members of the organization with member role.
  • Trusted GitHub Owner.

Authorizations

apiKey

API key as username in Basic Authorization with
empty password.

TypeAPI Key (header: Authorization)
or
jwtToken
TypeHTTP (bearer)

Parameters

Path Parameters

org_uuid*

UUID of the organization

Typestring
Required
format"uuid"

Request Body

application/json
JSON
{
"updated_at": 1707385396,
"pushed_at": 1707385396,
"commit_sha": "9730ff4ccab39c022404b41a435a179558f641c6",
"technology": "terraform",
"technology_layer": "default",
"review_request": {
"platform": "github",
"repository": "github.com/terramate-io/iac-gcloud",
"commit_sha": "deadc0decafebabecafed00ddeadbeeff00dface",
"branch": "some-branch-name",
"base_branch": "main",
"number": 23,
"title": "feat: Add feature X",
"description": "My Change Description with a lot of details. ",
"url": "https://github.com/terramate-io/iac-gcloud/pull/666",
"created_at": "string",
"updated_at": "string",
"pushed_at": "string",
"author": {
"login": "hacker",
"avatar_url": "https://avatar.url/hacker",
"id": "id"
},
"reviewers": [
{
"login": "hacker",
"avatar_url": "https://avatar.url/hacker",
"id": "id"
}
],
"labels": [
{
"name": "label1",
"color": "#000000",
"description": "label description"
}
],
"status": "open",
"draft": true,
"review_decision": "approved",
"changes_requested_count": 1,
"approved_count": 1,
"checks_total_count": 1,
"checks_failure_count": 1,
"checks_success_count": 1
},
"metadata": {
"additionalProperties": "string"
},
"stacks": [
{
"preview_status": "string",
"repository": "github.com/owner/repository",
"target": "staging",
"from_target": "staging",
"path": "/stacks/organizations/terramate.io/landing-zone/iam",
"default_branch": "main",
"meta_id": "deadbeef-babe-d00d-face-badc0de11111",
"meta_name": "My Stack Name",
"meta_description": "My Stack Description",
"meta_tags": [
[
"tagA",
"tagB"
]
],
"cmd": [
[
"terraform",
"plan"
]
]
}
]
}

Responses

Created

application/json
JSON
{
"preview_id": "42",
"stacks": [
{
"meta_id": "deadbeef-babe-d00d-face-badc0de11111 (not always uuid)",
"stack_preview_id": "42"
}
]
}

Playground

Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI