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

# Search traffic logs

> Search email delivery logs for your account. By default, searches cover the last 3 days of data.
To search a different date range, include both start_date and end_date in the request body.




## OpenAPI

````yaml /outbound/api-reference/openapi.yaml post /search
openapi: 3.0.3
info:
  contact:
    email: support@mailchannels.com
    name: MailChannels Corporation
  description: >
    Search email delivery logs, retrieve sender profiles, and query alerts with
    the MailChannels Log Search API.


    ## Rate limits


    This API is limited to 100 queries per second, per customer.

    Queries that exceed this rate may be rejected with the `503 Service
    Temporarily Unavailable` HTTP response.
  title: Search Service
  version: 0.7.0
servers:
  - url: https://api.mailchannels.net/outbound/v1/
security:
  - X-API-KEY: []
paths:
  /search:
    post:
      summary: Search traffic logs
      description: >
        Search email delivery logs for your account. By default, searches cover
        the last 3 days of data.

        To search a different date range, include both start_date and end_date
        in the request body.
      parameters:
        - description: >
            The offset from the first result. Defaults to 0. To fetch the next
            page, increase start_at by count.

            For example, with count set to 20, use offsets of 0, 20, and 40 for
            the first three pages.

            Requests return 400 Bad Request if start_at + count exceeds 9,999.
          in: query
          name: start_at
          required: false
          schema:
            type: integer
        - description: >-
            The number of results to return per page. Defaults to 20. The
            maximum is 100.
          in: query
          name: count
          required: false
          schema:
            maximum: 100
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
        description: >
          Filters for the search query. If omitted, returns logs for the
          authenticated account

          without additional filters. Use count to control the number of results
          per page.
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResults'
          description: Successful response.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Error.
components:
  schemas:
    SearchRequest:
      properties:
        delivered:
          description: |
            `Y` means the email is delivered while `N` means not delivered.
          enum:
            - 'Y'
            - 'N'
          type: string
        end_date:
          description: >
            Must be in the form yyyy-mm-dd and be after start_date. If end_date
            is present,

            start_date must be present too.
          type: string
        lastcmd:
          description: Last SMTP command.
          type: string
        message_id:
          description: ID of the message.
          type: string
        rcpt:
          description: >
            The recipient email addresses. This should correspond to the
            addresses in the SMTP `RCPT TO:` commands.
          type: string
        rspcode:
          description: SMTP response code.
          type: integer
        rspmsg:
          description: SMTP response message.
          type: string
        sender:
          description: |
            The sender email address. This should correspond to the address
            in the SMTP `MAIL FROM:` command.
          type: string
        sender_id:
          description: >
            The identity of the sender, if different from the envelope sender.
            This should correspond to a single customer.
          type: string
        spam_disposition:
          description: Disposition of spam.
          enum:
            - CONFIRMED
            - SUSPECT
            - BULK
            - UNKNOWN
          type: string
        start_date:
          description: >
            Must be in the form yyyy-mm-dd and be before end_date. If start_date
            is present,

            end_date must be present too.
          type: string
        subject:
          description: Subject of email.
          type: string
        upstream:
          description: Upstream IP address.
          type: string
        upstream_hostname:
          description: Host name of upstream.
          type: string
        virus_disposition:
          description: Disposition of virus.
          enum:
            - CONFIRMED
            - HIGH
            - MEDIUM
            - UNKNOWN
          type: string
    SearchResults:
      properties:
        notice:
          description: >
            An optional notice about the search results, such as a reminder that
            results are limited to the last 3 days of data.
          type: string
        results:
          items:
            $ref: '#/components/schemas/SearchResult'
          type: array
    ErrorResponse:
      properties:
        code:
          description: HTTP response code.
          type: integer
        errors:
          items:
            description: Response error.
            type: string
          type: array
        message:
          description: Response message.
          type: string
    SearchResult:
      properties:
        '@timestamp':
          description: Timestamp of log.
          type: string
        auth:
          description: Username.
          type: string
        delivered:
          type: string
        lastcmd:
          description: Last SMTP command.
          type: string
        message_id:
          description: ID of the message.
          type: string
        rcpt:
          description: >
            The recipient email addresses. This corresponds to the addresses in
            the SMTP `RCPT TO:` commands.
          type: string
        remediation_options:
          description: Options for remediation, including delist
          enum:
            - DELIST
          type: string
        rspcode:
          description: SMTP response code.
          type: string
        rspmsg:
          description: SMTP response message.
          type: string
        sender:
          description: >
            The sender email address. This corresponds to the address in the
            SMTP `MAIL FROM:` command.
          type: string
        sender_id:
          description: >
            The identity of the sender, if different from the envelope sender.
            This corresponds to a single customer.
          type: string
        size:
          description: Size of message.
          type: integer
        spam_disposition:
          description: Disposition of spam.
          type: string
        subject:
          description: Subject of email.
          type: string
        upstream_hostname:
          description: Host name of upstream.
          type: string
        virus_disposition:
          description: Disposition of virus.
          type: string
  securitySchemes:
    X-API-KEY:
      in: header
      name: X-API-KEY
      type: apiKey

````