Skip to main content
POST
/
lists
/
{list_id}
/
subscribe-bulk
curl -X POST https://api2.ecomailapp.cz/lists/1/subscribe-bulk \
  -H "key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subscriber_data": [
      {
        "name": "Foo",
        "surname": "Bar",
        "email": "foo@bar.cz",
        "custom_fields": { "category": "customer" }
      },
      {
        "name": "Foo 2",
        "email": "foo2@bar.cz"
      }
    ],
    "update_existing": true,
    "resubscribe": false,
    "trigger_autoresponders": false
  }'
$listId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/subscribe-bulk");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'key: YOUR_API_KEY',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'subscriber_data' => [
        [
            'name' => 'Foo',
            'surname' => 'Bar',
            'email' => 'foo@bar.cz',
            'custom_fields' => ['category' => 'customer'],
        ],
        [
            'name' => 'Foo 2',
            'email' => 'foo2@bar.cz',
        ],
    ],
    'update_existing' => true,
    'resubscribe' => false,
    'trigger_autoresponders' => false,
]));
$response = curl_exec($ch);
curl_close($ch);
{
  "inserts": 2
}
{
  "errors": {
    "subscriber_data.0": {
      "email": ["Invalid email address"],
      "custom_fields": [
        "Custom fields must be an array with unique keys (case-insensitive)",
        "Subscriber custom fields must be an array with max 5000 bytes"
      ]
    },
    "subscriber_data.1": { "email": ["Invalid email address"] }
  }
}
list_id
integer
required
ID of the list.
subscriber_data
array
required
Array of subscriber objects. Limited to 3000 subscribers per call — subscribers above the limit are ignored.
update_existing
boolean
default:"true"
Update subscribers that already exist in the list.
resubscribe
boolean
default:"false"
Force resubscribe if the subscriber was previously unsubscribed.
trigger_autoresponders
boolean
default:"false"
Trigger automations when subscribers are added.
Maximum of 3000 subscribers per call. Subscribers above the limit are silently ignored.
Subscribers added via bulk subscribe always skip double opt-in confirmation. Custom fields are limited to 5000 characters total. Custom field keys are case-insensitive — they are trimmed and lowercased on input, so SHOP, shop and Shop are treated as the same field; two keys that differ only in case or whitespace within the same subscriber are rejected as duplicates. Tags are limited to 2000 characters total and 50 characters per tag — tag content only updates when the tags parameter is present and update_existing is true.
curl -X POST https://api2.ecomailapp.cz/lists/1/subscribe-bulk \
  -H "key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subscriber_data": [
      {
        "name": "Foo",
        "surname": "Bar",
        "email": "foo@bar.cz",
        "custom_fields": { "category": "customer" }
      },
      {
        "name": "Foo 2",
        "email": "foo2@bar.cz"
      }
    ],
    "update_existing": true,
    "resubscribe": false,
    "trigger_autoresponders": false
  }'
$listId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/subscribe-bulk");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'key: YOUR_API_KEY',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'subscriber_data' => [
        [
            'name' => 'Foo',
            'surname' => 'Bar',
            'email' => 'foo@bar.cz',
            'custom_fields' => ['category' => 'customer'],
        ],
        [
            'name' => 'Foo 2',
            'email' => 'foo2@bar.cz',
        ],
    ],
    'update_existing' => true,
    'resubscribe' => false,
    'trigger_autoresponders' => false,
]));
$response = curl_exec($ch);
curl_close($ch);
{
  "inserts": 2
}
{
  "errors": {
    "subscriber_data.0": {
      "email": ["Invalid email address"],
      "custom_fields": [
        "Custom fields must be an array with unique keys (case-insensitive)",
        "Subscriber custom fields must be an array with max 5000 bytes"
      ]
    },
    "subscriber_data.1": { "email": ["Invalid email address"] }
  }
}