For the complete documentation index, see llms.txt. This page is also available as Markdown.

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
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?