Create Contact Field
Create new Contact Fields. Please note, you can have up to 40 fields.
post
Authorizations
Api-TokenstringRequired
Pass the API token in the Api-Token
Body
namestring · max: 80Optional
data_typestring · enumOptionalPossible values:
merge_tagstring · max: 80Optional
Personalize your campaigns by adding a merge tag. This field will be replaced with unique contact details for each recipient.
Responses
201
Contact Field Created.
application/json
idintegerOptional
namestring · max: 80Optional
data_typestring · enumOptionalPossible values:
merge_tagstring · max: 80Optional
Personalize your campaigns by adding a merge tag. This field will be replaced with unique contact details for each recipient.
401
Returns unauthorized error message. Check your credentials.
application/json
403
Returns forbidden error message. Check your permissions.
application/json
422
Returns validation errors.
application/json
429
Rate limit exceeded for the current account.
application/json
500
Internal error. Retry later or contact support.
application/json
post/api/contacts/fields
curl -X POST https://mailtrap.io/api/contacts/fields \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name": "Company", "data_type": "text", "merge_tag": "company"}'
{
"id": 26730,
"name": "My Contact Field",
"data_type": "text",
"merge_tag": "my_contact_field"
}Last updated
Was this helpful?

