Apex Aide apexaide

How to Invoke Salesforce Prompt Templates Using REST API — Complete Guide | #Salesforce #agentforce

www.salesforcebolt.com· ·Intermediate ·Developer ·2 min read
Summary

Salesforce now enables developers to invoke AI Prompt Templates directly via the REST API, allowing external apps and tools to leverage Salesforce AI governed by the Einstein Trust Layer. This guide walks through using Postman to authenticate with Salesforce, call a Prompt Template, and generate social media posts based on a custom Adventure Master record. It’s a practical tutorial showing how to integrate Salesforce AI capabilities into custom workflows and external applications. Teams can replicate these steps to build automated content generation or other AI-driven automation powered by Salesforce.

Takeaways
  • Authenticate Salesforce REST API calls via OAuth token in Postman.
  • Invoke Prompt Templates using Connect REST API with specific API names.
  • Pass record IDs as input parameters to generate dynamic AI responses.
  • Use Postman collections to organize and test Salesforce API requests efficiently.
  • Leverage Salesforce AI for automated social media post generation.

Salesforce AI is becoming more powerful with every release, and one of the most useful features for developers is the ability to invoke Prompt Templates through the REST API . This allows any external application — mobile apps, websites, backend systems, or automation tools — to use Salesforce’s AI capabilities, all governed by the Einstein Trust Layer. In this guide, I’ll walk you through exactly how to call a Prompt Template using Postman , using the same steps I demonstrated in my video. This tutorial is inspired by Salesforce's official Agentforce Workshop but simplified for quick learning. I've used a prompt template where I am accepting Adventure Master (A custom object having adventure name, duration, price, difficulty etc). Based on the record id it's going to create social media post for LinkedIn, Twitter and Slack. If you would like to watch complete prompt template setup, you can watch this video below 499 https://www.youtube.

REST & SOAP APIs