Consent API and Consent Write API
Author
July 7, 2022
- Customers intend to receive marketing promotions through emails,
- A customer has opted out/in for the fax or call.
Consent API and Consent Write API reads and write permission across the Contact, Contact Point Type Consent, Data Use Purpose, Individual, Lead, Person Account, and User objects when the records have a lookup relationship. APIs access organization-wide consent data, such as links between records and the value of consent flags, rather than just records to which the user has normal access.
Consent API
- Fetch consent settings for Lead, Contact, User, Person Account, or Individual object records.
- Fetch aggregated consent data
- API is available with version 44.0 and later.
- Multiaction endpoint is allowed with version 45.0 and later.
Permissions needed
View All Data or Allow User Access to Privacy Data user permission.
Consent API Syntax
URI
/services/data/vXX.X/consent/action/<action>?ids=list_of_Ids
/services/data/vXX.X/consent/multiaction?actions=list_of_actions&ids=list_of_Ids
Formats
JSON
HTTP methods
GET
Authentication
Authorization: Bearer token
Request body
None
Required Parameters
Example
/services/data/v55.0/consent/action/email?ids=test@test.com, test2@test.com
Response
{
“test@test.com” : {
“result” : “Success”,
“proceed” : {
“email” : “true”
“emailResult” : “Success”
},
“explanation” : [ {
“objectConsulted” : “ContactTypePointConsent”,
“status” : “opt_in”,
“purpose” : “billing”,
“recordId” : “003xx000004TxyY”,
“value” : “true”
},{
“objectConsulted” : “Contact”,
“field” : “HasOptedOutOfTracking”,
“recordId” : “1”,
“value” : “true”
}]
},
“test2@test.com” : {
“result” : “Success”,
“proceed” : {
“email” : “false”
“emailResult” : “Success”
},
“explanation” : [ {
“objectConsulted” : “Contact”,
“field” : ” HasOptedOutOfFax”,
“recordId” : “00Qxx00000skwO”,
“value” : “true”
} ]
}
}
Consent Write API
- A single API call can update and write consent across multiple records.
- API is available starting with version 48.0 and up.
Permissions needed
ModifyAllData or the ConsentApiUpdate user permission.
Consent Write API Syntax
URI
/services/data/vXX.X/consent/action/<action>?ids=<email-OR-recordID>
Formats
JSON
HTTP methods
PATCH
Authentication
Authorization: Bearer token
Request body
Only Salesforce CDP uses the request body. Pass in an empty object if there is nothing to pass in the request body.
Required Parameters
Example
/services/data/v55.0/consent/action/<action>?ids=test@test.com&status=<optout/optin/seen/notseen>
Response
{
“test@test.com” : {
“result” : “Success”,
“edited” : [{
“objectType” : “<Contact, Lead, User, etc.>”,
“field” : “<HasOptedOutofFax, DoNotCall,etc>”,
“valueOfField” : “<true/false>”,
“id” : “<recordID>”
}],
}
}
Recent Posts
-
Mirketa Unveils Next-Gen AI Solutions to Redefine the Future of Work Across Industries29 Jul 2025 Press Release
-
Salesforce Implementation School Universities Higher Education23 Jul 2025 Blog
-
Salesforce Health Cloud Implementation Partner: A Complete Guide23 Jul 2025 Blog
-
XML Parsing: Using MINIDOM Vs Element Tree (etree) in Python02 Jul 2025 Blog
-
A step by step Guide to create Salesforce web-to-lead form30 Jun 2025 Blog
-
How AI is Transforming User Experience Design in 202526 Jun 2025 Blog
-
How a Salesforce NPSP Consultant Can Elevate Nonprofit Impact25 Jun 2025 Blog
-
Salesforce Load and Performance Testing: Essentials, Importance & Execution23 Jun 2025 Blog
-
Salesforce Website Integration Boost Leads, Automation & Customer Experience11 Jun 2025 Blog
-
Driving Results in Manufacturing with Salesforce Manufacturing Cloud11 Jun 2025 Blog
-
Accelerating Growth with NetSuite SuiteCommerce02 Jun 2025 Blog
-
Salesforce Service Cloud Services streamlining operations29 May 2025 Blog
-
AI for Nonprofits: Mirketa & Exec Precision Webinar27 May 2025 Press Release
-
AI for Nonprofits: Use Cases, Tools & Implementation Strategies20 May 2025 Webinar
-
Javascript Frameworks for Salesforce Lightning Design System18 May 2025 Blog
-
Building a Smart Campus with Salesforce Student Information System: A Road to Smarter Education16 May 2025 Blog
-
Salesforce Nonprofit Cloud: Benefits & Consultant Role15 May 2025 Blog
-
Salesforce Consulting for Nonprofits: Maximize Impact09 May 2025 Blog
-
What to Expect from a Salesforce Admin Service Provider09 May 2025 Blog
-
Maximizing Efficiency with Salesforce Cloud Integration Services09 May 2025 Blog
-
Step-by-Step Guide to Salesforce NPSP Implementation09 May 2025 Blog
-
A Guide on How to Use Salesforce Agentforce for Manufacturing02 May 2025 E-Book
-
Choosing the Right Salesforce Integration Partner: A Complete Guide22 Apr 2025 Blog
-
Salesforce Higher Education: Transforming Modern Universities15 Apr 2025 Blog
-
AI Agents The Future of Business Applications09 Apr 2025 Blog
-
Why Purpose-Built AI Agents Are the Future of AI at Work07 Apr 2025 Blog
-
How the Atlas Reasoning Engine Powers Agentforce03 Apr 2025 Blog
-
Leveraging AI for Code Analysis, Real-Time Interaction, and AI-driven Documentation02 Apr 2025 Use-case
-
Transforming Healthcare with AI-Powered Patient Health Monitoring with Fitbit & Salesforce01 Apr 2025 Use-case
-
5 Myths About Autonomous Agents in Salesforce28 Mar 2025 Blog
Categories
Featured by



