---
title: "Get an attachment download URL"
method: GET
path: "/v1/attachments/{id}/download-url"
tags: ["Attachments"]
---

# Get an attachment download URL

`GET /v1/attachments/{id}/download-url`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/attachments/{id}/download-url`
- Auth: API key in header `x-api-key`

Generates a presigned, time-limited download URL for the attachment; expiry is configurable via the expiresIn query parameter.

## Path parameters

- `id` string, required

## Query parameters

- `expiresIn` string, nullable

## Response `200`

Success

- object
  - `url` string, required
  - `expiresAt` string, required
  - `attachment` object, required
    - `id` string, required
    - `messageId` string, required
    - `organizationId` string, required
    - `filename` string, required
    - `contentType` string, required
    - `size` integer, required
    - `contentId` string, nullable, required
    - `isInline` boolean, required
    - `createdAt` string, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

[API](https://skmtc.dev/samva/apis/samva-api.md) · [All operations](https://skmtc.dev/samva/apis/samva-api/llms.txt) · [OpenAPI document](https://skmtc.dev/samva/apis/samva-api/revisions/a99408542cc3?raw)
