> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ecomail.cz/llms.txt
> Use this file to discover all available pages before exploring further.

# Update bulk subscribers

> Update multiple existing subscribers in a specific list in a single request.

<ParamField path="list_id" type="integer" required>
  ID of the list.
</ParamField>

<ParamField body="subscriber_data" type="array" required>
  Array of subscriber objects to update. Limited to 3000 subscribers per call.

  <Expandable title="subscriber object properties">
    <ParamField body="subscriber_data[][email]" type="string" required>
      Email address of the subscriber to update.
    </ParamField>

    <ParamField body="subscriber_data[][name]" type="string">
      First name.
    </ParamField>

    <ParamField body="subscriber_data[][surname]" type="string">
      Last name.
    </ParamField>

    <ParamField body="subscriber_data[][status]" type="integer">
      Subscriber status. `1` = subscribed, `2` = unsubscribed, `4` = hard bounce.
    </ParamField>

    <ParamField body="subscriber_data[][custom_fields]" type="object">
      Custom field values. Limited to 5000 characters total.

      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.
    </ParamField>

    <ParamField body="subscriber_data[][tags]" type="array">
      Subscriber tags. Limited to 2000 characters total and 50 characters per tag. Content overwrites current tags.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="allow_resubscribe" type="boolean" default="false">
  Allow resubscribing previously unsubscribed contacts when `status` is set to `1`.
</ParamField>

<Warning>
  Maximum of 3000 subscribers per call. Subscribers above the limit are silently ignored.
</Warning>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT https://api2.ecomailapp.cz/lists/1/update-subscribers-bulk \
    -H "key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "subscriber_data": [
        {
          "email": "foo@bar.cz",
          "name": "Jan",
          "surname": "Novak",
          "custom_fields": { "shop": "myshop.cz" },
          "tags": ["vip"]
        },
        {
          "email": "foo2@bar.cz",
          "name": "Jana"
        }
      ],
      "allow_resubscribe": false
    }'
  ```

  ```php PHP theme={null}
  $listId = 1;
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/update-subscribers-bulk");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'key: YOUR_API_KEY',
      'Content-Type: application/json',
  ]);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
      'subscriber_data' => [
          [
              'email' => 'foo@bar.cz',
              'name' => 'Jan',
              'surname' => 'Novak',
              'custom_fields' => ['shop' => 'myshop.cz'],
              'tags' => ['vip'],
          ],
          [
              'email' => 'foo2@bar.cz',
              'name' => 'Jana',
          ],
      ],
      'allow_resubscribe' => false,
  ]));
  $response = curl_exec($ch);
  curl_close($ch);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "updates": 2
  }
  ```

  ```json 400 theme={null}
  {
    "errors": {
      "subscriber_data.0.email": ["Invalid email address"],
      "subscriber_data.0.custom_fields": [
        "Custom fields must be an array with unique keys (case-insensitive)",
        "Subscriber custom fields must be an array with max 5000 bytes"
      ]
    }
  }
  ```
</ResponseExample>
