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

# 查找联系人

> WTO WA API 接口参考：查找联系人。

# 查找联系人

> Search and filter contacts

## OpenAPI

```yaml /api-reference/openapi/WTO-WA-API/chat.yaml post /chat/findContacts/{instanceName} theme={null}
openapi: 3.0.4
info:
  title: WTO - WTO WA API - Chat
  description: Main WTO WA API for WhatsApp
  version: 2.3.7
servers:
  - url: http://localhost:8080
    description: Local development server
  - url: https://api.wtocrm.com
    description: Production server
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security:
  - ApiKeyAuth: []
paths:
  /chat/findContacts/{instanceName}:
    post:
      summary: Find Contacts
      description: Search and filter contacts
      parameters:
        - $ref: '#/components/parameters/InstanceName'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Query'
      responses:
        '200':
          description: Contacts found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Contact'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/findContacts/{instanceName}
                  method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/findContacts/{instanceName}
                  method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/findContacts/{instanceName}
                  method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/findContacts/{instanceName}
                  method: POST
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/findContacts/{instanceName}
                  method: POST
components:
  parameters:
    InstanceName:
      name: instanceName
      in: path
      required: true
      description: WhatsApp instance name
      schema:
        type: string
        example: my-instance
  schemas:
    Query:
      type: object
      properties:
        where:
          type: object
        take:
          type: integer
        skip:
          type: integer
        orderBy:
          type: object
    Contact:
      type: object
      properties:
        id:
          type: string
        pushName:
          type: string
        number:
          type: string
        profilePictureUrl:
          type: string
          nullable: true
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
        meta:
          type: object
          properties:
            timestamp:
              type: string
              format: date-time
            path:
              type: string
            method:
              type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: API Key for authentication (global or instance-specific)

```
