POST
/
v1
/
contacts
curl --request POST \
  --url https://api.mailsparky.com/v1/contacts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '{
  "email": "<string>",
  "subscribed": true,
  "data": {}
}'
{
    "success": true,
    "id": "80d74d13-16eb-48c5-bc2b-aae6fd5865cc",
    "email": "hello@mailsparky.com",
    "subscribed": true,
    "data": {
        "project": "MailSparky"
    },
    "createdAt": "2021-01-01T00:00:00.000Z",
    "updatedAt": "2021-01-01T00:00:00.000Z"
}

Trong hầu hết các trường hợp, bạn nên sử dụng track để tạo contact. Khi 1 contact sử track API thì liên hệ đó sẽ được tự động tạo trong danh bạ.

Body

email
string
required

The email address of the contact.

subscribed
boolean
required

Whether the contact is subscribed to marketing emails.

data
object

Metadata to store with the contact.

Headers

Content-Type
string
required

application/json

Response

{
    "success": true,
    "id": "80d74d13-16eb-48c5-bc2b-aae6fd5865cc",
    "email": "hello@mailsparky.com",
    "subscribed": true,
    "data": {
        "project": "MailSparky"
    },
    "createdAt": "2021-01-01T00:00:00.000Z",
    "updatedAt": "2021-01-01T00:00:00.000Z"
}