Preview a cleanup: how many contacts of each kind would be removed. Deletes or changes nothing
const url = 'https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/cleanups';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kinds":["duplicates"],"inactiveDays":1,"unconfirmedDays":7}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/cleanups \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kinds": [ "duplicates" ], "inactiveDays": 1, "unconfirmedDays": 7 }'kinds: duplicates (same Gmail mailbox), unconfirmed (double opt-in pending for more than unconfirmedDays: 7, 14 or 30; default 7), inactive (no real opens or clicks in inactiveDays, default 180; automatic opens do not count), unopened (no real open) and unclicked (no real click) in that same window; contacts with limited tracking are excluded from those three. Default: duplicates, unconfirmed and inactive. The preview expires after 24 h. To actually remove: POST /v1/cleanups/{id}:confirm and then :run.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
brd_01hx0000000000000000000000Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Preview
object
Minimum age (days) of the contacts pending confirmation that are included: 7, 14 or 30.
The preview expired (24 h): it can no longer be confirmed; request a new one.
Contacts that will be removed, each counted only once (duplicates > unconfirmed > inactive).
object
Deadline to undo (:undo): 30 days after it finished or was cancelled, on all plans. Null if there is nothing to undo yet.
:undo lifted the removals of this cleanup.
object
object
Up to 20 contacts per kind of what is still pending.
object
Example
{ "kinds": [ "duplicates" ], "status": "previewed", "sample": [ { "kind": "duplicates" } ]}Invalid data
object
object
Example
{ "error": { "code": "not_found" }}No session, expired session, or invalid, expired or revoked API key
object
object
Example
{ "error": { "code": "not_found" }}Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)
object
object
Example
{ "error": { "code": "not_found" }}Does not exist or is not visible to you
object
object
Example
{ "error": { "code": "not_found" }}Internal error
object
object
Example
{ "error": { "code": "not_found" }}