You can use Postman Flows to complete repetitive tasks. Businesses often need to delete emails from multiple systems. Logging in, searching, and deleting emails from multiple locations can be time consuming. This tutorial shows you how to create a flow that deletes an email from three locations each time you run the flow.
For this tutorial, the locations areStripe.com,Brevo.com, and a Postman mock server that acts as a hypothetical internal system.
You can find thecomplete flow in theDevOps Flows workspace.
test@email.com email address.test@email.com email address.Fork these collections from theDevOps Flows workspace into your workspace:
Fork this environment into your workspace:
In thegdpr-delete-email environment, replace<your-brevo-api-key> with your Brevo API key. Replace<your-stripe-secret-key> with your Stripe secret key.

Part one: Delete the contact from Stripe
Create a new flow. Add aString block and entertest@email.com.
Connect aCreate Variable block and enterCustomer Email.

Connect threeHTTP Request blocks to theStart block, arranged vertically.

In the topHTTP Request block, selectStripe API > Customers > Search customers.
Select thegdpr-delete-email environment.
For theemail variable, add aGet Variable block and selectCustomer Email.

Create anIf block next to theHTTP Request block. Add aSelect block to theIf block and changevalue1 tocontacts.

Connect theHTTP Request block’sSuccess output to theIf block’scontacts andData inputs. Next tocontacts, selectbody.data. In the FQL window, enter$count(contacts) > 0.
Connect theIf block’sFALSE output to aDisplay block.
Rename theDisplay blockContact not found and selectBoolean from the dropdown list.
Connect theIf block’sTRUE output to anHTTP Request block. SelectStripe API > Customers > Delete a customer.
Also connect theIf block’sTRUE output to theHTTP Request block’scustomer_id input and selectbody.data.0.id.
Connect theHTTP Request block’sSuccess output to aDisplay block.
Rename theDisplay blockContact deleted and selectBoolean from the dropdown list.

Part two: Delete the contact from Brevo
In the middleHTTP Request block, selectBrevo > Contact management > Contacts > Get a contact’s details.
Select thegdpr-delete-email environment
For theemail variable, add aGet Variable block and selectCustomer Email.
Connect this block’sSuccess output to anotherHTTP Request block and selectBrevo > Contact management > Contacts > Delete a contact. Also connect the middleHTTP Request block’sSuccess output to the newHTTP Request block’scontact_id input and selectbody.id.

Connect theDelete a contact block’sSuccess output to aDisplay block. Rename theDisplay blockContact deleted and selectBoolean from the dropdown list.
Connect aDisplay block to theGet a contact’s detailsHTTP Request block’sFailure output. Rename theDisplay blockContact not found and selectBoolean from the dropdown list.

Part three: Delete the contact from an internal system
In the bottomHTTP Request block, selectcustomer-list > customer/email.
For the email variable, add aGet Variable block and selectCustomer Email.
Connect theSuccess output to anHTTP Request block and selectcustomer-list > customer/id.
Also connect thecustomer/emailHTTP Request block’sSuccess output to theid input and selectbody.id.
Connect thecustomer/idHTTP Request block’sSuccess output to aDisplay block. Rename theDisplay blockContact deleted and selectBoolean from the dropdown list.
Connect thecustomer/idHTTP Request block’sFailure output to aDisplay block. Rename theDisplay blockContact not found and selectBoolean from the dropdown list.

SelectRun. The flow finds and deletes the contact with thetest@email.com email address on Brevo, Stripe, and the internal system. When the contact is deleted, theContact deletedDisplay block showsTrue. If there is no contact with that email address, theContact not foundDisplay block showsFalse.
Last modified: 2025/01/17
Explore ready-to-use Collection Templates, build API-first workflows with Postman Flows, and more!