Skip to main content
POST
/
api
/
v1
/
lists
Utwórz listę kontaktów
curl --request POST \
  --url https://api.example.com/api/v1/lists \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "is_active": true
}
'
{
  "success": true,
  "data": {
    "id": 123,
    "name": "<string>",
    "description": "<string>",
    "is_active": true,
    "contact_count": 123,
    "created_at": "<string>",
    "updated_at": "<string>"
  },
  "message": "<string>"
}

Treść żądania

name
string
required
Nazwa listy (1-255 znaków, wymagane)
description
string
Opis listy (max 1000 znaków, opcjonalne)
is_active
boolean
default:"true"
Czy lista jest aktywna

Response

success
boolean
Indicates if the request was successful
data
object
Created contact list object
message
string
Success message

Example request

curl -X POST https://api.mailist.com/api/v1/lists \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product Updates",
    "description": "Subscribers interested in product announcements",
    "is_active": true
  }'

Example response

{
  "success": true,
  "data": {
    "id": 125,
    "name": "Product Updates",
    "description": "Subscribers interested in product announcements",
    "is_active": true,
    "contact_count": 0,
    "created_at": "2025-12-30T09:00:00",
    "updated_at": "2025-12-30T09:00:00"
  },
  "message": "Contact list created successfully"
}

Error responses

Invalid request

{
  "success": false,
  "error": {
    "message": "List name is required",
    "code": "INVALID_REQUEST"
  }
}

Uwagi

  • Ten endpoint wymaga uprawnienia lists.write dla klucza API
  • Nazwy list muszą być unikalne w ramach konta
  • Nowe listy zaczynają z 0 kontaktami - użyj POST /lists//contacts aby dodać kontakty