Clean up a collection after you import it

You imported the Postman export. Everything is there: 140 requests, including "Copy of Get user (2)", a folder called "Old - do not use", three different ways of setting the auth header and a staging token from 2023 pasted into eleven requests. If the team starts using it like this, it stays like this.

Thirty minutes on the day you import pays for itself in the first week.

1. Delete what's dead (5 minutes)

Look for:

  • duplicates: "Copy of…", "… (2)", "… old", "… test",
  • folders named after people or dates,
  • requests to hosts that no longer exist.

Delete them. Deleted items go to the Trash and can be restored if someone misses one. When in doubt, move it to an Archive folder and delete that folder in a month.

2. Base URL and auth at the top (10 minutes)

Imported requests often have full URLs (https://staging.example.com/v1/users) and their own auth. Move both up:

  • Replace the host with {{baseUrl}} in every request, and put baseUrl in each environment.
  • Set auth once on the collection (or on a folder that differs) and set the requests to inherit.

See folder auth, variables and scripts for how inheritance works. After this, switching environments really switches everything.

3. Secrets out of requests (5 minutes)

A token pasted into a header is now visible to everyone in the workspace, and in exports and synced files. Replace it with {{apiToken}}, store the value as a secret variable in the environment, and revoke the old token if it's still valid.

If you haven't imported yet, let the import do it for you: see import without leaking secrets.

4. Names people can find (5 minutes)

Rename requests to verb + object (Create invoice, Get user), folders to resources (Invoices, Users). Don't aim for perfect; fix the ones you had trouble finding during steps 1 to 3. See organize an API collection.

5. Run it (5 minutes)

Terminal
requestarium run-collection "Shop API" --env Staging

or Run on the collection in the app. Then for each failure:

  • Unresolved variable: a value that lived in Postman globals or another environment. Add it to the environment.
  • 401: the auth from step 2 doesn't fit this request. Give its folder its own auth.
  • 404 or 5xx: the endpoint changed or is gone. Fix the request, or delete it.
  • A test fails: the test may have been failing in the old tool too. Fix it or delete it; don't keep red tests "for later".

Run until green. Now it's a collection the team can trust on day one.

Then tell the team

Write three lines in the collection's Overview: which environment to pick, how to get credentials, who to ask. Then invite people.