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

# `/v1` reference: Account and portfolio

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

### Describe the calling credential

`GET /v1/me`

Who the presented credential is: its type and scopes, and the tenant and organisation it reads (a tenant API key or an OAuth token), or the MSSP organisation it belongs to and how many tenants it can reach (a portfolio key; the tenants themselves are on `GET /v1/portfolio/tenants`). It describes the caller only: no other tenant, no secret, never the key or its hash. Any valid credential may call it: it requires NO scope, and it uses the same authentication and the same rate limits as every other operation. It never takes `X-HS-Tenant`.

**Required scope:** none

**Parameters:**

_No parameters._

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

```json
{
  "data": {
    "credential": {
      "type": "tenant",
      "prefix": null,
      "scopes": [
        "supply_risk:read"
      ]
    },
    "tenant": {
      "id": "0b8f2a52-6a0e-4d5c-9d3e-1f2a3b4c5d6e",
      "name": "Cliente Ejemplo Logística",
      "type": "direct"
    },
    "organization": {
      "id": "5d0c9e1f-2a3b-4c5d-8e9f-0a1b2c3d4e5f",
      "name": "Grupo Ejemplo",
      "type": "direct"
    },
    "portfolio": null
  }
}
```

### List the client tenants of an MSSP portfolio

`GET /v1/portfolio/tenants`

The client tenants the presented portfolio key (`hsp_…`) may select with the `X-HS-Tenant` header: the MSSP’s own tenants (its internal one included) and those of its active client organisations, active or not, licensed or not, narrowed to the key’s client subset when it has one. Membership is evaluated on every request. Only a portfolio key can call this operation, which never takes `X-HS-Tenant`. A tenant is readable when `active` is `true` and `licence_status` is not `inactive`.

**Required scope:** `portfolio: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(name, slug)` | Field to order by. One of: name, slug. |
| `order` | query | no | `enum(asc, desc)` | Sort direction. Defaults to desc. |

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

```json
{
  "data": [
    {
      "id": "0b8f2a52-6a0e-4d5c-9d3e-1f2a3b4c5d6e",
      "name": "Cliente Ejemplo Logística",
      "slug": "cliente-ejemplo-logistica",
      "organization": {
        "id": "5d0c9e1f-2a3b-4c5d-8e9f-0a1b2c3d4e5f",
        "name": "Grupo Ejemplo"
      },
      "internal": false,
      "active": true,
      "licence_status": "in_force"
    },
    {
      "id": "7e4a1c90-3b2d-4f6e-a1b2-c3d4e5f60718",
      "name": "MSSP Ejemplo — Interno",
      "slug": "mssp-ejemplo-interno",
      "organization": {
        "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
        "name": "MSSP Ejemplo"
      },
      "internal": true,
      "active": true,
      "licence_status": "grace"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 2,
    "total": 4,
    "total_pages": 2
  }
}
```
