Skip to main content
Resend Docs

Search documentation

Type to search this documentation.

On this pageOverview

Remove Batch Suppressions

POST

/

suppressions

/

batch

/

remove

Node.js
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.suppressions.batch.remove({
  ids: ['e169aa45-1ecf-4183-9955-b1499d5701d3'],
  // or: emails: ['steve.wozniak@example.com', 'susan.kare@example.com'],
});
PHP
$resend = Resend::client('re_xxxxxxxxx');

// Remove by suppression ids
$resend->suppressions->batch->remove([
  'ids' => ['e169aa45-1ecf-4183-9955-b1499d5701d3'],
]);

// Remove by emails
$resend->suppressions->batch->remove([
  'emails' => ['steve.wozniak@example.com', 'susan.kare@example.com'],
]);
Python
import resend

resend.api_key = "re_xxxxxxxxx"

# Remove by suppression ids
ids_params: resend.Suppressions.Batch.RemoveParams = {
  "ids": ["e169aa45-1ecf-4183-9955-b1499d5701d3"],
}

resend.Suppressions.Batch.remove(ids_params)

# Remove by emails
emails_params: resend.Suppressions.Batch.RemoveParams = {
  "emails": ["steve.wozniak@example.com", "susan.kare@example.com"],
}

resend.Suppressions.Batch.remove(emails_params)
Ruby
require "resend"

Resend.api_key = "re_xxxxxxxxx"

# Remove by suppression ids
Resend::Suppressions::Batch.remove(
  ids: ["e169aa45-1ecf-4183-9955-b1499d5701d3"]
)

# Remove by emails
Resend::Suppressions::Batch.remove(
  emails: ["steve.wozniak@example.com", "susan.kare@example.com"]
)
Go
package main

import "github.com/resend/resend-go/v4"

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

	// Remove by suppression ids
	client.Suppressions.Batch.Remove(&resend.BatchRemoveSuppressionsRequest{
		Ids: []string{"e169aa45-1ecf-4183-9955-b1499d5701d3"},
	})

	// Remove by emails
	client.Suppressions.Batch.Remove(&resend.BatchRemoveSuppressionsRequest{
		Emails: []string{"steve.wozniak@example.com", "susan.kare@example.com"},
	})
}
Rust
use resend_rs::{Resend, Result, types::BatchRemoveSuppressionOptions};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

  // Remove by email
  let opt_emails = BatchRemoveSuppressionOptions::new()
    .add_emails(vec!["steve.wozniak@example.com", "susan.kare@example.com"]);
  let _data = resend.suppressions.batch_remove(opt_emails).await?;

  // Remove by id
  let opt_ids =
    BatchRemoveSuppressionOptions::new().add_ids(vec!["e169aa45-1ecf-4183-9955-b1499d5701d3"]);

  let _data = resend.suppressions.batch_remove(opt_ids).await?;

  Ok(())
}
Java
import com.resend.Resend;
import com.resend.core.exception.ResendException;
import com.resend.services.suppressions.model.RemoveSuppressionsOptions;
import java.util.List;

public class Main {
    public static void main(String[] args) throws ResendException {
        Resend resend = new Resend("re_xxxxxxxxx");

        // Remove by suppression ids
        RemoveSuppressionsOptions byIds = RemoveSuppressionsOptions.builder()
                .ids(List.of("e169aa45-1ecf-4183-9955-b1499d5701d3"))
                .build();

        resend.suppressions().batch().remove(byIds);

        // Remove by emails
        RemoveSuppressionsOptions byEmails = RemoveSuppressionsOptions.builder()
                .emails(List.of("steve.wozniak@example.com", "susan.kare@example.com"))
                .build();

        resend.suppressions().batch().remove(byEmails);
    }
}
.NET
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" );

// Remove by suppression ids
await resend.SuppressionBatchRemoveAsync( new[]
{
    new Guid( "e169aa45-1ecf-4183-9955-b1499d5701d3" ),
} );

// Remove by emails
await resend.SuppressionBatchRemoveAsync( new[]
{
    "steve.wozniak@example.com",
    "susan.kare@example.com",
} );
cURL
# Remove by suppression ids
curl -X POST 'https://api.resend.com/suppressions/batch/remove' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d $'{
  "ids": ["e169aa45-1ecf-4183-9955-b1499d5701d3"]
}'

# Remove by emails
curl -X POST 'https://api.resend.com/suppressions/batch/remove' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d $'{
  "emails": ["steve.wozniak@example.com", "susan.kare@example.com"]
}'
CLI
# Remove by email
resend suppressions batch remove --file suppressions.json

# Remove by id
resend suppressions batch remove --file suppression-ids.json --ids
Response
{
  "data": [
    {
      "object": "suppression",
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "deleted": true
    }
  ]
}

Provide either emails or ids, but not both.

array

The email addresses to remove from the suppression list. Must contain between 1 and 100 email addresses.

array

The suppression IDs to remove from the suppression list. Must contain between 1 and 100 IDs.

Node.js
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.suppressions.batch.remove({
  ids: ['e169aa45-1ecf-4183-9955-b1499d5701d3'],
  // or: emails: ['steve.wozniak@example.com', 'susan.kare@example.com'],
});
PHP
$resend = Resend::client('re_xxxxxxxxx');

// Remove by suppression ids
$resend->suppressions->batch->remove([
  'ids' => ['e169aa45-1ecf-4183-9955-b1499d5701d3'],
]);

// Remove by emails
$resend->suppressions->batch->remove([
  'emails' => ['steve.wozniak@example.com', 'susan.kare@example.com'],
]);
Python
import resend

resend.api_key = "re_xxxxxxxxx"

# Remove by suppression ids
ids_params: resend.Suppressions.Batch.RemoveParams = {
  "ids": ["e169aa45-1ecf-4183-9955-b1499d5701d3"],
}

resend.Suppressions.Batch.remove(ids_params)

# Remove by emails
emails_params: resend.Suppressions.Batch.RemoveParams = {
  "emails": ["steve.wozniak@example.com", "susan.kare@example.com"],
}

resend.Suppressions.Batch.remove(emails_params)
Ruby
require "resend"

Resend.api_key = "re_xxxxxxxxx"

# Remove by suppression ids
Resend::Suppressions::Batch.remove(
  ids: ["e169aa45-1ecf-4183-9955-b1499d5701d3"]
)

# Remove by emails
Resend::Suppressions::Batch.remove(
  emails: ["steve.wozniak@example.com", "susan.kare@example.com"]
)
Go
package main

import "github.com/resend/resend-go/v4"

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

	// Remove by suppression ids
	client.Suppressions.Batch.Remove(&resend.BatchRemoveSuppressionsRequest{
		Ids: []string{"e169aa45-1ecf-4183-9955-b1499d5701d3"},
	})

	// Remove by emails
	client.Suppressions.Batch.Remove(&resend.BatchRemoveSuppressionsRequest{
		Emails: []string{"steve.wozniak@example.com", "susan.kare@example.com"},
	})
}
Rust
use resend_rs::{Resend, Result, types::BatchRemoveSuppressionOptions};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

  // Remove by email
  let opt_emails = BatchRemoveSuppressionOptions::new()
    .add_emails(vec!["steve.wozniak@example.com", "susan.kare@example.com"]);
  let _data = resend.suppressions.batch_remove(opt_emails).await?;

  // Remove by id
  let opt_ids =
    BatchRemoveSuppressionOptions::new().add_ids(vec!["e169aa45-1ecf-4183-9955-b1499d5701d3"]);

  let _data = resend.suppressions.batch_remove(opt_ids).await?;

  Ok(())
}
Java
import com.resend.Resend;
import com.resend.core.exception.ResendException;
import com.resend.services.suppressions.model.RemoveSuppressionsOptions;
import java.util.List;

public class Main {
    public static void main(String[] args) throws ResendException {
        Resend resend = new Resend("re_xxxxxxxxx");

        // Remove by suppression ids
        RemoveSuppressionsOptions byIds = RemoveSuppressionsOptions.builder()
                .ids(List.of("e169aa45-1ecf-4183-9955-b1499d5701d3"))
                .build();

        resend.suppressions().batch().remove(byIds);

        // Remove by emails
        RemoveSuppressionsOptions byEmails = RemoveSuppressionsOptions.builder()
                .emails(List.of("steve.wozniak@example.com", "susan.kare@example.com"))
                .build();

        resend.suppressions().batch().remove(byEmails);
    }
}
.NET
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" );

// Remove by suppression ids
await resend.SuppressionBatchRemoveAsync( new[]
{
    new Guid( "e169aa45-1ecf-4183-9955-b1499d5701d3" ),
} );

// Remove by emails
await resend.SuppressionBatchRemoveAsync( new[]
{
    "steve.wozniak@example.com",
    "susan.kare@example.com",
} );
cURL
# Remove by suppression ids
curl -X POST 'https://api.resend.com/suppressions/batch/remove' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d $'{
  "ids": ["e169aa45-1ecf-4183-9955-b1499d5701d3"]
}'

# Remove by emails
curl -X POST 'https://api.resend.com/suppressions/batch/remove' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d $'{
  "emails": ["steve.wozniak@example.com", "susan.kare@example.com"]
}'
CLI
# Remove by email
resend suppressions batch remove --file suppressions.json

# Remove by id
resend suppressions batch remove --file suppression-ids.json --ids
JSON
{
  "data": [
    {
      "object": "suppression",
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "deleted": true
    }
  ]
}

Was this page helpful?

⌘I

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu