> ## Documentation Index
> Fetch the complete documentation index at: https://docs.offloadapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Case Attachment

> GET /cases/{id}/attachments/{attachmentId}

## Endpoint

```http theme={null}
GET /cases/{id}/attachments/{attachmentId}
```

## Purpose

Returns a fresh AgentMail download link for an attachment already stored on the case.

## Authentication

```http theme={null}
x-api-key: your-api-key
```

## Path Parameters

| Parameter      | Type   | Required | Notes                                                           |
| -------------- | ------ | -------- | --------------------------------------------------------------- |
| `id`           | string | Yes      | Case ID                                                         |
| `attachmentId` | string | Yes      | Attachment ID from `attachments` on the case or webhook payload |

## Example Request

```bash theme={null}
curl -H "x-api-key: $OFFLOAD_API_KEY" \
  "$OFFLOAD_BASE_URL/cases/4fc5904d-0e44-4ed3-aa57-c4a47ad0ae4f/attachments/63016fee-124b-46d8-a3e5-616f187a6c41"
```

## Example Response

```json theme={null}
{
  "ok": true,
  "data": {
    "attachmentId": "63016fee-124b-46d8-a3e5-616f187a6c41",
    "name": "vendor-w9.pdf",
    "size": 904860,
    "type": "application/pdf",
    "messageId": "<message-id@example.com>",
    "inboxId": "dev-test@agentmail.to",
    "receivedAt": 1774131900000,
    "downloadUrl": "https://cdn.agentmail.to/attachments/63016fee-124b-46d8-a3e5-616f187a6c41?...",
    "expiresAt": "2026-03-21T16:42:00.000Z"
  }
}
```

## Notes

* `downloadUrl` is temporary.
* `expiresAt` is an ISO 8601 timestamp.
* Request the file URL only when you are ready to fetch the file.

## Errors

| Status | Code                   | Meaning                                          |
| ------ | ---------------------- | ------------------------------------------------ |
| `400`  | `INVALID_REQUEST`      | Missing case ID or attachment ID                 |
| `401`  | `UNAUTHORIZED`         | Missing or invalid API key                       |
| `403`  | `FORBIDDEN`            | Inactive API key or case belongs to another user |
| `404`  | `CASE_NOT_FOUND`       | No case exists for that ID                       |
| `404`  | `ATTACHMENT_NOT_FOUND` | Attachment is not stored on the case             |
| `500`  | `INTERNAL_ERROR`       | Attachment lookup against AgentMail failed       |
