Please note: this API is currently in beta and is subject to change based on testing and feedback. By using these endpoints you agree to adhere to HubSpot's Developer Terms and Developer Beta Terms. You also acknowledge and understand the risk associated with testing an unstable API.

Access and manage sensitive data (BETA)

With sensitive data properties, HubSpot users in Enterprise accounts can store certain types of sensitive data and use the data in HubSpot tools. For example, you can create a Passport Number property and filter contacts in a list based on its values. Refer to the sensitive data terms page to understand which types of sensitive data you can store and which HubSpot tools can access sensitive data.

Existing HubSpot APIs and apps will continue to work as expected, but if you have an app that needs access to sensitive data, you must update the app’s scopes and require app users to authorize and install the app. Once your app gains access, you can use the properties and object APIs to view sensitive data property definitions and view or update sensitive data property values for contacts, companies, deals, tickets, and custom objects.

Sensitive data scopes

For an app to access sensitive data, it must have the sensitive scopes for each applicable object. For example, if your app needs to read and update sensitive data on companies and contacts, you’ll need to add the company and contact read and write sensitive scopes. The sensitive scopes are:

  • crm.objects.contacts.sensitive.read
  • crm.objects.contacts.sensitive.write
  • crm.objects.companies.sensitive.read
  • crm.objects.companies.sensitive.write
  • crm.objects.deals.sensitive.read
  • crm.objects.deals.sensitive.write
  • crm.objects.custom.sensitive.read
  • crm.objects.custom.sensitive.write
  • tickets.sensitive (Both read and write access)
Please note: sensitive scopes are not required to retrieve schema information for a sensitive data property, but are required to access the property’s values.

Turn on sensitive data access for your app

The process for gaining access to sensitive data scopes depends on whether you have a private or public app.

Private apps

For private apps, you can add the scopes in your private app settings.

  • In your HubSpot account, click the settings icon in the top navigation bar.
  • In the left sidebar menu, navigate to Integrations > Private Apps.
  • On the private app, click Edit.

edit-private-app

  • Click the Scopes tab.
  • Select the checkboxes of the sensitive scopes you want to add.

sensitive-data-scopes

  • In the top right, click Commit changes.

Your private app's access token will immediately have access to read and/or write sensitive data properties on the selected objects.

Public apps

For public apps, you’ll need to request access to specific sensitive scopes from HubSpot’s Ecosystem Quality team. If approved, the team will allowlist the sensitive scopes to test your app and will help you publish your app with the required scopes following a period of testing and compliance checks. You’ll then need to notify app users of the change and request re-authorization of your app.

Navigate to this page to view the full process and fill out the form to request sensitive data access for public apps. 

Request authorization from app users

Once the sensitive scopes have been added to your app, you’ll need to send authorization URLs to app users so they can authorize and install the app, granting access to sensitive data scopes. If they’re existing users of the app, they’ll need to reauthorize with the updated scopes for sensitive data access to apply. 

Once you’ve notified your app users, a Super admin in their account will need to:

  • Click the authorization URL with sensitive data scopes.
  • Select the account into which to install the app. The HubSpot account must have an Enterprise subscription to access sensitive data functionality.
  • Review the updated list of scopes, then click Connect App to install.
Once authorized and installed, the app can access sensitive data via APIs for the account.

Manage sensitive data

Once your app has access to sensitive data, you can use the following APIs to manage sensitive data

  • Properties API: retrieve sensitive data property information.
  • Object APIs (Contacts, Companies, Deals, TicketsCustom objects): retrieve or update sensitive data property values.
  • CRM Search V3 API: search for records with values for sensitive data properties.
  • Forms API:  send form submissions containing sensitive data. 
  • Webhooks API: create propertyChange event type webhook subscriptions for contact, company, deal, and ticket sensitive data properties.

Retrieve sensitive data property definitions

You can use the properties API to view sensitive data property definitions and schema information. At this time, you cannot create, update, or delete sensitive data properties via API.

  • To retrieve all sensitive data properties, include the dataSensitivity query parameter with the value sensitive. This returns all sensitive data properties for the specified object. If you don't include this parameter when retrieving properties, only non-sensitive properties will be returned. For example, to retrieve all contact properties that store sensitive data, make a GET request to /crm/v3/properties/contacts?dataSensitivity=sensitive.
  • To retrieve an individual property, make a GET request to /crm/v3/properties/{objectType}/{propertyName}. If a property contains sensitive data, in the response, the dataSensitivity property will have the value sensitive. If it’s not a sensitive data property, the value will be non_sensitive.
If a returned sensitive data property stores protected health information (BETA), the returned sensitiveDataCategories field will have a value of ["HIPAA"].

For example, if you you have a Passport Number sensitive data property, when you retrieve it, your response would look like:

///Example response for GET /crm/v3/properties/contacts/passport_number { "updatedAt": "2021-11-03T15:24:08.528Z", "createdAt": "2021-04-16T18:17:14.911Z", "name": "passport_number", "label": "Passport Number", "type": "string", "fieldType": "text", "description": "", "groupName": "contactinformation", "options": [], "createdUserId": "9586504", "updatedUserId": "9586504", "displayOrder": -1, "dataSensitivity": "sensitive", "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "showCurrencySymbol": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": true }

Retrieve sensitive data property values

You can retrieve a record’s value for a sensitive data property. To do this, make a GET request to /crm/v3/objects/{object}/{recordId} and include the sensitive data property in your query parameters.

For example, to retrieve a contact’s Passport Number value, your request URL would look like: https://api.hubspot.com/crm/v3/objects/contacts/1234567?properties=passport_number.

Set or update sensitive data property values

You can use the object APIs to create or edit records to set values for sensitive data properties.

  • To create a record and set a value for a sensitive data property, make a POST request to /crm/v3/objects/{object}. In your request body, include the required properties and the sensitive data property. 
  • To update a record’s value for a sensitive data property, make a PATCH request to /crm/v3/objects/{object}/{objectId}. In your request body, include the sensitive data property with the new value. To clear the value, set the value to an empty string in your request body.
For example, if you want to create a contact and set a value for the Passport Number property, your request would look like:
///Example request body for POST /crm/v3/objects/contacts { "properties": { "email": "example@hubspot.com", "firstname": "Jane", "lastname": "Doe", "phone": "(555) 555-5555", "company": "HubSpot", "website": "hubspot.com", "lifecyclestage": "marketingqualifiedlead", "passport_number": "1234567" } }

If you wanted to update the property’s value later on, your request would look like:

///Example request body for PATCH crm/v3/objects/contacts/{contactID} { "properties": { "passport_number": "89101112" } }

CRM Search API

If your app has the sensitive data scopes, you can use the V3 CRM search API to search for records with values for sensitive data properties. To do so, make a POST request to /crm/v3/objects/{object}/search and include the sensitive data properties you want to search for.

For example, the following search would return contacts with their first name, last name, and passport number values:

/// Example POST request to /crm/v3/objects/contacts/search { "properties": ["firstname", "lastname", "passport_number"] }

Forms API

To send form submissions containing sensitive data to HubSpot, make a POST request to https://api.hsforms.com/submissions/v3/integration/secure/submit/{HubID}/:formGuid. Learn more about using this endpoint..

This is currently the only forms submission API endpoint that can be used with sensitive data because it supports authentication. Any other requests to the forms API will result in an error or hide sensitive data values.

Webhooks API

You can create propertyChange event type webhook subscriptions for sensitive data properties on contacts, companies, deals, and tickets. 

For non-sensitive property propertyChange events, the webhook payload has the new value in the propertyValue field.  For sensitive property propertyChange events, the webhook payload will have the propertyValue set as "REDACTED". To view the value, you'll need to retrieve the record's value for the sensitive data property.

For example, a webhook payload for a sensitive property propertyChange event contact subscription would look like the following:

///Example webhook payload [ { "eventId": 3029365631, "subscriptionId": 686627, "portalId": 891472211, "appId": 7906213, "occurredAt": 1715203101896, "subscriptionType": "contact.propertyChange", "attemptNumber": 0, "objectId": 847297356, "propertyName": "passport_number", "propertyValue": "REDACTED", "changeSource": "CRM_UI", "sourceId": "userId:882761034" } ]

Errors

The following errors and redactions are expected:

  • If you don’t have the required scope to read or update sensitive data for a given object, you’ll receive a 403 Forbidden error when you make a request containing a sensitive data property to that object's API.
  • Sensitive data access is only supported for the V3 properties, object, CRM search, and forms APIs.
    • If you use legacy versions of the properties and object APIs, your request will appear successful, but sensitive data values won't be updated and will be hidden in the response body.
    • If you use legacy versions of the CRM search API, you'll receive a 403 Forbidden error citing support in version 3 or later.
    • If you use the unauthorized form submission API, you'll receive a 403 Forbidden error. If you try to retrieve form submissions containing sensitive data, the submissions will be returned but the sensitive data properties and their values will be hidden.

Was this article helpful?
This form is used for documentation feedback only. Learn how to get help with HubSpot.