Skip to main content
POST
/
api
/
v1
/
contacts
Utwórz kontakt
curl --request POST \
  --url https://api.example.com/api/v1/contacts \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "first_name": "<string>",
  "last_name": "<string>",
  "phone": "<string>",
  "tags": [
    {}
  ],
  "list_id": 123,
  "list_name": "<string>"
}
'
{
  "success": true,
  "data": {
    "id": 456,
    "email": "[email protected]",
    "first_name": "Jane",
    "last_name": "Smith",
    "phone": "+1234567890",
    "tags": ["customer", "vip"],
    "lead_score": 0,
    "created_at": "2025-12-30T09:00:00",
    "updated_at": "2025-12-30T09:00:00"
  },
  "message": "Contact created successfully"
}

Treść żądania

email
string
required
Adres email kontaktu (wymagany i musi być prawidłowy)
first_name
string
Imię kontaktu
last_name
string
Nazwisko kontaktu
phone
string
Numer telefonu kontaktu
tags
array
Tablica nazw tagów do przypisania kontaktowi
list_id
integer
ID listy mailingowej do której dodać kontakt (opcjonalne)
list_name
string
Nazwa listy mailingowej do której dodać kontakt (alternatywa dla list_id)

Odpowiedź

success
boolean
Wskazuje czy żądanie zakończyło się sukcesem
data
object
Obiekt kontaktu
message
string
Komunikat sukcesu

Przykład

curl -X POST https://api.mailist.com/api/v1/contacts \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "first_name": "Jane",
    "last_name": "Smith",
    "phone": "+1234567890",
    "tags": ["customer", "vip"],
    "list_id": 123
  }'

Odpowiedź

{
  "success": true,
  "data": {
    "id": 456,
    "email": "[email protected]",
    "first_name": "Jane",
    "last_name": "Smith",
    "phone": "+1234567890",
    "tags": ["customer", "vip"],
    "lead_score": 0,
    "created_at": "2025-12-30T09:00:00",
    "updated_at": "2025-12-30T09:00:00"
  },
  "message": "Contact created successfully"
}