# Organization API: Customers: Custom fields

> The 3 Organization API operations for custom fields.

Source: https://docs.coritan.com/api/reference/organizations/customers/custom-fields/

Part of [Customers](/api/reference/organizations/customers/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/custom-fields`](#op-get-api-v1-orgs-org-slug-custom-fields) | List custom fields |
| POST | [`/api/v1/orgs/{org_slug}/custom-fields`](#op-post-api-v1-orgs-org-slug-custom-fields) | Create custom field |
| DELETE | [`/api/v1/orgs/{org_slug}/custom-fields/{field_id}`](#op-delete-api-v1-orgs-org-slug-custom-fields-field-id) | Delete custom field |

### List custom fields {#op-get-api-v1-orgs-org-slug-custom-fields}

`GET /api/v1/orgs/{org_slug}/custom-fields`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |
| `applies_to` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

A `200` response is a list; each item has these fields:

| Field | Type |
| --- | --- |
| `[].id` | integer |
| `[].org_id` | integer |
| `[].field_name` | string |
| `[].label` | string |
| `[].field_type` | string |
| `[].applies_to` | string |
| `[].validation_rules` | object or null |
| `[].options` | array of any or null |
| `[].default_value` | string or null |
| `[].required` | boolean |
| `[].is_indexed` | boolean |
| `[].sort_order` | integer |
| `[].created_at` | string (date-time) or null |

### Create custom field {#op-post-api-v1-orgs-org-slug-custom-fields}

`POST /api/v1/orgs/{org_slug}/custom-fields`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `field_name` | string | yes |
| `label` | string | yes |
| `field_type` | string | yes |
| `applies_to` | string | yes |
| `validation_rules` | object or null | no |
| `options` | array of any or null | no |
| `default_value` | string or null | no |
| `required` | boolean | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `201` response:

| Field | Type |
| --- | --- |
| `id` | integer |
| `org_id` | integer |
| `field_name` | string |
| `label` | string |
| `field_type` | string |
| `applies_to` | string |
| `validation_rules` | object or null |
| `options` | array of any or null |
| `default_value` | string or null |
| `required` | boolean |
| `is_indexed` | boolean |
| `sort_order` | integer |
| `created_at` | string (date-time) or null |

### Delete custom field {#op-delete-api-v1-orgs-org-slug-custom-fields-field-id}

`DELETE /api/v1/orgs/{org_slug}/custom-fields/{field_id}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `field_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
