> ## Documentation Index
> Fetch the complete documentation index at: https://n-a-818b4087.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Method reference

> Every public method, grouped by task.

All `send_*` methods use explicit named parameters, so your IDE can show the accepted options and types as you type. Message and media sends return a parsed `Message`; media groups return a list of `Message` objects.

## Client

| Method | Returns | Description |
| - | - | - |
| `TelegramAPI(token, session=None, timeout=(10, 30), upload_timeout=(10, 120), max_flood_retries=3)` | client | Create a client |
| `close()` | `None` | Close the session if the client owns it |
| `is_url(value)` | `bool` | Check whether a value is an HTTP or HTTPS URL |
| `convert_timestamp(timestamp)` | `str` | Format a Telegram Unix timestamp |

## Updates

| Method | Returns | Description |
| - | - | - |
| `get_updates(long_poll_timeout=30, allowed_updates=None, limit=100)` | `list[dict]` | Fetch raw updates and advance the offset |
| `poll_updates(polling_interval=2, long_poll_timeout=30, max_retries=None, allowed_updates=None, limit=100)` | generator of `Message` | Poll continuously and parse updates |

See [updates and polling](https://n-a-818b4087.mintlify.site/guides/updates.md).

## Messages

| Method | Returns | Description |
| - | - | - |
| `send_message(chat_id, text, ...)` | `Message` | Send text |
| `send_contact(chat_id, phone_number, first_name, ...)` | `Message` | Send a contact |
| `send_location(chat_id, latitude, longitude, ...)` | `Message` | Send a location |
| `send_chat_action(chat_id, action, ...)` | raw result | Show a chat action such as typing |
| `forward_message(chat_id, from_chat_id, message_id, ...)` | `Message` | Forward a message |
| `copy_message(chat_id, from_chat_id, message_id, ...)` | `dict` | Copy a message and return the new `message_id` |
| `delete_message(chat_id, message_id)` | raw result | Delete one message |
| `delete_messages(chat_id, message_ids)` | raw result | Delete multiple messages |
| `edit_message(chat_id, message_id, text, ...)` | `Message` | Edit text |
| `edit_message_caption(chat_id, message_id, caption, ...)` | `Message` | Edit a media caption |
| `edit_message_reply_markup(chat_id, message_id, reply_markup)` | `Message` | Replace or remove an inline keyboard |
| `pin_chat_message(chat_id, message_id, ...)` | raw result | Pin a message |
| `unpin_chat_message(chat_id, message_id=None)` | raw result | Unpin one or the most recent pinned message |
| `answer_callback_query(callback_query_id, ...)` | raw result | Acknowledge a callback query |

See [send messages](https://n-a-818b4087.mintlify.site/guides/messages.md) and [message actions](https://n-a-818b4087.mintlify.site/guides/message-actions.md).

## Media

| Method | Returns | Description |
| - | - | - |
| `send_voice(chat_id, voice, ...)` | `Message` | Send a voice note |
| `send_audio(chat_id, audio, ...)` | `Message` or `list[Message]` | Send audio or an audio group |
| `send_video(chat_id, video, ...)` | `Message` or `list[Message]` | Send a video or video group |
| `send_photo(chat_id, photo, ...)` | `Message` or `list[Message]` | Send a photo or photo group |
| `send_document(chat_id, document, ...)` | `Message` or `list[Message]` | Send a document or document group |
| `send_sticker(chat_id, sticker, ...)` | `Message` | Send a sticker |
| `send_animation(chat_id, animation, ...)` | `Message` | Send an animation |
| `send_video_note(chat_id, video_note, ...)` | `Message` | Send a circular video note |

See [send media](https://n-a-818b4087.mintlify.site/guides/media.md) and [media groups](https://n-a-818b4087.mintlify.site/guides/media-groups.md).

## Files and information

| Method | Returns | Description |
| - | - | - |
| `download_attachment(file_id, file_name=None, download_path=None, as_bytes=False, chunk_size=65536, timeout=None)` | `str` or `bytes` | Download a file to disk or memory |
| `get_me()` | `dict` | Get the bot's own user information |
| `get_chat(chat_id)` | `dict` | Get chat information |
| `get_file(file_id)` | `dict` | Get Telegram file metadata |

See [downloads](https://n-a-818b4087.mintlify.site/guides/downloads.md) and [client helpers](https://n-a-818b4087.mintlify.site/reference/client.md).

## Webhooks

| Method | Returns | Description |
| - | - | - |
| `set_webhook(url, certificate=None, ip_address=None, max_connections=None, allowed_updates=None, drop_pending_updates=None, secret_token=None, certificate_file_name=None)` | raw result | Register a webhook |
| `delete_webhook(drop_pending_updates=None)` | raw result | Remove the webhook |
| `get_webhook_info()` | `dict` | Read the current webhook status |

See [webhooks](https://n-a-818b4087.mintlify.site/guides/webhooks.md).

## Common parameters

Most sending methods share these options:

| Parameter | Description |
| - | - |
| `reply_to_message_id` | Reply to an existing message |
| `parse_mode` | `'Markdown'`, `'MarkdownV2'`, or `'HTML'` |
| `disable_notification` | Send silently |
| `protect_content` | Prevent forwarding and saving |
| `message_thread_id` | Target a forum topic |
| `reply_markup` | Inline keyboard or reply markup as a dictionary or JSON string |
| `caption_entities` | Explicit caption entities as a list or JSON string |
| `allow_sending_without_reply` | Send even if the replied-to message is missing |

Media methods also accept `caption`, `file_name`, `thumbnail`, and `thumbnail_file_name` where applicable.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.