> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Delete a contact from a list

POST https://api.brevo.com/v3/contacts/lists/{listId}/contacts/remove
Content-Type: application/json

Reference: https://developers.brevo.com/reference/remove-contact-from-list

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.

## Request

### Path parameters

- `listId` (long, required) — Id of the list

### Body (application/json)

This endpoint expects an any or any or any or any.

- `any or any or any or any`

## Response

### 201

All contacts have been removed successfully from the list with details of failed ones

- `contacts` (object, required)
  - `failure` (list of string or list of long, optional)
  - `processId` (long, optional) — Id of the process created to remove contacts from list when user opts for "all" option.
  - `success` (list of string or list of long, optional)
  - `total` (long, optional) — Displays the count of total number of contacts removed from list when user opts for "all" option.

## Errors

### 400 Bad Request Error

bad request

- `code` (enum, required) — Error code displayed in case of a failure
  - Allowed values: `invalid_parameter`, `missing_parameter`, `out_of_range`, `campaign_processing`, `campaign_sent`, `document_not_found`, `not_enough_credits`, `permission_denied`, `duplicate_parameter`, `duplicate_request`, `method_not_allowed`, `unauthorized`, `account_under_validation`, `not_acceptable`, `bad_request`, `unprocessable_entity`, `Domain does not exist`, `Contact email not found`, `Attribute not found`, `Category id not found`, `Invalid parameters passed`, `Record(s) for identifier not found`, `Returned when query params are invalid`, `Returned when invalid data posted`, `Feed not found`, `Campaign ID not found`, `api-key not found`, `DMARC policy requires domain authentication`, `DNS records not properly configured`, `Invalid OTP code provided`, `OTP code has expired`, `Domain already exists in your account`, `The sum of all IP weights must equal 100`, `Authentication failed`, `Insufficient credits`, `Request already processed`
- `message` (string, required) — Readable message associated to the failure

### 404 Not Found Error

List ID not found

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

## Examples

### Response example when 'all' is passed as true

**Request**

```json
undefined
```

**Response**

```json
{
  "contacts": {},
  "processId": 5,
  "total": 23
}
```

**SDK Code**

```typescript Response example when 'all' is passed as true
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.contacts.removeContactFromList({
        listId: 1,
    });
}
main();

```

```python Response example when 'all' is passed as true
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.contacts.remove_contact_from_list(
    list_id=1,
)

```

```php Response example when 'all' is passed as true
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Contacts\Requests\RemoveContactFromListRequest;
use Brevo\Contacts\Types\RemoveContactFromListRequestBodyEmails;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->contacts->removeContactFromList(
    1,
    new RemoveContactFromListRequest([
        'body' => new RemoveContactFromListRequestBodyEmails([]),
    ]),
);

```

```go Response example when 'all' is passed as true
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/contacts/lists/1/contacts/remove"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Response example when 'all' is passed as true
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Response example when 'all' is passed as true
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")
  .header("api-key", "<apiKey>")
  .asString();
```

```csharp Response example when 'all' is passed as true
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/contacts/lists/1/contacts/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Response example when 'all' is passed as true
import Foundation

let headers = ["api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/contacts/lists/1/contacts/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Response example when emails array is passed

**Request**

```json
undefined
```

**Response**

```json
{
  "contacts": {},
  "failure": [
    "david@example.com"
  ],
  "success": [
    "jeff32@example.com",
    "jim56@example.com"
  ]
}
```

**SDK Code**

```typescript Response example when emails array is passed
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.contacts.removeContactFromList({
        listId: 1,
    });
}
main();

```

```python Response example when emails array is passed
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.contacts.remove_contact_from_list(
    list_id=1,
)

```

```php Response example when emails array is passed
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Contacts\Requests\RemoveContactFromListRequest;
use Brevo\Contacts\Types\RemoveContactFromListRequestBodyEmails;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->contacts->removeContactFromList(
    1,
    new RemoveContactFromListRequest([
        'body' => new RemoveContactFromListRequestBodyEmails([]),
    ]),
);

```

```go Response example when emails array is passed
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/contacts/lists/1/contacts/remove"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Response example when emails array is passed
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Response example when emails array is passed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")
  .header("api-key", "<apiKey>")
  .asString();
```

```csharp Response example when emails array is passed
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/contacts/lists/1/contacts/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Response example when emails array is passed
import Foundation

let headers = ["api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/contacts/lists/1/contacts/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Response example when extIds array is passed

**Request**

```json
undefined
```

**Response**

```json
{
  "contacts": {},
  "failure": [
    "ext345"
  ],
  "success": [
    "ext123"
  ]
}
```

**SDK Code**

```typescript Response example when extIds array is passed
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.contacts.removeContactFromList({
        listId: 1,
    });
}
main();

```

```python Response example when extIds array is passed
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.contacts.remove_contact_from_list(
    list_id=1,
)

```

```php Response example when extIds array is passed
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Contacts\Requests\RemoveContactFromListRequest;
use Brevo\Contacts\Types\RemoveContactFromListRequestBodyEmails;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->contacts->removeContactFromList(
    1,
    new RemoveContactFromListRequest([
        'body' => new RemoveContactFromListRequestBodyEmails([]),
    ]),
);

```

```go Response example when extIds array is passed
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/contacts/lists/1/contacts/remove"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Response example when extIds array is passed
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Response example when extIds array is passed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")
  .header("api-key", "<apiKey>")
  .asString();
```

```csharp Response example when extIds array is passed
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/contacts/lists/1/contacts/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Response example when extIds array is passed
import Foundation

let headers = ["api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/contacts/lists/1/contacts/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Response example when ids array is passed

**Request**

```json
undefined
```

**Response**

```json
{
  "contacts": {},
  "failure": [
    5
  ],
  "success": [
    1,
    2
  ]
}
```

**SDK Code**

```typescript Response example when ids array is passed
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.contacts.removeContactFromList({
        listId: 1,
    });
}
main();

```

```python Response example when ids array is passed
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.contacts.remove_contact_from_list(
    list_id=1,
)

```

```php Response example when ids array is passed
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Contacts\Requests\RemoveContactFromListRequest;
use Brevo\Contacts\Types\RemoveContactFromListRequestBodyEmails;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->contacts->removeContactFromList(
    1,
    new RemoveContactFromListRequest([
        'body' => new RemoveContactFromListRequestBodyEmails([]),
    ]),
);

```

```go Response example when ids array is passed
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/contacts/lists/1/contacts/remove"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Response example when ids array is passed
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Response example when ids array is passed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")
  .header("api-key", "<apiKey>")
  .asString();
```

```csharp Response example when ids array is passed
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/contacts/lists/1/contacts/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Response example when ids array is passed
import Foundation

let headers = ["api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/contacts/lists/1/contacts/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Passing 'all' true

**Request**

```json
{
  "all": true
}
```

**Response**

```json
{
  "contacts": {},
  "processId": 5,
  "total": 23
}
```

**SDK Code**

```typescript Passing 'all' true
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.contacts.removeContactFromList({
        listId: 1,
        body: {
            all: true,
        },
    });
}
main();

```

```python Passing 'all' true
from brevo import Brevo
from brevo.contacts import RemoveContactFromListRequestBodyAll

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.contacts.remove_contact_from_list(
    list_id=1,
    request=RemoveContactFromListRequestBodyAll(
        all_=True,
    ),
)

```

```php Passing 'all' true
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Contacts\Requests\RemoveContactFromListRequest;
use Brevo\Contacts\Types\RemoveContactFromListRequestBodyEmails;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->contacts->removeContactFromList(
    1,
    new RemoveContactFromListRequest([
        'body' => new RemoveContactFromListRequestBodyEmails([]),
    ]),
);

```

```go Passing 'all' true
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/contacts/lists/1/contacts/remove"

	payload := strings.NewReader("{\n  \"all\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Passing 'all' true
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"all\": true\n}"

response = http.request(request)
puts response.read_body
```

```java Passing 'all' true
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"all\": true\n}")
  .asString();
```

```csharp Passing 'all' true
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/contacts/lists/1/contacts/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"all\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Passing 'all' true
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["all": true] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/contacts/lists/1/contacts/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Passing emails array

**Request**

```json
{
  "emails": [
    "jeff32@example.com",
    "jim56@example.com"
  ]
}
```

**Response**

```json
{
  "contacts": {},
  "processId": 5,
  "total": 23
}
```

**SDK Code**

```typescript Passing emails array
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.contacts.removeContactFromList({
        listId: 1,
        body: {
            emails: [
                "jeff32@example.com",
                "jim56@example.com",
            ],
        },
    });
}
main();

```

```python Passing emails array
from brevo import Brevo
from brevo.contacts import RemoveContactFromListRequestBodyEmails

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.contacts.remove_contact_from_list(
    list_id=1,
    request=RemoveContactFromListRequestBodyEmails(
        emails=[
            "jeff32@example.com",
            "jim56@example.com"
        ],
    ),
)

```

```php Passing emails array
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Contacts\Requests\RemoveContactFromListRequest;
use Brevo\Contacts\Types\RemoveContactFromListRequestBodyEmails;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->contacts->removeContactFromList(
    1,
    new RemoveContactFromListRequest([
        'body' => new RemoveContactFromListRequestBodyEmails([
            'emails' => [
                'jeff32@example.com',
                'jim56@example.com',
            ],
        ]),
    ]),
);

```

```go Passing emails array
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/contacts/lists/1/contacts/remove"

	payload := strings.NewReader("{\n  \"emails\": [\n    \"jeff32@example.com\",\n    \"jim56@example.com\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Passing emails array
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"emails\": [\n    \"jeff32@example.com\",\n    \"jim56@example.com\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Passing emails array
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"emails\": [\n    \"jeff32@example.com\",\n    \"jim56@example.com\"\n  ]\n}")
  .asString();
```

```csharp Passing emails array
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/contacts/lists/1/contacts/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"emails\": [\n    \"jeff32@example.com\",\n    \"jim56@example.com\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Passing emails array
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["emails": ["jeff32@example.com", "jim56@example.com"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/contacts/lists/1/contacts/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Passing extIds array

**Request**

```json
{
  "extIds": [
    "ext234",
    "ext456"
  ]
}
```

**Response**

```json
{
  "contacts": {},
  "processId": 5,
  "total": 23
}
```

**SDK Code**

```typescript Passing extIds array
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.contacts.removeContactFromList({
        listId: 1,
        body: {
            extIds: [
                "ext234",
                "ext456",
            ],
        },
    });
}
main();

```

```python Passing extIds array
from brevo import Brevo
from brevo.contacts import RemoveContactFromListRequestBodyExtIds

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.contacts.remove_contact_from_list(
    list_id=1,
    request=RemoveContactFromListRequestBodyExtIds(
        ext_ids=[
            "ext234",
            "ext456"
        ],
    ),
)

```

```php Passing extIds array
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Contacts\Requests\RemoveContactFromListRequest;
use Brevo\Contacts\Types\RemoveContactFromListRequestBodyEmails;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->contacts->removeContactFromList(
    1,
    new RemoveContactFromListRequest([
        'body' => new RemoveContactFromListRequestBodyEmails([]),
    ]),
);

```

```go Passing extIds array
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/contacts/lists/1/contacts/remove"

	payload := strings.NewReader("{\n  \"extIds\": [\n    \"ext234\",\n    \"ext456\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Passing extIds array
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"extIds\": [\n    \"ext234\",\n    \"ext456\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Passing extIds array
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"extIds\": [\n    \"ext234\",\n    \"ext456\"\n  ]\n}")
  .asString();
```

```csharp Passing extIds array
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/contacts/lists/1/contacts/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"extIds\": [\n    \"ext234\",\n    \"ext456\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Passing extIds array
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["extIds": ["ext234", "ext456"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/contacts/lists/1/contacts/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Passing ids array

**Request**

```json
{
  "ids": [
    1,
    2
  ]
}
```

**Response**

```json
{
  "contacts": {},
  "processId": 5,
  "total": 23
}
```

**SDK Code**

```typescript Passing ids array
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.contacts.removeContactFromList({
        listId: 1,
        body: {
            ids: [
                1,
                2,
            ],
        },
    });
}
main();

```

```python Passing ids array
from brevo import Brevo
from brevo.contacts import RemoveContactFromListRequestBodyIds

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.contacts.remove_contact_from_list(
    list_id=1,
    request=RemoveContactFromListRequestBodyIds(
        ids=[
            1,
            2
        ],
    ),
)

```

```php Passing ids array
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Contacts\Requests\RemoveContactFromListRequest;
use Brevo\Contacts\Types\RemoveContactFromListRequestBodyEmails;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->contacts->removeContactFromList(
    1,
    new RemoveContactFromListRequest([
        'body' => new RemoveContactFromListRequestBodyEmails([]),
    ]),
);

```

```go Passing ids array
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/contacts/lists/1/contacts/remove"

	payload := strings.NewReader("{\n  \"ids\": [\n    1,\n    2\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Passing ids array
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ids\": [\n    1,\n    2\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Passing ids array
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/contacts/lists/1/contacts/remove")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ids\": [\n    1,\n    2\n  ]\n}")
  .asString();
```

```csharp Passing ids array
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/contacts/lists/1/contacts/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ids\": [\n    1,\n    2\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Passing ids array
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["ids": [1, 2]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/contacts/lists/1/contacts/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```