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

# Get contacts in audience

> Get paginated list of contacts belonging to an audience. Supports search and sort.



## OpenAPI

````yaml /openapi.json get /api/audience/{id}/contacts
openapi: 3.0.0
info:
  title: GoMobile Backend API
  description: >-
    API documentation for GoMobile telephony platform - automated calling
    campaigns, interactive voice flows, and call management
  version: '1.0'
  contact: {}
servers:
  - url: http://localhost:3000
    description: Local Development
security: []
tags:
  - name: Organizations
    description: Multi-tenant organization management
  - name: Teams
    description: Team structure and hierarchy
  - name: Contacts
    description: Customer contact management (CRM)
  - name: Entities
    description: Business entities management
  - name: Audiences
    description: Contact segmentation and groups
  - name: Programs
    description: Call campaign configuration
  - name: Call Flows
    description: Interactive call flow builder
paths:
  /api/audience/{id}/contacts:
    get:
      tags:
        - Audiences
      summary: Get contacts in audience
      description: >-
        Get paginated list of contacts belonging to an audience. Supports search
        and sort.
      operationId: AudienceController_getContactsByAudience
      parameters:
        - name: id
          required: true
          in: path
          description: Audience UUID
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: Page number (1-based)
          schema:
            minimum: 1
            default: 1
            example: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Number of items per page
          schema:
            minimum: 1
            maximum: 100
            default: 20
            example: 20
            type: number
        - name: search
          required: false
          in: query
          description: Search term to filter results
          schema:
            maxLength: 100
            example: john
            type: string
        - name: sortBy
          required: false
          in: query
          description: Field to sort by
          schema:
            example: createdAt
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort order
          schema:
            default: desc
            example: desc
            type: string
            enum:
              - asc
              - desc
      responses:
        '200':
          description: Paginated list of contacts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedContactResponseDtoResponse'
        '404':
          description: Audience not found
components:
  schemas:
    PaginatedContactResponseDtoResponse:
      type: object
      properties:
        data:
          description: Array of items
          type: array
          items:
            $ref: '#/components/schemas/ContactResponseDto'
        meta:
          description: Pagination metadata
          allOf:
            - $ref: '#/components/schemas/PaginationMeta'
      required:
        - data
        - meta
    ContactResponseDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        organizationId:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        firstName:
          type: string
          example: John
          nullable: true
        lastName:
          type: string
          example: Doe
          nullable: true
        fullName:
          type: string
          example: John Doe
          nullable: true
        primaryEmail:
          type: string
          example: john@example.com
          nullable: true
        primaryPhone:
          type: string
          example: '+212612345678'
        address:
          type: string
          example: 123 Main St
          nullable: true
        city:
          type: string
          example: Casablanca
          nullable: true
        state:
          type: string
          example: Casablanca-Settat
          nullable: true
        zip:
          type: string
          example: '20000'
          nullable: true
        occupation:
          type: string
          example: Engineer
          nullable: true
        preferredChannel:
          type: string
          example: phone
          nullable: true
        gender:
          type: string
          enum:
            - male
            - female
        channels:
          type: array
          example: []
          items:
            type: string
          nullable: true
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T00:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          example: '2024-01-01T00:00:00.000Z'
      required:
        - id
        - organizationId
        - primaryPhone
        - channels
        - createdAt
        - updatedAt
    PaginationMeta:
      type: object
      properties:
        page:
          type: number
          description: Current page number
          example: 1
        limit:
          type: number
          description: Number of items per page
          example: 20
        total:
          type: number
          description: Total number of items
          example: 150
        totalPages:
          type: number
          description: Total number of pages
          example: 8
        hasNextPage:
          type: boolean
          description: Whether there is a next page
          example: true
        hasPreviousPage:
          type: boolean
          description: Whether there is a previous page
          example: false
      required:
        - page
        - limit
        - total
        - totalPages
        - hasNextPage
        - hasPreviousPage

````