# Explain Sending Time Series Popularity Prediction

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/ml/sending/explain_time_series_popularity:
    post:
      summary: Explain Sending Time Series Popularity Prediction
      deprecated: false
      description: >-
        Explains prediction for a specific sending and selected KPI based on
        historical KPI time series.


        ## Example


        ```shell

        curl -X POST \

        "https://api.mpc.placewise.com/v2/ml/sending/explain_time_series_popularity" 
        \

        -H 'Content-Type: application/json' \

        -H 'Authorization: Bearer B7t9U9tsoWsGhrv2ouUoSqpM' \

        -H 'x-product-name: default' \

        -H 'x-user-agent: CURL manual test' \

        -d '{
              "sending_date": "2025-04-15T12:19:48.578279",
              "channel": "email",
              "kpi": "ctr",
        }'

        ```


        > When successful, returns:

        ```json

        {
          "dates": [
            "2025-03-28",
            "2025-03-29",
            "2025-03-30"
          ],
          "predictions": [
            7.6644820793970885,
            7.6647581507025695,
            7.664979007746955
          ],
          "low_50_percentiles": [
            2.585277421222262,
            2.5597992934271305,
            2.534362770369186
          ],
          "high_50_percentiles": [
            12.743686737571915,
            12.76971700797801,
            12.795595245124723
          ],
          "low_95_percentiles": [
            0,
            0,
            0,
          ],
          "high_95_percentiles": [
            22.423873452263305,
            22.498987284518,
            22.573764561320587
          ]
        }

        ```
      tags:
        - API Reference/ML API/Sendings
      parameters:
        - name: Content-Type
          in: header
          description: '[Details](doc-341635)'
          required: true
          example: application/json
          schema:
            type: string
            default: application/json
            const: application/json
        - name: X-User-Agent
          in: header
          description: Arbitrary identifier of your client. [Details](doc-341635)
          required: true
          example: '{{X_USER_AGENT}}'
          schema:
            type: string
            default: '{{X_USER_AGENT}}'
        - name: X-Product-Name
          in: header
          description: API Product for API context. [Details](doc-341635)
          required: true
          example: '{{PRODUCT_NAME}}'
          schema:
            type: string
            default: '{{PRODUCT_NAME}}'
        - name: X-Loyalty-Club-Slug
          in: header
          description: LoyaltyClub for API context. [Details](doc-342138)
          required: false
          example: '{{LOYALTY_CLUB_SLUG}}'
          schema:
            type: string
            default: '{{LOYALTY_CLUB_SLUG}}'
        - name: X-Customer
          in: header
          description: Customer for API context.  [Details](doc-342139)
          required: false
          example: '{{CUSTOMER_ID}}'
          schema:
            type: string
            default: '{{CUSTOMER_ID}}'
        - name: Authorization
          in: header
          description: '[Member](doc-342129) or [User](doc-342130) Authorization.'
          required: false
          example: Bearer {{_OAUTH_TOKEN}}
          schema:
            type: string
            default: Bearer {{_OAUTH_TOKEN}}
        - name: X-Client-Authorization
          in: header
          description: '[Token](doc-342128) Authorization.'
          example: '{{API_TOKEN}}'
          schema:
            type: string
            default: '{{API_TOKEN}}'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExplainTimeSeriesPopularityRequest'
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExplainTimeSeriesPopularityResponse'
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: API Reference/ML API/Sendings
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-3768490-run
components:
  schemas:
    ExplainTimeSeriesPopularityRequest:
      $ref: '#/components/schemas/PredictTimeSeriesPopularityRequest'
      x-apidog-folder: ''
    PredictTimeSeriesPopularityRequest:
      type: object
      properties:
        channel:
          $ref: '#/components/schemas/Channel'
        kpi:
          $ref: '#/components/schemas/KPI'
        sending_date:
          $ref: '#/components/schemas/date_time'
          description: Date of sending, ISO 8601 format.
      x-apidog-orders:
        - channel
        - kpi
        - sending_date
      required:
        - channel
        - kpi
        - sending_date
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    date_time:
      type: string
      format: date-time
      examples:
        - '2022-11-09T16:25:58.099512Z'
      x-apidog-folder: ''
    KPI:
      type: string
      title: kpi
      description: Channel of the sending
      enum:
        - ctr
        - open_rate
        - sms
      x-apidog-enum:
        - value: ctr
          name: kpi
          description: ''
        - value: open_rate
          name: channel
          description: ''
        - value: sms
          name: channel
          description: ''
      x-apidog-folder: ''
    Channel:
      type: string
      enum:
        - email
        - push
        - sms
      x-apidog-enum:
        - value: email
          name: channel
          description: ''
        - value: push
          name: channel
          description: ''
        - value: sms
          name: channel
          description: ''
      title: channel
      description: Channel of the sending
      x-apidog-folder: ''
    ExplainTimeSeriesPopularityResponse:
      type: object
      properties:
        dates:
          type: array
          items:
            $ref: '#/components/schemas/date'
        predictions:
          type: array
          items:
            type: number
        low_50_percentiles:
          type: array
          items:
            type: number
        high_50_percentiles:
          type: array
          items:
            type: number
        low_95_percentiles:
          type: array
          items:
            type: number
        high_95_percentiles:
          type: array
          items:
            type: number
      x-apidog-orders:
        - dates
        - predictions
        - low_50_percentiles
        - high_50_percentiles
        - low_95_percentiles
        - high_95_percentiles
      required:
        - dates
        - predictions
        - low_50_percentiles
        - high_50_percentiles
        - low_95_percentiles
        - high_95_percentiles
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    date:
      type: string
      format: date
      examples:
        - '2023-01-15'
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```