REST API Resource Naming and URL Design/Use query parameters for field selection

Return only needed fields.

Section: Path vs query parameters

Use query parameters for field selection

http
http
GET /users/123?fields=id,name,email
Explanation

Sparse fieldsets can reduce payload size and overfetching in large representations.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Path vs query parameters
Put resource identity in the path
Use the path for the primary resource being addressed.
OpenIn sheethttpsame section
Use query parameters for filtering
Filter a collection with query fields.
OpenIn sheethttpsame section
Use includes for related resources
Let clients opt into embedded relationships.
OpenIn sheethttpsame section
Use consistent casing in paths
Pick one URL style and use it consistently.
OpenIn sheettext1 tag match
Avoid format suffixes in paths
Negotiate format via headers, not path suffixes.
OpenIn sheettext1 tag match
Name relationships clearly
Make related collections obvious.
OpenIn sheettext1 tag match