> ## 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.

# Получить результаты

> Возвращает текущий статус проверки и результат по каждому тестовому аккаунту.

Опрашивайте каждые 5–15 секунд, пока `status` не станет `complete` или `timeout`.

По умолчанию в каждом результате только `email` и `category`. Данные письма (отправитель, тема, SMTP, SPF/DKIM/DMARC, IP, PTR, тело, оригинал) добавляются через параметр `fields` — см. [Данные письма](/fields).

Категории `primary` и `updates` считаются попаданием во **Входящие (Inbox)**. Остальные (`promotions`, `social`, `forums`, `spam`, `trash`) — нет.



## OpenAPI

````yaml /openapi.json get /api/spam-check/{check_id}
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/spam-check/{check_id}:
    get:
      tags:
        - Spam Check
      summary: Получить результаты
      description: >-
        Возвращает текущий статус проверки и результат по каждому тестовому
        аккаунту.


        Опрашивайте каждые 5–15 секунд, пока `status` не станет `complete` или
        `timeout`.


        По умолчанию в каждом результате только `email` и `category`. Данные
        письма (отправитель, тема, SMTP, SPF/DKIM/DMARC, IP, PTR, тело,
        оригинал) добавляются через параметр `fields` — см. [Данные
        письма](/fields).


        Категории `primary` и `updates` считаются попаданием во **Входящие
        (Inbox)**. Остальные (`promotions`, `social`, `forums`, `spam`, `trash`)
        — нет.
      operationId: getSpamCheckResult
      parameters:
        - name: check_id
          in: path
          required: true
          description: Идентификатор проверки из ответа `POST /api/spam-check/start`
          schema:
            type: string
            example: a1b2c3d4e5f6
        - name: fields
          in: query
          required: false
          description: >-
            Какие данные письма вернуть — имена полей через запятую. Без
            параметра — только `email` и `category`.


            Доступно: `sender_name`, `sender_email`, `subject`, `reply_to`,
            `smtp`, `sender_ip`, `ptr`, `ip_type`, `spf`, `dkim`, `dmarc`,
            `has_attachments`, `body_text`, `body_html`, `raw`.


            `body_text`, `body_html` и `raw` тяжёлые — запрашивайте их один раз,
            когда `status` = `complete`, а не на каждом опросе. Неизвестное имя
            поля → `400`.
          schema:
            type: string
            example: sender_name,subject,spf,dkim,dmarc,ip_type
      responses:
        '200':
          description: Результаты проверки
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpamCheckResultResponse'
              examples:
                pending:
                  summary: Проверка в процессе
                  value:
                    check_id: a1b2c3d4e5f6
                    status: pending
                    received: 2
                    total: 5
                    results:
                      - email: inbox1@gmail.com
                        category: primary
                      - email: inbox2@gmail.com
                        category: spam
                      - email: inbox3@gmail.com
                        category: pending
                      - email: inbox4@gmail.com
                        category: pending
                      - email: inbox5@gmail.com
                        category: pending
                complete:
                  summary: Проверка завершена
                  value:
                    check_id: a1b2c3d4e5f6
                    status: complete
                    received: 5
                    total: 5
                    results:
                      - email: inbox1@gmail.com
                        category: primary
                      - email: inbox2@gmail.com
                        category: primary
                      - email: inbox3@gmail.com
                        category: updates
                      - email: inbox4@gmail.com
                        category: spam
                      - email: inbox5@gmail.com
                        category: promotions
                timeout:
                  summary: Таймаут (5 минут)
                  value:
                    check_id: a1b2c3d4e5f6
                    status: timeout
                    received: 3
                    total: 5
                    results:
                      - email: inbox1@gmail.com
                        category: primary
                      - email: inbox2@gmail.com
                        category: primary
                      - email: inbox3@gmail.com
                        category: spam
                      - email: inbox4@gmail.com
                        category: pending
                      - email: inbox5@gmail.com
                        category: pending
                with_fields:
                  summary: С полями письма (?fields=…)
                  value:
                    check_id: a1b2c3d4e5f6
                    status: pending
                    received: 1
                    total: 2
                    results:
                      - email: inbox1@gmail.com
                        category: primary
                        sender_name: Acme
                        sender_email: news@acme.com
                        subject: Ваш заказ отправлен
                        reply_to: support@acme.com
                        smtp: SendGrid
                        sender_ip: 149.72.1.2
                        ptr: o1.ptr1234.sendgrid.net
                        ip_type: shared
                        spf: pass
                        dkim: pass
                        dmarc: pass
                        has_attachments: false
                      - email: inbox2@gmail.com
                        category: pending
                        sender_name: null
                        sender_email: null
                        subject: null
                        reply_to: null
                        smtp: null
                        sender_ip: null
                        ptr: null
                        ip_type: null
                        spf: null
                        dkim: null
                        dmarc: null
                        has_attachments: null
        '400':
          description: Неизвестное имя в `fields`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: >-
                  Unknown field(s): foo. Allowed: sender_name, sender_email,
                  subject, reply_to, smtp, sender_ip, ptr, ip_type, spf, dkim,
                  dmarc, has_attachments, body_text, body_html, raw
        '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: Check not found or expired
components:
  schemas:
    SpamCheckResultResponse:
      type: object
      required:
        - check_id
        - status
        - received
        - total
        - results
      properties:
        check_id:
          type: string
          description: Идентификатор проверки
          example: a1b2c3d4e5f6
        status:
          type: string
          enum:
            - pending
            - complete
            - timeout
          description: >-
            `pending` — ждём письма, `complete` — получены все, `timeout` —
            прошло 5 минут, а пришли не все. Результаты доступны 30 минут после
            старта.
        received:
          type: integer
          description: Количество аккаунтов, получивших письмо
          example: 3
        total:
          type: integer
          description: Общее количество тестовых аккаунтов
          example: 5
        results:
          type: array
          description: Результаты по каждому аккаунту
          items:
            $ref: '#/components/schemas/AccountResult'
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Описание ошибки
    AccountResult:
      type: object
      required:
        - email
        - category
      properties:
        email:
          type: string
          format: email
          description: Email тестового аккаунта
          example: inbox1@gmail.com
        category:
          type: string
          enum:
            - primary
            - spam
            - promotions
            - updates
            - social
            - forums
            - trash
            - unknown
            - pending
          description: >-
            Категория Gmail. `primary` и `updates` = Inbox. `pending` = письмо
            ещё не получено (тогда все запрошенные поля — `null`).
        sender_name:
          type:
            - string
            - 'null'
          description: Имя отправителя из `From`. `null`, если в `From` только адрес.
          example: Acme
        sender_email:
          type:
            - string
            - 'null'
          description: Адрес отправителя из `From`.
          example: news@acme.com
        subject:
          type:
            - string
            - 'null'
          description: Тема письма.
          example: Ваш заказ отправлен
        reply_to:
          type:
            - string
            - 'null'
          description: Адрес(а) из `Reply-To` через запятую. `null`, если заголовка нет.
          example: support@acme.com
        smtp:
          type:
            - string
            - 'null'
          description: >-
            Сервис, отправивший письмо в Gmail (по заголовку `Received`, который
            пишет сам Gmail): `SendGrid`, `Amazon SES`, `Mailgun`… Если сервис
            не распознан — домен отправляющего сервера.
          example: SendGrid
        sender_ip:
          type:
            - string
            - 'null'
          description: IP сервера, передавшего письмо в Gmail.
          example: 149.72.1.2
        ptr:
          type:
            - string
            - 'null'
          description: PTR-запись (обратный DNS) `sender_ip`. `null`, если записи нет.
          example: o1.ptr1234.sendgrid.net
        ip_type:
          type:
            - string
            - 'null'
          enum:
            - shared
            - dedicated
            - unknown
            - null
          description: >-
            `shared` — общий пул ESP; `dedicated` — выделенный IP (PTR содержит
            домен отправителя); `unknown` — определить не удалось.
          example: shared
        spf:
          type:
            - string
            - 'null'
          enum:
            - pass
            - fail
            - softfail
            - neutral
            - none
            - temperror
            - permerror
            - unknown
            - null
          description: >-
            Результат SPF. Из заголовка `Authentication-Results` Gmail.
            `unknown` — заголовок есть, но результата в нём нет.
          example: pass
        dkim:
          type:
            - string
            - 'null'
          enum:
            - pass
            - fail
            - neutral
            - none
            - temperror
            - permerror
            - unknown
            - null
          description: >-
            Результат DKIM. Из заголовка `Authentication-Results` Gmail.
            `unknown` — заголовок есть, но результата в нём нет.
          example: pass
        dmarc:
          type:
            - string
            - 'null'
          enum:
            - pass
            - fail
            - bestguesspass
            - none
            - temperror
            - permerror
            - unknown
            - null
          description: >-
            Результат DMARC. Из заголовка `Authentication-Results` Gmail.
            `unknown` — заголовок есть, но результата в нём нет.
          example: pass
        has_attachments:
          type:
            - boolean
            - 'null'
          description: >-
            Есть ли в письме вложения (любые файлы, включая встроенные
            картинки). Сами файлы не отдаются.
          example: false
        body_text:
          type:
            - string
            - 'null'
          description: Текстовая версия письма (`text/plain`). `null`, если её нет.
        body_html:
          type:
            - string
            - 'null'
          description: HTML-версия письма (`text/html`) без изменений. `null`, если её нет.
        raw:
          type:
            - string
            - 'null'
          description: >-
            Оригинал письма целиком (как «Показать оригинал» в Gmail) — строка с
            переводами строк `\r\n`. Байт-в-байт копия — эндпоинт `/raw`.
      description: >-
        Результат по одному тестовому аккаунту. Всегда есть `email` и
        `category`; остальные поля — только запрошенные в `fields`. `null` —
        значения нет или письмо ещё не пришло.
  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.