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

# Search customer contacts

> Search for customer contacts using various criteria. Supports searching by `email`, `first_name`, `last_name` (case-insensitive substring match), or `customer_id` (exact match to filter by associated customer). At least one search parameter must be provided. Pagination is handled via query params (limit, offset).



## OpenAPI

````yaml https://api.salesbricks.com/api/v2/openapi.yaml post /persons/search
openapi: 3.0.3
info:
  title: Salesbricks REST API
  version: 2.0.0
  description: API reference for external integrations
servers:
  - url: https://api.salesbricks.com/api/v2
    description: Production
  - url: https://api.staging.salesbricks.com/api/v2
    description: Staging
security:
  - ApiKeyAuth: []
tags:
  - name: Subscriptions
    description: >-
      Operations related to subscription management, including creation,
      updates, and retrieving subscription details. Subscriptions can be
      upgraded to add / remove add-ons by using the POST
      /subscriptions/{subscription_id}/upgrade endpoint and can be recasted for
      replacing the current agreement using the POST
      /subscriptions/{subscription_id}/recast endpoint
  - name: Customers
    description: >-
      Operations related to customer management, including creation, updates,
      and managing customer person objects.
  - name: Invoices
    description: Operations related to subscription's invoicing details.
  - name: Plans
    description: >-
      Operations related to listing and getting plan details including bricks in
      the plan.
  - name: Payment Methods
    description: Operations related to subscription's payment method.
paths:
  /persons/search:
    post:
      tags:
        - Customer Contacts
      summary: Search customer contacts
      description: >-
        Search for customer contacts using various criteria. Supports searching
        by `email`, `first_name`, `last_name` (case-insensitive substring
        match), or `customer_id` (exact match to filter by associated customer).
        At least one search parameter must be provided. Pagination is handled
        via query params (limit, offset).
      operationId: searchCustomerContacts
      parameters:
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonSearchInput'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PersonSearchInput'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PersonSearchInput'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPersonOutputList'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                BadRequestResponse:
                  value:
                    error:
                      code: ERR_BAD_REQUEST
                      message: >-
                        Bad request — the input payload is malformed, missing
                        required fields, or contains invalid data.
                  summary: Bad Request Response
          description: ''
components:
  schemas:
    PersonSearchInput:
      type: object
      description: >-
        Input serializer for person search requests.

        Note: Pagination (limit/offset) is handled via query params, not POST
        body.
      properties:
        email:
          type: string
          description: Search by email (case-insensitive substring match)
        first_name:
          type: string
          description: Search by first name (case-insensitive substring match)
        last_name:
          type: string
          description: Search by last name (case-insensitive substring match)
        customer_id:
          type: string
          format: uuid
          description: Filter persons by their associated customer ID
    PaginatedPersonOutputList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/PersonOutput'
    ErrorResponse:
      type: object
      description: >-
        Standardizes API error responses with a consistent structure containing
        error code and message.
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
    PersonOutput:
      type: object
      description: Person output serializer for creating a new person.
      properties:
        person_id:
          type: string
          format: uuid
          description: The ID of the person
        first_name:
          type: string
          description: The first name of the person
        last_name:
          type: string
          description: The last name of the person
        email:
          type: string
          format: email
          description: The email of the person
        preferred_name:
          type: string
          nullable: true
          maxLength: 255
        role:
          type: string
          readOnly: true
          description: The role of the person
      required:
        - email
        - first_name
        - last_name
        - person_id
        - role
    Error:
      type: object
      description: >-
        Represents individual error details with a standardized code and
        descriptive message.
      properties:
        code:
          enum:
            - ERR_NOT_FOUND
            - ERR_BAD_REQUEST
            - ERR_SERVER_ERROR
          type: string
          x-spec-enum-id: dc5a5d6feae1b697
          description: >-
            Error code indicating the type of error: NOT_FOUND for missing
            resources, BAD_REQUEST for invalid input, SERVER_ERROR for internal
            server issues


            * `ERR_NOT_FOUND` - ERR_NOT_FOUND

            * `ERR_BAD_REQUEST` - ERR_BAD_REQUEST

            * `ERR_SERVER_ERROR` - ERR_SERVER_ERROR
        message:
          type: string
        error_id:
          type: string
          format: uuid
          description: >-
            Correlation handle for SERVER_ERROR responses — quote this when
            contacting support; it joins to the structured server log line for
            the failure. Not present on 4xx responses.
      required:
        - code
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-SALESBRICKS-KEY
      description: API key for authentication

````

## Related topics

- [Building an Order](/quickstart-guide/building-an-order.md)
- [Navigating Salesbricks](/quickstart-guide/navigating-salesbricks.md)
- [Customer email notifications](/documentation/customer-email-notifications.md)
