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

# Add Custom Fields

Add custom fields, Maximum limit for an entity to add custom fields is 20. Below is a sample cURL request to add some custom fields:

{% file src="/files/lHcdOQDq2keSogvRZGVr" %}

<mark style="color:green;">`POST`</mark>[`{{apiUrl}}custom_fields/add_update_custom_field`](https://api.evitalrx.in/v1/custom_fields/add_update_custom_field)

#### Request Body

| Name                                     | Type   | Description                                                                                                                             |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                                                                    |
| custom\_fields                           | Array  | <p>Array of custom field object<br>For ex:<br>{attribute\_key: string, module: string }<br>Valid module are:<br>sales and customers</p> |
| action                                   | String | add                                                                                                                                     |

{% tabs %}
{% tab title="OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-10-01 10:36:31",
    "data": null
}
```

{% endtab %}

{% tab title="Limit Error" %}

```json
{
    "status_code": "0",
    "status_message": "Total custom field exceeds limit of 20",
    "datetime": "2024-10-01 10:44:00",
    "data": null
}
```

{% endtab %}
{% endtabs %}
