How to Send Path Parameters in Postman: Step-by-Step Guide
In Postman, you send
path parameters by including them directly in the URL using curly braces like {parameterName}. Define the parameter values in the Params tab or as environment variables, and Postman replaces them when sending the request.Syntax
Path parameters are placeholders in the URL enclosed in curly braces {}. You write the URL with these placeholders, then provide actual values separately.
- URL pattern:
https://api.example.com/users/{userId}/posts/{postId} - Parameter names:
userIdandpostIdare keys you replace with real values. - Value assignment: You assign values in Postman's Params tab or environment variables.
http
https://api.example.com/users/{userId}/posts/{postId}Example
This example shows how to send a GET request with path parameters userId and postId in Postman.
http
GET https://api.example.com/users/{userId}/posts/{postId} // In Postman Params tab: // Key: userId, Value: 123 // Key: postId, Value: 456
Output
Request URL sent: https://api.example.com/users/123/posts/456
Response: 200 OK with user 123's post 456 data
Common Pitfalls
Common mistakes when sending path parameters in Postman include:
- Not using curly braces
{}around parameter names in the URL. - Forgetting to define parameter values in the Params tab or environment variables.
- Mixing path parameters with query parameters incorrectly.
- Using incorrect parameter names that don't match the API specification.
Always double-check the API docs for exact parameter names and ensure values are set before sending the request.
http
Wrong URL: GET https://api.example.com/users/userId/posts/postId Right URL: GET https://api.example.com/users/{userId}/posts/{postId} // Then set values in Params tab
Quick Reference
| Step | Action | Notes |
|---|---|---|
| 1 | Write URL with {paramName} | Use curly braces for each path parameter |
| 2 | Open Params tab in Postman | Add keys matching param names |
| 3 | Enter values for each parameter | Values replace placeholders in URL |
| 4 | Send request | Postman sends URL with parameters replaced |
Key Takeaways
Use curly braces {} in the URL to mark path parameters in Postman.
Set parameter values in the Params tab or environment variables before sending.
Check API docs for exact parameter names to avoid errors.
Do not confuse path parameters with query parameters.
Always verify the final request URL in Postman before sending.