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

# Get Analytics

> Retrieves analytics data for a specific outbound campaign within a given date range.



## OpenAPI

````yaml post /v1/Outbound/{outboundId}/Analytics
openapi: 3.0.1
info:
  title: NLPearl Client API
  description: A sample API that demonstrates features in the OpenAPI specification
  version: v1
servers:
  - url: https://api.nlpearl.ai
    description: Production Environement
security:
  - bearer_auth: []
paths:
  /v1/Outbound/{outboundId}/Analytics:
    post:
      tags:
        - Outbound
      summary: Get Analytics
      description: >-
        Retrieves analytics data for a specific outbound campaign within a given
        date range.
      parameters:
        - name: outboundId
          in: path
          description: The unique identifier of the outbound campaign.
          required: true
          schema:
            type: string
      requestBody:
        description: "The object containing the start and end dates for the analytics query.  \r\nThe maximum allowed range between the start and end date is 90 days."
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/DateSearch'
              description: Represents a date range used to query analytics data.
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/DateSearch'
              description: Represents a date range used to query analytics data.
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/DateSearch'
              description: Represents a date range used to query analytics data.
      responses:
        '200':
          description: >-
            Returns an object containing the analytics data for the specified
            outbound campaign.
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/AnalyticsOutboundApi'
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsOutboundApi'
            text/json:
              schema:
                $ref: '#/components/schemas/AnalyticsOutboundApi'
        '400':
          description: >-
            The request was invalid. Possible causes include a missing or
            malformed outbound ID, or errors in the search parameters.
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
components:
  schemas:
    DateSearch:
      type: object
      properties:
        from:
          type: string
          description: The start date of the query range (inclusive).
          format: date-time
        to:
          type: string
          description: "The end date of the query range (inclusive).  \r\nMust not be more than 90 days after the `From` date."
          format: date-time
      additionalProperties: false
      description: Represents a date range used to query analytics data.
    AnalyticsOutboundApi:
      type: object
      properties:
        callsStatusOverview:
          allOf:
            - $ref: '#/components/schemas/CallsStatusAnalyticsOverview'
          description: Overview of call statuses (e.g. success, failed, no answer).
          nullable: true
        callsSentimentOverview:
          allOf:
            - $ref: '#/components/schemas/CallsSentimentOverview'
          description: 'Overview of sentiment analysis results for the client during calls. '
          nullable: true
        callsStatusTimeLine:
          type: array
          items:
            $ref: '#/components/schemas/CallsStatusTimeLine'
          description: Timeline showing the distribution of call statuses over time.
          nullable: true
        callsAverageTimeLine:
          type: array
          items:
            $ref: '#/components/schemas/CallsAverageTimeLine'
          description: Timeline showing average call durations over time.
          nullable: true
        callsCostTimeLine:
          type: array
          items:
            $ref: '#/components/schemas/CallsCostTimeLine'
          description: Timeline showing call costs over time.
          nullable: true
        callsPickupRateTimeLine:
          type: array
          items:
            $ref: '#/components/schemas/CallsPickupRateTimeLine'
          description: Timeline showing pickup rate trends over time.
          nullable: true
        callsSuccessRateTimeLine:
          type: array
          items:
            $ref: '#/components/schemas/CallsSuccessRateTimeLine'
          description: Timeline showing success rate trends over time.
          nullable: true
        callLabelCount:
          type: array
          items:
            $ref: '#/components/schemas/CallLabelCount'
          description: Count of labels applied to calls.
          nullable: true
        callEventsCounts:
          allOf:
            - $ref: '#/components/schemas/CallEventsCount'
          description: Summary of events that occurred during calls.
          nullable: true
        callsByHourDayOfWeeks:
          type: array
          items:
            $ref: '#/components/schemas/CallsByHourDayOfWeek'
          description: Breakdown of calls by hour and day of the week.
          nullable: true
      additionalProperties: false
      description: Represents the analytics data for an outbound campaign.
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          nullable: true
      additionalProperties: {}
    CallsStatusAnalyticsOverview:
      type: object
      properties:
        totalCalls:
          type: integer
          format: int32
        totalLeads:
          type: integer
          format: int32
        needRetry:
          type: integer
          format: int32
        wrongCountryCode:
          type: integer
          format: int32
        needFollowUp:
          type: integer
          format: int32
        voiceMailLeft:
          type: integer
          format: int32
        successful:
          type: integer
          format: int32
        unsuccessful:
          type: integer
          format: int32
        wrongNumber:
          type: integer
          format: int32
        completed:
          type: integer
          format: int32
        unreachable:
          type: integer
          format: int32
        error:
          type: integer
          format: int32
      additionalProperties: false
      description: Overview of call statuses (e.g. success, failed, no answer).
    CallsSentimentOverview:
      type: object
      properties:
        negative:
          type: integer
          format: int32
        slightlyNegative:
          type: integer
          format: int32
        neutral:
          type: integer
          format: int32
        slightlyPositive:
          type: integer
          format: int32
        positive:
          type: integer
          format: int32
      additionalProperties: false
      description: 'Overview of sentiment analysis results for the client during calls. '
    CallsStatusTimeLine:
      type: object
      properties:
        totalCalls:
          type: integer
          format: int32
        totalLeads:
          type: integer
          format: int32
        needRetry:
          type: integer
          format: int32
        wrongCountryCode:
          type: integer
          format: int32
        needFollowUp:
          type: integer
          format: int32
        voiceMailLeft:
          type: integer
          format: int32
        successful:
          type: integer
          format: int32
        unsuccessful:
          type: integer
          format: int32
        wrongNumber:
          type: integer
          format: int32
        completed:
          type: integer
          format: int32
        unreachable:
          type: integer
          format: int32
        error:
          type: integer
          format: int32
        date:
          type: string
          format: date-time
      additionalProperties: false
      description: Overview of call statuses (e.g. success, failed, no answer).
    CallsAverageTimeLine:
      type: object
      properties:
        date:
          type: string
          format: date-time
        averageCallDuration:
          type: number
          format: double
      additionalProperties: false
    CallsCostTimeLine:
      type: object
      properties:
        date:
          type: string
          format: date-time
        totalPrice:
          type: number
          format: double
        averageCostPerCall:
          type: number
          format: double
      additionalProperties: false
    CallsPickupRateTimeLine:
      type: object
      properties:
        date:
          type: string
          format: date-time
        pickupRatePercentage:
          type: number
          format: double
      additionalProperties: false
    CallsSuccessRateTimeLine:
      type: object
      properties:
        date:
          type: string
          format: date-time
        successRatePercentage:
          type: number
          format: double
      additionalProperties: false
    CallLabelCount:
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        color:
          type: string
          nullable: true
        count:
          type: integer
          format: int32
      additionalProperties: false
    CallEventsCount:
      type: object
      properties:
        takeMessageCount:
          type: integer
          format: int32
        smsSentCount:
          type: integer
          format: int32
        callTransferredCount:
          type: integer
          format: int32
        calendarBookedCount:
          type: integer
          format: int32
        emailSentCount:
          type: integer
          format: int32
      additionalProperties: false
      description: Summary of events that occurred during calls.
    CallsByHourDayOfWeek:
      type: object
      properties:
        hourOfDay:
          type: integer
          format: int32
        dayOfWeek:
          allOf:
            - $ref: '#/components/schemas/DayOfWeek'
          description: |+
            `0 - Sunday`

            `1 - Monday`

            `2 - Tuesday`

            `3 - Wednesday`

            `4 - Thursday`

            `5 - Friday`

            `6 - Saturday`

        count:
          type: integer
          format: int32
      additionalProperties: false
    DayOfWeek:
      type: integer
      description: |+
        `0 - Sunday`

        `1 - Monday`

        `2 - Tuesday`

        `3 - Wednesday`

        `4 - Thursday`

        `5 - Friday`

        `6 - Saturday`

      format: int32
  securitySchemes:
    bearer_auth:
      type: http
      description: >-
        Specify the authorization token.


        For more information, check out the [Authorization
        Guide](/api-reference/authorization).
      scheme: bearer

````