Download OOTB policy content
Out-of-the-box (OOTB) policies are pre-built policy definitions sourced from curated compliance framework libraries. This endpoint returns the set of distinct values currently present in the catalog that can be used as filter parameters when calling the List OOTB Policies endpoint.
GET /ootb-policies/:external_id/download
This endpoint provides a redirect to allow downloading an OOTB policy. Returns the latest version by default. Use the version query parameter to download a specific version. Returns 404 if no version has been uploaded.
Path Parameters
| Parameter | Description |
|---|---|
:external_id | The external ID of the OOTB policy (prefix ootbpol-). |
Query Parameters
| Parameter | Required | Description |
|---|---|---|
version | No | The external ID of a specific OOTB policy version to download (prefix ootbpolver-). If omitted, the latest version is returned. |
| Status | Response | Reason |
|---|---|---|
| 302 | Redirect (Location header) | Successfully generated a temporary signed download URL. |
| 404 | JSON API error object | Policy not found or no version available. |
Response Headers
On a 302 response, the Location header contains the temporary signed URL to download the policy source.
| Header | Description |
|---|---|
Location | The temporary signed URL to download the policy source. |
Sample Request
curl \
--header "Authorization: Bearer $TOKEN" \
--request GET \
"https://app.terraform.io/api/v2/ootb-policies/ootbpol-xxxxxxxxxxxxxxxx/download"
Sample Request (specific version)
curl \
--header "Authorization: Bearer $TOKEN" \
--request GET \
"https://app.terraform.io/api/v2/ootb-policies/ootbpol-xxxxxxxxxxxxxxxx/download?version=ootbpolver-xxxxxxxxxxxxxxxx"
Sample Response
The server responds with a 302 Found redirect. The Location header contains the temporary signed URL:
HTTP/2 302
Location: https://archivist.terraform.io/v1/object/<SIGNED_URL>
Follow the redirect to retrieve the policy source file directly.
Error responses
Error responses follow the JSON API error object format and use the standard HTTP status codes described in the HCP Terraform API documentation.
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Resource not found"
}
]
}