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

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

sendNotification

Обновлено

POST /api/v1/notifications

Queue a push notification to one user

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

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["push"]

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

ПолеЗначение
0.description"Required for a nonempty POST body by the canonical24-hour HTTP response receipt."
0.in"header"
0.name"Idempotency-Key"
0.requiredtrue
0.schema0.schema

Тело запроса

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

Ответы

ПолеЗначение
202.content.application/json.schemaSendNotificationResponse
202.description"Queue notification delivery"
202.headers.X-Bot-Username.description"Active public bot username when available"
202.headers.X-Bot-Username.schema202.headers.X-Bot-Username.schema
202.headers.X-Client-Slug.description"Active tenant slug when authenticated metadata supplies it"
202.headers.X-Client-Slug.schema202.headers.X-Client-Slug.schema
202.headers.X-RateLimit-Limit.description"Effective request budget"
202.headers.X-RateLimit-Limit.schema202.headers.X-RateLimit-Limit.schema
202.headers.X-RateLimit-Remaining.description"Remaining budget, or unknown"
202.headers.X-RateLimit-Remaining.schema202.headers.X-RateLimit-Remaining.schema
202.headers.X-RateLimit-Reset.description"Window reset in Unix seconds"
202.headers.X-RateLimit-Reset.schema202.headers.X-RateLimit-Reset.schema

Ошибки

ПолеЗначение
400.content.application/problem+json.schemaProblemDetails
400.description"Invalid request or missing required Idempotency-Key"
401.content.application/problem+json.schemaProblemDetails
401.description"Missing, invalid, expired or revoked authentication"
403.content.application/problem+json.schemaProblemDetails
403.description"Required scope, plan or resource policy refused the caller"
413.content.application/problem+json.schemaProblemDetails
413.description"Request exceeds the per-tool size or item-count limit"
422.content.application/problem+json.schemaProblemDetails
422.description"USER_NOT_FOUND, TEXT_TOO_LONG, INVALID_BUTTON_CONFIG, INVALID_MEDIA, or Idempotency-Key mismatch"
429.content.application/problem+json.schemaProblemDetails
429.description"Per-tool resource rate limit exceeded"
429.headers.Retry-After.description"Retry delay in seconds when supplied by the resource policy decision"
429.headers.Retry-After.schema429.headers.Retry-After.schema
503.content.application/problem+json.schemaProblemDetails
503.description"SERVICE_UNAVAILABLE: push notifications are switched off for now; nothing was queued"

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

ПолеЗначение
description"Delivers a transactional text with optional buttons to the user's private chat on the messenger they use (Telegram, MAX or VK), with a copy in the user's Open Lines topic; promotional messages go through broadcasts. Media is not delivered and is refused with INVALID_MEDIA. Callback buttons are an integration mechanism of an ExternalApp key: a tap is delivered to your server by the button.clicked webhook. A callback button for a MAX or VK user, or sent with any credential other than an ExternalApp key (an OAuth grant or M2M credential), is refused with INVALID_BUTTON_CONFIG, and the Open Lines copy carries only the url buttons. 202 means queued: a push is dropped if not handed over for delivery within 24 hours, an accepted push not yet handed over is also dropped if the platform switches push delivery off in an emergency, and a user who blocked the bot or was deleted receives nothing. 503 SERVICE_UNAVAILABLE means push notifications are switched off for now and nothing was queued."
operationId"sendNotification"
summary"Queue a push notification to one user"
tags["notifications"]
x-idempotency"http-cache"