Salesforce Einstein Predictions API

Make predictions using Discovery models

Operations 6

POST /wave/prediction Salesforce Einstein Make a prediction #
POST /sentiment Salesforce Einstein Analyze sentiment #
POST /intent Salesforce Einstein Detect intent #
GET /einstein/prediction-definitions/{predictionDefinitionId}/predictions Salesforce Einstein List predictions for a definition #
POST /predict Salesforce Einstein Make a prediction #
POST /detect Salesforce Einstein Detect objects in an image #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/salesforce-einstein-predictions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

salesforce-einstein-predictions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Salesforce Einstein Predictions API
  contact:
    name: Salesforce Developer Support
    url: https://developer.salesforce.com/
  license:
    name: Salesforce Master Subscription Agreement
    url: https://www.salesforce.com/company/legal/agreements/
  termsOfService: https://www.salesforce.com/company/legal/agreements/
  version: '1.0'
  description: 'Operations tagged Predictions across 4 of this provider''s published API definitions: salesforce-einstein-discovery-openapi.yml, salesforce-einstein-language-openapi.yml, salesforce-einstein-prediction-builder-openapi.yml, salesforce-einstein-vision-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://{instance}.salesforce.com/services/data/v58.0
  description: Salesforce Instance
  variables:
    instance:
      default: login
      description: Your Salesforce instance domain.
- url: https://api.einstein.ai/v2/language
  description: Einstein Language Production Server
- url: https://api.einstein.ai/v2/vision
  description: Einstein Vision Production Server
tags:
- name: Predictions
  description: Make predictions using Discovery models
paths:
  /wave/prediction:
    post:
      operationId: predict
      summary: Salesforce Einstein Make a prediction
      description: Makes a prediction using an Einstein Discovery model. Provide the model ID and input field values to receive a prediction with explanatory factors.
      tags:
      - Predictions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PredictionInput'
      responses:
        '200':
          description: Successful prediction response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionOutput'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
      - oauth2: []
    servers:
    - url: https://{instance}.salesforce.com/services/data/v58.0
      description: Salesforce Instance
      variables:
        instance:
          default: login
          description: Your Salesforce instance domain.
  /sentiment:
    post:
      operationId: analyzeSentiment
      summary: Salesforce Einstein Analyze sentiment
      description: Analyzes the sentiment of the given text. Use the pre-built CommunitySentiment model or a custom-trained sentiment model.
      tags:
      - Predictions
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                modelId:
                  type: string
                  description: ID of the model to use. Use 'CommunitySentiment' for the pre-built model.
                document:
                  type: string
                  description: Text to analyze.
                numResults:
                  type: integer
                  description: Maximum number of results to return.
                  default: 3
              required:
              - modelId
              - document
      responses:
        '200':
          description: Successful sentiment analysis response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionResponse'
        '400':
          $ref: '#/components/responses/BadRequest_2'
        '401':
          $ref: '#/components/responses/Unauthorized_2'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/language
      description: Einstein Language Production Server
  /intent:
    post:
      operationId: detectIntent
      summary: Salesforce Einstein Detect intent
      description: Detects the intent of the given text. Requires a custom-trained intent model.
      tags:
      - Predictions
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                modelId:
                  type: string
                  description: ID of the custom intent model to use.
                document:
                  type: string
                  description: Text to classify.
                numResults:
                  type: integer
                  description: Maximum number of results to return.
                  default: 3
              required:
              - modelId
              - document
      responses:
        '200':
          description: Successful intent detection response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionResponse'
        '400':
          $ref: '#/components/responses/BadRequest_2'
        '401':
          $ref: '#/components/responses/Unauthorized_2'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/language
      description: Einstein Language Production Server
  /einstein/prediction-definitions/{predictionDefinitionId}/predictions:
    get:
      operationId: listPredictions
      summary: Salesforce Einstein List predictions for a definition
      description: Returns prediction results for a given prediction definition.
      tags:
      - Predictions
      parameters:
      - $ref: '#/components/parameters/PredictionDefinitionId'
      - name: recordId
        in: query
        description: Filter predictions by Salesforce record ID.
        schema:
          type: string
      - name: limit
        in: query
        description: Maximum number of predictions to return.
        schema:
          type: integer
          default: 25
      - name: offset
        in: query
        description: Offset for pagination.
        schema:
          type: integer
          default: 0
      responses:
        '200':
          description: Successful response with predictions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionResultList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - oauth2: []
    servers:
    - url: https://{instance}.salesforce.com/services/data/v58.0
      description: Salesforce Instance
      variables:
        instance:
          default: login
          description: Your Salesforce instance domain.
  /predict:
    post:
      operationId: predictImage
      summary: Salesforce Einstein Make a prediction
      description: Classifies an image using a trained model. Submit either an image file or a URL to an image.
      tags:
      - Predictions
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                modelId:
                  type: string
                  description: ID of the model to use for prediction.
                sampleLocation:
                  type: string
                  description: URL of the image to classify.
                sampleContent:
                  type: string
                  format: binary
                  description: Binary content of the image to classify.
                sampleBase64Content:
                  type: string
                  description: Base64-encoded image content.
                numResults:
                  type: integer
                  description: Maximum number of prediction results to return.
                  default: 3
              required:
              - modelId
      responses:
        '200':
          description: Successful prediction response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionResponse'
        '400':
          $ref: '#/components/responses/BadRequest_3'
        '401':
          $ref: '#/components/responses/Unauthorized_3'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/vision
      description: Einstein Vision Production Server
  /detect:
    post:
      operationId: detectObjects
      summary: Salesforce Einstein Detect objects in an image
      description: Detects objects and their bounding boxes in an image.
      tags:
      - Predictions
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                modelId:
                  type: string
                  description: ID of the object detection model to use.
                sampleLocation:
                  type: string
                  description: URL of the image.
                sampleContent:
                  type: string
                  format: binary
                  description: Binary content of the image.
                sampleBase64Content:
                  type: string
                  description: Base64-encoded image content.
              required:
              - modelId
      responses:
        '200':
          description: Successful detection response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest_3'
        '401':
          $ref: '#/components/responses/Unauthorized_3'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/vision
      description: Einstein Vision Production Server
components:
  responses:
    BadRequest:
      description: Bad request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest_2:
      description: Bad request. Invalid parameters or missing required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_2'
    Unauthorized_2:
      description: Unauthorized. Invalid or missing bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_2'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest_3:
      description: Bad request. Invalid parameters or missing required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_3'
    Unauthorized_3:
      description: Unauthorized. Invalid or missing bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_3'
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
        errorCode:
          type: string
        fields:
          type: array
          items:
            type: string
    PredictionInput:
      type: object
      properties:
        predictionDefinition:
          type: string
          description: ID of the prediction definition or model.
        columnNames:
          type: array
          description: Names of the input columns.
          items:
            type: string
        rows:
          type: array
          description: Input data rows for prediction.
          items:
            type: array
            items:
              type: string
      required:
      - predictionDefinition
      - columnNames
      - rows
    PredictionOutput:
      type: object
      properties:
        predictionResults:
          type: array
          items:
            type: object
            properties:
              prediction:
                type: object
                properties:
                  total:
                    type: number
                    description: Predicted value.
                  baseLine:
                    type: number
                    description: Baseline prediction value.
              prescriptions:
                type: array
                items:
                  type: object
                  properties:
                    action:
                      type: string
                    description:
                      type: string
                    impact:
                      type: number
              middleValues:
                type: array
                items:
                  type: object
                  properties:
                    columnName:
                      type: string
                    value:
                      type: string
                    impact:
                      type: number
    Error_2:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message.
        errorCode:
          type: string
          description: Machine-readable error code.
    PredictionResponse:
      type: object
      properties:
        probabilities:
          type: array
          items:
            $ref: '#/components/schemas/Probability'
        object:
          type: string
    Probability:
      type: object
      properties:
        label:
          type: string
          description: Predicted label.
        probability:
          type: number
          description: Confidence score (0.0 to 1.0).
    PredictionFactor:
      type: object
      properties:
        featureName:
          type: string
          description: Name of the feature contributing to the prediction.
        featureValue:
          type: string
          description: Value of the feature.
        importance:
          type: number
          description: Importance weight of the factor.
        direction:
          type: string
          enum:
          - Positive
          - Negative
          description: Whether the factor positively or negatively affects the prediction.
    PredictionResultList:
      type: object
      properties:
        predictions:
          type: array
          items:
            $ref: '#/components/schemas/PredictionResult'
        totalSize:
          type: integer
    PredictionResult:
      type: object
      properties:
        recordId:
          type: string
          description: Salesforce record ID.
        prediction:
          type: object
          properties:
            score:
              type: number
              description: Prediction score.
            label:
              type: string
              description: Predicted label (for categorical predictions).
            factors:
              type: array
              description: Top factors influencing the prediction.
              items:
                $ref: '#/components/schemas/PredictionFactor'
        predictionDefinitionId:
          type: string
    Error_3:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message.
        errorCode:
          type: string
          description: Machine-readable error code.
    DetectionResponse:
      type: object
      properties:
        probabilities:
          type: array
          items:
            $ref: '#/components/schemas/DetectionResult'
        object:
          type: string
    DetectionResult:
      type: object
      properties:
        label:
          type: string
          description: Detected object label.
        probability:
          type: number
          description: Confidence score.
        boundingBox:
          $ref: '#/components/schemas/BoundingBox'
    BoundingBox:
      type: object
      properties:
        minX:
          type: integer
          description: Minimum X coordinate.
        minY:
          type: integer
          description: Minimum Y coordinate.
        maxX:
          type: integer
          description: Maximum X coordinate.
        maxY:
          type: integer
          description: Maximum Y coordinate.
  parameters:
    PredictionDefinitionId:
      name: predictionDefinitionId
      in: path
      required: true
      description: Unique identifier for the prediction definition.
      schema:
        type: string
  securitySchemes:
    oauth2:
      type: oauth2
      description: Salesforce OAuth 2.0 authentication.
      flows:
        authorizationCode:
          authorizationUrl: https://login.salesforce.com/services/oauth2/authorize
          tokenUrl: https://login.salesforce.com/services/oauth2/token
          scopes:
            api: Full access to Salesforce APIs
            wave_api: Access to Analytics APIs
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth 2.0 Bearer token. Generate a token using your Einstein Platform Services private key.
x-refined-from:
- salesforce-einstein-discovery-openapi.yml
- salesforce-einstein-language-openapi.yml
- salesforce-einstein-prediction-builder-openapi.yml
- salesforce-einstein-vision-openapi.yml