# Create a data attribute

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

Endpoint: POST /data_attributes
Version: 2.16
Security: bearerAuth

## Header parameters:

  - `Intercom-Version` (string)

## Request fields (application/json):

  - `data_type` (string)
    Enum: "options"

  - `options` (array, 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.
    Example: [{"value":"1-10"},{"value":"11-50"}]

  - `options.value` (string)

## Response 200 fields (application/json):

  - `type` (string)
    Value is `data_attribute`.
    Enum: "data_attribute"

  - `id` (integer)
    The unique identifier for the data attribute which is given by Intercom. Only available for custom attributes.
    Example: 12878

  - `model` (string)
    Value is `contact` for user/lead attributes and `company` for company attributes.
    Enum: "contact", "company"

  - `name` (string)
    Name of the attribute.
    Example: paid_subscriber

  - `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.
    Example: custom_attributes.paid_subscriber

  - `label` (string)
    Readable name of the attribute (i.e. name you see in the UI)
    Example: Paid Subscriber

  - `description` (string)
    Readable description of the attribute.
    Example: Whether the user is a paid subscriber.

  - `data_type` (string)
    The data type of the attribute.
    Enum: "string", "integer", "float", "boolean", "date"

  - `options` (array)
    List of predefined options for attribute value.
    Example: ["true","false"]

  - `api_writable` (boolean)
    Can this attribute be updated through API
    Example: true

  - `messenger_writable` (boolean)
    Can this attribute be updated by the Messenger
    Example: false

  - `ui_writable` (boolean)
    Can this attribute be updated in the UI
    Example: true

  - `custom` (boolean)
    Set to true if this is a CDA
    Example: true

  - `archived` (boolean)
    Is this attribute archived. (Only applicable to CDAs)
    Example: false

  - `created_at` (integer)
    The time the attribute was created as a UTC Unix timestamp
    Example: 1671028894

  - `updated_at` (integer)
    The time the attribute was last updated as a UTC Unix timestamp
    Example: 1671028894

  - `admin_id` (string)
    Teammate who created the attribute. Only applicable to CDAs
    Example: 5712945

## Response 400 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

## Response 401 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

