# sendNotification

Source: <https://telegafirst.com/docs/api-op-sendnotification>
Locale: ru
releaseGitSha: ea133cd4ad87fe549ef000b139be145be9bd1717
sourceContentDigest: 10c7678da76eaf9fc0e47e4dcd15cbbf2231633d7337b69f4a77f3ff3cfa1fc9
Version: 2

# 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.required | true |
| 0.schema | [0.schema](https://telegafirst.com/docs/schema-9ac136edb99a2063b3091602181c8d2022fdccb5b514991319d58544c2e57e95) |

## Тело запроса

| Поле | Значение |
| - | - |
| content.application/json.schema | [SendNotificationRequest](https://telegafirst.com/docs/schema-a3ca482b3342920afca5e553654848a1dbcca0838b82d31b970a070c94461de3) |
| required | true |

## Ответы

| Поле | Значение |
| - | - |
| 202.content.application/json.schema | [SendNotificationResponse](https://telegafirst.com/docs/schema-4c9df310fe575cca0fa729b462822db36c8ab94647838f072bff18ec9712cde8) |
| 202.description | "Queue notification delivery" |
| 202.headers.X-Bot-Username.description | "Active public bot username when available" |
| 202.headers.X-Bot-Username.schema | [202.headers.X-Bot-Username.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 202.headers.X-Client-Slug.description | "Active tenant slug when authenticated metadata supplies it" |
| 202.headers.X-Client-Slug.schema | [202.headers.X-Client-Slug.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 202.headers.X-RateLimit-Limit.description | "Effective request budget" |
| 202.headers.X-RateLimit-Limit.schema | [202.headers.X-RateLimit-Limit.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 202.headers.X-RateLimit-Remaining.description | "Remaining budget, or unknown" |
| 202.headers.X-RateLimit-Remaining.schema | [202.headers.X-RateLimit-Remaining.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 202.headers.X-RateLimit-Reset.description | "Window reset in Unix seconds" |
| 202.headers.X-RateLimit-Reset.schema | [202.headers.X-RateLimit-Reset.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |

## Ошибки

| Поле | Значение |
| - | - |
| 400.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 400.description | "Invalid request or missing required Idempotency-Key" |
| 401.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 401.description | "Missing, invalid, expired or revoked authentication" |
| 403.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 403.description | "Required scope, plan or resource policy refused the caller" |
| 413.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 413.description | "Request exceeds the per-tool size or item-count limit" |
| 422.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 422.description | "USER\_NOT\_FOUND, TEXT\_TOO\_LONG, INVALID\_BUTTON\_CONFIG, INVALID\_MEDIA, or Idempotency-Key mismatch" |
| 429.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 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.schema | [429.headers.Retry-After.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 503.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 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" |
