Skip to main content

Documentation Index

Fetch the complete documentation index at: https://knowledge.deeto.com/llms.txt

Use this file to discover all available pages before exploring further.

The power of signals

Your CRM tracks every critical moment in the customer journey — from first contact through closed won, onboarding, renewal, and beyond. By creating a simple Salesforce Flow, you can capture these moments as triggers and automatically enroll contacts into Deeto campaigns. These campaigns engage your leads and customers to understand what happened during the sales journey and why. This guide walks through a complete example: enrolling opportunity contact roles into one of two Deeto campaigns 5 days after an opportunity closes — depending on whether it was Closed Won or Closed Lost.

Part 1: Named Credential setup

You must set up a Named Credential to allow Salesforce to call the Deeto CRM API using an API key.

Step 1 — Open Named Credentials in Setup

Click the Salesforce gear icon and select Setup. In the Quick Find box, type Named Credentials. Salesforce Setup showing Named Credentials with External Credentials tab and New button highlighted

Step 2 — Create a new External Credential

Select External Credentials and click New. Fill in the Label and Name, choose Custom as the Authentication Protocol, and click Save. New External Credential dialog with Label "Deeto API Key Ex Cred", Name, and Custom Authentication Protocol

Step 3 — Add the API key header

On the newly created External Credential page, scroll to the Custom Headers section and click New. Create a header with the name X-Deeto-API-Key and enter the API key value provided to you by Deeto, then click Save. Create Custom Header dialog showing X-Deeto-API-Key name and API key value
The API key should be 64 characters long. Contact your Deeto Customer Success Manager if you have not received it.

Step 4 — Create a Principal

On the same page, go to the Principals section and click New. Fill in the Parameter Name and click Save. Create Principal dialog showing Parameter Name "Deeto API Key Principal" and Named Principal Identity Type

Step 5 — Create the Named Credential

Go back to Named Credentials and select the Named Credentials tab, then click New. Fill in the Label, Name, and URL (https://api.deeto.ai), select the External Credential you just created, and make sure to uncheck “Generate Authorization Header”. New Named Credential form with Label "Deeto CRM API Cred", URL https://api.deeto.ai, and External Credential selected

Part 2: Permission setup

You must create a Permission Set that grants users access to the Deeto Named Credential.

Step 1 — Open Permission Sets

Click the Salesforce gear icon and select Setup. In Quick Find, type Permission, then click Permission Sets and click New. Salesforce Setup showing Permission Sets page with New button highlighted

Step 2 — Create the Permission Set

Enter a Label and API Name for the Permission Set, then click Save. Permission Set Create form with Label "Deeto CRM API Callout" and API Name "Deeto_CRM_API_Callout"

Step 3 — Open External Credential Principal Access

On the Permission Set page, click External Credential Principal Access. Permission Set overview page showing External Credential Principal Access section with Edit button

Step 4 — Edit the External Credential Principal Access

Click Edit on the External Credential Principal Access table. External Credential Principal Access section with Edit button highlighted

Step 5 — Add the credential

Select the Deeto credential in the left pane and click Add to move it to the right pane, then click Save. External Credential Principal Access showing Deeto_API_Key_Ex_Cred credential being moved from left to right pane with Add button and Save button

Step 6 — Open Manage Assignments

The credential is now assigned. Click Manage Assignments to assign users. Permission Set page showing External Credential Principal Access with credential assigned and Manage Assignments button highlighted

Step 7 — Add user assignments

Click Add Assignment, select the users who will run automation flows that call the Deeto CRM API, click Next, then click Assign. Select Users to Assign page showing list of users for the Deeto CRM API Callout permission set

Part 3: Building the automation flow

This section walks through creating a Salesforce Flow that enrolls opportunity contact roles into Deeto campaigns 5 days after an opportunity closes.

Before you build — considerations

  • Should you filter opportunity contact roles by role type to limit which contacts are enrolled?
  • Should you broaden the audience to include all contacts on the opportunity account?
  • Are there additional conditions — account size, product line, territory — that should factor into which campaign contacts are enrolled in?
Discuss these with your CRM team and your Deeto Customer Success Manager before building.

Step 1 — Open Flows in Setup

Click the Salesforce gear icon and select Setup. In Quick Find, type Flows. Salesforce Setup showing Flows page under Process Automation

Step 2 — Create a new Record-Triggered Flow

Click New Flow and select Record-Triggered Flow. New Automation screen showing Record-Triggered Flow option highlighted

Step 3 — Configure the Start element

Configure the start element to trigger on Opportunity, set the trigger to A record is created or updated, add a condition for Closed = True. Flow builder showing Start element configured for Opportunity with Closed=True condition and entry conditions

Step 4 — Add a Scheduled Path

Add a Scheduled Path set to run 5 Days After Close Date. Configure Scheduled Paths panel showing 5 Days After Close with Time Source set to Opportunity Close Date and Offset 5 Days After

Step 5 — Click + and select Action

Click the + button under the 5 Days After Close path, then select Action from the Add Element panel. Flow canvas showing 5 Days After Close path with Add Element panel open, Action option visible

Step 6 — Click Create HTTP Callout

In the Search Actions panel, scroll to the bottom and click Create HTTP Callout. Search Actions panel with Create HTTP Callout option highlighted at the bottom

Step 7 — Enter service name and choose Named Credential

Enter the service name DeetoWebhookTrigger, select the Named Credential Deeto CRM API Cred from the dropdown, then click Next. Create External Service form showing Name "DeetoWebhookTrigger" and Named Credential "Deeto CRM API Cred" selected with URL https://api.deeto.ai

Step 8 — Configure Label, Method, and URL Path

Enter the Label Deeto Webhook Trigger, set Method to POST, and set the URL Path to /v1/salesforce/update2, then click Next. New HTTP Callout form showing Label "Deeto Webhook Trigger", Method POST, and URL Path /v1/salesforce/update2

Step 9 — Enter the Sample JSON Request

Paste the Sample JSON Request below into the request body field, click Review (the Data Structure section will auto-populate), then click Next.
{"eventType": "create", "recordType": "Lead", "recordId": "**", "crmSettings": {"referenceRecruitmentAutomationId": "**"}}
New HTTP Callout showing Sample JSON Request pasted with Data Structure auto-populated showing eventType, recordType, recordId, and crmSettings fields

Step 10 — Select Use Example Response

Select Use Example Response and click Next. Select Sample Response Method screen showing Use Example Response option highlighted

Step 11 — Enter the Sample JSON Response

Paste the Sample JSON Response below, click Review (the Data Structure section will auto-populate), then click Save.
{"success": true}
New HTTP Callout showing Sample JSON Response with success:true and Data Structure showing success Boolean field

Step 12 — Configure the callout Label, API Name, and Value

The callout action now appears in the right pane. Fill in the Label and API Name, then click in the Value field and select + New Resource. Deeto Webhook Trigger action panel showing Label, API Name fields filled in and + New Resource option highlighted in the Value dropdown

Step 13 — Complete the New Resource

In the New Resource dialog, enter the API Name DeetoWebhookPayload, set the Data Type to Apex-Defined, and click Done. New Resource dialog showing API Name "DeetoWebhookPayload" with Apex-Defined data type and Apex Class auto-populated
You have now completed the construction of the Deeto callout action. This callout is required for any flow that enrolls a contact into a Deeto campaign.

Step 14 — Add Get Records for the Account

Add a Get Records element to retrieve the related Account from the triggering opportunity. Flow builder showing Get Records element configuration for Account record

Step 15 — Add Get Records for Opportunity Contact Roles

Add another Get Records element to retrieve all Opportunity Contact Roles from the triggering opportunity. Flow builder showing Get Records element for Opportunity Contact Roles

Step 16 — Add a Decision element

Add a Decision element to branch the flow based on whether the opportunity was Closed Won or Closed Lost. Flow builder showing Decision element with Closed Won and Closed Lost outcome paths

Step 17 — Add Assignment nodes for Campaign IDs

Add an Assignment node on each branch to set the correct Deeto Campaign ID variable based on the outcome. Assignment node showing the campaign ID variable being set for one of the outcome branches

Step 18 — Add the Loop element

Add a Loop element to iterate through each opportunity contact role record. Loop element dialog showing Label "Loop Contact Roles" and Collection Variable set to Get Opportunity Contacts

Step 19 — Add Get Records for Contact inside the loop

Inside the loop, add a Get Records element to retrieve the full Contact record for each contact role. Flow builder showing Get Records element inside the loop for individual Contact records

Step 20 — Set payload values

Add an Assignment node to populate the required payload values for the Deeto callout. Assignment node showing payload variable fields being populated with contact and campaign data

Step 21 — Add the Deeto callout action inside the loop

Add the Deeto callout action you created in Step 13. This is the final step inside each loop iteration. Flow builder showing the Deeto Add To Campaign callout action being added inside the loop

Step 22 — Review the completed flow

Your flow now handles the full enrollment logic. Review the complete flow structure before activating. Complete Salesforce Flow showing all elements: Start with scheduled path, Get Records, Decision, Loop, Assignment nodes, and Deeto callout In Deeto, navigate to the campaign you want to enroll contacts into, and copy the Campaign API link. You will use this in the Assignment node to set the campaign ID variable. Deeto campaign settings showing the API link URL highlighted for copying

Step 24 — Configure the Assignment for Closed Won

In the Assignment node for Closed Won, paste the Closed Won campaign API link into the campaign ID variable. Assignment node for Closed Won showing the campaign ID variable being set with the Deeto API link

Step 25 — Configure the Assignment for Closed Lost

In the Assignment node for Closed Lost, paste the Closed Lost campaign API link into the campaign ID variable. Assignment node for Closed Lost showing the campaign ID variable being set with the Deeto API link

Step 26 — Add the final callout action Label and API Name

Give the Deeto callout action inside the loop a Label and API Name, then save. Deeto Add To Campaign action dialog showing Label "Deeto Add To Campaign Action 1", API Name, External Service, and URL path https://api.deeto.ai/v1/salesforce/update2 confirmed

Step 27 — Save and Activate

Click Save in the flow builder, then click Activate. Your flow is now live and will automatically enroll contacts into Deeto campaigns 5 days after an opportunity closes.
Congratulations — you have completed your flow. Reach out to your Deeto Customer Success Manager if you have any questions or issues.

Support: Contact your Deeto Customer Success Manager or email support@deeto.ai.