# Download a package file

`GET /v1/jobs/{id}/package/files/{path}`

Downloads a file of a job's package. It reads the newest version of the package, or the one `version` names.

## Headers

- `Authorization` (Bearer key, required): An API key. [Request access](/) to get one.

## Path parameters

- `path` ([FilePath](/docs/types/file-path.md) (string, pattern), required): The file's `path` in the package, such as `raw/nmr/1.zip`.
- `id` ([JobId](/docs/types/job-id.md) (string, pattern), required): A job's ID: `job_` and then the job's UUID in 26 characters of base32, as a TypeID (github.com/jetify-com/typeid).

## Query parameters

- `version` (integer, at least 0): A package's `version`. Leave it out for the newest.

## Responses

| Status | Meaning |
|---|---|
| 200 | The file's bytes. Its ETag is its SHA-256. |
| 401 | Send a valid API key as `Authorization: Bearer <key>`. |
| 404 | No such file in that version of a package of this customer's. |
| 422 | A parameter or the body does not parse. |
| 500 | Something went wrong on our side. |

200 returns the file's bytes. Every error is a [Problem](/docs/types/problem.md), whose `detail` says what went wrong.

## Examples

### cURL

```bash
$ curl https://api.sequencylabs.com/v1/jobs/job_01h455vb4pex5vsknk084sn02q/package/files/raw/nmr/1.zip \
  -H "Authorization: Bearer $SEQUENCY_API_KEY" \
  -o 1.zip
```

### Python

```python
import os
import httpx

response = httpx.get(
    "https://api.sequencylabs.com/v1/jobs/job_01h455vb4pex5vsknk084sn02q/package/files/raw/nmr/1.zip",
    headers={"Authorization": f"Bearer {os.environ['SEQUENCY_API_KEY']}"},
)
response.raise_for_status()
data = response.content
```

### JavaScript

```javascript
const response = await fetch("https://api.sequencylabs.com/v1/jobs/job_01h455vb4pex5vsknk084sn02q/package/files/raw/nmr/1.zip", {
  headers: {
    Authorization: `Bearer ${process.env.SEQUENCY_API_KEY}`,
  },
});
const bytes = await response.arrayBuffer();
```

### Response (200 OK)

```text
HTTP/1.1 200 OK
Content-Type: application/octet-stream

<file bytes>
```
