swagger: "2.0"
schemes:
  - https
host: azure.local
basePath: /personalizer/v1.0
info:
  description: Personalizer Service is an Azure Cognitive Service that makes it easy to target content and experiences without complex pre-analysis or cleanup of past data. Given a context and featurized content, the Personalizer Service returns which content item to show to users in rewardActionId. As rewards are sent in response to the use of rewardActionId, the reinforcement learning algorithm will improve the model and improve performance of future rank calls.
  title: Personalizer Client
  version: v1.0
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/Personalizer/stable/v1.0/Personalizer.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: cognitiveservices-Personalizer
  x-tags:
    - Azure
    - Microsoft
securityDefinitions:
  apim_key:
    in: header
    name: Ocp-Apim-Subscription-Key
    type: apiKey
security:
  - apim_key: []
parameters:
  Endpoint:
    description: Supported Cognitive Services endpoint.
    in: path
    name: Endpoint
    required: true
    type: string
    x-ms-parameter-location: client
    x-ms-skip-url-encoding: true
tags:
  - description: Manages configuration operations.
    name: Configurations
  - description: Manages counterfactual evaluation operations.
    name: Evaluations
  - description: Manages event operations.
    name: Events
  - description: Manages reinforcement learning logs.
    name: Logs
  - description: Manages reinforcement learning configuration operations.
    name: Model
  - description: Manages ranking operations.
    name: Rank
paths:
  /configurations/policy:
    delete:
      consumes: []
      description: Resets the Learning settings of the Personalizer service to default.
      operationId: Policy_Reset
      parameters: []
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/PolicyContract"
      summary: Reset Policy.
      tags:
        - Configurations
      x-ms-examples:
        Successful Policy_Reset request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "200":
              body:
                arguments: --cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5
                name: myPersonalizer
              headers: {}
    get:
      consumes: []
      description: Get the Learning settings currently used by the Personalizer service.
      operationId: Policy_Get
      parameters: []
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/PolicyContract"
      summary: Get Policy.
      tags:
        - Configurations
      x-ms-examples:
        Successful Policy_Get request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "200":
              body:
                arguments: --cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5
                name: myPersonalizer
              headers: {}
    put:
      consumes:
        - application/json
      description: Update the Learning settings that the Personalizer service will use to train models.
      operationId: Policy_Update
      parameters:
        - description: The Learning settings.
          in: body
          name: policy
          required: true
          schema:
            $ref: "#/definitions/PolicyContract"
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/PolicyContract"
        default:
          description: Invalid policy configuration.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Update Policy.
      tags:
        - Configurations
      x-ms-examples:
        Successful Policy_Update request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
            policy:
              arguments: --cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5
              name: myPersonalizer
          responses:
            "200":
              body:
                arguments: --cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5
                name: myPersonalizer
              headers: {}
  /configurations/service:
    get:
      consumes: []
      description: Get the Personalizer service configuration.
      operationId: ServiceConfiguration_Get
      parameters: []
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/ServiceConfiguration"
      summary: Get Service Configuration.
      tags:
        - Configurations
      x-ms-examples:
        Successful ServiceConfiguration_Get request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "200":
              body:
                defaultReward: 0
                explorationPercentage: 0.2
                logMirrorEnabled: true
                logMirrorSasUri: https://testblob.blob.core.windows.net/container?se=2020-08-13T00%3A00Z&sp=rwl&spr=https&sv=2018-11-09&sr=c&sig=signature
                logRetentionDays: 7
                modelExportFrequency: PT5M
                rewardAggregation: earliest
                rewardWaitTime: PT10M
              headers: {}
    put:
      consumes:
        - application/json
      description: Update the Personalizer service configuration.
      operationId: ServiceConfiguration_Update
      parameters:
        - description: The personalizer service configuration.
          in: body
          name: config
          required: true
          schema:
            $ref: "#/definitions/ServiceConfiguration"
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/ServiceConfiguration"
        default:
          description: Invalid service configuration.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Update Service Configuration.
      tags:
        - Configurations
      x-ms-examples:
        Successful ServiceConfiguration_Update request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
            config:
              defaultReward: 0
              explorationPercentage: 0.2
              logMirrorEnabled: true
              logMirrorSasUri: https://testblob.blob.core.windows.net/container?se=2020-08-13T00%3A00Z&sp=rwl&spr=https&sv=2018-11-09&sr=c&sig=signature
              logRetentionDays: 7
              modelExportFrequency: PT5M
              rewardAggregation: earliest
              rewardWaitTime: PT10M
          responses:
            "200":
              body:
                defaultReward: 0
                explorationPercentage: 0.2
                logMirrorEnabled: true
                logMirrorSasUri: https://testblob.blob.core.windows.net/container?se=2020-08-13T00%3A00Z&sp=rwl&spr=https&sv=2018-11-09&sr=c&sig=signature
                logRetentionDays: 7
                modelExportFrequency: PT5M
                rewardAggregation: earliest
                rewardWaitTime: PT10M
              headers: {}
  /evaluations:
    get:
      consumes: []
      description: List all the submitted evaluations.
      operationId: Evaluations_List
      parameters: []
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            items:
              $ref: "#/definitions/Evaluation"
            type: array
      summary: List Evaluations.
      tags:
        - Evaluations
      x-ms-examples:
        Successful Evaluations_List request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "200":
              body:
                - endTime: 2018-12-19T00:00:00Z
                  featureImportance: []
                  id: b58c6d92-b727-48c1-9487-4be2782c9e0a
                  name: myFirstEvaluation
                  policyResults:
                    - arguments: --cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5
                      name: Custom Learning settings 1
                  startTime: 2018-11-19T00:00:00Z
                  status: pending
                - endTime: 2019-01-19T00:00:00Z
                  featureImportance: []
                  id: 21d03972-9130-4be9-8c8b-8ac3ec9b9dd1
                  name: mySecondEvaluation
                  policyResults: []
                  startTime: 2018-12-19T00:00:00Z
                  status: pending
              headers: {}
    post:
      consumes:
        - application/json
      description: Submit a new evaluation job.
      operationId: Evaluations_Create
      parameters:
        - description: The evaluation job definition.
          in: body
          name: evaluation
          required: true
          schema:
            $ref: "#/definitions/EvaluationContract"
      produces:
        - application/json
      responses:
        "201":
          description: Success
          headers:
            Location:
              description: Location of the evaluation resource
              type: string
          schema:
            $ref: "#/definitions/Evaluation"
        default:
          description: Invalid evaluation contract.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Create Evaluation.
      tags:
        - Evaluations
      x-ms-examples:
        Successful Evaluations_Create request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
            evaluation:
              enableOfflineExperimentation: true
              endTime: 2019-01-19T00:00:00Z
              name: myFirstEvaluation
              policies:
                - arguments: --cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5
                  name: Custom Learning settings 1
              startTime: 2018-12-19T00:00:00Z
          responses:
            "201":
              body:
                endTime: 2019-01-19T00:00:00Z
                featureImportance: []
                id: b58c6d92-b727-48c1-9487-4be2782c9e0a
                name: myFirstEvaluation
                policyResults:
                  - arguments: --cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5
                    name: Custom Learning settings 1
                startTime: 2018-12-19T00:00:00Z
                status: pending
              headers:
                Location: "{endpoint}/personalizer/v1.0/evaluations/{evaluationId}"
  "/evaluations/{evaluationId}":
    delete:
      consumes: []
      description: Delete the evaluation associated with the Id.
      operationId: Evaluations_Delete
      parameters:
        - description: Id of the evaluation to delete.
          in: path
          maxLength: 256
          name: evaluationId
          required: true
          type: string
      produces: []
      responses:
        "204":
          description: Success
      summary: Delete Evaluation.
      tags:
        - Evaluations
      x-ms-examples:
        Successful Evaluations_Delete request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
            evaluationId: id
          responses:
            "204": {}
    get:
      consumes: []
      description: Get the evaluation associated with the Id.
      operationId: Evaluations_Get
      parameters:
        - description: Id of the evaluation.
          in: path
          maxLength: 256
          name: evaluationId
          required: true
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/Evaluation"
        default:
          description: Evaluation not found.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Get Evaluation.
      tags:
        - Evaluations
      x-ms-examples:
        Successful Evaluations_Get request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
            evaluationId: id
          responses:
            "200":
              body:
                endTime: 2019-01-19T00:00:00Z
                featureImportance:
                  - - f1
                    - f2
                  - - f3
                    - f4
                id: b58c6d92-b727-48c1-9487-4be2782c9e0a
                name: myFirstEvaluation
                policyResults:
                  - arguments: --cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5
                    name: Custom Learning settings 1
                    summary:
                      - aggregateTimeWindow: PT0S
                        confidenceInterval: 0
                        ipsEstimatorDenominator: 170
                        ipsEstimatorNumerator: 0
                        nonZeroProbability: 64
                        snipsEstimatorDenominator: 308.25
                        sumOfSquares: 0
                        timeStamp: 2018-12-19T00:00:00Z
                      - aggregateTimeWindow: PT0S
                        confidenceInterval: 1.1009
                        ipsEstimatorDenominator: 196
                        ipsEstimatorNumerator: 2.2
                        nonZeroProbability: 68
                        snipsEstimatorDenominator: 193.761
                        sumOfSquares: 2.424
                        timeStamp: 2018-12-19T00:05:00Z
                    totalSummary:
                      aggregateTimeWindow: PT0S
                      confidenceInterval: 1.1209
                      ipsEstimatorDenominator: 1906
                      ipsEstimatorNumerator: 22.2
                      nonZeroProbability: 68
                      snipsEstimatorDenominator: 1993.761
                      sumOfSquares: 2.484
                      timeStamp: 2019-01-19T00:00:00Z
                startTime: 2018-12-19T00:00:00Z
                status: completed
              headers: {}
  "/events/{eventId}/activate":
    post:
      consumes: []
      description: Report that the specified event was actually displayed to the user and a reward should be expected for it
      operationId: Events_Activate
      parameters:
        - description: The event ID this activation applies to.
          in: path
          maxLength: 256
          name: eventId
          required: true
          type: string
      produces:
        - application/json
      responses:
        "204":
          description: Success
        default:
          description: Invalid activate event request.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Activate Event.
      tags:
        - Events
      x-ms-examples:
        Successful Events_Activate request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
            eventId: id
          responses:
            "204": {}
  "/events/{eventId}/reward":
    post:
      consumes:
        - application/json
      description: Report reward that resulted from using the action specified in rewardActionId for the specified event.
      operationId: Events_Reward
      parameters:
        - description: The event id this reward applies to.
          in: path
          maxLength: 256
          name: eventId
          required: true
          type: string
        - description: The reward should be a floating point number, typically between 0 and 1.
          in: body
          name: reward
          required: true
          schema:
            $ref: "#/definitions/RewardRequest"
      produces:
        - application/json
      responses:
        "204":
          description: Success
        default:
          description: Invalid reward request.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Post Reward.
      tags:
        - Events
      x-ms-examples:
        Successful Events_Reward request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
            eventId: id
            reward:
              value: 1
          responses:
            "204": {}
  /logs:
    delete:
      consumes: []
      description: Delete all generated logs.
      operationId: Log_Delete
      parameters: []
      produces: []
      responses:
        "204":
          description: Success
      summary: Deletes Logs.
      tags:
        - Logs
      x-ms-examples:
        Successful Log_Delete request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "204": {}
  /logs/properties:
    get:
      consumes: []
      description: Get properties of generated logs.
      operationId: Log_GetProperties
      parameters: []
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/LogsProperties"
        default:
          description: Logs properties not found.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Get Log Properties.
      tags:
        - Logs
      x-ms-examples:
        Successful Log_GetProperties request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "200":
              body:
                dateRange:
                  from: 2019-01-18T16:00:00-08:00
                  to: 2019-02-18T16:00:00-08:00
              headers: {}
  /model:
    delete:
      consumes: []
      description: Resets the model file generated by Personalizer service.
      operationId: Model_Reset
      parameters: []
      produces:
        - application/json
      responses:
        "204":
          description: Success
        default:
          description: Model reset failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Reset Model.
      tags:
        - Model
      x-ms-examples:
        Successful Model_Reset request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "204": {}
    get:
      consumes: []
      description: Get the model file generated by Personalizer service.
      operationId: Model_Get
      parameters: []
      produces:
        - application/octet-stream
      responses:
        "200":
          description: Success
          schema:
            type: file
      summary: Get Model.
      tags:
        - Model
      x-ms-examples:
        Successful Model_Get request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "200":
              body: ""
              headers: {}
  /model/properties:
    get:
      consumes: []
      description: Get properties of the model file generated by Personalizer service.
      operationId: Model_GetProperties
      parameters: []
      produces:
        - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/ModelProperties"
      summary: Get Model Properties.
      tags:
        - Model
      x-ms-examples:
        Successful Model_GetProperties request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
          responses:
            "200":
              body:
                creationTime: 2019-01-18T16:00:00-08:00
                lastModifiedTime: 2019-01-18T16:00:00-08:00
              headers: {}
  /rank:
    post:
      consumes:
        - application/json
      description: Submit a Personalizer rank request, to get which of the provided actions should be used in the provided context.
      operationId: Rank
      parameters:
        - description: A Personalizer request.
          in: body
          name: rankRequest
          required: true
          schema:
            $ref: "#/definitions/RankRequest"
      produces:
        - application/json
      responses:
        "201":
          description: Success
          schema:
            $ref: "#/definitions/RankResponse"
        default:
          description: Invalid rank request.
          schema:
            $ref: "#/definitions/ErrorResponse"
      summary: Post Rank.
      tags:
        - Rank
      x-ms-examples:
        Successful Rank request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{API key}"
            rankRequest:
              actions:
                - features:
                    - type: News
                  id: NewsArticle
                - features:
                    - type: Sports
                  id: SportsArticle
                - features:
                    - type: Entertainment
                  id: EntertainmentArticle
              contextFeatures:
                - timeOfDay: Morning
              deferActivation: false
              eventId: 75269AD0-BFEE-4598-8196-C57383D38E10
              excludedActions:
                - SportsArticle
          responses:
            "201":
              body:
                eventId: 75269AD0-BFEE-4598-8196-C57383D38E10
                ranking:
                  - id: EntertainmentArticle
                    probability: 0.8
                  - id: SportsArticle
                    probability: 0
                  - id: NewsArticle
                    probability: 0.2
                rewardActionId: EntertainmentArticle
              headers: {}
definitions:
  ContainerStatus:
    properties:
      apiStatus:
        type: string
      apiStatusMessage:
        type: string
      service:
        type: string
    type: object
  DateRange:
    properties:
      from:
        format: date-time
        readOnly: true
        type: string
      to:
        format: date-time
        readOnly: true
        type: string
    type: object
  ErrorResponse:
    description: Used to return an error to the client
    properties:
      error:
        $ref: "#/definitions/PersonalizerError"
        description: The error object.
    required:
      - error
    type: object
  Evaluation:
    properties:
      endTime:
        format: date-time
        readOnly: true
        type: string
      featureImportance:
        items:
          items:
            type: string
          type: array
        type: array
      id:
        maxLength: 256
        readOnly: true
        type: string
      jobId:
        readOnly: true
        type: string
      name:
        maxLength: 256
        readOnly: true
        type: string
      policyResults:
        items:
          $ref: "#/definitions/PolicyResult"
        type: array
      startTime:
        format: date-time
        readOnly: true
        type: string
      status:
        enum:
          - completed
          - pending
          - failed
          - notSubmitted
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: EvaluationJobStatus
    type: object
  EvaluationContract:
    description: A counterfactual evaluation.
    properties:
      enableOfflineExperimentation:
        description: True if the evaluation should explore for a more optimal Learning settings.
        type: boolean
      endTime:
        description: The end time of the evaluation.
        format: date-time
        type: string
      name:
        description: The name of the evaluation.
        maxLength: 256
        type: string
      policies:
        description: Additional Learning settings to evaluate.
        items:
          $ref: "#/definitions/PolicyContract"
        type: array
      startTime:
        description: The start time of the evaluation.
        format: date-time
        type: string
    required:
      - name
      - startTime
      - endTime
      - policies
    type: object
  InternalError:
    description: An object containing more specific information than the parent object about the error.
    properties:
      code:
        description: Detailed error code.
        type: string
      innererror:
        $ref: "#/definitions/InternalError"
        description: The error object.
    type: object
  LogsProperties:
    properties:
      dateRange:
        allOf:
          - $ref: "#/definitions/DateRange"
        readOnly: true
    type: object
  ModelProperties:
    properties:
      creationTime:
        format: date-time
        readOnly: true
        type: string
      lastModifiedTime:
        format: date-time
        readOnly: true
        type: string
    type: object
  PersonalizerError:
    description: The error object.
    properties:
      code:
        description: High level error code.
        enum:
          - BadRequest
          - ResourceNotFound
          - InternalServerError
          - InvalidServiceConfiguration
          - InvalidPolicyConfiguration
          - InvalidPolicyContract
          - InvalidEvaluationContract
          - InvalidRewardRequest
          - InvalidEventIdToActivate
          - InvalidRankRequest
          - InvalidExportLogsRequest
          - InvalidContainer
          - FrontEndNotFound
          - EvaluationNotFound
          - LogsPropertiesNotFound
          - RankNullResponse
          - UpdateConfigurationFailed
          - ModelResetFailed
        type: string
        x-ms-enum:
          modelAsString: true
          name: PersonalizerErrorCode
          values:
            - description: Request could not be understood by the server.
              value: BadRequest
            - description: Requested resource does not exist on the server.
              value: ResourceNotFound
            - description: A generic error has occurred on the server.
              value: InternalServerError
            - description: Invalid service configuration.
              value: InvalidServiceConfiguration
            - description: Invalid policy configuration.
              value: InvalidPolicyConfiguration
            - description: Invalid policy contract.
              value: InvalidPolicyContract
            - description: Invalid evaluation contract.
              value: InvalidEvaluationContract
            - description: Invalid reward request.
              value: InvalidRewardRequest
            - description: Invalid activate event request.
              value: InvalidEventIdToActivate
            - description: Invalid rank request.
              value: InvalidRankRequest
            - description: Invalid export logs request.
              value: InvalidExportLogsRequest
            - description: SAS Uri must be the Uri to a container that has write permissions.
              value: InvalidContainer
            - description: Front end not found.
              value: FrontEndNotFound
            - description: Evaluation not found.
              value: EvaluationNotFound
            - description: Logs properties not found.
              value: LogsPropertiesNotFound
            - description: Rank call returned null response.
              value: RankNullResponse
            - description: Failed to update configuration.
              value: UpdateConfigurationFailed
            - description: Model reset failed.
              value: ModelResetFailed
      details:
        description: An array of details about specific errors that led to this reported error.
        items:
          $ref: "#/definitions/PersonalizerError"
        type: array
      innerError:
        $ref: "#/definitions/InternalError"
        description: Finer error details.
      message:
        description: A message explaining the error reported by the service.
        type: string
      target:
        description: Error source element.
        type: string
    required:
      - code
      - message
    type: object
  PolicyContract:
    description: Learning settings specifying how to train the model.
    properties:
      arguments:
        description: Arguments of the Learning settings.
        maxLength: 1024
        type: string
      name:
        description: Name of the Learning settings.
        maxLength: 256
        type: string
    required:
      - name
      - arguments
    type: object
  PolicyResult:
    properties:
      arguments:
        readOnly: true
        type: string
      name:
        readOnly: true
        type: string
      summary:
        items:
          $ref: "#/definitions/PolicyResultSummary"
        readOnly: true
        type: array
      totalSummary:
        allOf:
          - $ref: "#/definitions/PolicyResultSummary"
        readOnly: true
    type: object
  PolicyResultSummary:
    properties:
      aggregateTimeWindow:
        format: duration
        readOnly: true
        type: string
      confidenceInterval:
        format: float
        readOnly: true
        type: number
      ipsEstimatorDenominator:
        format: float
        readOnly: true
        type: number
      ipsEstimatorNumerator:
        format: float
        readOnly: true
        type: number
      nonZeroProbability:
        format: float
        type: number
      snipsEstimatorDenominator:
        format: float
        readOnly: true
        type: number
      sumOfSquares:
        format: float
        readOnly: true
        type: number
      timeStamp:
        format: date-time
        readOnly: true
        type: string
    type: object
  RankRequest:
    description: Request a set of actions to be ranked by the Personalizer service.
    properties:
      actions:
        description: "The set of actions the Personalizer service can pick from.\r

          The set should not contain more than 50 actions.\r

          The order of the actions does not affect the rank result but the order\r

          should match the sequence your application would have used to display them.\r

          The first item in the array will be used as Baseline item in Offline evaluations."
        items:
          $ref: "#/definitions/RankableAction"
        type: array
      contextFeatures:
        description: "Features of the context used for Personalizer as a\r

          dictionary of dictionaries. This depends on the application, and\r

          typically includes features about the current user, their\r

          device, profile information, aggregated data about time and date, etc.\r

          Features should not include personally identifiable information (PII),\r

          unique UserIDs, or precise timestamps."
        items:
          type: object
        type: array
      deferActivation:
        default: false
        description: "Send false if it is certain the rewardActionId in rank results will be shown to the user, therefore\r

          Personalizer will expect a Reward call, otherwise it will assign the default\r

          Reward to the event. Send true if it is possible the user will not see the\r

          action specified in the rank results, because the page is rendering later, or the Rank results may be\r

          overridden by code further downstream."
        type: boolean
      eventId:
        description: "Optionally pass an eventId that uniquely identifies this Rank event.\r

          If null, the service generates a unique eventId. The eventId will be used for\r

          associating this request with its reward, as well as seeding the pseudo-random\r

          generator when making a Personalizer call."
        maxLength: 256
        type: string
      excludedActions:
        description: The set of action ids to exclude from ranking.
        items:
          type: string
        type: array
    required:
      - actions
    type: object
  RankResponse:
    description: Returns which action to use as rewardActionId, and additional information about each action as a result of a Rank request.
    properties:
      eventId:
        description: The eventId for the round trip from request to response.
        maxLength: 256
        readOnly: true
        type: string
      ranking:
        description: The calculated ranking for the current request.
        items:
          $ref: "#/definitions/RankedAction"
        readOnly: true
        type: array
      rewardActionId:
        description: "The action chosen by the Personalizer service. This is the action your application should display, and for which to report the reward. This might not be the\r

          first found in 'ranking' if an action in the request in first position was part of the excluded ids."
        maxLength: 256
        readOnly: true
        type: string
    type: object
  RankableAction:
    description: An action with it's associated features used for ranking.
    properties:
      features:
        description: List of dictionaries containing features.
        items:
          type: object
        type: array
      id:
        description: Id of the action.
        maxLength: 256
        type: string
    required:
      - id
      - features
    type: object
  RankedAction:
    description: A ranked action with its resulting probability.
    properties:
      id:
        description: Id of the action
        maxLength: 256
        readOnly: true
        type: string
      probability:
        description: Probability of the action
        format: float
        maximum: 1
        minimum: 0
        readOnly: true
        type: number
    type: object
  RewardRequest:
    description: Reward given to a rank response.
    properties:
      value:
        description: Reward to be assigned to an action. Value should be between -1 and 1 inclusive.
        format: float
        type: number
    required:
      - value
    type: object
  ServiceConfiguration:
    description: The configuration of the service.
    properties:
      defaultReward:
        description: The reward given if a reward is not received within the specified wait time.
        format: float
        maximum: 1
        minimum: -1
        type: number
      explorationPercentage:
        description: The percentage of rank responses that will use exploration.
        format: float
        maximum: 1
        minimum: 0
        type: number
      logMirrorEnabled:
        description: Flag indicates whether log mirroring is enabled.
        type: boolean
      logMirrorSasUri:
        description: Azure storage account container SAS URI for log mirroring.
        type: string
      logRetentionDays:
        description: Number of days historical logs are to be maintained. -1 implies the logs will never be deleted.
        format: int32
        maximum: 2147483647
        minimum: -1
        type: integer
      modelExportFrequency:
        description: "Personalizer will start using the most updated trained model for online ranks automatically every specified time period.\r

          For example, PT5M (5 mins). For information about the time format,\r

          see http://en.wikipedia.org/wiki/ISO_8601#Durations"
        format: duration
        type: string
      rewardAggregation:
        description: The function used to process rewards, if multiple reward scores are received before rewardWaitTime is over.
        maxLength: 256
        type: string
      rewardWaitTime:
        description: "The time span waited until a request is marked with the default reward.\r

          For example, PT5M (5 mins). For information about the time format,\r

          see http://en.wikipedia.org/wiki/ISO_8601#Durations"
        format: duration
        type: string
    required:
      - rewardWaitTime
      - defaultReward
      - rewardAggregation
      - explorationPercentage
      - modelExportFrequency
      - logRetentionDays
    type: object
x-ms-parameterized-host:
  hostTemplate: "{Endpoint}"
  parameters:
    - $ref: "#/parameters/Endpoint"
  useSchemePrefix: false
