- Overview
- Plans and Features
- Getting Started
- API Docs template
- Overview
- Account
- Agent Pools
- Agent Tokens
- Applies
- Audit Trails
- Assessment Results
- Comments
- Configuration Versions
- Cost Estimates
- Feature Sets
- Invoices
- IP Ranges
- Notification Configurations
- OAuth Clients
- OAuth Tokens
- Organizations
- Organization Memberships
- Organization Tags
- Organization Tokens
- Plan Exports
- Plans
- Policies
- Policy Checks
- Policy Sets
- Policy Set Parameters
- Runs
- Run Triggers
- SSH Keys
- State Versions
- State Version Outputs
- Subscriptions
- Team Access
- Team Membership
- Team Tokens
- Teams
- User Tokens
- Users
- Variables
- VCS Events
- Workspaces
- Workspace-Specific Variables
- Workspace Resources
- Variable Sets
- Changelog
- Stability Policy
- Migrating to Terraform Cloud
- Overview
- Part 1: Overview of Our Recommended Workflow
- Part 2: Evaluating Your Current Provisioning Practices
- Part 3: How to Evolve Your Provisioning Practices
- Part 3.1: From Manual Changes to Semi-Automation
- Part 3.2: From Semi-Automation to Infrastructure as Code
- Part 3.3: From Infrastructure as Code to Collaborative Infrastructure as Code
- Part 3.4: Advanced Workflow Improvements
- Terraform Cloud Agents
- Intro to Terraform
- Configuration Language
- Terraform CLI
- Terraform Cloud
- Terraform Enterprise
- Provider Use
- Plugin Development
- Registry Publishing
- Integration Program
- Terraform Tools
- CDK for Terraform
- Glossary
Terraform Cloud
Other Docs
A new platform for documentation and tutorials is launching soon.
We are migrating Terraform documentation into HashiCorp Developer, our new developer experience.
»Comments API
Comments allow users to leave feedback or record decisions about a run.
»List Comments for a Run
GET /runs/:id/comments
Parameter | Description |
---|---|
id | The ID of the run. |
»Sample Request
$ curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/runs/run-KTuq99JSzgmDSvYj/comments
$ curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/runs/run-KTuq99JSzgmDSvYj/comments
»Sample Reponse
{ "data": [ { "id": "wsc-JdFX3u8o114F4CWf", "type": "comments", "attributes": { "body": "A comment body" }, "relationships": { "run-event": { "data": { "id": "re-fo1YXZ8W5bp5GBKM", "type": "run-events" }, "links": { "related": "/api/v2/run-events/re-fo1YXZ8W5bp5GBKM" } } }, "links": { "self": "/api/v2/comments/wsc-JdFX3u8o114F4CWf" } }, { "id": "wsc-QdhSPFTNoCTpfafp", "type": "comments", "attributes": { "body": "Another comment body" }, "relationships": { "run-event": { "data": { "id": "re-fo1YXZ8W5bp5GBKM", "type": "run-events" }, "links": { "related": "/api/v2/run-events/re-fo1YXZ8W5bp5GBKM" } } }, "links": { "self": "/api/v2/comments/wsc-QdhSPFTNoCTpfafp" } } ] }
{
"data": [
{
"id": "wsc-JdFX3u8o114F4CWf",
"type": "comments",
"attributes": {
"body": "A comment body"
},
"relationships": {
"run-event": {
"data": {
"id": "re-fo1YXZ8W5bp5GBKM",
"type": "run-events"
},
"links": {
"related": "/api/v2/run-events/re-fo1YXZ8W5bp5GBKM"
}
}
},
"links": {
"self": "/api/v2/comments/wsc-JdFX3u8o114F4CWf"
}
},
{
"id": "wsc-QdhSPFTNoCTpfafp",
"type": "comments",
"attributes": {
"body": "Another comment body"
},
"relationships": {
"run-event": {
"data": {
"id": "re-fo1YXZ8W5bp5GBKM",
"type": "run-events"
},
"links": {
"related": "/api/v2/run-events/re-fo1YXZ8W5bp5GBKM"
}
}
},
"links": {
"self": "/api/v2/comments/wsc-QdhSPFTNoCTpfafp"
}
}
]
}
»Show a Comment
GET /comments/:id
Parameter | Description |
---|---|
id | The ID of the comment. |
»Sample Request
$ curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/comments/wsc-gTFq83JSzjmAvYj
$ curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/comments/wsc-gTFq83JSzjmAvYj
»Sample Response
{ "data": { "id": "wsc-gTFq83JSzjmAvYj", "type": "comments", "attributes": { "body": "Another comment" }, "relationships": { "run-event": { "data": { "id": "re-8RB5ZaFrDanG2hGY", "type": "run-events" }, "links": { "related": "/api/v2/run-events/re-8RB5ZaFrDanG2hGY" } } }, "links": { "self": "/api/v2/comments/wsc-gTFq83JSzjmAvYj" } } }
{
"data": {
"id": "wsc-gTFq83JSzjmAvYj",
"type": "comments",
"attributes": {
"body": "Another comment"
},
"relationships": {
"run-event": {
"data": {
"id": "re-8RB5ZaFrDanG2hGY",
"type": "run-events"
},
"links": {
"related": "/api/v2/run-events/re-8RB5ZaFrDanG2hGY"
}
}
},
"links": {
"self": "/api/v2/comments/wsc-gTFq83JSzjmAvYj"
}
}
}
»Create Comment
POST /runs/:id/comments
Parameter | Description |
---|---|
id | The ID of the run. |
»Request Body
This POST endpoint requires a JSON object with the following properties as the request payload.
Key Path | Type | Default | Description |
---|---|---|---|
data.type | string | Must be "comments" . | |
data.attributes.body | string | The body of the comment. |
»Sample Payload
{ "data": { "attributes": { "body": "A comment about the run", }, "type": "comments" } }
{
"data": {
"attributes": {
"body": "A comment about the run",
},
"type": "comments"
}
}
»Sample Request
$ curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ --request POST \ --data @payload.json \ https://app.terraform.io/api/v2/runs/run-KTuq99JSzgmDSvYj/comments
$ curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
--request POST \
--data @payload.json \
https://app.terraform.io/api/v2/runs/run-KTuq99JSzgmDSvYj/comments
»Sample Response
{ "data": { "id": "wsc-oRiShushpgLU4JD2", "type": "comments", "attributes": { "body": "A comment about the run" }, "relationships": { "run-event": { "data": { "id": "re-E3xsBX11F1fbm2zV", "type": "run-events" }, "links": { "related": "/api/v2/run-events/re-E3xsBX11F1fbm2zV" } } }, "links": { "self": "/api/v2/comments/wsc-oRiShushpgLU4JD2" } } }
{
"data": {
"id": "wsc-oRiShushpgLU4JD2",
"type": "comments",
"attributes": {
"body": "A comment about the run"
},
"relationships": {
"run-event": {
"data": {
"id": "re-E3xsBX11F1fbm2zV",
"type": "run-events"
},
"links": {
"related": "/api/v2/run-events/re-E3xsBX11F1fbm2zV"
}
}
},
"links": {
"self": "/api/v2/comments/wsc-oRiShushpgLU4JD2"
}
}
}