Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Cordial Destination



Getting Started

getting-started page anchor

To enable the destination, you will need to authenticate by entering your Cordial API Key in the Segment dashboard.

To access your Cordial API Key, log in to your Cordial account and open the dropdown menu in the top right corner. Navigate to Administration > API Keys.


Supported Segment methods

supported-segment-methods page anchor

Cordial supports the identify, track, group, page methods.


When identify is called, user_id should be a valid identifier that matches the Cordial account's primary key. This will be the contact e-mail address unless you have set up a custom value.

If the user_id passed is valid and known, the contact in Cordial will be updated with any corresponding property values. For example, first_name, user_id, address.state, and email will populate or replace the corresponding values in Cordial.

If the user_id passed is valid but does not correspond to a Cordial contact, a new contact will be created and assigned any mapped values.

If the user_id passed is invalid, an error will be returned.


If the user_id passed is valid and known, and the group_id passed is valid and known, the contact will be added to the list in Cordial.

If the user_id passed is invalid, an error will be returned.

Supported data parameters

supported-data-parameters page anchor
Segment keyTypeCordial mapping
user_idstringemail address or custom primary key
group_idstringlist ID

If the user_id passed is valid and known, the event and its properties will be attributed to the contact in Cordial.

If the user_id passed is invalid, an error will be returned.

Segment keyTypeCordial mapping
user_idstringemail address or custom primary key
eventstringevent name
propertiesobjectevent properties (optional)

If the user_id passed is valid and known, a page view event will be attributed to the contact in Cordial.

If the user_id passed is invalid, an error will be returned.

Supported data parameters:

supported-data-parameters-2 page anchor
Segment keyTypeCordial mapping
user_idstringemail address or custom primary key

Optional advanced configuration

optional-advanced-configuration page anchor

POST https://admin.cordial.io/api/integrations/segment This endpoint can be used to configure custom mappings for your Segment destination.

1
{ "name":"segment",
2
"enabled":true,
3
"attributeMapping":[
4
{"segmentField":"first_name","cordialKey":"fname"},
5
{"segmentField":"user_id","cordialKey":"extid"},
6
{"segmentField":"address.state","cordialKey":"state"},
7
{"segmentField":"email","cordialKey":"channels.email.address"}
8
],
9
"ignoreFields":["website"],
10
"contactsErrorHandling":"ignoreMissingAttributes" }

You will be asked to authenticate. Use your Cordial API key as the username and proceed with the password blank. (To do this, log in to your Cordial account and open the dropdown menu in the top right corner. Navigate to Administration > API Keys. Here you will create a new key by whitelisting your IP with us.)

PUT https://admin.cordial.io/api/integrations/segment Update your Cordial/Segment field mapping using the same JSON format as in the POST call.

GET https://admin.cordial.io/api/integrations Retrieve a JSON list of integrations you have set up with Cordial.