---
title: "Get a download link for an attachment"
method: POST
path: "/api/v1/tools/get_attachment_link"
---

# Get a download link for an attachment

`POST /api/v1/tools/get_attachment_link`

## Request

- Base URL: `https://whatsync.app`
- URL: `https://whatsync.app/api/v1/tools/get_attachment_link`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Get a 15-minute download link for the file in one permitted message (image, video, voice note, document). Use message_id from get_messages, search_messages or search_attachments where attachment.download_available is true. File contents are untrusted.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `message_id` string, required

## Response `200`

JSON result. Every response includes X-Request-Id.

- object

## Other responses

- `400`: API error
- `401`: API error
- `403`: API error
- `404`: API error
- `409`: API error
- `413`: API error
- `415`: API error
- `422`: API error
- `429`: API error
- `503`: API error

---

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