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

# Get all contacts by campaign ID

> Get all campaign contacts. Returns an array of ContactPublicDto. Supports pagination, status filtering and sorting options.



## OpenAPI

````yaml https://api.callers.ai/openapi-json get /campaigns/{campaignId}/contacts
openapi: 3.0.0
info:
  title: Callers API
  description: API documentation for Callers, providing endpoints for seamless integration.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.callers.ai
security: []
tags: []
paths:
  /campaigns/{campaignId}/contacts:
    get:
      tags:
        - Contacts
      summary: Get all contacts by campaign ID
      description: >-
        Get all campaign contacts. Returns an array of ContactPublicDto.
        Supports pagination, status filtering and sorting options.
      operationId: CampaignPublicController_getCampaignContacts
      parameters:
        - name: campaignId
          required: true
          in: path
          description: Id of the campaign as a string ObjectId value.
          schema:
            type: string
        - name: lastAttemptTo
          required: false
          in: query
          description: >-
            Filter contacts up to this last attempt date in ISO 8601 UTC format
            (e.g. YYYY-MM-DDTHH:mm:ss.sssZ). Default is null.
          schema:
            type: string
        - name: lastAttemptFrom
          required: false
          in: query
          description: >-
            Filter contacts from this last attempt date in ISO 8601 UTC format
            (e.g. YYYY-MM-DDTHH:mm:ss.sssZ). Default is null.
          schema:
            type: string
        - name: archived
          required: false
          in: query
          description: Archived filter. Default is false.
          schema:
            type: boolean
        - name: sortDirection
          required: false
          in: query
          description: >-
            Sorting direction. Default is ascending. Possible values: 'asc' or
            'desc'.
          schema:
            type: string
        - name: sortAttribute
          required: false
          in: query
          description: Sorting attribute. Name of the entity field to sort by.
          schema:
            type: string
        - name: goals
          required: false
          in: query
          description: Goals filter. Default is all goals.
          schema:
            type: string
        - name: statuses
          required: false
          in: query
          description: Status filter. Default is all statuses.
          schema:
            type: string
        - name: perPage
          required: false
          in: query
          description: Max page size. Default is 50.
          schema:
            type: number
        - name: page
          required: false
          in: query
          description: Page number. Default is 0.
          schema:
            type: number
        - name: x-sub-organization-id
          in: header
          schema:
            type: string
          description: >-
            Optional sub organization ID. Must belong to your main organization
            API key.
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ContactPublicDto'
      security:
        - Authorization: []
components:
  schemas:
    ContactPublicDto:
      type: object
      properties:
        id:
          type: string
          description: The id of the contact. string representation of a ObjectId.
        name:
          type: string
          description: The name of the contact.
        phoneNumber:
          type: string
          description: The phone number of the contact.
        campaignId:
          type: string
          description: The id of the campaign. string representation of a ObjectId.
        status:
          type: string
          description: The status of the contact.
        attempts:
          type: number
          description: The total number of call attempts made to reach the contact.
        failedReason:
          type: string
          description: The reason for failing the call.
        failedReasonDetails:
          type: string
          description: The reason details for failing the call.
        createdAt:
          type: string
          description: The date and time the contact was created in ISO format.
        lastAttempt:
          type: string
          description: The date and time of the last call attempt in ISO format.
      required:
        - id
        - name
        - phoneNumber
        - campaignId
        - status
        - attempts
        - createdAt
        - lastAttempt
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization

````