Reference

Endpoint Delete List Member (Archive)


Name

delete_list_member

Description

Archive a list member. To permanently delete, use the delete_list_member_permanent endpoint. [API reference]

Related Tables

ListMembers , ListMembersBulk

Parameters

Parameter Required Options
Name: ListId

Label: List Id

The ID of the list for which you like to perform this operation.
YES
Name: Id

Label: Member Id

The ID of the list member for which data should be deleted.
YES

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_WSTR nvarchar(4000) 4000
ListId DT_WSTR nvarchar(4000) 4000
Status DT_WSTR nvarchar(4000) 4000
StatusCode DT_I4 int
If the column you are looking for is missing, consider customizing Mailchimp Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_WSTR nvarchar(4000) 4000
Required columns that you need to supply are bolded.

Examples

SSIS

Use Mailchimp Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Source

API Source - Mailchimp
Read and write Mailchimp data effortlessly. Integrate, manage, and automate campaigns, lists, members, and reports — almost no coding required.
Mailchimp
Delete List Member (Archive)
Required Parameters
List Id Fill-in the parameter...
Member Id Fill-in the parameter...
Optional Parameters
RawOutputDataRowTemplate {}
EnableRawOutputModeSingleRow True
ContineOnErrorForStatusCode True
ErrorStatusCodeToMatchRegex 404|405
SSIS API Source - Read from table or endpoint

API Destination

This Endpoint belongs to the ListMembers table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to delete list member:

API Destination - Mailchimp
Read and write Mailchimp data effortlessly. Integrate, manage, and automate campaigns, lists, members, and reports — almost no coding required.
Mailchimp
ListMembers
Delete
Required Parameters
List Id Fill-in the parameter...
Member Id Fill-in the parameter...
Optional Parameters
RawOutputDataRowTemplate {}
EnableRawOutputModeSingleRow True
ContineOnErrorForStatusCode True
ErrorStatusCodeToMatchRegex 404|405
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Delete list member (archive)

<p>Archives a list member by ID using <code>DELETE FROM ListMembers WHERE Id='...' WITH (ListId='...')</code>. Archived or bounced records cannot be resubscribed; to resubscribe, use the permanent delete operation first to remove the member permanently.</p>

DELETE FROM ListMembers 
WHERE Id='170a0722daae03855d6434eb3a5959fb' 
WITH (ListId='e246f7e24d')

Delete list members (archive) by date

<p>Archives list members that opted in after a specific date using <code>DELETE FROM ListMembers WHERE TimestampOpt > '...' WITH (ListId='...')</code>. For permanent delete, use the permanent delete operation instead.</p>

DELETE from ListMembers 
WHERE TimestampOpt > '2023-06-16' 
WITH (ListId='a4d24015f8')

delete_list_member endpoint belongs to ListMembers , ListMembersBulk table(s), and can therefore be used via those table(s).

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Delete list member (archive)

<p>Archives a list member by ID using <code>DELETE FROM ListMembers WHERE Id='...' WITH (ListId='...')</code>. Archived or bounced records cannot be resubscribed; to resubscribe, use the permanent delete operation first to remove the member permanently.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM ListMembers 
WHERE Id=''170a0722daae03855d6434eb3a5959fb'' 
WITH (ListId=''e246f7e24d'')';

EXEC (@MyQuery) AT [LS_TO_MAILCHIMP_IN_GATEWAY];

Delete list members (archive) by date

<p>Archives list members that opted in after a specific date using <code>DELETE FROM ListMembers WHERE TimestampOpt > '...' WITH (ListId='...')</code>. For permanent delete, use the permanent delete operation instead.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE from ListMembers 
WHERE TimestampOpt > ''2023-06-16'' 
WITH (ListId=''a4d24015f8'')';

EXEC (@MyQuery) AT [LS_TO_MAILCHIMP_IN_GATEWAY];

delete_list_member endpoint belongs to ListMembers , ListMembersBulk table(s), and can therefore be used via those table(s).