Skip to content

Submit a Terraform plan from CI

POST
/api/v1/ingest/terraform-plans
curl --request POST \
--url https://api.aletheia-ops.com/api/v1/ingest/terraform-plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "external_id": "example", "execution_external_id": "example", "repository": "example", "project_path": "example", "workspace": "example", "commit_sha": "example", "branch": "example", "pull_request_number": 1, "source": "example", "terraform_version": "example", "plan_json": "example" }'
Media typeapplication/json

Body of POST /ingest/terraform-plans

object
external_id
string
execution_external_id
string
repository
string
project_path
string
workspace
string
commit_sha
string
branch
string
pull_request_number
integer
source
required
string
terraform_version
string
plan_json
required
Examplegenerated
{
"external_id": "example",
"execution_external_id": "example",
"repository": "example",
"project_path": "example",
"workspace": "example",
"commit_sha": "example",
"branch": "example",
"pull_request_number": 1,
"source": "example",
"terraform_version": "example",
"plan_json": "example"
}

Accepted

Media typeapplication/json

202 response of the plan ingest endpoint

object
plan_id
string
url
string
Examplegenerated
{
"plan_id": "example",
"url": "example"
}

The request is malformed or fails validation.

Media typeapplication/json
object
code
required

Stable, machine-readable identifier. Branch on this.

string
message
required

Human-readable explanation. Safe to display; do not parse.

string
Examples
{
"code": "validation_failed",
"message": "name: must not be blank"
}

No valid credential was presented, or it has expired.

Media typeapplication/json
object
code
required

Stable, machine-readable identifier. Branch on this.

string
message
required

Human-readable explanation. Safe to display; do not parse.

string
Examples
{
"code": "unauthorized",
"message": "authentication required"
}

Authenticated, but not permitted to perform this action.

Media typeapplication/json
object
code
required

Stable, machine-readable identifier. Branch on this.

string
message
required

Human-readable explanation. Safe to display; do not parse.

string
Examples
{
"code": "forbidden",
"message": "you do not have permission to perform this action"
}

The request conflicts with the current state.

Media typeapplication/json
object
code
required

Stable, machine-readable identifier. Branch on this.

string
message
required

Human-readable explanation. Safe to display; do not parse.

string
Examples
{
"code": "email_taken",
"message": "an account with this email already exists"
}

The request body exceeds the configured limit. Terraform plans are capped by CRITIAS_INGEST_MAX_PLAN_BYTES (32 MiB by default); webhook bodies have their own limit.

Media typeapplication/json
object
code
required

Stable, machine-readable identifier. Branch on this.

string
message
required

Human-readable explanation. Safe to display; do not parse.

string
Examples
Examplepayload_too_large
{
"code": "payload_too_large",
"message": "plan exceeds CRITIAS_INGEST_MAX_PLAN_BYTES"
}

An unexpected failure. Diagnostic detail is logged server-side and deliberately not returned. Quote the X-Request-Id response header when reporting one.

Media typeapplication/json
object
code
required

Stable, machine-readable identifier. Branch on this.

string
message
required

Human-readable explanation. Safe to display; do not parse.

string
Examples
Exampleinternal_error
{
"code": "internal_error",
"message": "internal server error"
}