# Get team scoring challenges

```http
GET /api/public/v1/competitions/acc/leaderboard/teams/{teamId}/challenges
```

**Scope**: `competition.read`. An API key is required; the key owner need not belong to this team. Returns only the team's currently scoring challenges in one problem and score snapshot.

## Parameters

| Parameter          | Type and rules                                                                          |
| :----------------- | :-------------------------------------------------------------------------------------- |
| Path `teamId`      | Required nonempty string from `entry.team.teamId`.                                      |
| Query `problem`    | Required exactly once: `ac` or `stable_ac`.                                             |
| Query `snapshotId` | Optional nonempty opaque ID; supply the leaderboard's ID to pin the same score version. |
| Query `limit`      | Integer `1`–`100`; default `25`.                                                        |
| Query `cursor`     | Opaque `nextCursor`; omit on the first page.                                            |

Keep problem, team and snapshot unchanged during pagination. Items are ordered by `challengeId` ascending.

## Response fields

All fields are required.

| Field         | Type and meaning                                                                                                                  |
| :------------ | :-------------------------------------------------------------------------------------------------------------------------------- |
| `problem`     | `"ac"` or `"stable_ac"`.                                                                                                          |
| `published`   | `boolean`.                                                                                                                        |
| `generatedAt` | UTC ISO 8601 `string` or `null`; null before a scoring run or when unpublished.                                                   |
| `snapshotId`  | Nonempty opaque `string` when published, including empty pages; `null` when unpublished.                                          |
| `entry`       | [LeaderboardEntry](./get-leaderboard.md#leaderboardentry) or `null` when unpublished.         |
| `items`       | Array of [ScoringChallenge](#scoringchallenge).                                                                                   |
| `totalCount`  | Non-negative integer — All current scoring challenges, not just this page; equals `entry.currentBestCount` when entry is present. |
| `nextCursor`  | `string` or `null`.                                                                                                               |

When `entry` is null, `items` is empty, `totalCount` is zero, and `nextCursor` is null. A ranked team with no current scoring challenges retains its entry with an empty list.

A team absent from a published leaderboard snapshot returns `404 NOT_FOUND`.

### ScoringChallenge

| Field               | Type and meaning                                                                     |
| :------------------ | :----------------------------------------------------------------------------------- |
| `challengeId`       | Nonempty `string` — Official challenge ID.                                           |
| `currentBestLength` | Non-negative integer — Global shortest verified move count. Zero is valid.           |
| `kTeams`            | Positive integer — Distinct teams at that minimum.                                   |
| `teamPoints`        | Decimal `string` with four fractional digits — This team's points for the challenge. |

Use the returned score and counts; do not sum rounded per-challenge points to reconstruct the exact team score. These public results do not disclose the submitted path or note.

## Example request

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

curl --get "$SAIR_API_BASE/competitions/acc/leaderboard/teams/team-17/challenges" \
  -H "Authorization: Bearer $SAIR_API_KEY" \
  --data-urlencode "problem=ac" \
  --data-urlencode "snapshotId=$ACC_SNAPSHOT_ID" \
  --data-urlencode "limit=25"
```

Set `ACC_SNAPSHOT_ID` to a returned leaderboard snapshot ID.

## Errors

| HTTP  | Code               | Meaning                                                                                                                                               |
| :---: | :----------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400` | `E_MALFORMED`      | Invalid parameters, including missing or repeated problem.                                                                                            |
| `400` | `INVALID_CURSOR`   | Cursor from another problem, team, operation, or snapshot.                                                                                            |
| `404` | `NOT_FOUND` | The team is not in the selected published leaderboard snapshot. |
| `409` | `SNAPSHOT_EXPIRED` | Snapshot or cursor expired after 15 minutes, or its version is unavailable. Discard that version and all related cursors; reload all standings views. |

See [shared errors](../acc.md#shared-errors) for authentication, scope, availability, and configuration errors.
