> ## 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 calls by campaign ID and contact ID

> Get all calls by campaign id and contact id. Returns an array of PaginatedCallPublicDto. Supports pagination.



## OpenAPI

````yaml https://api.callers.ai/openapi-json get /campaigns/{campaignId}/contacts/{contactId}/calls
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/{contactId}/calls:
    get:
      tags:
        - Calls
      summary: Get calls by campaign ID and contact ID
      description: >-
        Get all calls by campaign id and contact id. Returns an array of
        PaginatedCallPublicDto. Supports pagination.
      operationId: CampaignPublicController_getCampaignContactCalls
      parameters:
        - name: campaignId
          required: true
          in: path
          description: Id of the campaign as a string ObjectId value.
          schema:
            type: string
        - name: contactId
          required: true
          in: path
          description: Id of the contact as a string ObjectId value.
          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:
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
        default:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaginatedCallPublicDto'
      security:
        - Authorization: []
components:
  schemas:
    PaginatedCallPublicDto:
      type: object
      properties:
        data:
          description: Array of CallPublicDto objects
          type: array
          items:
            $ref: '#/components/schemas/CallPublicDto'
        total:
          type: number
          description: Total number of records
        page:
          type: number
          description: Current page number
        perPage:
          type: number
          description: Number of records per page
      required:
        - data
        - total
        - page
        - perPage
    CallPublicDto:
      type: object
      properties:
        id:
          type: string
          description: The id of the call. string representation of a ObjectId.
        sessionId:
          type: string
          description: The id of the session. string representation of a ObjectId.
        campaignId:
          type: string
          description: The id of the campaign. string representation of a ObjectId.
        organizationId:
          type: string
          description: The id of the organization. string representation of a ObjectId.
        duration:
          type: number
          description: The duration of the call in seconds.
        hangUpReason:
          type: string
          description: The reason for hanging up the call.
        status:
          type: string
          description: The status of the call.
        failedReason:
          type: string
          description: The reason of the failing call.
        failedReasonDetails:
          type: string
          description: The reason details of the failed call.
        recordingUrl:
          type: string
          description: The url of the recording.
        createdAt:
          type: string
          description: The datetime the call object was created in ISO string format.
          example: '2021-09-01T00:00:00.000Z'
        updatedAt:
          type: string
          description: The datetime the call was updated last time in ISO string format.
          example: '2021-09-01T00:00:00.000Z'
        phoneFrom:
          type: string
          description: The phone number.
        phoneTo:
          type: string
          description: The phone number.
        messages:
          description: The ordered messages of the call.
          type: array
          items:
            $ref: '#/components/schemas/TranscriptMessagePublicDto'
        contactId:
          type: string
          description: >-
            Id of the contact within the system. String representation of a
            ObjectId.
        summary:
          type: object
          description: The summary object of the call.
        events:
          description: The scripted events that successfully occurred during the call.
          type: array
          items:
            $ref: '#/components/schemas/CallEventPublicDto'
        goal:
          description: The goal object of the call.
          allOf:
            - $ref: '#/components/schemas/GoalPublicDto'
        promptVars:
          type: object
          description: Prompt variables associated with the call
        twilioAccountSid:
          type: string
          description: Twilio account sid.
        incomingCall:
          type: boolean
          description: >-
            This boolean value indicates the call direction: true for incoming
            calls and false for outgoing calls.
        web:
          type: boolean
          description: Indicates whether the call was initiated via the web SDK.
      required:
        - id
        - sessionId
        - campaignId
        - organizationId
        - duration
        - hangUpReason
        - status
        - failedReason
        - failedReasonDetails
        - recordingUrl
        - createdAt
        - updatedAt
        - phoneFrom
        - phoneTo
        - messages
        - contactId
        - summary
        - events
        - goal
        - promptVars
        - twilioAccountSid
        - incomingCall
        - web
    TranscriptMessagePublicDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the message within the transcript.
        role:
          type: string
          description: The role of the speaker.
        duration:
          type: number
          description: The duration of the message in mils.
        timestamp:
          type: number
          description: The timestamp of the message in mils.
        content:
          type: string
          description: The real content of the message.
      required:
        - id
        - role
        - duration
        - timestamp
        - content
    CallEventPublicDto:
      type: object
      properties:
        type:
          type: string
          description: The type of the event.
          enum:
            - SMS
            - MEETING
            - FORWARD
        data:
          type: object
          description: The specific data of the event.
      required:
        - type
    GoalPublicDto:
      type: object
      properties:
        description:
          type: string
          description: The description of the goal
        reached:
          type: boolean
          description: The status of the goal. Was it reached or not.
      required:
        - description
        - reached
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization

````