Skip to content

Create a data attribute

Request

You can create a data attributes for a contact or a company.

Security
bearerAuth
Headers
Intercom-Versionstring(intercom_version)

Intercom API version.
By default, it's equal to the version set in the app package.

Default:"2.11"
Enum:"1.0""1.1""1.2""1.3""1.4""2.0""2.1""2.2""2.3""2.4"
Example:2.11
Bodyapplication/json
One of:
namestringrequired

The name of the data attribute.

Example:"My Data Attribute"
modelstringrequired

The model that the data attribute belongs to.

Enum:"contact""company"
Example:"contact"
descriptionstring

The readable description you see in the UI for the attribute.

Example:"My Data Attribute Description"
messenger_writableboolean

Can this attribute be updated by the Messenger

Example:false
data_typeanyrequired
Value:"options"
optionsarray of objectsrequired

Array of objects representing the options of the list, with value as the key and the option as the value. At least two options are required.

Example:
[ { "value": "1-10" }, { "value": "11-50" } ]
curl -i -X POST \
  https://api.intercom.io/data_attributes \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Intercom-Version: 2.11' \
  -d '{
    "name": "Mithril Shirt",
    "model": "company",
    "data_type": "string"
  }'

Responses

Successful

Bodyapplication/json

Data Attributes are metadata used to describe your contact, company and conversation models. These include standard and custom attributes. By using the data attributes endpoint, you can get the global list of attributes for your workspace, as well as create and archive custom attributes.

typestringrequired

Value is data_attribute.

Value:"data_attribute"
Example:"data_attribute"
idinteger

The unique identifier for the data attribute which is given by Intercom. Only available for custom attributes.

Example:12878
modelstring

Value is contact for user/lead attributes and company for company attributes.

Enum:"contact""company"
Example:"contact"
namestringrequired

Name of the attribute.

Example:"paid_subscriber"
full_namestringrequired

Full name of the attribute. Should match the name unless it's a nested attribute. We can split full_name on . to access nested user object values.

Example:"custom_attributes.paid_subscriber"
labelstringrequired

Readable name of the attribute (i.e. name you see in the UI)

Example:"Paid Subscriber"
descriptionstringrequired

Readable description of the attribute.

Example:"Whether the user is a paid subscriber."
data_typestringrequired

The data type of the attribute.

Enum:"string""integer""float""boolean""date"
Example:"boolean"
optionsarray of strings

List of predefined options for attribute value.

Example:
[ "true", "false" ]
api_writableboolean

Can this attribute be updated through API

Example:true
messenger_writableboolean

Can this attribute be updated by the Messenger

Example:false
ui_writableboolean

Can this attribute be updated in the UI

Example:true
customboolean

Set to true if this is a CDA

Example:true
archivedboolean

Is this attribute archived. (Only applicable to CDAs)

Example:false
created_atinteger, (date-time)

The time the attribute was created as a UTC Unix timestamp

Example:1671028894
updated_atinteger, (date-time)

The time the attribute was last updated as a UTC Unix timestamp

Example:1671028894
admin_idstring

Teammate who created the attribute. Only applicable to CDAs

Example:"5712945"
Response
{ "id": 37, "type": "data_attribute", "name": "Mithril Shirt", "full_name": "custom_attributes.Mithril Shirt", "label": "Mithril Shirt", "data_type": "string", "api_writable": true, "ui_writable": false, "messenger_writable": false, "custom": true, "archived": false, "admin_id": "991267686", "created_at": 1719492955, "updated_at": 1719492955, "model": "company" }