# Create a conversation attribute

Create a new conversation attribute.

Endpoint: POST /conversations/attributes
Version: Preview
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer

## Header parameters:

  - `Intercom-Version` (string)

## Request fields (application/json):

  - `name` (string, required)
    Name of the attribute.
    Example: api_test_attr

  - `description` (string)
    Readable description of the attribute.
    Example: Created via API test

  - `data_type` (string, required)
    Enum: "string", "integer", "list", "decimal", "boolean", "datetime", "relationship", "files"

  - `required` (boolean)
    Whether this attribute is required.
    Example: false

  - `visible_to_team_ids` (array)
    Team IDs that can see this attribute. Empty array means all teams.
    Example: []

  - `multiline` (boolean)
    Whether this string attribute is multiline.
    Example: false

  - `options` (array, required)
    Initial options for this list attribute. Each option must have a `label`. A list attribute needs at least 2 options.

  - `options.label` (string, required)
    The label for the new option.
    Example: High

  - `reference` (object, required)
    Reference configuration for related objects.

  - `reference.type` (string, required)
    The cardinality of the relationship: `one` or `many`.
    Enum: "one", "many"

  - `reference.object_type_id` (string, required)
    The ID of the related custom object type. It must match an existing custom object type.

## Request examples:

  - `Create a string attribute` (unknown)

## Response 200:

  - `200` (unknown)
    Successful response

## Response 200 fields (application/json):

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

  - `id` (integer)
    The unique identifier for the conversation attribute.
    Example: 8

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

  - `description` (string)
    Readable description of the attribute.
    Example: Created via API test

  - `data_type` (string)
    Enum: "string", "integer", "list", "decimal", "boolean", "datetime", "relationship", "files"

  - `required` (boolean)
    Whether this attribute is required.
    Example: false

  - `visible_to_team_ids` (array)
    Team IDs that can see this attribute. Empty array means all teams.
    Example: []

  - `archived` (boolean)
    Whether this attribute is archived.
    Example: false

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

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

  - `admin_id` (string)
    ID of the admin who created the attribute, or `null` if there isn't one.
    Example: 16

  - `multiline` (boolean)
    Whether this string attribute is multiline.
    Example: false

  - `options` (array)
    Predefined options for this attribute. Each option has a unique UUID used to identify it in the options management endpoints.

  - `options.id` (string)
    The unique UUID identifier for this option. Use this value as `option_id` in the options management endpoints.
    Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

  - `options.label` (string)
    The display label for the option.
    Example: High

  - `options.archived` (boolean)
    Whether this option is archived (soft-deleted).
    Example: false

  - `reference` (object)
    Reference configuration for related objects.

  - `reference.type` (string)
    The cardinality of the relationship: `one` or `many`.
    Enum: "one", "many"

  - `reference.object_type_id` (string)
    The ID of the related custom object type.
    Example: Test_Object

## Response 401:

  - `401` (unknown)
    Unauthorized

## 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.data` (object)
    Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
    Example: {"required_permissions":["read_conversations"]}

## Response 422:

  - `422` (unknown)
    Unprocessable entity

## Response 422 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.data` (object)
    Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
    Example: {"required_permissions":["read_conversations"]}

## Response 200 examples:

  - `Successful response` (unknown)

## Response 401 examples:

  - `Unauthorized` (unknown)

## Response 422 examples:

  - `Invalid data_type` (unknown)

  - `List without options` (unknown)

  - `List with too few options` (unknown)

  - `Relationship without object_type_id` (unknown)

  - `Name already exists` (unknown)

