Tài liệu

Tham chiếu

Tạo webhook

Tạo một webhook thuộc kết nối này. Trả bí mật ký MỘT LẦN (lưu ngay; thử lại với cùng idempotency key trả về đúng bí mật đó) và next_steps: webhook chỉ tính là đã thiết lập sau khi webhooks_test trả 2xx. Mọi loại (*) hoặc mọi tài khoản cần người dùng xác nhận.

Xem MarkdownTrang này sinh tự động từ mã nguồn mỗi lần phát hành.

Tạo một webhook thuộc kết nối này. Trả bí mật ký MỘT LẦN (lưu ngay; thử lại với cùng idempotency key trả về đúng bí mật đó) và next_steps: webhook chỉ tính là đã thiết lập sau khi webhooks_test trả 2xx. Mọi loại (*) hoặc mọi tài khoản cần người dùng xác nhận.

Thông tin

Tên Giá trị
Mã webhooks.create
Scope cần webhooks.manage
Mức Ghi
Có thể cần xác nhận Có
Kiểu chạy Trả kết quả ngay
Cần Idempotency-Key Có
Vai trò thành viên được phép owner, manager, agent
Trong app Cài đặt → Webhook

Trường vào

Trường Kiểu Bắt buộc Mô tả
name chữ Có
description chữ Không
url chữ Có
eventTypes chữ[] Có Loại cụ thể (message.mentioned), nhóm (messages.*) hoặc * cho tất cả.
accountScope đối tượng Không Mặc định: các account của người gọi (kết nối chỉ giới hạn vài account) hoặc mọi account.
filters đối tượng Không
contentMode "full" | "thin" | "none" Không
contentType "application/json" | "application/cloudevents+json" Không

Ví dụ gọi

curl -X POST https://tlg.builera.app/api/public/v2/ops/webhooks.create \
  -H "Authorization: Bearer $TELEGRAM_AUTO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: <mã riêng mỗi việc>" \
  -d '{"name":"…","url":"…","eventTypes":[]}'

Trường ra (data)

Trường Kiểu Bắt buộc
ok true Có
webhook đối tượng Có
secret đối tượng Có
next_steps đối tượng[] Có

Ví dụ trả về

{
  "data": {
    "ok": true,
    "webhook": {
      "url_host": "text",
      "status": "active",
      "status_reason": "text",
      "status_changed_at": "2026-10-22T12:00:00.000Z",
      "owner": {
        "kind": "human",
        "user_id": "00000000-0000-4000-8000-000000000000",
        "connection_id": "00000000-0000-4000-8000-000000000000",
        "connection_name": "text"
      },
      "event_types": [
        "text"
      ],
      "account_scope": {
        "mode": "all"
      },
      "filters": {
        "direction": "in",
        "keywords": {
          "any": [
            "text"
          ],
          "none": [
            "text"
          ]
        },
        "chat_types": [
          "channel"
        ],
        "mention_only": true,
        "exclude_self": true,
        "exclude_sent_by": [
          "campaign"
        ],
        "exclude_connection_ids": [
          "text"
        ],
        "exclude_own_connection": true,
        "include_backfill": true,
        "conversation_ids": [
          "text"
        ],
        "conversation_tags": [
          "text"
        ],
        "has_media": true,
        "person_stage_ids": [
          "text"
        ],
        "campaign_ids": [
          "text"
        ]
      },
      "filters_text": "text",
      "content_mode": "full",
      "content_type": "application/json",
      "revision": 1,
      "verified_at": "2026-10-22T12:00:00.000Z",
      "tested_at": "2026-10-22T12:00:00.000Z",
      "ready": true,
      "consecutive_failures": 1,
      "failing_since": "text",
      "last_success_at": "2026-10-22T12:00:00.000Z",
      "last_failure_at": "2026-10-22T12:00:00.000Z",
      "created_at": "2026-10-22T12:00:00.000Z",
      "updated_at": "2026-10-22T12:00:00.000Z",
      "url": "text",
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "text",
      "description": "text",
      "url_masked": "text"
    },
    "secret": {
      "kid": "text",
      "value": "text",
      "shown_once": true
    },
    "next_steps": [
      {
        "op": "text",
        "mcp_tool": "text",
        "why": "text"
      }
    ]
  }
}

Dùng qua MCP

Tool webhooks_create có tên sẵn trong profile: Đầy đủ (full). Ở profile khác, tìm bằng tools_search rồi chạy bằng tools_run.

Trang này có hữu ích không?

Kiểm lại lần cuối: 24/10/2026 · bản 2.0