> Documentation index: https://docs.hodeishield.com/llms.txt

# `/v1` reference: Risks

The operations of this resource. They share the pagination and error vocabulary described in [Overview](https://docs.hodeishield.com/en/api/overview/) and [Errors](https://docs.hodeishield.com/en/api/errors/). Example values on this page are **fictitious**. The other operations are in the [complete reference](https://docs.hodeishield.com/en/api/reference/).

## Operations

### List risk-register entries

`GET /v1/risks`

The tenant's risk register.

**Required scope:** `supply_risk:read`

**Parameters:**

| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
| `page` | query | no | `integer` | 1-based page number. Defaults to 1. |
| `per_page` | query | no | `integer` | Items per page, 1..200. Defaults to 50. |
| `sort` | query | no | `enum(created_at, updated_at, inherent_score, residual_score)` | Field to order by. One of: created_at, updated_at, inherent_score, residual_score. |
| `order` | query | no | `enum(asc, desc)` | Sort direction. Defaults to desc. |
| `status` | query | no | `string` | Exact status match. Known values: identified, assessed, treatment_planned, treatment_implemented, closed. Open vocabulary: any other value is matched exactly and matches nothing, and the answer then carries a `meta.warnings` entry and the `X-HS-Unknown-Filter` header. |
| `domain` | query | no | `string` | Exact domain match. Known values: vendor, cyber, data, operational, compliance, concentration, strategic, legal, financial, reputational. Open vocabulary: any other value is matched exactly and matches nothing, and the answer then carries a `meta.warnings` entry and the `X-HS-Unknown-Filter` header. |
| `vendor_id` | query | no | `string` | Only risks linked to this vendor. |
| `min_inherent_score` | query | no | `integer` | Only risks whose inherent score is at least this. |
| `X-HS-Tenant` | header | no | `string` | The tenant to read, as its id (a UUID, any case). REQUIRED with a portfolio key (`hsp_…`); with a tenant API key or an OAuth token, optional and accepted only when it equals the credential’s own tenant. Never a slug. |

**Example response (200, fictitious values):**

```json
{
  "data": [
    {
      "id": "33333333-3333-4333-8333-333333333333",
      "title": "Concentración de subprocesadores en un mismo cuarto-parte",
      "status": "accepted",
      "severity": "high",
      "ale_eur": 185000,
      "created_at": "2026-05-02T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total": 14,
    "total_pages": 1
  }
}
```

### Fetch one risk-register entry

`GET /v1/risks/{id}`

The same object as the collection, for a single entry by id.

**Required scope:** `supply_risk:read`

**Parameters:**

| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
| `id` | path | yes | `string` | Risk identifier. |
| `X-HS-Tenant` | header | no | `string` | The tenant to read, as its id (a UUID, any case). REQUIRED with a portfolio key (`hsp_…`); with a tenant API key or an OAuth token, optional and accepted only when it equals the credential’s own tenant. Never a slug. |

**Example response (200, fictitious values):**

```json
{
  "data": {
    "id": "33333333-3333-4333-8333-333333333333",
    "title": "Concentración de subprocesadores en un mismo cuarto-parte",
    "status": "accepted",
    "severity": "high",
    "ale_eur": 185000,
    "created_at": "2026-05-02T10:00:00Z"
  }
}
```

### Move a risk along its lifecycle

`POST /v1/risks/{id}/transition`

Changes the lifecycle status of one risk-register entry, exactly as the console does: only the transitions the lifecycle allows (`identified` → `assessed`; `assessed` → `treatment_planned`; `treatment_planned` → `treatment_implemented`; `treatment_implemented` → `closed`; `closed` → `assessed`); anything else is a `409` `TRANSITION_NOT_ALLOWED` that names the current status and where it may go. Asking for the status the entry already has answers its current state with `changed: false` and writes nothing. The key acts with the role of the user who created it, read on every request: only an administrator role of the tenant may move a risk (`403` `ROLE_NOT_PERMITTED` otherwise), and a creator who was demoted, suspended, deleted or removed from the tenant takes the power away from the key (`403` `WRITE_ACTOR_UNRESOLVED` or `ROLE_NOT_PERMITTED`). A tenant API key (`hsk_…`) writes in its own tenant. An MSSP portfolio key (`hsp_…`) names the client tenant with `X-HS-Tenant`, exactly as on the reads: a tenant outside its client set is a `404` (`TENANT_NOT_FOUND`); only an MSSP organisation administrator can grant `risks:write` on a portfolio key. Writes have their own request budget per key (`error.details.scope: "write_key"`), separate from reads, and are refused while the licence is in its grace period. Every change writes the register’s history row (from, to, note, the acting user) and one entry in the tenant’s audit trail with the key id (never the secret). An id of another tenant answers the same `404` as one that does not exist. The body is a JSON object; an unknown key is a `400`.

**Required scope:** `risks:write`

**Parameters:**

| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
| `id` | path | yes | `string` | Risk identifier. |
| `X-HS-Tenant` | header | no | `string` | The tenant to read, as its id (a UUID, any case). REQUIRED with a portfolio key (`hsp_…`); with a tenant API key or an OAuth token, optional and accepted only when it equals the credential’s own tenant. Never a slug. |

**Request body:** JSON. `to_status` is required; `note` is optional (at most 2000 characters). An unknown key is a `400`.

**Example (curl):**

```bash
curl -X POST "https://api.hodeishield.com/v1/risks/33333333-3333-4333-8333-333333333333/transition" \
  -H "Authorization: Bearer $HODEISHIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to_status":"assessed","note":"Scored after the vendor review"}'
```

With a portfolio key `hsp_…`, add `-H "X-HS-Tenant: <tenant id>"`.

**Example response (200, fictitious values):**

```json
{
  "data": {
    "id": "33333333-3333-4333-8333-333333333333",
    "status": "assessed",
    "updated_at": "2026-11-19T09:30:00Z"
  },
  "changed": true
}
```
