---
title: "Add a new custom attribute"
method: POST
path: "/v1/workspaces/{workspace_id}/custom_attribute_definitions"
tags: ["Custom attributes"]
---

# Add a new custom attribute

`POST /v1/workspaces/{workspace_id}/custom_attribute_definitions`

## Request

- Base URL: `https://api.oxvo.com`
- URL: `https://api.oxvo.com/v1/workspaces/{workspace_id}/custom_attribute_definitions`
- Auth: API key in header `api_access_token`

Add a new custom attribute to account

## Request body

- CustomAttributeCreateUpdatePayload
  - `attribute_display_name` string: Attribute display name
  - `attribute_display_type` integer: Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)
  - `attribute_description` string: Attribute description
  - `attribute_key` string: Attribute unique key value
  - `attribute_values` string[]: Attribute values
  - `attribute_model` integer: Attribute type(conversation_attribute- 0, contact_attribute- 1)
  - `regex_pattern` string: Regex pattern (Only applicable for type- text). The regex pattern is used to validate the attribute value(s).
  - `regex_cue` string: Regex cue message (Only applicable for type- text). The cue message is shown when the regex pattern is not matched.

## Response `200`

Success

- CustomAttribute
  - `id` integer: Identifier
  - `attribute_display_name` string: Attribute display name
  - `attribute_display_type` string: Attribute display type (text, number, currency, percent, link, date, list, checkbox)
  - `attribute_description` string: Attribute description
  - `attribute_key` string: Attribute unique key value
  - `regex_pattern` string: Regex pattern
  - `regex_cue` string: Regex cue
  - `attribute_values` string: Attribute values
  - `attribute_model` string: Attribute type(conversation_attribute/contact_attribute)
  - `default_value` string: Attribute default value
  - `created_at` string: The date and time when the custom attribute was created
  - `updated_at` string: The date and time when the custom attribute was updated

## Other responses

- `403`: Access denied

---

[API](https://skmtc.dev/oxvo/apis/oxvo-apis.md) · [All operations](https://skmtc.dev/oxvo/apis/oxvo-apis/llms.txt) · [OpenAPI document](https://skmtc.dev/oxvo/apis/oxvo-apis/revisions/9a8448cbd1fe?raw)
