К содержанию
TelegaFirst

Для AI-агентов: markdown этой страницы — /docs/api-op-setpublicchannel.mdиндекс документации — /llms.txt

setPublicChannel

Обновлено

POST /api/v1/tools/public-channels/{channel}

Bind the public channel of one messenger

Авторизация и права

Scopes: ALL. Auth alternatives: OR; scopes внутри альтернативы: ALL.

ПолеЗначение
security.0.hubApiKey[]
security.1.hubBearer[]
securitySchemes.hubApiKey.in"header"
securitySchemes.hubApiKey.name"X-Api-Key"
securitySchemes.hubApiKey.type"apiKey"
securitySchemes.hubBearer.scheme"bearer"
securitySchemes.hubBearer.type"http"
x-required-scopes["public-channel:write"]

Параметры запроса

ПолеЗначение
0.in"path"
0.name"channel"
0.requiredtrue
0.schema0.schema

Тело запроса

ПолеЗначение
content.application/json.schemaPublicChannelSetBody
requiredtrue

Ответы

ПолеЗначение
200.content.application/json.schemaPublicChannelSetResult
200.description"Bound, unchanged or not checked"

Ошибки

ПолеЗначение
400.content.application/problem+json.schemaProblemDetails
400.description"VALIDATION_ERROR: unknown messenger, or a channel_ref that is neither a signed decimal id nor an @handle"
401.content.application/problem+json.schemaProblemDetails
401.description"INVALID_API_KEY"
403.content.application/problem+json.schemaProblemDetails
403.description"INSUFFICIENT_SCOPE: public-channel:* (a member needs the settings permission)"
422.content.application/problem+json.schemaProblemDetails
422.description"PUBLIC_CHANNEL_BOT_NOT_ADMIN: the bot is not an administrator of the channel, or no such channel exists (the id or @handle names none); INVALID_INPUT: the messenger is not enabled, or it addresses a channel by id only and channel_ref is an @handle"
429.content.application/problem+json.schemaProblemDetails
429.description"RATE_LIMIT_EXCEEDED or RATE_LIMIT_UNAVAILABLE"

Дополнительные условия

ПолеЗначение
description"`channel_ref` is the numeric id of the channel or, for Telegram, the @handle of a public channel; a handle is resolved once to the id and only the id is stored. The business bot of that messenger must be an administrator of the channel; it is checked before anything changes. `outcome: unavailable` — the messenger did not answer and nothing changed. The owner and the Settings group are notified of a change."
operationId"setPublicChannel"
summary"Bind the public channel of one messenger"
tags["public-channels"]