Delete companies and users in bulk with Postman

The following capabilities are available on all Productboard plans.

 

This document provides a step-by-step guide on how to delete users or companies in bulk using Postman, a collaborative API development platform.

In this article:

Step 1: Generate a public API access token

Postman will require an access token from Productboard to run its scripts. Here's how to generate one:

  1. Make sure you're signed in to your Productboard workspace as an admin.
  2. From the bottom of the Main menu, click Settings > Integrations. 
  3. Find and click Access token, which should be at the bottom of the page under APIs.
  4. Click Add token to create a new token.
  5. Give the token a useful name, like "Postman - company deletion".
  6. Copy the token and keep it somewhere secure. You will not be able to copy the token again once you leave this page. 

Step 2: Set up a new collection in Postman

Postman is a collaborative API development platform. You'll need to set up a collection within it to house the deletion scripts.

  1. Go to https://www.postman.com/downloads/ and download the Postman app that best suits your computer.



  2. Open Postman.
  3. On the left, on the Collections page, click Create new collection > Blank collection.



Step 3: Add a DELETE request to the collection

Add a DELETE request to the new collection using the following data:

  • For Companies: URL: {{baseUrl}}/companies/{{CompId}}
  • For Users: URL:{{baseUrl}}/users/{{UserId}}
  • Variables:
    • baseUrlhttps://api.productboard.com
    • CompId: The name of the column header in the CSV
    • UserId: The name of the column header in the CSV

In the Scripts section, add the following code:

pm.test("Status code is 204", function(){ pm.response.to.have.status(204); })

Step 4: Add a GET request to the collection

Add a GET request to the new collection using the following data:

  • For Companies: URL: {{baseUrl}}/companies/{{CompId}}
  • For Users: URL:{{baseUrl}}/users/{{UserId}}
  • Variables:
    • baseUrlhttps://api.productboard.com
    • CompId: The name of the column header in the CSV
    • UserId: The name of the column header in the CSV

In the Scripts section, add the following code:

pm.test("Status code is 404", function(){ pm.response.to.have.status(404); })

Step 5: Create a CSV to identify deletion targets

Create a CSV file containing the UUIDs of the companies or users that need to be deleted in bulk. (Note: use the header name as the variable in request URL as mentioned in point 3 and 4)

Step 6: Run the collection

All that's left is to prime and run the collection. To do so:

  1. In Postman, on the Collections page, in the Authorization tab, paste the access token you generated back in Step 1, then click Save.


  2. In the header, on the right side of the screen, click Run > Run collection.



  3. The Run console will appear. In the Functional tab, under Data file, upload the CSV you made in Step 5, then click Run [collection name].

The collection will run and the records you indicated will be deleted.

See also

  •  
Was this article helpful?
0 out of 0 found this helpful

Articles in this section

See more
Our Support hours:
Monday to Friday from 9:00 am - 2:00 am CET. Monday to Friday from 0:00 am - 5:00 pm PST.
Productboard Academy
Become a Productboard expert with self-paced courses, quick tip videos, webinars and more.
Product Makers Community
Connect with product leaders, share and find product jobs, and learn how to approach similar challenges. Come join our Product Makers community.