> ## Documentation Index
> Fetch the complete documentation index at: https://docs.taimly.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Дождаться письма

> Держит запрос открытым, пока не придёт письмо, и сразу отдаёт его целиком — без опроса в цикле.

Ждёт первое письмо, полученное после `since` (по умолчанию — момент запроса) и подходящее под фильтры `from` и `subject`. Если за `timeout` секунд письма нет, возвращает `{"message": null}` — просто повторите запрос.

Найденное письмо отмечается прочитанным.



## OpenAPI

````yaml /openapi.json get /api/mail/mailboxes/{address}/wait
openapi: 3.1.0
info:
  title: Taimly API
  version: 1.3.0
  description: >-
    API Taimly: проверка доставляемости email (Spam Check) и временные почты для
    приёма писем.
servers:
  - url: https://taimly.net
    description: Production
security:
  - BearerAuth: []
paths:
  /api/mail/mailboxes/{address}/wait:
    get:
      tags:
        - Временные почты
      summary: Дождаться письма
      description: >-
        Держит запрос открытым, пока не придёт письмо, и сразу отдаёт его
        целиком — без опроса в цикле.


        Ждёт первое письмо, полученное после `since` (по умолчанию — момент
        запроса) и подходящее под фильтры `from` и `subject`. Если за `timeout`
        секунд письма нет, возвращает `{"message": null}` — просто повторите
        запрос.


        Найденное письмо отмечается прочитанным.
      operationId: waitMessage
      parameters:
        - name: address
          in: path
          required: true
          description: >-
            Адрес ящика. Регистр и `+тег` не важны: `Anna+github@example.com` —
            это ящик `anna@example.com`.
          schema:
            type: string
            format: email
            example: anna.smith42@example.com
        - name: timeout
          in: query
          required: false
          description: Сколько секунд ждать, от 0 до 55
          schema:
            type: number
            minimum: 0
            maximum: 55
            default: 30
        - name: since
          in: query
          required: false
          schema:
            type: string
            example: '2026-10-26T12:00:00Z'
          description: >-
            Искать письма, полученные после этого момента: unix-время или ISO
            8601. По умолчанию — момент запроса, то есть ждать только новое
            письмо
        - name: from
          in: query
          required: false
          description: Подстрока адреса или имени отправителя, без учёта регистра
          schema:
            type: string
            example: github.com
        - name: subject
          in: query
          required: false
          description: Подстрока темы, без учёта регистра
          schema:
            type: string
            example: verify
      responses:
        '200':
          description: Письмо или `null`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WaitResponse'
              example:
                message:
                  id: 9f2c4e1a7b3d5f60
                  to: anna.smith42+github@example.com
                  from_name: GitHub
                  from_email: noreply@github.com
                  subject: '[GitHub] Please verify your device'
                  intro: >-
                    Verification code: 482913. If you did not attempt to sign
                    in…
                  code: '482913'
                  has_attachments: false
                  size: 14820
                  seen: true
                  received_at: '2026-10-26T12:03:41Z'
                  text: |-
                    Verification code: 482913

                    If you did not attempt to sign in…
                  html: <html>…</html>
                  reply_to: []
                  cc: []
                  attachments: []
                  headers:
                    - name: From
                      value: GitHub <noreply@github.com>
                    - name: Subject
                      value: '[GitHub] Please verify your device'
        '400':
          description: Неверный `since`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: 'since: unix time or ISO 8601 expected'
        '401':
          description: Невалидный или отсутствующий API-ключ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Invalid or missing API key
        '404':
          description: Ящик не найден или принадлежит другому пользователю
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Mailbox not found
components:
  schemas:
    WaitResponse:
      type: object
      properties:
        message:
          description: Письмо целиком или `null`, если за `timeout` письма не было
          oneOf:
            - $ref: '#/components/schemas/MessageFull'
            - type: 'null'
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Описание ошибки
    MessageFull:
      allOf:
        - $ref: '#/components/schemas/Message'
        - type: object
          properties:
            text:
              type:
                - string
                - 'null'
              description: >-
                Текст письма. Если в письме только HTML — текст, извлечённый из
                него
            html:
              type:
                - string
                - 'null'
              description: HTML письма как есть
            reply_to:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    description: Имя (может быть пустым)
                  address:
                    type: string
                    format: email
              description: Reply-To
            cc:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    description: Имя (может быть пустым)
                  address:
                    type: string
                    format: email
              description: Копия (Cc)
            attachments:
              type: array
              description: Вложения
              items:
                type: object
                properties:
                  index:
                    type: integer
                    description: >-
                      Номер для [Скачать
                      вложение](/api-reference/mail/get-attachment)
                  filename:
                    type: string
                  content_type:
                    type: string
                  size:
                    type: integer
                    description: Размер в байтах
            headers:
              type: array
              description: Все заголовки письма по порядку
              items:
                type: object
                properties:
                  name:
                    type: string
                  value:
                    type: string
    Message:
      type: object
      properties:
        id:
          type: string
          description: Идентификатор письма
        to:
          type:
            - string
            - 'null'
          description: Адрес, на который пришло письмо, вместе с `+тегом`
        from_name:
          type:
            - string
            - 'null'
          description: Имя отправителя
        from_email:
          type:
            - string
            - 'null'
          description: Адрес отправителя
        subject:
          type: string
          description: Тема
        intro:
          type: string
          description: Начало текста письма
        code:
          type:
            - string
            - 'null'
          description: >-
            Код подтверждения, если он найден в письме. `null` — кода нет или он
            не распознан
        has_attachments:
          type: boolean
          description: Есть ли вложения
        size:
          type: integer
          description: Размер оригинала в байтах
        seen:
          type: boolean
          description: Прочитано ли письмо
        received_at:
          type: string
          format: date-time
          description: Когда получено (UTC)
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API-ключ. Передаётся в заголовке `Authorization: Bearer <ваш_ключ>`.
        Ключ выдаётся администратором Taimly.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.