---
title: "Create a data attribute"
method: POST
path: "/data_attributes"
tags: ["Data Attributes"]
---

# Create a data attribute

`POST /data_attributes`

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

## Headers

- `Intercom-Version` '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '2.0' | '2.1' | '2.2' | '2.3' | '2.4' | '2.5' | '2.6' | '2.7' | '2.8' | '2.9' | '2.10' | '2.11' | '2.12' | '2.13' | '2.14' — Intercom API version.</br>By default, it's equal to the version set in the app package.

## Request body

- union
  - object
    - `name` string, required — The name of the data attribute.
    - `model` 'contact' | 'company', required — The model that the data attribute belongs to.
    - `description` string — The readable description you see in the UI for the attribute.
    - `messenger_writable` boolean — Can this attribute be updated by the Messenger
    - `data_type` 'options', required
    - `options` object[], required — 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.
      - `value` string
  - object
    - `name` string, required — The name of the data attribute.
    - `model` 'contact' | 'company', required — The model that the data attribute belongs to.
    - `description` string — The readable description you see in the UI for the attribute.
    - `messenger_writable` boolean — Can this attribute be updated by the Messenger
    - `data_type` 'string' | 'integer' | 'float' | 'boolean' | 'datetime' | 'date', required

## Response `200`

Successful

- DataAttribute — 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.
  - `type` 'data_attribute' — Value is `data_attribute`.
  - `id` integer — The unique identifier for the data attribute which is given by Intercom. Only available for custom attributes.
  - `model` 'contact' | 'company' — Value is `contact` for user/lead attributes and `company` for company attributes.
  - `name` string — Name of the attribute.
  - `full_name` string — 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.
  - `label` string — Readable name of the attribute (i.e. name you see in the UI)
  - `description` string — Readable description of the attribute.
  - `data_type` 'string' | 'integer' | 'float' | 'boolean' | 'date' — The data type of the attribute.
  - `options` string[] — List of predefined options for attribute value.
  - `api_writable` boolean — Can this attribute be updated through API
  - `messenger_writable` boolean — Can this attribute be updated by the Messenger
  - `ui_writable` boolean — Can this attribute be updated in the UI
  - `custom` boolean — Set to true if this is a CDA
  - `archived` boolean — Is this attribute archived. (Only applicable to CDAs)
  - `created_at` integer — The time the attribute was created as a UTC Unix timestamp
  - `updated_at` integer — The time the attribute was last updated as a UTC Unix timestamp
  - `admin_id` string — Teammate who created the attribute. Only applicable to CDAs

## Other responses

- `400` — Too few options for list
- `401` — Unauthorized

---

[API](https://skmtc.net/intercom/apis/intercom-api.md) · [All operations](https://skmtc.net/intercom/apis/intercom-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/intercom/intercom-api/revisions/9517e80f2642/schema)
