# Explain Sending Popularity Prediction

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/ml/sending/explain_sending_popularity:
    post:
      summary: Explain Sending Popularity Prediction
      deprecated: false
      description: >-
        Explains sending popularity prediction for selected KPI for a given
        sending entity. Version v2, with upgraded
        models.                                                               


        **Warning:** combination of "sms" channel and "open_rate" KPI is not
        supported.


        Text should be as shown to the end user, without any HTML.


        ## Example


        ```shell

        curl -X POST \

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

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

        -H 'Authorization: Bearer B7t9U9tsoWsGhrv2ouUoSqpM' \

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

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

        -d '{
          "channel": "email",
          "kpi": "ctr",
          "scheduled_date": "2020-01-01",
          "sending_hour": 12,
          "text": "Great title! Great content".
        }'

        ```


        > When successful, returns:

        ```json

        {
          "feature_influences": {
            "sending_hour": 0.011576919053739497,
            "forecast": -0.017071377705380756,
            "text_pred": -0.16006355483664164,
            "historical_median": 0.3328648681685314
          }
        }

        ```
      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/PredictSendingPopularityRequest'
            example:
              channel: sms
              kpi: open_rate
              sending_date: '2024-04-20'
              sending_hour: 16
              text: >-
                Canis acervus maxime trepide conculco strues. Calco placeat
                ipsam tibi.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  feature_influences:
                    type: object
                    properties:
                      sending_hour:
                        type: number
                      forecast:
                        type: number
                      text_pred:
                        type: number
                      historical_median:
                        type: number
                    x-apidog-orders:
                      - sending_hour
                      - forecast
                      - text_pred
                      - historical_median
                    required:
                      - sending_hour
                      - forecast
                      - text_pred
                      - historical_median
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - feature_influences
                required:
                  - feature_influences
                x-apidog-ignore-properties: []
          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-3768482-run
components:
  schemas:
    PredictSendingPopularityRequest:
      type: object
      properties:
        channel:
          $ref: '#/components/schemas/Channel'
        kpi:
          $ref: '#/components/schemas/KPI'
        sending_date:
          $ref: '#/components/schemas/date'
        sending_hour:
          type: integer
          maximum: 23
          minimum: 0
        text:
          description: >-
            Sending text. For emails, it should contain both title and content,
            separated with a space.
          $ref: '#/components/schemas/text'
      x-apidog-orders:
        - channel
        - kpi
        - sending_date
        - sending_hour
        - text
      required:
        - channel
        - kpi
        - sending_date
        - sending_hour
        - text
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    text:
      type: string
      description: Text of sending. If it has title and content, combine them as one text.
      x-apidog-folder: ''
    date:
      type: string
      format: date
      examples:
        - '2023-01-15'
      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: ''
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```