# Withdraw a shared solver template

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

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

Withdraws an active Stage 2 Contributor Network solver template authored by the calling account.

The publication becomes unavailable through lists and direct item reads, while its immutable record is retained to preserve descendant lineage. The owned private source is unlocked, and its `publishedContributorNetworkItemId` becomes `null`.

## Path parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :---: | :--- |
| `itemId` | string | Yes | ID of the Stage 2 publication to withdraw. |

## Query parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :---: | :--- |
| `competitionId` | string | Yes | Use the Stage 2 competition ID shown in the example. |
| `kind` | string | Yes | Must be `solver-template`. |

The two discriminators prevent a Stage 2 client from withdrawing an item from another competition or Contributor Network kind. Withdrawal rechecks item identity and authorship, but changes to enrollment, team role, submission windows, or the model catalog do not prevent an author from cleaning up an existing publication.

## Example request

```bash
STAGE2_COMPETITION_ID="mathematics-distillation-challenge-equational-theories-stage2"

curl -X DELETE \
  --url "https://api.sair.foundation/api/public/v1/contributor-network/items/$ITEM_ID" \
  --url-query "competitionId=$STAGE2_COMPETITION_ID" \
  --url-query "kind=solver-template" \
  -H "Authorization: Bearer $SAIR_API_KEY"
```

## Response

Returns `204 No Content` with no response body after both the public item and its private-source lock have been updated.

The operation is naturally idempotent and does not use an `idempotencyKey`. Repeating it as the original author after a successful withdrawal returns `204` again and does not release active capacity more than once.

Withdrawal does not delete or modify:

- the private solver template's title, track, or `solverCode`;
- formal competition submissions or existing Playground Run snapshots;
- active descendants of this publication;
- lineage references, which expose the withdrawn item only as `available: false`.

The source template may then be edited or published again. A later publication is a new operation with a new item ID, public code, publication time, and `idempotencyKey`; the withdrawn item is never reactivated. Withdrawing releases active-publication capacity but does not restore the UTC-day creation quota.

## Errors

| HTTP | Code | When |
| :---: | :--- | :--- |
| `403` | `ITEM_NOT_AUTHOR` | The matching active item exists, but the calling account is not its author. |
| `404` | `NOT_FOUND` | The item is missing, does not match the required competition and kind, or is inactive for a reason other than this caller's completed withdrawal. |
| `422` | `RESOURCE_FIELD_INVALID` | A required discriminator is missing or invalid. |

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