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

# Conversations Filter

> Filter conversations with custom filter options and pagination



## OpenAPI

````yaml /api-reference/openapi/EvoAI-CRM-Service/conversations.yaml post /api/v1/conversations/filter
openapi: 3.0.4
info:
  title: Evolution Foundation - CRM Service - Conversations
  description: Management of contacts, conversations, inboxes, labels and macros
  version: 1.1.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3000
    description: Development server
    variables:
      port:
        default: '3000'
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security: []
paths:
  /api/v1/conversations/filter:
    parameters: []
    post:
      summary: Conversations Filter
      description: Filter conversations with custom filter options and pagination
      operationId: conversationFilter
      parameters:
        - name: page
          in: query
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                payload:
                  type: array
                  items:
                    type: object
                    properties:
                      attribute_key:
                        type: string
                        description: filter attribute name
                      filter_operator:
                        type: string
                        description: filter operator name
                        enum:
                          - equal_to
                          - not_equal_to
                          - contains
                          - does_not_contain
                      values:
                        type: array
                        items:
                          type: string
                        description: array of the attribute values to filter
                      query_operator:
                        type: string
                        description: query operator name
                        enum:
                          - AND
                          - OR
                  example:
                    - attribute_key: browser_language
                      filter_operator: not_equal_to
                      values:
                        - en
                      query_operator: AND
                    - attribute_key: status
                      filter_operator: equal_to
                      values:
                        - pending
                      query_operator: null
      responses:
        '200':
          description: Conversations filtered successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                  - meta
                  - message
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    description: Array of filtered conversations
                    items:
                      $ref: '#/components/schemas/conversation'
                  meta:
                    type: object
                    properties:
                      pagination:
                        type: object
                        properties:
                          page:
                            type: integer
                            description: Current page number
                            example: 1
                          pageSize:
                            type: integer
                            description: Number of items per page
                            example: 20
                          total:
                            type: integer
                            description: Total number of conversations
                            example: 100
                          totalPages:
                            type: integer
                            description: Total number of pages
                            example: 5
                          hasNextPage:
                            type: boolean
                            nullable: true
                            description: Whether there is a next page
                            example: true
                          hasPreviousPage:
                            type: boolean
                            nullable: true
                            description: Whether there is a previous page
                            example: null
                      timestamp:
                        type: string
                        format: date-time
                        description: Response timestamp
                        example: '2024-01-15T10:30:00Z'
                  message:
                    type: string
                    description: Success message
                    example: Conversations filtered successfully
              example:
                success: true
                data: []
                meta:
                  pagination:
                    page: 1
                    pageSize: 20
                    total: 0
                    totalPages: 0
                    hasNextPage: null
                    hasPreviousPage: null
                  timestamp: '2024-01-15T10:30:00Z'
                message: Conversations filtered successfully
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validation_error:
                  summary: Invalid request parameters
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Invalid request parameters
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/filter
                      method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_token:
                  summary: Invalid or missing token
                  value:
                    success: false
                    error:
                      code: INVALID_TOKEN
                      message: Invalid or missing authentication token
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/filter
                      method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbidden:
                  summary: Insufficient permissions
                  value:
                    success: false
                    error:
                      code: FORBIDDEN
                      message: You do not have permission to access this resource
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/filter
                      method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                not_found:
                  summary: Resource not found
                  value:
                    success: false
                    error:
                      code: NOT_FOUND
                      message: Resource not found
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/filter
                      method: POST
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: Internal server error
                  value:
                    success: false
                    error:
                      code: INTERNAL_ERROR
                      message: An internal server error occurred
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/filter
                      method: POST
      security:
        - userApiKey: []
components:
  schemas:
    conversation:
      type: object
      properties:
        id:
          type: string
          format: uuid
        display_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - open
            - resolved
            - pending
            - snoozed
        contact_id:
          type: string
          format: uuid
        inbox_id:
          type: string
          format: uuid
        assignee_id:
          type: string
          format: uuid
          nullable: true
        team_id:
          type: string
          format: uuid
          nullable: true
        account_id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        last_activity_at:
          type: string
          format: date-time
        contact:
          $ref: '#/components/schemas/contact'
        assignee:
          $ref: '#/components/schemas/user'
          nullable: true
        inbox:
          type: object
          properties:
            id:
              type: string
              format: uuid
            channel_id:
              type: string
              format: uuid
            name:
              type: string
            channel_type:
              type: string
            enable_auto_assignment:
              type: boolean
            greeting_enabled:
              type: boolean
            greeting_message:
              type: string
              nullable: true
            working_hours_enabled:
              type: boolean
            out_of_office_message:
              type: string
              nullable: true
            timezone:
              type: string
            enable_email_collect:
              type: boolean
            csat_survey_enabled:
              type: boolean
            allow_messages_after_resolved:
              type: boolean
            auto_assignment_config:
              type: object
              additionalProperties: true
            lock_to_single_conversation:
              type: boolean
            csat_config:
              type: object
              additionalProperties: true
            sender_name_type:
              type: string
            business_name:
              type: string
              nullable: true
            display_name:
              type: string
            default_conversation_status:
              type: string
              nullable: true
            avatar_url:
              type: string
            working_hours:
              type: array
              items:
                type: object
                properties:
                  day_of_week:
                    type: integer
                  closed_all_day:
                    type: boolean
                  open_hour:
                    type: integer
                    nullable: true
                  open_minutes:
                    type: integer
                    nullable: true
                  close_hour:
                    type: integer
                    nullable: true
                  close_minutes:
                    type: integer
                    nullable: true
                  open_all_day:
                    type: boolean
            created_at:
              type: integer
            updated_at:
              type: integer
            provider:
              type: string
    ErrorResponse:
      type: object
      required:
        - success
        - error
        - meta
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Validation failed
            details:
              type: object
              additionalProperties: true
              nullable: true
        meta:
          type: object
          required:
            - timestamp
            - path
            - method
          properties:
            timestamp:
              type: string
              format: date-time
              example: '2024-01-15T10:30:00Z'
            path:
              type: string
              example: /public/api/v1/inboxes/{inbox_identifier}/contacts
            method:
              type: string
              example: POST
    contact:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
          nullable: true
        phone_number:
          type: string
          nullable: true
        account_id:
          type: string
          format: uuid
        custom_attributes:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    user:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
        avatar_url:
          type: string
          nullable: true
        available_name:
          type: string
          description: Display name for the user
  securitySchemes:
    userApiKey:
      type: apiKey
      in: header
      name: api_access_token

````

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