> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.apologist.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.apologist.ai/_mcp/server.

# Telegram Message Webhook

POST https://your-agent-domain.com/api/v1/channels/{id}/telegram
Content-Type: application/json

Receives Telegram bot update events for the channel. Non-message updates are acknowledged and ignored. Payload shape is defined by Telegram.

Reference: https://docs.apologist.ai/agent-api/api-reference/channels/receive-telegram-update

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: agent-api
  version: 1.0.0
paths:
  /channels/{id}/telegram:
    post:
      operationId: receiveTelegramUpdate
      summary: Telegram Message Webhook
      description: >-
        Receives Telegram bot update events for the channel. Non-message updates
        are acknowledged and ignored. Payload shape is defined by Telegram.
      tags:
        - channels
      parameters:
        - name: id
          in: path
          description: The channel id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Update handled or ignored
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Channels_receiveTelegramUpdate_Response_200
        '403':
          description: Incorrect Telegram credentials
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        description: Telegram update payload.
        content:
          application/json:
            schema:
              type: object
              properties: {}
servers:
  - url: https://your-agent-domain.com/api/v1
    description: Production server
components:
  schemas:
    Channels_receiveTelegramUpdate_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Channels_receiveTelegramUpdate_Response_200

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{}
```

**SDK Code**

```typescript
import { ApologistAgentClient } from "apologist";

async function main() {
    const client = new ApologistAgentClient();
    await client.channels.receiveTelegramUpdate("id", {
        body: {},
    });
}
main();

```

```python
from apologist import ApologistAgent

client = ApologistAgent()

client.channels.receive_telegram_update(
    id="id",
    request={},
)

```

```java
package com.example.usage;

import ai.apologist.AgentClient;
import ai.apologist.resources.channels.requests.ReceiveTelegramUpdateRequest;
import java.util.HashMap;

public class Example {
    public static void main(String[] args) {
        AgentClient client = AgentClient
            .builder()
            .build();

        client.channels().receiveTelegramUpdate(
            "id",
            ReceiveTelegramUpdateRequest
                .builder()
                .body(
                    new HashMap<String, Object>()
                )
                .build()
        );
    }
}
```

```ruby
require "apologist"

client = Apologist::AgentClient.new

client.channels.receive_telegram_update(
  id: "id",
  body: {}
)

```

```csharp
using Apologist;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new AgentClient();

        await client.Channels.ReceiveTelegramUpdateAsync(
            new ReceiveTelegramUpdateRequest {
                Id = "id",
                Body = new Dictionary<string, object?>()
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    apgsdkgo "github.com/apologist-project/apg-sdk-go"
    client "github.com/apologist-project/apg-sdk-go/client"
)

func do() {
    client := client.NewApologistAgentClient()
    request := &apgsdkgo.ReceiveTelegramUpdateRequest{
        ID: "id",
        Body: map[string]any{},
    }
    client.Channels.ReceiveTelegramUpdate(
        context.TODO(),
        request,
    )
}

```

```php
<?php

namespace Example;

use Apologist\AgentClient;
use Apologist\Channels\Requests\ReceiveTelegramUpdateRequest;

$client = new AgentClient();
$client->channels->receiveTelegramUpdate(
    'id',
    new ReceiveTelegramUpdateRequest([
        'body' => [],
    ]),
);

```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://your-agent-domain.com/api/v1/channels/id/telegram")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```