# List problems

```http
GET /api/public/v1/competitions/lean-kernel-challenge/problems
```

**Scope**: `competition.read`.

Returns the ordered problem catalog for the approved challenge revision.

## Example request

```bash
export SAIR_API_BASE="https://api.sair.foundation/api/public/v1"

curl "$SAIR_API_BASE/competitions/lean-kernel-challenge/problems" \
  -H "Authorization: Bearer $SAIR_API_KEY"
```

## Example response

The example deliberately shows two entries. The live response is the complete current catalog; do not infer its length, order, availability, or revision from this example.

```json
{
  "ok": true,
  "data": {
    "approvedRevision": "7a0abb4a80d635740a91aed1894f714dfbb82edd",
    "items": [
      {
        "problemId": "fib",
        "displayName": "Fibonacci number",
        "availability": "available",
        "officialWorkspace": "https://github.com/SAIRcompetition/lean-kernel-challenge/tree/7a0abb4a80d635740a91aed1894f714dfbb82edd/problems/fib"
      },
      {
        "problemId": "partition",
        "displayName": "Partition function",
        "availability": "available",
        "officialWorkspace": "https://github.com/SAIRcompetition/lean-kernel-challenge/tree/7a0abb4a80d635740a91aed1894f714dfbb82edd/problems/partition"
      }
    ],
    "sourceLimits": {
      "entrypoint": "Submission.lean",
      "uiMaxFiles": 1,
      "uiMaxBytes": 1048576,
      "participantMaxFiles": 1,
      "participantMaxBytes": 1048576
    }
  }
}
```

## Response fields

| Field | Type and meaning |
| :--- | :--- |
| `approvedRevision` | `string` — Full Git commit SHA that pins every Problem workspace in this catalog snapshot. |
| `items` | `Problem[]` — Complete catalog in the server-defined display and selection order. The array contains both available and temporarily unavailable Problems. |
| `sourceLimits` | [`PlaygroundSourceLimits`](#playground-source-limits) — Current runnable-source contract for the first-party Playground UI and evaluator-bound participant packages. |

### Problem

| Field | Type and meaning |
| :--- | :--- |
| `problemId` | `string` — Stable, case-sensitive identifier used by formal submission, Playground, Contributor Network, and leaderboard endpoints. |
| `displayName` | `string` — Participant-facing Problem name for the approved revision. |
| `availability` | `available \| unavailable` — Whether new practice Runs and formal submissions may currently be created for this Problem. |
| `officialWorkspace` | `string` — Absolute URL of the Problem directory at exactly `approvedRevision`; it contains the pinned statement, trusted source, starter, and configuration files. |

### Playground source limits

| Field | Type and meaning |
| :--- | :--- |
| `entrypoint` | `string` — Required root source filename. It is currently `Submission.lean`. |
| `uiMaxFiles` | `integer` — Maximum number of source files supported by the first-party Playground editor. |
| `uiMaxBytes` | `integer` — Maximum UTF-8 source bytes accepted by the first-party Playground editor. |
| `participantMaxFiles` | `integer` — Maximum source-file count eligible for participant execution and publication handoff. |
| `participantMaxBytes` | `integer` — Maximum total source bytes eligible for participant execution and publication handoff. |

The current runnable contract is one non-empty `Submission.lean` file of at most 1,048,576 bytes. Clients must read these values from the live catalog instead of assuming they remain unchanged. Saved Solutions may retain a historical Workspace shape that is not currently runnable; these fields do not describe that storage ceiling. They also do not replace the separate formal submission contract.

## Availability

| Value | Meaning |
| :--- | :--- |
| `available` | The Problem may be selected for a new practice Run or formal submission, subject to the endpoint's other authorization, lifecycle, and quota checks. |
| `unavailable` | Keep the Problem visible for discovery and existing-resource reads, but do not offer it for a new practice Run or formal submission. |

Use `items` as the catalog source of truth: preserve its order, render every returned entry, and re-read it instead of maintaining a client-side list. A catalog revision may add or remove Problems, rename their display labels, reorder them, or change availability.

`approvedRevision` pins the Problem workspaces only. For formal source limits, rules links, and the `contractVersionAcknowledged` value required at submission time, read [Get submission spec](./get-submission-spec.md).

## Errors

| HTTP | Code | When |
| :---: | :--- | :--- |
| `404` | `NOT_FOUND` | The competition does not exist or is not publicly visible. |
| `404` | `DISCOVERY_NOT_LAUNCHED` | The Problem catalog is not public yet. |
| `502` | `PLATFORM_UNAVAILABLE` | Competition visibility cannot be verified because the platform authority is unavailable. |
| `502` | `SERVICE_UNAVAILABLE` | The authoritative Lean Kernel configuration service is unavailable. |
| `502` | `CATALOG_UNAVAILABLE` | The catalog is missing, empty, or inconsistent with its approved revision. |

See [Errors](../../../errors.md) for shared authentication, scope, and rate-limit errors.
