# Download a submission body

```http
GET /api/public/v1/competitions/{competitionId}/submissions/{submissionId}/download
```

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

Returns `text/plain; charset=utf-8` rather than the JSON success envelope.

## Path parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :---: | :--- |
| `competitionId` | string | Yes | Competition ID. |
| `submissionId` | string | Yes | Opaque submission ID. |

## Mathematics Distillation Stage 1

```bash
curl "https://api.sair.foundation/api/public/v1/competitions/mathematics-distillation-challenge-equational-theories-stage1/submissions/sub_01JSTAGE100000000000000001/download" \
  -H "Authorization: Bearer $SAIR_API_KEY"
```

Complete response body:

```text
When the equation has a neutral element, test substitutions that preserve it before expanding the search.
```

## Mathematics Distillation Stage 2

```bash
curl "https://api.sair.foundation/api/public/v1/competitions/mathematics-distillation-challenge-equational-theories-stage2/submissions/sub_01JSTAGE200000000000000001/download" \
  -H "Authorization: Bearer $SAIR_API_KEY"
```

Complete response body:

```lean
import Mathlib

example (n : Nat) : n = n := by
  rfl
```

## Inverse Galois Problem (IGP24)

The response contains the original submitted polynomial lines, including trailing comments, separated by newlines.

```bash
curl "https://api.sair.foundation/api/public/v1/competitions/igp24/submissions/sub_01JIGP24000000000000000001/download" \
  -H "Authorization: Bearer $SAIR_API_KEY"
```

Complete response body:

```text
3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 # poly_disc_primes=[2,3]
```

The response includes a `Content-Disposition` attachment filename for IGP24.

## Modular Arithmetic Challenge

Model-reference submissions have no downloadable text body. The complete error response is:

```json
{
  "ok": false,
  "error": {
    "code": "NO_DOWNLOAD_FOR_KIND",
    "message": "This submission kind has no downloadable file",
    "details": {}
  }
}
```

## Errors

| HTTP | Code | When |
| :---: | :--- | :--- |
| `404` | `NOT_FOUND` | The submission is missing or not visible to the caller. |
| `404` | `NO_DOWNLOAD_FOR_KIND` | The submission kind has no text body. |
| `404` | `ORIGINAL_PAYLOAD_UNAVAILABLE` | A legacy IGP24 submission's original polynomial lines cannot be recovered. |

See [Errors](../../../errors.md) for common errors.
