Salesforce Einstein Prompt Templates API

Manage prompt templates for content generation

Operations 5

GET /einstein/llm/prompt/templates Salesforce Einstein List prompt templates #
POST /einstein/llm/prompt/templates Salesforce Einstein Create a prompt template #
GET /einstein/llm/prompt/templates/{templateId} Salesforce Einstein Get a prompt template #
PATCH /einstein/llm/prompt/templates/{templateId} Salesforce Einstein Update a prompt template #
DELETE /einstein/llm/prompt/templates/{templateId} Salesforce Einstein Delete a prompt template #

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-prompt-templates-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-prompt-templates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Salesforce Einstein GPT Prompt Templates API
  description: Generative AI API powered by large language model integration for creating personalized content across Salesforce. Einstein GPT (now part of Einstein Copilot and Einstein Generative AI) provides endpoints for text generation, prompt management, and AI-powered content creation.
  version: 58.0.0
  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/
servers:
- url: https://{instance}.salesforce.com/services/data/v58.0
  description: Salesforce Instance
  variables:
    instance:
      default: login
      description: Your Salesforce instance domain.
security:
- oauth2: []
tags:
- name: Prompt Templates
  description: Manage prompt templates for content generation
paths:
  /einstein/llm/prompt/templates:
    get:
      operationId: listPromptTemplates
      summary: Salesforce Einstein List prompt templates
      description: Returns a list of all prompt templates in the org.
      tags:
      - Prompt Templates
      parameters:
      - name: pageSize
        in: query
        description: Number of templates to return per page.
        schema:
          type: integer
          default: 25
      - name: page
        in: query
        description: Page token for pagination.
        schema:
          type: string
      responses:
        '200':
          description: Successful response with prompt templates.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptTemplateCollection'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createPromptTemplate
      summary: Salesforce Einstein Create a prompt template
      description: Creates a new prompt template for content generation.
      tags:
      - Prompt Templates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptTemplateInput'
      responses:
        '201':
          description: Prompt template created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptTemplate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /einstein/llm/prompt/templates/{templateId}:
    get:
      operationId: getPromptTemplate
      summary: Salesforce Einstein Get a prompt template
      description: Returns details of a specific prompt template.
      tags:
      - Prompt Templates
      parameters:
      - $ref: '#/components/parameters/TemplateId'
      responses:
        '200':
          description: Successful response with template details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptTemplate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updatePromptTemplate
      summary: Salesforce Einstein Update a prompt template
      description: Updates an existing prompt template.
      tags:
      - Prompt Templates
      parameters:
      - $ref: '#/components/parameters/TemplateId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptTemplateInput'
      responses:
        '200':
          description: Template updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptTemplate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deletePromptTemplate
      summary: Salesforce Einstein Delete a prompt template
      description: Deletes a prompt template.
      tags:
      - Prompt Templates
      parameters:
      - $ref: '#/components/parameters/TemplateId'
      responses:
        '204':
          description: Template deleted successfully.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    BadRequest:
      description: Bad request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
        errorCode:
          type: string
        fields:
          type: array
          items:
            type: string
    PromptTemplateCollection:
      type: object
      properties:
        promptTemplates:
          type: array
          items:
            $ref: '#/components/schemas/PromptTemplate'
        totalSize:
          type: integer
        nextPageUrl:
          type: string
    PromptTemplate:
      type: object
      properties:
        id:
          type: string
        developerName:
          type: string
        masterLabel:
          type: string
        description:
          type: string
        promptText:
          type: string
          description: The template text with merge field placeholders.
        type:
          type: string
          enum:
          - salesGeneration
          - fieldGeneration
          - recordSummary
          - chatGeneration
          - flexibleGeneration
          description: Type of prompt template.
        relatedEntity:
          type: string
          description: Salesforce object the template relates to.
        activeVersionId:
          type: string
        status:
          type: string
          enum:
          - Active
          - Draft
          - Inactive
        createdDate:
          type: string
          format: date-time
        lastModifiedDate:
          type: string
          format: date-time
    PromptTemplateInput:
      type: object
      properties:
        developerName:
          type: string
        masterLabel:
          type: string
        description:
          type: string
        promptText:
          type: string
        type:
          type: string
          enum:
          - salesGeneration
          - fieldGeneration
          - recordSummary
          - chatGeneration
          - flexibleGeneration
        relatedEntity:
          type: string
      required:
      - developerName
      - masterLabel
      - promptText
      - type
  parameters:
    TemplateId:
      name: templateId
      in: path
      required: true
      description: Unique identifier for the prompt template.
      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
            einstein_gpt: Access to Einstein Generative AI features