POST
/data_attributesCreate a data attribute
Creates a data attribute for a contact or company model. Provide name, model, and data_type; for a list attribute, also supply options with at least two entries.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Intercom-Versionstringoptional
The Intercom API version to use. Defaults to 2.17 when omitted; use a supported version.
Data attribute details. Supply name, model, and data_type; list attributes also require options.
namestringrequired
The name of the data attribute.
modelstringrequired
The model that the data attribute belongs to.
descriptionstringoptional
The readable description you see in the UI for the attribute.
messenger_writablebooleanoptional
Can this attribute be updated by the Messenger
200Returns the created data attribute, including its identifier, model, name, data type, options, and writable and archived flags.
typestringoptional
Value is `data_attribute`.
idintegeroptional
The unique identifier for the data attribute which is given by Intercom. Only available for custom attributes.
modelstringoptional
Value is `contact` for user/lead attributes and `company` for company attributes.
namestringoptional
Name of the attribute.
full_namestringoptional
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.
labelstringoptional
Readable name of the attribute (i.e. name you see in the UI)
descriptionstringoptional
Readable description of the attribute.
data_typestringoptional
The data type of the attribute.
optionsarray<string>optional
List of predefined options for attribute value.
api_writablebooleanoptional
Can this attribute be updated through API
messenger_writablebooleanoptional
Can this attribute be updated by the Messenger
ui_writablebooleanoptional
Can this attribute be updated in the UI
custombooleanoptional
Set to true if this is a CDA
archivedbooleanoptional
Is this attribute archived. (Only applicable to CDAs)
created_atintegeroptional
The time the attribute was created as a UTC Unix timestamp
updated_atintegeroptional
The time the attribute was last updated as a UTC Unix timestamp
admin_idstringoptional
Teammate who created the attribute. Only applicable to CDAs
400Returned when a list attribute has fewer than two options.
One documented failure
parameter_invalidYou already have 'The One Ring' in your company data. To save this as new people data, use a different name.
typestringrequired
The type is error.list
request_idstringoptional
errorsarray<object>required
An array of one or more error objects
401Returned when the request is unauthorized.
One documented failure
unauthorizedAccess Token Invalid
typestringrequired
The type is error.list
request_idstringoptional
errorsarray<object>required
An array of one or more error objects
Error handling
A 400 is returned when a list attribute has fewer than two options, and a 401 is returned when the request is unauthorized. name, model, and data_type are required; model must be contact or company, and data_type must be options, string, integer, float, boolean, datetime, or date.