> For the complete documentation index, see [llms.txt](https://api.senderwiz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.senderwiz.com/customer/contact-list/update-a-list.md).

# Update a List

### ✏️ Update a List

Update an existing subscriber list using its unique ID.

#### 🔹 HTTP Request

```http
PUT API-URL/lists/LIST-UNIQUE-ID
```

#### 🔸 URL Segments

| Segment          | Required | Description                              |
| ---------------- | -------- | ---------------------------------------- |
| `LIST-UNIQUE-ID` | Yes      | Unique identifier of the list to update. |

#### 🔐 Authorization Header

Include your customer API key:

```
X-API-KEY: your-api-key-here
```

#### 📝 PUT Parameters

| Parameter | Type  | Required | Description                                                                               |
| --------- | ----- | -------- | ----------------------------------------------------------------------------------------- |
| `data`    | array | Yes      | Array containing list details. Accepts `general`, `defaults`, and `notifications` blocks. |

***

#### 📦 `general` Block *(Required)*

| Parameter     | Type   | Required | Description       |
| ------------- | ------ | -------- | ----------------- |
| `name`        | string | Yes      | Name of the list. |
| `description` | string | No       | List description  |

***

#### 📦 `defaults` Block *(Optional)*

| Parameter    | Type   | Required | Description             |
| ------------ | ------ | -------- | ----------------------- |
| `from_name`  | string | Yes      | Sender's name.          |
| `from_email` | string | Yes      | Sender's email address. |
| `reply_to`   | string | Yes      | Reply-to email address. |
| `subject`    | string | No       | Default subject line.   |

***

#### 📦 `notifications` Block *(Optional)*

| Parameter        | Type   | Required | Description                                         |
| ---------------- | ------ | -------- | --------------------------------------------------- |
| `subscribe`      | Yes/No | No       | Notify on new subscriber (yes or no).               |
| `unsubscribe`    | Yes/No | No       | Notify on unsubscribe (yes or no).                  |
| `subscribe_to`   | string | No       | Email address to receive subscribe notifications.   |
| `unsubscribe_to` | string | No       | Email address to receive unsubscribe notifications. |

***

#### 💻 PHP Example

```php
// update list
$response = $endpoint->update('LIST-UNIQUE-ID', [
    // required
    'general' => [
        'name'          => 'API Test List - Updated!', // required
        'description'   => 'This is a test list, updated from the API.', // optional
    ],
    // optional
    'defaults' => [
        'from_name' => 'Emily Carter', // required
        'from_email'=> 'emily.carter@example.org', // required
        'reply_to'  => 'emily.carter@example.org', // required
        'subject'   => 'Welcome to Our Newsletter!', // required
    ],
    // optional
    'notifications' => [
        // notification when new subscriber added
        'subscribe'         => 'yes', // yes|no
        // notification when subscriber unsubscribes
        'unsubscribe'       => 'yes', // yes|no
        // where to send the notifications.
        'subscribe_to'      => 'emily.carter@example.org',
        'unsubscribe_to'    => 'emily.carter@example.org',
    ],
]);

// and get the response
echo '<pre>';
print_r($response->body);
echo '</pre>';

```

#### 📦 Sample JSON Response

```json
{
  "status": "success"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.senderwiz.com/customer/contact-list/update-a-list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
