We have an multiple always running agentless campaign, contacts are inserted via the API from a website form. each agentless campaign is configured to attempt 3 or more times. now the contact lists are growing, we would like to delete old contact from the contact lists.
old contact means the contact has been dialled, marked completed or 3 attempt has completed,(the dialer will not re-attempt dial the contact anymore).
we're thinking about have a scheduled lambda function (every 30 minutes) loop through all contacts in the list, if the contact is 'old', then delete it.
we don't want to use /api/v2/outbound/contactlists/{contactListId}/clear, this will clear any recall or scheduled callback.
if we query the contact with Get a contact.
/api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}
How do we determine if the contact is no longer callable can be deleted ? it has been dialled or no re-call on the contact.
You can check out this link for reference. Under the responses section, you can see there is an attribute called callable, which is a boolean value that indicates whether the contact is callable or not. Also, you can try the API and check the response using API Explorer. Hope this helps.