# io.kich.pantry.listItems

> Published by [kich.io](https://lexicon.garden/identity/did:plc:uxjwdy4wvuridijisalvxlxe)

✓ This is the authoritative definition for this NSID.

## Description

What is in a household's kitchen, soonest to turn first. Read-only.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:uxjwdy4wvuridijisalvxlxe/io.kich.pantry.listItems)
- [Documentation](https://lexicon.garden/lexicon/did:plc:uxjwdy4wvuridijisalvxlxe/io.kich.pantry.listItems/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:uxjwdy4wvuridijisalvxlxe/io.kich.pantry.listItems/examples)

## Definitions

### `io.kich.pantry.listItems`

**Type**: `query`

List a household's pantry items. Items with status `finished` are never returned — they are history, not stock.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No |  |
| `expiringWithinDays` | `integer` | No | Only items that turn within this many days |
| `household` | `string` | Yes | The household whose pantry to read. Must be the household the credential is scoped to. |
| `limit` | `integer` | No |  |
| `status` | `string` | No | Only items in this state |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No | Absent when there is no further page. |
| `items` | `array` | Yes |  |

#### Errors

- **AuthRequired**: No bearer token, or one this endpoint does not accept.
- **HouseholdNotFound**: No such household, or the credential is not scoped to it. Deliberately the same error for both: a caller holding the wrong token learns nothing about which households exist.
- **InvalidCursor**: The cursor was not one this endpoint issued.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "List a household's pantry items. Items with status `finished` are never returned — they are history, not stock.",
      "errors": [
        {
          "description": "No bearer token, or one this endpoint does not accept.",
          "name": "AuthRequired"
        },
        {
          "description": "No such household, or the credential is not scoped to it. Deliberately the same error for both: a caller holding the wrong token learns nothing about which households exist.",
          "name": "HouseholdNotFound"
        },
        {
          "description": "The cursor was not one this endpoint issued.",
          "name": "InvalidCursor"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "description": "Absent when there is no further page.",
              "type": "string"
            },
            "items": {
              "items": {
                "ref": "io.kich.pantry.defs#pantryItemView",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "items"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "type": "string"
          },
          "expiringWithinDays": {
            "description": "Only items that turn within this many days",
            "maximum": 365,
            "minimum": 1,
            "type": "integer"
          },
          "household": {
            "description": "The household whose pantry to read. Must be the household the credential is scoped to.",
            "type": "string"
          },
          "limit": {
            "default": 50,
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "status": {
            "description": "Only items in this state",
            "knownValues": [
              "in_stock",
              "low",
              "depleted"
            ],
            "type": "string"
          }
        },
        "required": [
          "household"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "description": "What is in a household's kitchen, soonest to turn first. Read-only.",
  "id": "io.kich.pantry.listItems",
  "lexicon": 1
}
```
