# Create Telegram notification channel Creates a new Telegram notification channel for bot message delivery Endpoint: POST /notification_channels/telegram Version: 1.0.0 Security: ApiKeyAuth ## Request fields (application/json): - `name` (string, required) User-defined human-readable name for the notification channel. Used to identify and distinguish between different notification channels. The name should be descriptive and help users understand the purpose or destination of the channel. Example: "Production Alerts Webhook" - `bot_token` (string, required) Telegram Bot API token obtained from @BotFather. Format: {bot_id}:{auth_token} Example: "123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11" Security Note: This is sensitive data and should be handled securely. In some API responses, this may be masked or omitted. Example: "123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789" - `chat_id` (integer, required) Telegram chat ID where notifications will be sent. Chat ID formats: - Private chats (positive numbers) - Group chats (negative numbers) - Channel chats (negative numbers starting with -100) You can obtain chat IDs by: - Adding the bot to a chat and using /start command - Using Telegram Bot API methods like getUpdates - Using @userinfobot for user/chat information Example: -1001234567890 ## Response 200 fields (application/json): - `id` (string, required) Unique identifier in UUID format Example: "550e8400-e29b-41d4-a716-446655440000" - `kind` (string, required) Defines the type of notification delivery channel. Each kind determines the transport mechanism and configuration structure: - nats — NATS subject-based messaging for internal microservice communication - telegram — Telegram bot message delivery to chats or direct messages - webhook — HTTP POST callbacks to external endpoints Enum: "nats", "telegram", "webhook" - `name` (string, required) User-defined human-readable name for the notification channel. Used to identify and distinguish between different notification channels. The name should be descriptive and help users understand the purpose or destination of the channel. Example: "Production Alerts Webhook" - `config` (object, required) Configuration structure for notification channels. The exact schema depends on the channel kind. Each channel type has specific configuration requirements: - NATS channels require a subject for message routing - Telegram channels require bot token and chat ID for message delivery - Webhook channels require URL and optional headers/authentication - `is_archived` (boolean, required) Indicates whether the notification channel is archived (disabled) - `created_at` (string, required) Timestamp when the resource was created Example: "2024-01-15T10:30:00Z" - `updated_at` (string, required) Timestamp when the resource was last updated Example: "2024-01-15T10:30:00Z" ## Response 201 fields (application/json): - `id` (string, required) Unique identifier in UUID format Example: "550e8400-e29b-41d4-a716-446655440000" - `kind` (string, required) Defines the type of notification delivery channel. Each kind determines the transport mechanism and configuration structure: - nats — NATS subject-based messaging for internal microservice communication - telegram — Telegram bot message delivery to chats or direct messages - webhook — HTTP POST callbacks to external endpoints Enum: "nats", "telegram", "webhook" - `name` (string, required) User-defined human-readable name for the notification channel. Used to identify and distinguish between different notification channels. The name should be descriptive and help users understand the purpose or destination of the channel. Example: "Production Alerts Webhook" - `config` (object, required) Configuration structure for notification channels. The exact schema depends on the channel kind. Each channel type has specific configuration requirements: - NATS channels require a subject for message routing - Telegram channels require bot token and chat ID for message delivery - Webhook channels require URL and optional headers/authentication - `is_archived` (boolean, required) Indicates whether the notification channel is archived (disabled) - `created_at` (string, required) Timestamp when the resource was created Example: "2024-01-15T10:30:00Z" - `updated_at` (string, required) Timestamp when the resource was last updated Example: "2024-01-15T10:30:00Z" ## Response 400 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type Example: "https://docs.vilna.io/apis/problems/invalid-request" - `title` (string, required) A short, human-readable summary of the problem type Example: "Invalid Request" - `status` (integer, required) The HTTP status code Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem Example: "Validation error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem Example: "/errors?id=XXXXXX-xxxxx" - `fields` (array) List of invalid fields in the request - `fields.name` (string, required) The name of the invalid field Example: "meta" - `fields.reason` (string, required) Why this field is invalid Example: "Exceeded maximum data size — must not exceed 1000 characters" ## Response default fields (application/problem+json): - `detail` (string) A human-readable explanation specific to this occurrence of the problem Example: "An unexpected error occurred while processing your request" - `instance` (string) A URI reference that identifies the specific occurrence of the problem Example: "/errors/1234567890" - `status` (integer, required) The HTTP status code Example: 500 - `title` (string, required) A short, human-readable summary of the problem type Example: "Internal Server Error" - `type` (string, required) A URI reference that identifies the problem type Example: "https://api.vilna.io/problems/internal-error"