# Read the organisation's HCP Terraform run task

> Page: https://docs.plotwork.dev/api/get-orgs-org-hcp-terraform-run-task. Index of every page: https://docs.plotwork.dev/llms.txt

Whether the run task is on, the endpoint URL for HCP Terraform, the HMAC key's last four characters, what a run Plotwork cannot draw reports, and the last run.

`GET /orgs/{org}/hcp-terraform/run-task`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Read the organisation's HCP Terraform run task. |
| What does it take? | `org` in the path. |
| What does it return? | Status 200 with a body of type [`RunTask`](https://docs.plotwork.dev/api/schemas.md#runtask). |
| What can go wrong? | `401` not signed in; `403` a member may not see it (orgs.forbidden); `404` no such organisation, or the caller is not a member of it; `429` too many requests; `503` organisations are not set up on this server. Every failure uses the one error envelope. |

## What it does

Whether the run task is on, the endpoint URL for HCP Terraform, the HMAC key's last four characters, what a run Plotwork cannot draw reports, and the last run. The owner and an admin may look.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `org` | `string` | yes | The organisation's id or its slug. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The run task. | [`RunTask`](https://docs.plotwork.dev/api/schemas.md#runtask) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | A member may not see it (orgs.forbidden). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such organisation, or the caller is not a member of it. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Organisations are not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`RunTask`](https://docs.plotwork.dev/api/schemas.md#runtask).

| Field | Type | Required | Description |
|---|---|---|---|
| `active` | `boolean` | yes | Whether the owner's plan includes the run task (Pro and Enterprise). While it does not, each run is reported as passed with a sentence, and nothing is drawn. |
| `plan` | `"free" \| "pro" \| "enterprise"` | yes |  |
| `enabled` | `boolean` | yes | Whether the run task is on. |
| `endpoint` | `string \| null` | yes | The endpoint URL to give HCP Terraform, by the organisation id. Null on a server with no `API_URL`. |
| `keyLast4` | `string \| null` | yes | The HMAC key's last four characters, or null while the run task is off. |
| `failOnError` | `boolean` | yes | True when a run Plotwork cannot draw or keep is reported as failed. False (the default) reports it as passed, with a sentence. |
| `enabledAt` | `integer \| null` | yes | When it was turned on, in milliseconds since the epoch. |
| `enabledBy` | `object \| null` | yes | Who turned it on, or null when that account is gone. |
| `enabledBy.id` | `string` | yes |  |
| `enabledBy.email` | `string` | yes |  |
| `lastRunAt` | `integer \| null` | yes | When HCP Terraform last called it for a run, in milliseconds since the epoch, or null for never. |
| `lastStatus` | `"passed" \| "failed" \| null` | yes | The status sent back to the last run. |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
