Build and activate a prompt template in Prompt Builder (Einstein 1 Studio); note the template's developer name (API name) as shown on the template detail page.
Authenticate using a standard Salesforce OAuth access token with the api scope.
Invoke the template via the Connect REST API: POST /services/data/vXX.0/einstein/prompt-templates/<templateDeveloperName>/generations with a JSON body containing the inputParams object whose keys match the template's defined input variables.
Set isPreview: false in the request body to get a full LLM-generated response; set it to true to preview the resolved prompt text before LLM generation.
Parse the response body: the generated text is in the generatedText field within the generations array; also inspect the enrichedOutput for any grounding data references.
Handle errors: a 400 response typically indicates missing required input parameters; a 500 may indicate the connected LLM model is unavailable — check Einstein Trust Layer audit logs for details.
Known gotchas
The endpoint path uses the template's developer name (e.g., Generate_Case_Summary), not its label or record ID — mismatched names return 404.
Input variable names in the inputParams body must match exactly what is defined in the template; extra or missing keys cause a 400 validation error.
Prompt templates route through the Einstein Trust Layer; if data masking rules scrub the input values, the generated output will be based on redacted data — verify masking rules in Setup before testing.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp