---
title: "Create a custom field"
slug: "create-a-custom-field"
abstract: "Describes the request and response details of this Sitecore Send API endpoint to create a custom field."
---
# Create a custom field

`POST /lists/{MailingListID}/customfields/create.{Format}`

Creates a new custom field in a specific email list.

## Request

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| Accept | header | string | true | Determines the expected format and data type to retrieve the response data.Value: application/json |
| MailingListID | path | string | true | The ID of the email list where the custom field is created. |
| Format | path | string | true | The supported file format for getting a response.Possible values: json and xml. |
| apikey | query | string | true | The API key of your account. |
| Name | body | string | true | The name of the custom field. |
| CustomFieldType | body | string | false | Specifies the data type of the custom field. This must be one of the following values.Text (Default) - accepts any text value as input.Number - accepts only numeric values as input.DateTime - accepts only date values as input, with or without time.SingleSelectDropdown - accepts only values explicitly defined in a list.CheckBox - accepts only values of true or false. |
| Options | body | string | false | If you want to create a SingleSelectDropdown custom field, you must set this parameter to specify the available options for the user to choose from. Use a comma (,) to separate different options. |
| IsRequired | body | Boolean | false | Specifies whether the custom field is mandatory or not when adding a subscriber to your list. You must specify a value of true or false (Default). |
| IsHidden | body | Boolean | false | Specifies whether the custom field is visible to your subscribers in the Update Profile page. You must specify a value of true or false (Default). |

```http
POST https://{hostname}/v3/lists/{MailingListID}/customfields/create.{Format}?apikey=

Request body:
{
  "Name": "Town",
  "CustomFieldType": "SingleSelectDropdown",
  "Options": "Athens,London,New York"
}
```

```curl
curl --include \\
     --request POST \\
     --header "Content-Type: application/json" \\
     --header "Accept: application/json" \\
     --data-raw '{
    "Name": "Town",
    "CustomFieldType": "SingleSelectDropdown",
    "Options": "Athens,London,New York"
}' \\
'https://{hostname}/v3/lists/{MailingListID}/customfields/create.{Format}?apikey='
```

## Response

| Status | Description | Headers | Schema |
| --- | --- | --- | --- |
| 200 OK | The request is successful. | Content-Type:application/json | N/A |

```json
{
  "Code": 0,
  "Error": null,
  "Context": "b42b4e0f-ca2f-403d-8231-32a2405651af"
}
```

-   `Code` - the response code. This is `0` if successful.
    
-   `Error` - the response error message. This is `null` if successful.
    
-   `Context` - the ID of the custom field created.