> For the complete documentation index, see [llms.txt](https://documentation.proto.cx/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.proto.cx/docs/developers/apis/custom-fields-api.md).

# Custom fields API

Define custom fields for the teamspace and set their values on tickets.

***

### [**Create a custom field**](https://v3-api.proto.cx/api/platform/v1/docs#/v1/create_customer_custom_fields_v1_custom_fields__subcompany_id__create_custom_field_post)

Creates a [custom field](/docs/settings/teamspaces/custom-fields.md) for people, with its type, name, description, default value, and the option list for select fields.

{% code title="URL" overflow="wrap" %}

```
POST https://v3-api.proto.cx/api/platform/v1/custom-fields/{subcompany_id}/create-custom-field
```

{% endcode %}

{% code title="Body" overflow="wrap" %}

```
{
  "type": ""text" | "number" | "boolean" | "select" | "single_select" | "datetime"" (required),
  "name": "string" (required),
  "description": "string",
  "select_options": "array",
  "single_select_options": "array",
  "default_value": "string"
}
```

{% endcode %}

{% code title="Returns" overflow="wrap" %}

```
{
  "id": "string",
  "entity": ""customer" | "ticket" | "livechat"",
  "type": ""text" | "number" | "boolean" | "select" | "single_select" | "datetime"",
  "name": "string",
  "description": "string",
  "select_options": "array",
  "single_select_options": "array",
  "default_value": "string"
}
```

{% endcode %}

***

### [**List custom fields**](https://v3-api.proto.cx/api/platform/v1/docs#/v1/list_custom_fields_v1_custom_fields__subcompany_id__list_custom_fields_get)

Lists all custom fields defined for the teamspace.

{% code title="URL" overflow="wrap" %}

```
GET https://v3-api.proto.cx/api/platform/v1/custom-fields/{subcompany_id}/list-custom-fields
```

{% endcode %}

{% code title="Returns" overflow="wrap" %}

```
{
  "custom_fields": [object]
}
```

{% endcode %}

***

### [**Set ticket custom field values**](https://v3-api.proto.cx/api/platform/v1/docs#/v1/update_values_for_ticket_custom_fields_v1_custom_fields__subcompany_id__ticket__ticket_id__update_ticket_custom_fields_patch)

Sets custom field values on a ticket.

{% code title="URL" overflow="wrap" %}

```
PATCH https://v3-api.proto.cx/api/platform/v1/custom-fields/{subcompany_id}/ticket/{ticket_id}/update-ticket-custom-fields
```

{% endcode %}

{% code title="Body" overflow="wrap" %}

```
{
  "custom_fields": [object] (required)
}
```

{% endcode %}

{% code title="Returns" overflow="wrap" %}

```
{
  "success": "boolean"
}
```

{% endcode %}

***

### [**Delete custom fields**](https://v3-api.proto.cx/api/platform/v1/docs#/v1/delete_custom_fields_v1_custom_fields__subcompany_id__delete_custom_fields_delete)

Deletes one or more custom fields by ID.

{% code title="URL" overflow="wrap" %}

```
DELETE https://v3-api.proto.cx/api/platform/v1/custom-fields/{subcompany_id}/delete-custom-fields
```

{% endcode %}

{% code title="Body" overflow="wrap" %}

```
{
  "ids": [string] (required)
}
```

{% endcode %}

{% code title="Returns" overflow="wrap" %}

```
{
  "success": "boolean"
}
```

{% endcode %}

***

### [**Delete custom fields (earlier platform)**](https://v3-api.proto.cx/api/platform/v1/docs#/v1/delete_custom_fields_v1_custom_fields__subcompany_id__custom_field__custom_field_id__delete_custom_fields_delete)

Deletes custom fields. Serves the earlier platform edition.

{% code title="URL" overflow="wrap" %}

```
DELETE https://v3-api.proto.cx/api/platform/v1/custom-fields/{subcompany_id}/custom-field/{custom_field_id}/delete-custom-fields
```

{% endcode %}

{% code title="Body" overflow="wrap" %}

```
{
  "ids": [string] (required)
}
```

{% endcode %}

{% code title="Returns" overflow="wrap" %}

```
{
  "success": "boolean"
}
```

{% endcode %}
