# Add Custom Field

{% hint style="warning" %}
All API requests should contain [authorization headers](/docs/apis/tickets/authorization-headers.md).
{% endhint %}

#### Request

```
POST /customFields
```

#### Query Parameters

This endpoint doesn't require query parameters.

**Request Body**

Request body should contain [custom field](/docs/apis/tickets/reference/objects/custom-field.md) object. The `id` field should be equal to 0 or left unset.

If the `value` field is set it will be ignored.

```json
{
    "assignedCategoryIds": null,
    "defaultValue": null,
    "id": 0,
    "isHidden": false,
    "isRequired": false,
    "isSensitiveData": false,
    "name": "Client Comment",
    "placeholder": "Client Comment",
    "possibleValues": null,
    "type": "text_input"
}
```

#### Response

```json
{
    "data": {
        "assignedCategoryIds": [],
        "defaultValue": null,
        "id": 26707,
        "isHidden": false,
        "isRequired": false,
        "isSensitiveData": false,
        "name": "Client Comment",
        "placeholder": "Client Comment",
        "possibleValues": [],
        "type": "text_input"
    },
    "errorCode": -1,
    "errorText": null
}
```

`Data` field has type of [Custom Field](/docs/apis/tickets/reference/objects/custom-field.md) object.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.socialboards.com/docs/apis/tickets/reference/endpoints/add-custom-field.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
