Change requests API reference
Note: Change requests are in public beta. All APIs and workflows are subject to change.
You can use change requests to keep track of workspace to-dos directly on that workspace. Change requests are a backlog of the changes that a workspace requires, often to ensure that workspace keeps up with compliance and best practices of your company. Change requests can also trigger team notifications to directly notify team members whenever someone creates a new change request.
Note: Change requests are available in the HCP Terraform Plus Edition. Refer to HCP Terraform pricing for details.
List change requests
Use this endpoint to list a workspace's change requests.
GET api/v2/workspaces/:workspace_name/change-requests
Parameter | Description |
---|---|
:workspace_name | The name of workspace you want to list the change requests of. |
Query parameters
This endpoint supports pagination with standard URL query parameters. Remember to percent-encode [
as %5B
and ]
as %5D
if your tooling doesn't automatically encode URLs.
Parameter | Description |
---|---|
page[number] | Optional. If omitted, the endpoint will return the first page. |
page[size] | Optional. If omitted, the endpoint will return 20 teams per page. |
Sample request
Sample response
Show a change request
Use this endpoint to list the details of a specific change request.
GET api/v2/workspaces/change-requests/:change_request_id
Parameter | Description |
---|---|
:change_request_id | The change request ID |
Sample request
Sample response
Archive change request
If someone completes a change request, they can archive it to reflect the request's completion. You can still view archived change requests, however they are be sorted separated and marked as "archived"
.
POST api/v2/workspaces/change-requests/:change_request_id
Parameter | Description |
---|---|
:change_request_id | The ID of the change request to archive. |
Sample request
Sample response
Create new change request
You can make change requests through the explorer's experimental "bulk actions"
endpoint.
POST /api/v2/organizations/:organization_name/explorer/bulk-actions
Parameter | Description |
---|---|
:organization_id | The ID of the organization you want to create a change request in. |
You must specify the following fields in your payload when creating a new change request.
Key path | Type | Required | Description |
---|---|---|---|
data.action_type | string | Required | The action to take. To create a change request, specify "change_request" . |
data.action_inputs | object | Required | Arguments for the bulk action. |
data.action_inputs.subject | string | Required | The change request's subject line. |
data.action_inputs.message | string | Required | The change request's message, which HCP Terraform treats as markdown. |
data.target_ids | array | Optional | The IDs of the workspace you want to associate with this change request. You do not need to specify this field if you provide data.query . |
data.query | object | Optional | An explorer query with workspace data. You do not need to specify this field if you provide data.target_ids . |
Sample Payload
Sample request
Sample response