How to get ChatGPT talking to Salesforce: K2’s step-by-step guide

Integrating cutting-edge AI technologies with customer relationship management (CRM) systems can significantly enhance business efficiency. One of the most impactful integrations is connecting ChatGPT with Salesforce. Read this blog post and watch the video below for K2’s step-by-step process to achieve this connection, leveraging a custom GPT for seamless interaction with Salesforce.

Step 1: Setting up your custom GPT

The journey begins by exploring GPTs within the ChatGPT environment. Here, you can create a custom GPT tailored to your needs. Name your GPT (for instance, “Salesforce Newton GPT”) and provide clear instructions or prompts that will guide its interactions.

Key configuration settings

Configure your GPT to perform specific tasks:

  • Enable web browsing for dynamic data access.
  • Use a code interpreter for complex calculations, enhancing the GPT’s arithmetic capabilities.

Step 2: Integrating with Salesforce

Integration involves connecting your custom GPT to Salesforce using OAuth for secure data access. This requires setting up a new action within your GPT’s configuration, specifying authentication methods, and defining how your GPT will communicate with Salesforce APIs.

Authentication setup

Create a connected app in Salesforce to generate the necessary credentials such as client ID and client secret. These details will facilitate the OAuth authentication process.

Defining API interactions

Use the Open API format to define the schema that your GPT will utilize for interacting with Salesforce. This includes specifying endpoints and methods for data retrieval and modification. For example, setting up actions for GET and POST requests that your GPT can execute to fetch or update data.

Step 3: Running your first queries

Once your custom GPT is configured and integrated, test it by running queries directly from the ChatGPT interface. Start with simple requests like retrieving company data or contact details from Salesforce. This is where you see the practical benefits of the integration, as your GPT efficiently handles CRM queries through natural language processing.

Example queries

  • “Can you tell me what companies we have in the system?”
  • “Can you tell me what contacts we have at Accenture?”

These queries demonstrate the GPT’s ability to interface seamlessly with Salesforce, fetching information as if you were querying the CRM directly.

Step 4: Enhancing security and permissions

Adjust security settings and permissions within Salesforce to ensure that your integration adheres to organizational policies and data protection standards. This includes managing IP restrictions and configuring OAuth scopes.


Integrating ChatGPT with Salesforce not only streamlines operations but also enhances the capabilities of your CRM system, making it more interactive and intelligent. This setup empowers teams to perform CRM tasks more efficiently and with greater accuracy, thanks to the advanced AI capabilities of ChatGPT.

Remember, the success of such an integration relies on meticulous configuration and testing. Ensure that every step is followed thoroughly and consider expanding the capabilities as you become more familiar with the API and its potential applications.

Need help getting started with AI? K2’s AI consulting practice will put you on the right path and support you through every step of your AI transformation. Contact us today.

Marketing Team

Transforming Salesforce with GenAI
Transforming Salesforce with GenAI

Join us for our expert-led webinar where we’ll explore the dynamic integration of generative AI with Salesforce to revolutionize your CRM capabilities.