# Get a shared solver template

```http
GET /api/public/v1/contributor-network/items/{itemId}
```

**Scope**: `contributor-network.read`.

Returns one active Stage 2 Contributor Network solver template with its exact published source and lineage references. Use an `itemId` returned by [List Shared Solver Templates](./list-contributor-solvers.md).

Send both optional type assertions when the client expects a Stage 2 solver template. They prevent an ID from another competition or Contributor Network kind from being accepted as the requested type.

## Path parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :---: | :--- |
| `itemId` | string | Yes | Stable Contributor Network item ID. |

## Query parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :---: | :--- |
| `competitionId` | string | No | When present, use the Stage 2 competition ID shown in the request and also send `kind`. |
| `kind` | string | No | When present, must be `solver-template` and must be sent with `competitionId`. |

## Example request

```bash
curl --get "https://api.sair.foundation/api/public/v1/contributor-network/items/$ITEM_ID" \
  -H "Authorization: Bearer $SAIR_API_KEY" \
  --data-urlencode "competitionId=mathematics-distillation-challenge-equational-theories-stage2" \
  --data-urlencode "kind=solver-template"
```

## Response fields

The response contains every [ContributorSolverSummary](./list-contributor-solvers.md#summary-fields) field, plus:

| Field | Type | Description |
| :--- | :--- | :--- |
| `solverCode` | string | Exact immutable Python source published from the private solver template. |
| `lineage.depth` | integer | Number of parent edges from the root; `0` for an original item. |
| `lineage.parent` | [ContributorItemReference](#lineage-reference-fields) \| null | Direct parent, or `null` for an original item. |
| `lineage.root` | [ContributorItemReference](#lineage-reference-fields) | Root of this lineage; points to this item when `depth` is `0`. |

`contentBytes` and `contentSha256` from the summary describe the returned `solverCode` exactly.

### Lineage reference fields

| Field | Type | Description |
| :--- | :--- | :--- |
| `id` | string | Referenced Contributor Network item ID. |
| `publicCode` | string | Immutable public code of the referenced publication. |
| `available` | boolean | Whether the referenced item is still active and can be retrieved. |

An inactive ancestor remains as a structural reference with `available: false`; its source and other redacted metadata are not returned by this endpoint. A parent may use a different Stage 2 track or model because lineage records provenance, not execution configuration.

## Example response

```json
{
  "ok": true,
  "data": {
    "id": "cn_01JSTAGE200000000000000001",
    "publicCode": "EQT01-S00042",
    "competitionId": "mathematics-distillation-challenge-equational-theories-stage2",
    "kind": "solver-template",
    "title": "Equivalence prover",
    "remark": "Baseline solver for the solo track.",
    "author": {
      "sairId": "U-9f7e1c00",
      "displayName": "alice",
      "avatarUrl": null
    },
    "track": "solo",
    "modelId": "openai-gpt-oss-120b",
    "contentBytes": 135,
    "contentSha256": "f19dae70e4222d778477048200ad96d3f226a6e75069f8f41fd32cb1017dc565",
    "favoriteCount": 4,
    "viewerHasFavorited": false,
    "commentCount": 2,
    "directChildCount": 1,
    "publishedAt": "2026-05-04T17:02:11Z",
    "solverCode": "import json\ncontext = json.loads(input())\nprint(json.dumps({\"call\": \"judge\", \"verdict\": \"true\", \"code\": context.get(\"candidate\", \"\")}))",
    "lineage": {
      "depth": 0,
      "parent": null,
      "root": {
        "id": "cn_01JSTAGE200000000000000001",
        "publicCode": "EQT01-S00042",
        "available": true
      }
    }
  }
}
```

## Errors

| HTTP | Code | When |
| :---: | :--- | :--- |
| `404` | `NOT_FOUND` | The item or owning competition is unavailable, or a supplied type assertion does not match. |
| `422` | `RESOURCE_FIELD_INVALID` | Type assertions are incomplete or invalid, or the request contains an unknown or repeated query parameter. |

Inactive and mismatched items use the same `404` response as a missing ID. See [Errors](../../../errors.md) for authentication, scope, and rate-limit errors.
