Naming conventions for API collections, environments and variables
Names are the interface of a shared collection. People search for them, CI prints them, scripts depend on them, and a CLI command breaks when one changes. A few rules agreed early save a lot of "which one is the real login?" later.
This builds on organizing a collection a team can find things in, which covers structure. Here it's only names.
Requests
Use the action and the outcome, the way a person would say it:
| Instead of | Use |
|---|---|
POST /v1/invoices | Create invoice |
invoices test 2 | Create invoice (missing customer, 400) |
get_user_NEW | Get user |
Login (Dima) | Log in as admin |
- The method and path are already on screen; the name adds what they don't.
- Put the case in brackets for negative tests, so a CI report reads "Create invoice (missing customer, 400) failed".
- Keep names unique inside a collection.
requestarium run "Users API/Invoices/Create invoice"andpm.execution.setNextRequest("Create invoice")find requests by name.
Folders
Folders are resources or flows, not people or dates:
- Invoices, Customers, Webhooks: one folder per resource.
- Checkout flow: a sequence that must run in order.
- Smoke, Regression: only if your CI runs folders by purpose (
requestarium run-collection … --folder Smoke).
Avoid Old, New, Misc and Anna's tests. They grow forever and nobody dares delete them.
Environments
Name environments after where the API runs, with the same names in every environment group: Local, Dev, Staging, Production. Then --env Staging means the same thing for every service, and a matrix in CI is one list. More in environment groups for many services.
If you need a variant, add it after a space or a dash: Staging EU, Staging-US. Don't abbreviate one and spell out another (prod here, Production there).
Variables
| Rule | Good | Avoid |
|---|---|---|
| One style everywhere | baseUrl, apiKey | BASE_URL next to apiKey |
| No environment in the name | baseUrl | stagingBaseUrl |
| Say what it is | adminToken, customerId | token2, id |
| Same name for the same thing across collections | baseUrl everywhere | host, url, server |
The environment already says where. A variable called stagingBaseUrl defeats the point of switching environments.
Values set by scripts during a run are variables too. Name them after what they hold: createdInvoiceId, not tmp.
Tests
A test name is the first line of a failure message. Write it as the expectation:
pm.test('returns 201 and the new invoice id', () => { … });
pm.test('rejects a missing customer with 400', () => { … });Not status check or test 1. See naming tests so a failure explains itself.
Fixing names you already have
Renaming is cheap in the app and risky outside it. Before renaming a request or folder, search for its old name in:
- CI files (
--folder,run "…") and scripts that callsetNextRequest, - test suites, which reference requests directly and keep working,
- docs and tickets that link to it.
Rename in small batches, and run the collection once after each batch.
Write the rules down
Put the five lines from the TL;DR in the collection's Overview, so the next person reads them where they work.