> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.houseofapps.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.houseofapps.ai/_mcp/server.

# Create a custom field

POST https://api-dev.houseofapps.ai/v1/integrations/custom-fields
Content-Type: application/json

Create a custom field definition. Organization is resolved from Isometrik credentials (`licenseKey`/`appSecret`).

Reference: https://docs.houseofapps.ai/api-reference/overview/platform/custom-fields/external-create-custom-field-v-1-integrations-custom-fields-post

## Request

### Headers

- `licenseKey` (string, required)
- `appSecret` (string, required)

### Body (application/json)

This endpoint expects a CreateCustomFieldRequest.

- `field_name` (string, required) — Field name
- `field_type` (enum, required) — Field type
  - Allowed values: `text`, `number`, `date`, `yes_no`, `url`, `email`, `phone`, `long_text`, `rich_text`, `dropdown`, `multi_select`, `range_slider`, `currency`, `file_upload`, `image`, `address`, `object`, `list`, `api`
- `description` (string, optional, nullable) — Field description
- `field_key` (string, optional, nullable) — Optional stable key; auto-generated from field_name when omitted
- `show_on_create` (boolean, optional, default: true) — Show on create form
- `show_on_detail` (boolean, optional, default: false) — Show on detail page
- `is_required` (boolean, optional, default: false) — Field is required
- `searchable` (boolean, optional, default: false) — Include field values in entity free-text search
- `filterable` (boolean, optional, default: false) — Expose field as a list filter
- `type_config` (map from string to any, optional) — Type-specific configuration
- `visibility_logic` (VisibilityLogic, optional, nullable) — Optional conditional hide/disable rules (root fields only; same rule shape as dynamic filters).
- `sort_order` (integer, optional, default: 0) — Sort order for field
- `entity_type` (enum, optional, nullable) — Entity type (required for top-level fields, inherited for nested fields)
  - Allowed values: `company`, `contact`, `lead`, `prospect`, `project`, `user`, `cp_board`, `cp_task`, `ticket`
- `parent_id` (string, optional, nullable) — Parent field ID (required when adding via update endpoint)
- `sub_fields` (list of CreateCustomFieldRequest, optional) — Sub-fields for object type (multiple allowed) or list type (exactly one required)

## Response

### 201

Created

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable success message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `data` (SuccessResponseData, optional, nullable) — Payload for this endpoint

## Errors

### 400 Bad Request Error

Bad Request

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 401 Unauthorized Error

Unauthorized

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 404 Not Found Error

Not Found

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 409 Conflict Error

Conflict

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 422 Unprocessable Entity Error

Unprocessable Entity

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 429 Too Many Requests Error

Too Many Requests

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 500 Internal Server Error

Internal Server Error

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 503 Service Unavailable Error

Service Unavailable

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

## Types

### VisibilityLogic

Conditional UI logic for a root custom field (when rules match → actions).

- `rules` (list of VisibilityLogicRulesItems, required) — Filter rules (same shape as dynamic list filters).
- `actions` (list of enum, required) — Actions to apply when rules match (hide and/or disable).
  - Allowed values: `hide`, `disable`
- `match` (enum, optional) — Combine rules with AND (all) or OR (any).
  - Allowed values: `all`, `any`

### CreateCustomFieldRequest

Request schema for creating a custom field. Supports creating: - Top-level fields (with entity_type) - Object parent fields with nested sub-fields recursively (with entity_type, field_type='object', sub_fields array) - List fields with a single child field (with entity_type, field_type='list', sub_fields array with exactly one item) This model is recursive - sub_fields can themselves contain sub_fields for nested object structures. List fields can contain any field type as their child, including object types which can have their own sub_fields.

- `field_name` (string, required) — Field name
- `field_type` (enum, required) — Field type
  - Allowed values: `text`, `number`, `date`, `yes_no`, `url`, `email`, `phone`, `long_text`, `rich_text`, `dropdown`, `multi_select`, `range_slider`, `currency`, `file_upload`, `image`, `address`, `object`, `list`, `api`
- `description` (string, optional, nullable) — Field description
- `field_key` (string, optional, nullable) — Optional stable key; auto-generated from field_name when omitted
- `show_on_create` (boolean, optional, default: true) — Show on create form
- `show_on_detail` (boolean, optional, default: false) — Show on detail page
- `is_required` (boolean, optional, default: false) — Field is required
- `searchable` (boolean, optional, default: false) — Include field values in entity free-text search
- `filterable` (boolean, optional, default: false) — Expose field as a list filter
- `type_config` (map from string to any, optional) — Type-specific configuration
- `visibility_logic` (VisibilityLogic, optional, nullable) — Optional conditional hide/disable rules (root fields only; same rule shape as dynamic filters).
- `sort_order` (integer, optional, default: 0) — Sort order for field
- `entity_type` (enum, optional, nullable) — Entity type (required for top-level fields, inherited for nested fields)
  - Allowed values: `company`, `contact`, `lead`, `prospect`, `project`, `user`, `cp_board`, `cp_task`, `ticket`
- `parent_id` (string, optional, nullable) — Parent field ID (required when adding via update endpoint)
- `sub_fields` (list of CreateCustomFieldRequest, optional) — Sub-fields for object type (multiple allowed) or list type (exactly one required)

### SuccessResponseData

Payload for this endpoint

- map from string to any
- list of any
- string
- double
- boolean

### VisibilityLogicRulesItems

- DropdownCustomFieldFilter: DropdownCustomFieldFilter
- FilterGroup: FilterGroup

### DropdownCustomFieldFilter

A single filter rule. Backward compatible with `{field_id, values}` (implied operator `eq`).

- `field_id` (string, required) — Standard field key or custom field UUID.
- `operator` (enum, optional) — Comparison operator. Defaults to eq for legacy payloads.
  - Allowed values: `eq`, `neq`, `contains`, `not_contains`, `starts_with`, `is_set`, `is_not_set`, `gt`, `gte`, `lt`, `lte`, `between`, `before`, `after`
- `values` (list of string, optional) — Selected values (IN for eq). Ignored for is_set / is_not_set.

### FilterGroup

Nested boolean group (one extra level under the top-level match).

- `rules` (list of FilterGroupRulesItems, required)
- `match` (enum, optional) — Boolean combinator for a rule list.
  - Allowed values: `all`, `any`

### FilterGroupRulesItems

- DropdownCustomFieldFilter: DropdownCustomFieldFilter
- FilterGroup: FilterGroup

## Examples

**Request**

```json
{
  "field_name": "string",
  "field_type": "text"
}
```

**Response**

```json
{
  "status": "success",
  "message": "Created successfully",
  "statusCode": 201,
  "code": "2001",
  "data": {}
}
```

**SDK Code**

```python Created
import requests

url = "https://api-dev.houseofapps.ai/v1/integrations/custom-fields"

payload = {
    "field_name": "string",
    "field_type": "text"
}
headers = {
    "appSecret": "appSecret",
    "licenseKey": "licenseKey",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Created
const url = 'https://api-dev.houseofapps.ai/v1/integrations/custom-fields';
const options = {
  method: 'POST',
  headers: {
    appSecret: 'appSecret',
    licenseKey: 'licenseKey',
    'Content-Type': 'application/json'
  },
  body: '{"field_name":"string","field_type":"text"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Created
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-dev.houseofapps.ai/v1/integrations/custom-fields"

	payload := strings.NewReader("{\n  \"field_name\": \"string\",\n  \"field_type\": \"text\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("appSecret", "appSecret")
	req.Header.Add("licenseKey", "licenseKey")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Created
require 'uri'
require 'net/http'

url = URI("https://api-dev.houseofapps.ai/v1/integrations/custom-fields")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["appSecret"] = 'appSecret'
request["licenseKey"] = 'licenseKey'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"field_name\": \"string\",\n  \"field_type\": \"text\"\n}"

response = http.request(request)
puts response.read_body
```

```java Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-dev.houseofapps.ai/v1/integrations/custom-fields")
  .header("appSecret", "appSecret")
  .header("licenseKey", "licenseKey")
  .header("Content-Type", "application/json")
  .body("{\n  \"field_name\": \"string\",\n  \"field_type\": \"text\"\n}")
  .asString();
```

```php Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-dev.houseofapps.ai/v1/integrations/custom-fields', [
  'body' => '{
  "field_name": "string",
  "field_type": "text"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'appSecret' => 'appSecret',
    'licenseKey' => 'licenseKey',
  ],
]);

echo $response->getBody();
```

```csharp Created
using RestSharp;

var client = new RestClient("https://api-dev.houseofapps.ai/v1/integrations/custom-fields");
var request = new RestRequest(Method.POST);
request.AddHeader("appSecret", "appSecret");
request.AddHeader("licenseKey", "licenseKey");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"field_name\": \"string\",\n  \"field_type\": \"text\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Created
import Foundation

let headers = [
  "appSecret": "appSecret",
  "licenseKey": "licenseKey",
  "Content-Type": "application/json"
]
let parameters = [
  "field_name": "string",
  "field_type": "text"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-dev.houseofapps.ai/v1/integrations/custom-fields")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```