- Terraform Enterprise
- 1.1.x (latest)
- 1.0.x
- v202507-1
- v202506-1
- v202505-1
- v202504-1
- v202503-1
- v202502-2
- v202502-1
- v202501-1
- v202411-2
- v202411-1
- v202410-1
- v202409-2
- v202409-1
- v202408-1
- No versions of this document exist before v202408-1. Click below to redirect to the version homepage.
- v202407-1
- v202406-1
- v202405-1
- v202404-2
- v202404-1
- v202402-2
- v202402-1
- v202401-2
- v202401-1
- v202312-1
- v202311-1
- v202310-1
- v202309-1
- v202308-1
- v202307-1
- v202306-1
- v202305-2
- v202305-1
- v202304-1
- v202303-1
- v202302-1
- v202301-2
- v202301-1
- v202212-2
- v202212-1
- v202211-1
- v202210-1
- v202209-2
- v202209-1
- v202208-3
- v202208-2
- v202208-1
- v202207-2
- v202207-1
- v202206-1
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/commentsSample 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" } } ]}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-gTFq83JSzjmAvYjSample 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" } }}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" }}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/commentsSample 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" } }}