---
schema_version: "1"
id: 4ce2e8ba589aac636704c28e82db8812fe278bc0417d949a5efb7700bd88082d
title: Get Predictions in REST APIs
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_ai_rest.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_ai_rest.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 98f46ad74cf5bcff25a6315f0c80d01ec39bf635c5e28207428be9592b518d42
description: Use the Salesforce Data 360 Connect REST API to programmatically interact with predictive models. Get predictions, top factors, and prescriptions using the predict endpoint.
products:
  - Data 360
release: "264"
---
# Get Predictions in REST APIs

Use the Salesforce Data 360 Connect REST API to programmatically interact with predictive models. Get predictions, top factors, and prescriptions using the predict endpoint.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>All Editions</strong> supported by Data 360. See <a href="https://help.salesforce.com/s/articleView?id=data.c360_a_dc_editions.htm&amp;language=en_US" target="_blank">Data 360 edition availability</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d57348e59">USER PERMISSIONS
              NEEDED</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="USER PERMISSIONS NEEDED" class="slds-cell-wrap" style="vertical-align:top;" headers="d57348e59 ">Allow users to manage models in AI Models</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d57348e59 ">Enables you to create, update, and delete models in AI Models.</td>

          </tr>
        </tbody>
      </table> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d57348e89">PERMISSION SETS </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="PERMISSION SETS" class="slds-cell-wrap" style="vertical-align:top;" headers="d57348e89 ">Data Cloud Architect</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d57348e89 ">Admin-level access to all AI Models features, including the ability to create,
              update, delete, and activate models.</td>

          </tr>
          <tr class="">
            <td data-label="PERMISSION SETS" class="slds-cell-wrap" style="vertical-align:top;" headers="d57348e89 ">Data Cloud User</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d57348e89 ">Restricted access to use a model, including getting predictions and
              improvements derived from a model.</td>

          </tr>
        </tbody>
      </table>

## Prediction Request

Syntax for the predict endpoint.

```markup
POST /services/data/v63.0/ssot/machine-learning/predict
```

## POST Request Body

When you run a prediction, Salesforce applies the model to the set of model inputs and returns a prediction score for each set of input values specified. For example, if you specify three sets of values, you get three predictions in the order that the records were specified in the request.

```markup
GET /services/data/v61.0/ssot/machine-learning/configured-models/{ModelIdOrName}
```

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_note.png)

Note You can use the predictive model name (this example) or model id (API Name). Some APIs also require the model API name “{ModelIdOrName}”. You can find a model's API name in Model Builder, on the model details page.

![The model detail page displays the model API name.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/data_cloud/images/c360_a_ai_ec_model_details_api_name.png)

Let's look at the REST request using the Predicted Purchased model.

```markup
{
    "model": 
    {
        "name": "Predicted_Purchased_CM_12l_YSs01128465"
    },
    "type": "RawData",
    "fieldNames": ["Industry_c__c", "Response_Time_From_Assignment_c__c" , "Company_c__c", "Title_c__c"],
    "rows": 
    [
        ["High Tech", 56, "Condax","Student"],
        ["Professional Services",70,"Rantouch","Developer"]
    ],
    "settings" : {
        "maxPrescriptions" : 3,
        "maxTopFactors" : 2,
        "prescriptionImpactPercentage" : 50
    }
    
 }
```

- `maxPrescriptions` specifies the maximum number of improvements (1-3) to return in the response
- `maxTopFactors` specifies the number of top predictors (1-3) to return in the response
- `prescriptionImpactPercentage` specifies the threshold filter (minimum % improvement for the outcome, which in this example is 50%) needed for the improvement to be returned in the response

## POST Response

Example POST response.

```markup
{
  "aggregatePredictions": [],
  "model": {
    "id": "12l1Q000000blV0QAI"//Id
  },
  "predictionType": "BinaryClassification",
  "predictions": [
    {
      "factors": [
        {
          "fields": [
            {
              "customText": null,
              "inputValue": "Student",
              "label": null,
              "name": "Title_c__c",
              "prescribedValue": "Title"
            }
          ],
          "value": -40.58208510642879
        },
        {
          "fields": [
            {
              "customText": null,
              "inputValue": "56",
              "label": null,
              "name": "Response_Time_From_Assignment_c__c",
              "prescribedValue": "Response Time From Assignment"
            }
          ],
          "value": 10.187649697792125
        }
      ],
      "partition": {
        "id": "12l1Q000000blV0QAI" //Id"
      },
      "predictedValue": 0.5997765233332488,
      "prescriptions": [],
      "status": "Success",
      "type": "BinaryClassification",
      "warnings": {
        "missingFieldNames": [],
        "outOfBoundsFields": []
      }
    },
    {
      "factors": [
        {
          "fields": [
            {
              "customText": null,
              "inputValue": "Developer",
              "label": null,
              "name": "Title_c__c",
              "prescribedValue": "Title"
            }
          ],
          "value": -28.000138322513255
        },
        {
          "fields": [
            {
              "customText": null,
              "inputValue": "70",
              "label": null,
              "name": "Response_Time_From_Assignment_c__c",
              "prescribedValue": "Response Time From Assignment"
            }
          ],
          "value": 6.156639498073147
        }
      ],
      "partition": {
        "id": "12l1Q000000blV0QAI" //Id"
      },
      "predictedValue": 5.278021902657085,
      "prescriptions": [],
      "status": "Success",
      "type": "BinaryClassification",
      "warnings": {
        "missingFieldNames": [],
        "outOfBoundsFields": []
      }
    }
  ],
  "settings": {
    "aggregateFunctions": [],
    "maxPrescriptions": 3,
    "maxTopFactors": 2,
    "prescriptionImpactPercentage": 50
  }
}
```

#### See Also

- [_Salesforce Developer:_ Salesforce Data 360 Connect REST API](https://developer.salesforce.com/docs/platform/connectapi/references/spec?meta=Get%2Bprediction.htm)
- [_Salesforce Developer:_ Data 360 Connect REST API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/intro_what_is_chatter_connect.htm)