---
title: "Get a file"
method: GET
path: "/bot{token}/getFile"
tags: ["Bot"]
---

# Get a file

`GET /bot{token}/getFile`

Returns metadata and a short-lived download URL for a Bot-owned file or a file in a currently accessible message.

## Path parameters

- `token` string, required

## Query parameters

- `file_id` string, required

## Headers

- `authorization` string

## Response `200`

BotGetFileSuccess

- BotGetFileSuccess
  - `ok` true, required — Always true for a successful request.
  - `result` object, required — Method-specific response payload.
    - `file` BotFile, required — Reusable file metadata. File identifiers and URLs are opaque.
      - `file_id` string, required
      - `file_name` string
      - `mime_type` string
      - `file_size` integer — A non-negative integer that can be represented exactly by a JavaScript number
      - `width` integer — A non-negative integer that can be represented exactly by a JavaScript number
      - `height` integer — A non-negative integer that can be represented exactly by a JavaScript number
      - `duration` integer — A non-negative integer that can be represented exactly by a JavaScript number
      - `download_url` string
      - `download_url_expires_at` integer — A non-negative integer that can be represented exactly by a JavaScript number

## Other responses

- `400` — The request parameters are missing or invalid.
- `401` — The bot token is missing or invalid.
- `403` — The bot is not allowed to perform this action.
- `404` — The requested method or resource was not found.
- `500` — The server could not complete the request.

---

[API](https://skmtc.dev/inline/apis/inline-bot-http-api-docs.md) · [All operations](https://skmtc.dev/inline/apis/inline-bot-http-api-docs/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/inline/inline-bot-http-api-docs/revisions/69017b8dc5fe/schema)
