API - How to Retrieve or Delete Archived Leads

Recovering archived leads is an important function to maintain flexibility in contact base management. Sometimes an archived lead may re-engage or present new opportunities, and it is essential that the unarchiving process is quick and straightforward. The SprintHub API allows you to query and manage your archived leads easily by using the correct endpoint.
Endpoint to Query Archived Leads
To retrieve the leads that are archived in a SprintHub instance, you must use the following endpoint:
https://sprinthub-api-master.sprinthub.app/lead/archive?i=YOUR_INSTANCE&apitoken=YOUR_INSTANCE_TOKEN
In this endpoint, you need to pass two essential parameters:
i=YOUR_INSTANCE: Identifies which instance is being queried.
apitoken=YOUR_INSTANCE_TOKEN: Authentication token, ensuring that the request is being made by an authorized user.
Requirements for the Request Body
To perform the query and ensure the archived lead is correctly identified, the request body must contain the following data in JSON format:
Explanation:
archived: This field must be set to
trueto confirm that you are searching for archived leads.id: The specific ID of the lead you want to query or manage. In this case, the ID is 2331, but it should be replaced with the ID of the lead you are trying to recover.
Step-by-Step to Recover Archived Leads
Request Configuration: Use an API tool such as Postman or an HTTP client to perform the POST request to the endpoint mentioned.
Sending the Parameters: Make sure the URL parameters and the authentication token are correct, ensuring access to the right instance and appropriate authorization.
Set the Request Body: In the request body, as shown above, set the fields
"archived": falseand specify theidof the archived lead.Send the Request: Click "Send" to send the request. If the request is correct, you will receive a response with status 200 OK, indicating that the lead was found.
Practical Example of a Request in Postman
The image shown illustrates a real example in Postman, where the request was successful, returning a 200 OK.
Method: POST
URL:
https://sprinthub-api-master.sprinthub.app/lead/archive?i=YOUR_INSTANCE&apitoken=YOUR_INSTANCE_TOKENBody:

When performing this request, the lead with ID 2331 was retrieved as archived.

Now to Delete:
Remember that by Deleting this lead it is lost forever and cannot be recovered
Method: DELETE
URL:
https://sprinthub-api-master.sprinthub.app/leads/LEAD_ID?i=YOUR_INSTANCE&apitoken=YOUR_INSTANCE_TOKEN

When performing this request, the lead with ID 2346 was Deleted, even while archived.

If you wish to perform an archive, unarchive, or bulk delete of archived leads, you will need to pass an array with all the lead IDs.
Conclusion
The process of recovering archived leads via the SprintHub API is simple and effective. Make sure to always use the correct ID and set the field "archived": true in the request body to ensure you are accessing archived lead information. This feature is essential to maintain flexibility and ensure that leads can be restored whenever necessary, without losing important data.
Last updated
Was this helpful?