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

# Search received emails

> Queries the account's email trigger index. Conditions are combined by `operator`, with paging and sorting set by `limit` and `sort_by`.



## OpenAPI

````yaml /api-reference/endpoint/trigger/openapi.json post /trigger/emails/search
openapi: 3.0.3
info:
  title: quiva.ai Triggers API
  description: >-
    Manages the triggers that start automation in response to events — create,
    retrieve and delete gateway triggers (custom API endpoints that kick off a
    flow) and stream triggers (real-time data flowing from a source into a
    target).
  contact:
    name: quiva.ai Support
  version: '1.0'
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Triggers
    description: Gateway, stream and object store triggers
  - name: Email triggers
    description: Emails received by email triggers
paths:
  /trigger/emails/search:
    post:
      tags:
        - Email triggers
      summary: Search received emails
      description: >-
        Queries the account's email trigger index. Conditions are combined by
        `operator`, with paging and sorting set by `limit` and `sort_by`.
      operationId: searchEmails
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                sort_by:
                  type: string
                  description: Field to sort by
                operator:
                  type: string
                  description: How conditions combine
                conditions:
                  type: array
                  items:
                    type: object
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  body:
                    type: object
                    properties:
                      results:
                        type: array
                        items:
                          type: object
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: >-
            Detailed error message explaining what went wrong and potential
            solutions.
          example: 'Invalid request: Missing required field'
        status_code:
          type: integer
          description: HTTP status code indicating the specific error type.
          example: 400
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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