Create a new Contact
Create a new contact
post
Authorizations
Api-TokenstringRequired
Pass the API token in the Api-Token
Body
Responses
201
Contact created successfully.
application/json
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
curl -X POST https://mailtrap.io/api/contacts \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"contact": {
"email": "john.smith@example.com",
"fields": {"first_name": "John", "last_name": "Smith", "company": "Example Inc"},
"list_ids": [1, 2, 3]
}
}'
{
"data": {
"id": "018dd5e3-f6d2-7c00-8f9b-e5c3f2d8a132",
"status": "subscribed",
"email": "john.smith@example.com",
"fields": {
"first_name": "John",
"last_name": "Smith"
},
"list_ids": [
1,
2,
3
],
"created_at": 1742820600230,
"updated_at": 1742820600230
}
}Last updated
Was this helpful?

