How to send bulk API requests using Postman
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Sometimes, we need to send a large number of REST API requests to an application.
As an example, if we need to archive many issues in Jira, we can use the script in Is there an easy way to archive a lot of issues?, but we don't always have scripts built for the requests we need.
Here we'll detail how to use a CSV file as input to Postman and use that to make the REST API requests.
Environment
Any computer with Postman installed, sending requests to any application.
Solution
Create a CSV with a header line to use as input.
In our example, we'll call a PUT request to the
/rest/api/2/user
method to update a user email in Jira DCOur CSV looks like this:
1 2 3 4
lower_user_name,lower_email_address agrant-sd-demo,agrant-sd-demo@example2.com jevans-sd-demo,jevans-sd-demo@example2.com mdavis-sd-demo,mdavis-sd-demo@example2.com
Download and install Postman - https://www.postman.com/downloads/
Build the request, but replace the parameters by the CSV header with two curly brackets, like
{{lower_user_name}}
Going back to our example, our request looks like this:
ℹ️ Remember to set the Authorization and the Headers as needed. Usually, we can use our login and password for Basic Auth in the authorization. For POST/PUT methods, usually we need to add the
Content-Type
header asapplication/json
Save the request - that will create a collection
Click the "Runner" button on the lower right:
Drag the collection to the "Run Order" panel
In the right portion of the screen, click "Select file" and select the CSV file.
Click the "Preview" button to validate that the parameters are parsed as expected.
Finally, click the run collection button.
Postman will show the result for each of the requests on the screen.
Was this helpful?