Available methods
-
-
Add a new merge field
POST /lists/{list_id}/merge-fields
Add a new merge field for a specific list.
Path parameters
list_id |
The unique id for the list. |
Request body parameters
tag |
Type: String |
Title: Merge Field Tag |
Read only: false |
The tag used in Mailchimp campaigns and for the /members endpoint. |
name |
Type: String |
Title: Merge Field Name |
Read only: false |
The name of the merge field. |
type |
Type: String |
Title: Merge Field Type |
Read only: false |
The type for the merge field.
Possible Values:
- text
- number
- address
- phone
- date
- url
- imageurl
- radio
- dropdown
- birthday
- zip
|
required |
Type: Boolean |
Title: Required |
Read only: false |
The boolean value if the merge field is required. |
default_value |
Type: String |
Title: Default Value |
Read only: false |
The default value for the merge field if null . |
public |
Type: Boolean |
Title: Merge Field Public Status |
Read only: false |
Whether the merge field is displayed on the signup form. |
display_order |
Type: Integer |
Title: Display Order |
Read only: false |
The order that the merge field displays on the list signup form. |
options |
Type: Object |
Title: Merge Field Options |
Read only: false |
Extra options for some merge field types. |
Show properties
default_country |
Type: Integer |
Title: Default Country |
Read only: false |
In an address field, the default country code if none supplied. |
phone_format |
Type: String |
Title: Phone Type |
Read only: false |
In a phone field, the phone number type: US or International. |
date_format |
Type: String |
Title: Date Type |
Read only: false |
In a date or birthday field, the format of the date. |
choices |
Type: Array |
Title: Choices |
Read only: false |
In a radio or dropdown non-group field, the available options for members to pick from. |
size |
Type: Integer |
Title: Text Field Size |
Read only: false |
In a text field, the default length of the text field. |
|
help_text |
Type: String |
Title: Merge Field Help Text |
Read only: false |
Extra text to help the subscriber fill out the form. |
Response body parameters
merge_id |
Type: Integer |
Title: Merge Field ID |
Read only: true |
An unchanging id for the merge field. |
tag |
Type: String |
Title: Merge Field Tag |
Read only: false |
The tag used in Mailchimp campaigns and for the /members endpoint. |
name |
Type: String |
Title: Merge Field Name |
Read only: false |
The name of the merge field. |
type |
Type: String |
Title: Merge Field Type |
Read only: true |
The type for the merge field. |
required |
Type: Boolean |
Title: Required |
Read only: false |
The boolean value if the merge field is required. |
default_value |
Type: String |
Title: Default Value |
Read only: false |
The default value for the merge field if null . |
public |
Type: Boolean |
Title: Merge Field Public Status |
Read only: false |
Whether the merge field is displayed on the signup form. |
display_order |
Type: Integer |
Title: Display Order |
Read only: false |
The order that the merge field displays on the list signup form. |
options |
Type: Object |
Title: Merge Field Options |
Read only: false |
Extra options for some merge field types. |
Show properties
default_country |
Type: Integer |
Title: Default Country |
Read only: false |
In an address field, the default country code if none supplied. |
phone_format |
Type: String |
Title: Phone Type |
Read only: false |
In a phone field, the phone number type: US or International. |
date_format |
Type: String |
Title: Date Type |
Read only: false |
In a date or birthday field, the format of the date. |
choices |
Type: Array |
Title: Choices |
Read only: false |
In a radio or dropdown non-group field, the available options for members to pick from. |
size |
Type: Integer |
Title: Text Field Size |
Read only: true |
In a text field, the default length of the text field. |
|
help_text |
Type: String |
Title: Merge Field Help Text |
Read only: false |
Extra text to help the subscriber fill out the form. |
list_id |
Type: String |
Title: List ID |
Read only: true |
A string that identifies this merge field collections’ list. |
_links |
Type: Array |
Title: Links |
Read only: true |
A list of link types and descriptions for the API schema documents. |
Show properties
rel |
Type: String |
Title: Rel |
Read only: true |
As with an HTML ‘rel’ attribute, this describes the type of link. |
href |
Type: String |
Title: Href |
Read only: true |
This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action. |
method |
Type: String |
Title: Method |
Read only: true |
The HTTP method that should be used when accessing the URL defined in ‘href’.
Possible Values:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
- HEAD
|
targetSchema |
Type: String |
Title: Target Schema |
Read only: true |
For GETs, this is a URL representing the schema that the response should conform to. |
schema |
Type: String |
Title: Schema |
Read only: true |
For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to. |
|
Example request
curl --request POST \
--url 'https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields' \
--user 'anystring:apikey' \
--header 'content-type: application/json' \
--data '{"name":"FAVORITEJOKE", "type":"text"}' \
--include
Example response
HTTP/1.1 200 OK
Server: nginx
Content-Type: application/json; charset=utf-8
Content-Length: 992
Vary: Accept-Encoding
X-Request-Id: bd7aa329-e233-4679-a854-15466373df22
Link: <https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json>; rel="describedBy"
Date: Wed, 16 Sep 2015 21:03:36 GMT
Connection: keep-alive
{
"merge_id": 3,
"tag": "MMERGE3",
"name": "FAVORITEJOKE",
"type": "text",
"required": false,
"default_value": "",
"public": false,
"display_order": 6,
"options": {
"size": 25
},
"help_text": "",
"list_id": "57afe96172",
"_links": [
{
"rel": "self",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "parent",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Collection.json",
"schema": "https://api.mailchimp.com/schema/3.0/CollectionLinks/Lists/MergeFields.json"
},
{
"rel": "update",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "PATCH",
"schema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "delete",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "DELETE"
}
]
}
Error response
type |
Type: String |
Title: Problem Type |
Read only: false |
An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type. |
title |
Type: String |
Title: Error Title |
Read only: false |
A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization. |
status |
Type: Integer |
Title: HTTP Status Code |
Read only: false |
The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem. |
detail |
Type: String |
Title: Error Message |
Read only: false |
A human-readable explanation specific to this occurrence of the problem. Learn more about errors. |
instance |
Type: String |
Title: Instance ID |
Read only: false |
A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support. |
-
-
Get all merge fields for a list
GET /lists/{list_id}/merge-fields
Get a list of all merge fields (formerly merge vars) for a list.
Path parameters
list_id |
The unique id for the list. |
Query string parameters
fields |
Type: Array |
Title: Fields |
Read only: false |
A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. |
exclude_fields |
Type: Array |
Title: Exclude Fields |
Read only: false |
A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. |
count |
Type: Integer |
Title: Count |
Read only: true |
The number of records to return. Default value is 10. |
offset |
Type: Integer |
Title: Offset |
Read only: false |
The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. Default value is 0. |
type |
Type: String |
Title: Merge Type |
Read only: false |
The merge field type. |
required |
Type: Boolean |
Title: Required |
Read only: false |
The boolean value if the merge field is required. |
Response body parameters
merge_fields |
Type: Array |
Title: Merge Fields |
Read only: false |
An array of objects, each representing a merge field resource. |
Show properties
merge_id |
Type: Integer |
Title: Merge Field ID |
Read only: true |
An unchanging id for the merge field. |
tag |
Type: String |
Title: Merge Field Tag |
Read only: false |
The tag used in Mailchimp campaigns and for the /members endpoint. |
name |
Type: String |
Title: Merge Field Name |
Read only: false |
The name of the merge field. |
type |
Type: String |
Title: Merge Field Type |
Read only: true |
The type for the merge field. |
required |
Type: Boolean |
Title: Required |
Read only: false |
The boolean value if the merge field is required. |
default_value |
Type: String |
Title: Default Value |
Read only: false |
The default value for the merge field if null . |
public |
Type: Boolean |
Title: Merge Field Public Status |
Read only: false |
Whether the merge field is displayed on the signup form. |
display_order |
Type: Integer |
Title: Display Order |
Read only: false |
The order that the merge field displays on the list signup form. |
options |
Type: Object |
Title: Merge Field Options |
Read only: false |
Extra options for some merge field types. |
Show properties
default_country |
Type: Integer |
Title: Default Country |
Read only: false |
In an address field, the default country code if none supplied. |
phone_format |
Type: String |
Title: Phone Type |
Read only: false |
In a phone field, the phone number type: US or International. |
date_format |
Type: String |
Title: Date Type |
Read only: false |
In a date or birthday field, the format of the date. |
choices |
Type: Array |
Title: Choices |
Read only: false |
In a radio or dropdown non-group field, the available options for members to pick from. |
size |
Type: Integer |
Title: Text Field Size |
Read only: true |
In a text field, the default length of the text field. |
|
help_text |
Type: String |
Title: Merge Field Help Text |
Read only: false |
Extra text to help the subscriber fill out the form. |
list_id |
Type: String |
Title: List ID |
Read only: true |
A string that identifies this merge field collections’ list. |
_links |
Type: Array |
Title: Links |
Read only: true |
A list of link types and descriptions for the API schema documents. |
Show properties
rel |
Type: String |
Title: Rel |
Read only: true |
As with an HTML ‘rel’ attribute, this describes the type of link. |
href |
Type: String |
Title: Href |
Read only: true |
This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action. |
method |
Type: String |
Title: Method |
Read only: true |
The HTTP method that should be used when accessing the URL defined in ‘href’.
Possible Values:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
- HEAD
|
targetSchema |
Type: String |
Title: Target Schema |
Read only: true |
For GETs, this is a URL representing the schema that the response should conform to. |
schema |
Type: String |
Title: Schema |
Read only: true |
For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to. |
|
|
list_id |
Type: String |
Title: List ID |
Read only: true |
The list id. |
total_items |
Type: Integer |
Title: Item Count |
Read only: false |
The total number of items matching the query regardless of pagination. |
_links |
Type: Array |
Title: Links |
Read only: true |
A list of link types and descriptions for the API schema documents. |
Show properties
rel |
Type: String |
Title: Rel |
Read only: true |
As with an HTML ‘rel’ attribute, this describes the type of link. |
href |
Type: String |
Title: Href |
Read only: true |
This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action. |
method |
Type: String |
Title: Method |
Read only: true |
The HTTP method that should be used when accessing the URL defined in ‘href’.
Possible Values:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
- HEAD
|
targetSchema |
Type: String |
Title: Target Schema |
Read only: true |
For GETs, this is a URL representing the schema that the response should conform to. |
schema |
Type: String |
Title: Schema |
Read only: true |
For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to. |
|
Example request
curl --request GET \
--url 'https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields' \
--user 'anystring:apikey' \
--include
Example response
HTTP/1.1 200 OK
Server: nginx
Content-Type: application/json; charset=utf-8
Content-Length: 2697
Vary: Accept-Encoding
X-Request-Id: 70cdda27-b6c4-4031-9c7b-301ccb7edd1d
Link: <https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Collection.json>; rel="describedBy"
Date: Wed, 16 Sep 2015 20:54:04 GMT
Connection: keep-alive
{
"merge_fields": [
{
"merge_id": 1,
"tag": "FNAME",
"name": "First Name",
"type": "text",
"required": false,
"default_value": "",
"public": true,
"display_order": 2,
"options": {
"size": 25
},
"help_text": "",
"list_id": "57afe96172",
"_links": [
{
"rel": "self",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/1",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "parent",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Collection.json",
"schema": "https://api.mailchimp.com/schema/3.0/CollectionLinks/Lists/MergeFields.json"
},
{
"rel": "update",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/1",
"method": "PATCH",
"schema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "delete",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/1",
"method": "DELETE"
}
]
},
{
"merge_id": 2,
"tag": "LNAME",
"name": "Last Name",
"type": "text",
"required": false,
"default_value": "",
"public": true,
"display_order": 3,
"options": {
"size": 25
},
"help_text": "",
"list_id": "57afe96172",
"_links": [
{
"rel": "self",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/2",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "parent",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Collection.json",
"schema": "https://api.mailchimp.com/schema/3.0/CollectionLinks/Lists/MergeFields.json"
},
{
"rel": "update",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/2",
"method": "PATCH",
"schema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "delete",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/2",
"method": "DELETE"
}
]
}
],
"list_id": "57afe96172",
"_links": [
{
"rel": "self",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Collection.json",
"schema": "https://api.mailchimp.com/schema/3.0/CollectionLinks/Lists/MergeFields.json"
},
{
"rel": "create",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields",
"method": "POST",
"schema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "parent",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"
}
],
"total_items": 2
}
Error response
type |
Type: String |
Title: Problem Type |
Read only: false |
An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type. |
title |
Type: String |
Title: Error Title |
Read only: false |
A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization. |
status |
Type: Integer |
Title: HTTP Status Code |
Read only: false |
The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem. |
detail |
Type: String |
Title: Error Message |
Read only: false |
A human-readable explanation specific to this occurrence of the problem. Learn more about errors. |
instance |
Type: String |
Title: Instance ID |
Read only: false |
A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support. |
Get a specific merge field
GET /lists/{list_id}/merge-fields/{merge_id}
Get information about a specific merge field in a list.
Path parameters
list_id |
The unique id for the list. |
merge_id |
The id for the merge field. |
Query string parameters
exclude_fields |
Type: Array |
Title: Exclude Fields |
Read only: false |
A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. |
fields |
Type: Array |
Title: Fields |
Read only: false |
A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. |
Response body parameters
merge_id |
Type: Integer |
Title: Merge Field ID |
Read only: true |
An unchanging id for the merge field. |
tag |
Type: String |
Title: Merge Field Tag |
Read only: false |
The tag used in Mailchimp campaigns and for the /members endpoint. |
name |
Type: String |
Title: Merge Field Name |
Read only: false |
The name of the merge field. |
type |
Type: String |
Title: Merge Field Type |
Read only: true |
The type for the merge field. |
required |
Type: Boolean |
Title: Required |
Read only: false |
The boolean value if the merge field is required. |
default_value |
Type: String |
Title: Default Value |
Read only: false |
The default value for the merge field if null . |
public |
Type: Boolean |
Title: Merge Field Public Status |
Read only: false |
Whether the merge field is displayed on the signup form. |
display_order |
Type: Integer |
Title: Display Order |
Read only: false |
The order that the merge field displays on the list signup form. |
options |
Type: Object |
Title: Merge Field Options |
Read only: false |
Extra options for some merge field types. |
Show properties
default_country |
Type: Integer |
Title: Default Country |
Read only: false |
In an address field, the default country code if none supplied. |
phone_format |
Type: String |
Title: Phone Type |
Read only: false |
In a phone field, the phone number type: US or International. |
date_format |
Type: String |
Title: Date Type |
Read only: false |
In a date or birthday field, the format of the date. |
choices |
Type: Array |
Title: Choices |
Read only: false |
In a radio or dropdown non-group field, the available options for members to pick from. |
size |
Type: Integer |
Title: Text Field Size |
Read only: true |
In a text field, the default length of the text field. |
|
help_text |
Type: String |
Title: Merge Field Help Text |
Read only: false |
Extra text to help the subscriber fill out the form. |
list_id |
Type: String |
Title: List ID |
Read only: true |
A string that identifies this merge field collections’ list. |
_links |
Type: Array |
Title: Links |
Read only: true |
A list of link types and descriptions for the API schema documents. |
Show properties
rel |
Type: String |
Title: Rel |
Read only: true |
As with an HTML ‘rel’ attribute, this describes the type of link. |
href |
Type: String |
Title: Href |
Read only: true |
This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action. |
method |
Type: String |
Title: Method |
Read only: true |
The HTTP method that should be used when accessing the URL defined in ‘href’.
Possible Values:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
- HEAD
|
targetSchema |
Type: String |
Title: Target Schema |
Read only: true |
For GETs, this is a URL representing the schema that the response should conform to. |
schema |
Type: String |
Title: Schema |
Read only: true |
For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to. |
|
Example request
curl --request GET \
--url 'https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3' \
--user 'anystring:apikey' \
--include
Example response
HTTP/1.1 200 OK
Server: nginx
Content-Type: application/json; charset=utf-8
Content-Length: 992
Vary: Accept-Encoding
X-Request-Id: 9d3853fc-5538-4463-902e-4521c20c253a
Link: <https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json>; rel="describedBy"
Date: Wed, 16 Sep 2015 21:06:58 GMT
Connection: keep-alive
{
"merge_id": 3,
"tag": "MMERGE3",
"name": "FAVORITEJOKE",
"type": "text",
"required": false,
"default_value": "",
"public": false,
"display_order": 6,
"options": {
"size": 25
},
"help_text": "",
"list_id": "57afe96172",
"_links": [
{
"rel": "self",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "parent",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Collection.json",
"schema": "https://api.mailchimp.com/schema/3.0/CollectionLinks/Lists/MergeFields.json"
},
{
"rel": "update",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "PATCH",
"schema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "delete",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "DELETE"
}
]
}
Error response
type |
Type: String |
Title: Problem Type |
Read only: false |
An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type. |
title |
Type: String |
Title: Error Title |
Read only: false |
A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization. |
status |
Type: Integer |
Title: HTTP Status Code |
Read only: false |
The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem. |
detail |
Type: String |
Title: Error Message |
Read only: false |
A human-readable explanation specific to this occurrence of the problem. Learn more about errors. |
instance |
Type: String |
Title: Instance ID |
Read only: false |
A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support. |
-
-
Update a merge field
PATCH /lists/{list_id}/merge-fields/{merge_id}
Update a specific merge field in a list.
Path parameters
list_id |
The unique id for the list. |
merge_id |
The id for the merge field. |
Request body parameters
tag |
Type: String |
Title: Merge Field Tag |
Read only: false |
The tag used in Mailchimp campaigns and for the /members endpoint. |
name |
Type: String |
Title: Merge Field Name |
Read only: false |
The name of the merge field. |
required |
Type: Boolean |
Title: Required |
Read only: false |
The boolean value if the merge field is required. |
default_value |
Type: String |
Title: Default Value |
Read only: false |
The default value for the merge field if null . |
public |
Type: Boolean |
Title: Merge Field Public Status |
Read only: false |
Whether the merge field is displayed on the signup form. |
display_order |
Type: Integer |
Title: Display Order |
Read only: false |
The order that the merge field displays on the list signup form. |
options |
Type: Object |
Title: Merge Field Options |
Read only: false |
Extra options for some merge field types. |
Show properties
default_country |
Type: Integer |
Title: Default Country |
Read only: false |
In an address field, the default country code if none supplied. |
phone_format |
Type: String |
Title: Phone Type |
Read only: false |
In a phone field, the phone number type: US or International. |
date_format |
Type: String |
Title: Date Type |
Read only: false |
In a date or birthday field, the format of the date. |
choices |
Type: Array |
Title: Choices |
Read only: false |
In a radio or dropdown non-group field, the available options for members to pick from. |
|
help_text |
Type: String |
Title: Merge Field Help Text |
Read only: false |
Extra text to help the subscriber fill out the form. |
Response body parameters
merge_id |
Type: Integer |
Title: Merge Field ID |
Read only: true |
An unchanging id for the merge field. |
tag |
Type: String |
Title: Merge Field Tag |
Read only: false |
The tag used in Mailchimp campaigns and for the /members endpoint. |
name |
Type: String |
Title: Merge Field Name |
Read only: false |
The name of the merge field. |
type |
Type: String |
Title: Merge Field Type |
Read only: true |
The type for the merge field. |
required |
Type: Boolean |
Title: Required |
Read only: false |
The boolean value if the merge field is required. |
default_value |
Type: String |
Title: Default Value |
Read only: false |
The default value for the merge field if null . |
public |
Type: Boolean |
Title: Merge Field Public Status |
Read only: false |
Whether the merge field is displayed on the signup form. |
display_order |
Type: Integer |
Title: Display Order |
Read only: false |
The order that the merge field displays on the list signup form. |
options |
Type: Object |
Title: Merge Field Options |
Read only: false |
Extra options for some merge field types. |
Show properties
default_country |
Type: Integer |
Title: Default Country |
Read only: false |
In an address field, the default country code if none supplied. |
phone_format |
Type: String |
Title: Phone Type |
Read only: false |
In a phone field, the phone number type: US or International. |
date_format |
Type: String |
Title: Date Type |
Read only: false |
In a date or birthday field, the format of the date. |
choices |
Type: Array |
Title: Choices |
Read only: false |
In a radio or dropdown non-group field, the available options for members to pick from. |
size |
Type: Integer |
Title: Text Field Size |
Read only: true |
In a text field, the default length of the text field. |
|
help_text |
Type: String |
Title: Merge Field Help Text |
Read only: false |
Extra text to help the subscriber fill out the form. |
list_id |
Type: String |
Title: List ID |
Read only: true |
A string that identifies this merge field collections’ list. |
_links |
Type: Array |
Title: Links |
Read only: true |
A list of link types and descriptions for the API schema documents. |
Show properties
rel |
Type: String |
Title: Rel |
Read only: true |
As with an HTML ‘rel’ attribute, this describes the type of link. |
href |
Type: String |
Title: Href |
Read only: true |
This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action. |
method |
Type: String |
Title: Method |
Read only: true |
The HTTP method that should be used when accessing the URL defined in ‘href’.
Possible Values:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
- HEAD
|
targetSchema |
Type: String |
Title: Target Schema |
Read only: true |
For GETs, this is a URL representing the schema that the response should conform to. |
schema |
Type: String |
Title: Schema |
Read only: true |
For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to. |
|
Example request
curl --request PATCH \
--url 'https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3' \
--user 'anystring:apikey' \
--header 'content-type: application/json' \
--data '{"name":"FAVORITEHAT", "type":"text", "required":true}' \
--include
Example response
HTTP/1.1 200 OK
Server: nginx
Content-Type: application/json; charset=utf-8
Content-Length: 990
Vary: Accept-Encoding
X-Request-Id: a6e06793-b2bd-4c37-b444-f8265bada66a
Link: <https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json>; rel="describedBy"
Date: Wed, 16 Sep 2015 21:11:31 GMT
Connection: keep-alive
{
"merge_id": 3,
"tag": "MMERGE3",
"name": "FAVORITEHAT",
"type": "text",
"required": true,
"default_value": "",
"public": false,
"display_order": 6,
"options": {
"size": 25
},
"help_text": "",
"list_id": "57afe96172",
"_links": [
{
"rel": "self",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "parent",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields",
"method": "GET",
"targetSchema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Collection.json",
"schema": "https://api.mailchimp.com/schema/3.0/CollectionLinks/Lists/MergeFields.json"
},
{
"rel": "update",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "PATCH",
"schema": "https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json"
},
{
"rel": "delete",
"href": "https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3",
"method": "DELETE"
}
]
}
Error response
type |
Type: String |
Title: Problem Type |
Read only: false |
An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type. |
title |
Type: String |
Title: Error Title |
Read only: false |
A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization. |
status |
Type: Integer |
Title: HTTP Status Code |
Read only: false |
The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem. |
detail |
Type: String |
Title: Error Message |
Read only: false |
A human-readable explanation specific to this occurrence of the problem. Learn more about errors. |
instance |
Type: String |
Title: Instance ID |
Read only: false |
A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support. |
-
-
Delete a merge field
DELETE /lists/{list_id}/merge-fields/{merge_id}
Delete a specific merge field in a list.
Path parameters
list_id |
The unique id for the list. |
merge_id |
The id for the merge field. |
Example request
curl --request DELETE \
--url 'https://usX.api.mailchimp.com/3.0/lists/57afe96172/merge-fields/3' \
--user 'anystring:apikey' \
--include
Example response
HTTP/1.1 204 No Content
Server: nginx
Content-Type: application/json; charset=utf-8
Content-Length: 2
X-Request-Id: fc47a558-5743-47bc-805c-aeee9e00162b
Date: Wed, 16 Sep 2015 21:13:23 GMT
Connection: keep-alive
Error response
type |
Type: String |
Title: Problem Type |
Read only: false |
An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type. |
title |
Type: String |
Title: Error Title |
Read only: false |
A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization. |
status |
Type: Integer |
Title: HTTP Status Code |
Read only: false |
The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem. |
detail |
Type: String |
Title: Error Message |
Read only: false |
A human-readable explanation specific to this occurrence of the problem. Learn more about errors. |
instance |
Type: String |
Title: Instance ID |
Read only: false |
A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support. |