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

# Busca avançada de clientes

> Buscar clientes com filtros e critérios específicos. Leia [aqui sobre busca avançada](https://docs.olie.ai/api-reference/general/advanced-search).



## OpenAPI

````yaml /api-reference/openapi.json post /api/management/customers/search
openapi: 3.0.0
info:
  title: Olie API
  version: 1.0.0
  description: >
    # Introdução 👋


    Olá! Esta é a documentação oficial da API da [olie.ai](https://olie.ai/).
    Aqui você encontra as referências e exemplos de uso dos nossos endpoints.


    Para uma visão completa, recomendamos fortemente que você leia a
    [documentação oficial](https://docs.olie.ai/api-reference/introduction). Lá
    estão detalhados tópicos essenciais como
    [autenticação](https://docs.olie.ai/api-reference/introduction/authentication),
    [estrutura de
    respostas](https://docs.olie.ai/api-reference/general/response-structure),
    [paginação](https://docs.olie.ai/api-reference/general/pagination) e outros
    guias de integração.


    No Postman, esta coleção foca nas informações específicas de cada requisição
    (endpoints, parâmetros e exemplos), servindo como apoio rápido para testes e
    desenvolvimento.
servers:
  - url: https://api.olie.ai
security:
  - BearerAuth: []
paths:
  /api/management/customers/search:
    post:
      tags:
        - customers
        - search
      summary: Busca avançada de clientes
      description: >-
        Buscar clientes com filtros e critérios específicos. Leia [aqui sobre
        busca
        avançada](https://docs.olie.ai/api-reference/general/advanced-search).
      operationId: buscaAvanAdaDeClientes
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filters:
                  type: array
                  description: Array de filtros a serem aplicados na busca
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                        description: >-
                          Campo a ser filtrado. Consulte os campos disponíveis
                          de cada modelo [rota de listagem de parâmetros
                          `/api/management/system/params/{model_name}`](https://docs.olie.ai/api-reference/system/listar-par%C3%A2metros-dispon%C3%ADveis-para-filtragem-de-um-modelo)
                        x-markdownDescription: >-
                          Campo a ser filtrado. Consulte os campos disponíveis
                          de cada modelo [rota de listagem de parâmetros
                          `/api/management/system/params/{model_name}`](https://docs.olie.ai/api-reference/system/listar-par%C3%A2metros-dispon%C3%ADveis-para-filtragem-de-um-modelo)
                      operator:
                        type: string
                        enum:
                          - equals
                          - not_equals
                          - contains
                          - not_contains
                          - greater_than
                          - greater_than_or_equals
                          - less_than
                          - less_than_or_equals
                          - is_null
                          - is_not_null
                        description: Operador relacional a ser usado no filtro
                      value:
                        description: >-
                          Valor a ser filtrado (pode ser string, number,
                          boolean, object com id, ou null)
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                          - type: object
                            properties:
                              id:
                                type: string
                            required:
                              - id
                      logical_operator:
                        type: string
                        enum:
                          - and
                          - or
                        description: >-
                          Operador lógico para combinar com outros filtros
                          (padrão: 'and')
                        default: and
                      arguments:
                        type: array
                        description: >-
                          Argumentos adicionais para filtros especiais (ex:
                          answer_pool requer edge_id)
                        items:
                          type: object
                          properties:
                            argument_key:
                              type: string
                              description: Chave do argumento
                            argument_value_id:
                              type: string
                              description: ID do valor do argumento
                            argument_value_type:
                              type: string
                              description: Tipo do valor do argumento (classe do modelo)
                          required:
                            - argument_key
                            - argument_value_id
                            - argument_value_type
                    required:
                      - field
                      - operator
                sorting:
                  type: array
                  description: Array de ordenações a serem aplicadas
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                        enum:
                          - name
                          - status
                          - email
                          - company_name
                          - document
                          - customer_type
                          - main_activity
                          - address
                          - description
                          - created_at
                        description: Campo para ordenação
                      direction:
                        type: string
                        enum:
                          - asc
                          - desc
                        description: Direção da ordenação
                      arguments:
                        type: array
                        description: Argumentos adicionais para ordenações especiais
                        items:
                          type: object
                    required:
                      - field
                      - direction
                page:
                  type: integer
                  minimum: 1
                  description: Número da página (paginação Laravel)
                  default: 1
                per_page:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: Quantidade de itens por página
                  default: 15
            example:
              filters:
                - field: name
                  operator: contains
                  value: Le
      responses:
        '200':
          description: 'Sucesso: Filtro por telefone'
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
              example: '*'
            Access-Control-Expose-Headers:
              schema:
                type: string
              example: '*'
            Cache-Control:
              schema:
                type: string
              example: no-cache, private
            Date:
              schema:
                type: string
              example: Fri, 16 Jan 2026 18:11:44 GMT
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 160
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 159
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
          content:
            application/json:
              schema:
                type: object
                properties:
                  customers:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        headquarter:
                          type: string
                        company_name:
                          type: string
                        document_type:
                          type: integer
                        customer_type:
                          type: integer
                        document:
                          type: string
                        email:
                          type: string
                          format: email
                        phone:
                          type: string
                        address:
                          type: string
                        status:
                          type: integer
                        form_answers:
                          type: array
                          items: {}
                        contacts:
                          type: array
                          items: {}
                        frame_id:
                          type: string
                        created_at:
                          type: string
                          format: date-time
                        updated_at:
                          type: string
                          format: date-time
                        created_by_user:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            avatar_url:
                              type: string
                              format: uri
                        created_by:
                          type: string
                        contacts_count:
                          type: integer
                        projects_count:
                          type: integer
                        tags:
                          type: array
                          items: {}
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      from:
                        type: integer
                      last_page:
                        type: integer
                      per_page:
                        type: integer
                      to:
                        type: integer
                      total:
                        type: integer
                  response:
                    type: boolean
              example:
                customers:
                  - id: 019bc7f9-f586-7386-a27d-a070e8ae5ac2
                    name: Cliente Exemplo - Filial Rio Preto
                    headquarter: Cliente Exemplo - Filial Rio Preto
                    branch: null
                    company_name: Cliente Exemplo Comércio LTDA
                    document_type: 2
                    customer_type: 1
                    parent: null
                    document: 12.345.678/0000-00
                    main_activity: null
                    email: rp@clienteexemplo.com.br
                    phone: (99) 99999-9999
                    address: Av. Exemplo, 456 - Campinas/SP
                    description: null
                    custom_fields: null
                    status: 1
                    form_answers: []
                    contacts: []
                    parent_id: null
                    frame_id: 019b329a-4346-7064-bba3-e7c19057cda4
                    created_at: '2026-01-16T18:03:25.000000Z'
                    updated_at: '2026-01-16T18:03:25.000000Z'
                    deleted_at: null
                    created_by_user:
                      id: 019b329a-3f1f-7198-89e5-008dc4e2bd60
                      name: Test User
                      avatar_url: https://via.placeholder.com/124x124.png/00eebb?text=vero
                    created_by: 019b329a-3f1f-7198-89e5-008dc4e2bd60
                    contacts_count: 0
                    projects_count: 0
                    tags: []
                meta:
                  current_page: 1
                  from: 1
                  last_page: 1
                  per_page: 30
                  to: 1
                  total: 1
                response: true
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````