---
title: "POST /getFile"
method: POST
path: "/getFile"
---

# POST /getFile

`POST /getFile`

Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a [File](https://core.telegram.org/bots/api/#file) object is returned. The file can then be downloaded via the link `https://api.telegram.org/file/bot<token>/<file_path>`, where `<file_path>` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling [getFile](https://core.telegram.org/bots/api/#getfile) again.

## Request body

- object
  - `file_id` string, required — File identifier to get info about

## Response `200`

- object
  - `ok` boolean, required
  - `result` File, required — This object represents a file ready to be downloaded. The file can be downloaded via the link `https://api.telegram.org/file/bot<token>/<file_path>`. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling [getFile](https://core.telegram.org/bots/api/#getfile). Maximum file size to download is 20 MB
    - `file_id` string, required — Identifier for this file, which can be used to download or reuse the file
    - `file_unique_id` string, required — Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    - `file_size` integer — *Optional*. File size, if known
    - `file_path` string — *Optional*. File path. Use `https://api.telegram.org/file/bot<token>/<file_path>` to get the file.

## Other responses

- `default`

---

[API](https://skmtc.net/stoplight/apis/telegram-bot-api.md) · [All operations](https://skmtc.net/stoplight/apis/telegram-bot-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stoplight/telegram-bot-api/versions/be4bbb34b64a/schema)
