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

# Update List

> Update an existing contact list

Update properties of an existing contact list including name, description, and custom fields.

## Path Parameters

<ParamField path="id" type="string" required>
  The unique list ID (e.g., `lst_abc123`).
</ParamField>

## Request Body

<ParamField body="name" type="string">
  New list name (max 100 characters).
</ParamField>

<ParamField body="description" type="string">
  New description (max 500 characters).
</ParamField>

<ParamField body="customFields" type="array">
  Updated custom field definitions. Replaces existing fields.

  <Expandable title="Custom field object">
    <ParamField body="key" type="string" required>
      Field key used in API.
    </ParamField>

    <ParamField body="label" type="string" required>
      Display label.
    </ParamField>

    <ParamField body="type" type="string" required>
      Field type: `text`, `number`, `date`, `boolean`, or `select`.
    </ParamField>

    <ParamField body="required" type="boolean">
      Whether field is required.
    </ParamField>

    <ParamField body="defaultValue" type="any">
      Default value.
    </ParamField>

    <ParamField body="options" type="string[]">
      Required for `select` type.
    </ParamField>
  </Expandable>
</ParamField>

## Examples

<CodeGroup>
  ```typescript JavaScript theme={null}
  import { MailBreeze } from "mailbreeze";

  const mailbreeze = new MailBreeze({ apiKey: "sk_live_xxx" });

  // Update name and description
  const list = await mailbreeze.lists.update("lst_abc123", {
    name: "Premium Newsletter",
    description: "Updated description",
  });

  // Add new custom field
  const list = await mailbreeze.lists.update("lst_abc123", {
    customFields: [
      { key: "company", label: "Company", type: "text" },
      { key: "industry", label: "Industry", type: "select", options: ["tech", "finance", "healthcare"] },
    ],
  });

  console.log(list.updatedAt); // "2024-01-20T14:15:00Z"
  ```

  ```python Python theme={null}
  from mailbreeze import MailBreeze

  client = MailBreeze(api_key="sk_live_xxx")

  # Update name and description
  list = await client.lists.update("lst_abc123",
      name="Premium Newsletter",
      description="Updated description",
  )

  # Add new custom field
  list = await client.lists.update("lst_abc123",
      custom_fields=[
          {"key": "company", "label": "Company", "type": "text"},
          {"key": "industry", "label": "Industry", "type": "select", "options": ["tech", "finance"]},
      ],
  )

  print(list.updated_at)  # "2024-01-20T14:15:00Z"
  ```

  ```go Go theme={null}
  client := mailbreeze.NewClient("sk_live_xxx")

  // Update name and description
  list, err := client.Lists.Update(ctx, "lst_abc123", &mailbreeze.UpdateListParams{
      Name:        "Premium Newsletter",
      Description: "Updated description",
  })

  fmt.Println(list.UpdatedAt) // "2024-01-20T14:15:00Z"
  ```

  ```php PHP theme={null}
  $mailbreeze = new MailBreeze('sk_live_xxx');

  // Update name and description
  $list = $mailbreeze->lists->update('lst_abc123', [
      'name' => 'Premium Newsletter',
      'description' => 'Updated description',
  ]);

  echo $list['updatedAt']; // "2024-01-20T14:15:00Z"
  ```

  ```rust Rust theme={null}
  let client = Client::new("sk_live_xxx");

  // Update name and description
  let list = client.lists().update("lst_abc123", UpdateListParams {
      name: Some("Premium Newsletter".to_string()),
      description: Some("Updated description".to_string()),
      custom_fields: None,
  }).await?;

  println!("{}", list.updated_at); // "2024-01-20T14:15:00Z"
  ```

  ```bash cURL theme={null}
  curl -X PUT "https://api.mailbreeze.com/api/v1/contact-lists/lst_abc123" \
    -H "Authorization: Bearer sk_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Premium Newsletter",
      "description": "Updated description"
    }'
  ```
</CodeGroup>

## Response

Returns the updated contact list object.

```json Example Response theme={null}
{
  "success": true,
  "data": {
    "domainId": "6911cf4253eb3ff3b4de6215",
    "userId": "68da571fdc22fcf0773dcb33",
    "name": "Premium Newsletter",
    "description": "Updated description",
    "totalContacts": 1523,
    "activeContacts": 1520,
    "suppressedContacts": 3,
    "tags": [],
    "createdAt": "2025-12-27T11:22:14.221Z",
    "updatedAt": "2025-12-27T14:15:00.000Z",
    "id": "694fc1669e63563857ae8d72"
  },
  "meta": {
    "timestamp": "2025-12-27T14:15:00.123Z",
    "requestId": "abc123-def456",
    "path": "/api/v1/contact-lists/694fc1669e63563857ae8d72"
  }
}
```

## Errors

| Code               | HTTP Status | Description                     |
| ------------------ | ----------- | ------------------------------- |
| `NOT_FOUND`        | 404         | List with this ID doesn't exist |
| `VALIDATION_ERROR` | 400         | Invalid field values or format  |

<Warning>
  Updating `customFields` replaces the entire array. Include all fields you want to keep.
</Warning>
