Working with Custom & Original Fields
When integrating with platforms and SaaS apps, you often need control over which fields to receive or send. This guide explains how to work with both standard and custom fields.
Requesting Specific Fields
By default, API calls return all available fields for an object. However, you can optimize your requests by specifying only the fields you need using the fields parameter:
GET /crm/{connection_id}?/contact?fields=id,name,emails
Accessing Original Data (Raw Fields)
Reading Original Data
Sometimes you need access to the original, unmodified data from an integration (for example, to access platform-specific fields). To receive this data:
- Include
rawin yourfieldsparameter - The response will include a
rawobject containing the original data from the source
GET /crm/{connection_id}?/contact?fields=id,name,emails,raw
Writing Original Data
When creating or updating records, you can include integration-specific data that isn't part of our unified data model:
{
"name": "John Doe",
"raw": {
"custom_integration_field": "value"
}
}
Accessing the original ID of the object
Usually, Unified.to will return the object's ID in the id field.
But sometimes, Unified.to is required to transform that original ID with additional information. If you require the original object's ID (for example, using our Passthrough API), it will be available in the raw.__id field.
Working with Custom Original Fields
Some CRM platforms (like HubSpot and Salesforce) require specific fields to be explicitly included in the API call i.e., they won't be returned if you only added raw to the request parameters. If your app requires specific fields in this way ("custom fields"):
- Include
rawin your fields parameter - Add the specific custom fields you need with the
raw.prefix
For example, to request custom fields named leadFunnelStage and customerSegment:
GET /crm/{connection_id}?/contact?fields=id,name,raw,raw.leadFunnelStage,raw.customerSegment