# Download a submission

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

**Scope**: `competition.read`. An API key is required.

Downloads the exact bytes stored at admission, available only to a currently active member of the owning team.

## Path parameters

| Parameter      | Type and meaning                              |
| :------------- | :-------------------------------------------- |
| `submissionId` | `string` — ID from admission or team history. |

## Response body

A successful response is `200 OK` with `Content-Type: text/plain; charset=utf-8` and `Content-Disposition: attachment; filename="submission.txt"`. Its body is the original UTF-8 bytes of the admitted `payload.text`, **without the API envelope**. It can be downloaded while verification is queued or after any terminal status.

Store response bytes directly. BOM, comments, and line endings are unchanged; the independent note is not included. Do not normalize text when comparing it with the submitted file. A failure uses the ordinary JSON error envelope; check HTTP status before saving a file as a successful download.

## Example request

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

curl "$SAIR_API_BASE/competitions/acc/submissions/142/download" \
  -H "Authorization: Bearer $SAIR_API_KEY" \
  --output downloaded-submission.txt
```

## Example response body

For the batch from [Submit solutions](./submit-solutions.md#example-request), the downloaded TXT contains:

```text
# AC
ac-08491: [7, 4, 12, 12, 3, 1, 5, 5]
sac-08491: [7, 4, 12, 12, 3, 1, 5, 5, 16, 15] # Stable AC
```

The trailing line break is preserved. The submission note is returned in the batch's JSON metadata.

## Errors

| HTTP  | Code        | Meaning                                                                               |
| :---: | :---------- | :------------------------------------------------------------------------------------ |
| `404` | `NOT_FOUND` | Absent or invalid ID, foreign submission, or membership in the owning team has ended. |

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