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
curl
Response
| Status | Description | Headers | Schema |
|---|---|---|---|
| 200 OK | The request is successful. | Content-Type/json | N/A |
json
-
Code- the response code. This is0if successful. -
Error- the response error message. This isnullif successful. -
Context- the ID of the custom field created.
If you have suggestions for improving this article, let us know!