# Queue health

Source: https://amanucci.com/docs/developers/api/queue/readQueueHealth

## GET /v1/firms/{firmId}/queue-health

Queue health

The work queue's health for what your firm seat reaches: counts per kind × status, the oldest claimable item per kind, items stuck past their lease, recent exhaustions and the last schedule tick — all from durable rows on the database's clock, so an external probe can alert on a worker that died. An accountant seat with portfolio `all` at the platform firm reads every entity and the system rows; every other seat reads the entities its portfolio reaches under its firm. Firm seats only: anything else is the same 404 as a firm that does not exist. Read-only.

Operation ID: `readQueueHealth`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "firmId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "description": "Narrow to one entity your seat reaches; one outside it answers the hidden 404."
    },
    "required": false,
    "description": "Narrow to one entity your seat reaches; one outside it answers the hidden 404.",
    "name": "entityId",
    "in": "query"
  },
  {
    "schema": {
      "type": "integer",
      "minimum": 1,
      "maximum": 168,
      "default": 24,
      "description": "How far back `recentExhaustions` reaches, in hours (1..168, default 24)."
    },
    "required": false,
    "description": "How far back `recentExhaustions` reaches, in hours (1..168, default 24).",
    "name": "windowHours",
    "in": "query"
  }
]
```

### Responses

#### 200 The queue's health in scope.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/QueueHealth"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
