Design a clear REST API contract | DevPrompt Lab
Specify routes, validation, authorization, errors, and pagination consistently.
prompt · API design · intermediate
English Tiếng ViệtCreate an implementation-ready API contract that aligns client needs with server-side ownership and data rules.
Reusable content
Design the API contract for the capability below. Specify method and route, authentication type, authorization scope, request fields and limits, response envelope, status codes, validation errors, pagination and sorting rules, and idempotency behavior where relevant. Keep locale separate from domain language fields. Explain how legacy clients remain compatible if the route replaces an existing one. Include examples with realistic but non-sensitive values.
Capability: {{CAPABILITY}}
Clients: {{CLIENTS}}
Authentication: {{AUTH}}
Data model: {{DATA_MODEL}}
How to use it
Describe current response conventions and whether clients are browser sessions, API keys, or both.
Example
GET /v1/resources?locale=vi&programmingLanguage=TypeScript&page=1. locale chooses translated text; programmingLanguage filters the resource domain.