In plain words
REST API design means modelling your data as resources with noun addresses like /teams/42/invoices, using HTTP methods for the action and status codes for the outcome, and keeping all of it consistent.
Where you see it
Harbor opens a public API so customers can pull invoices into their accounting tools. GET /v1/teams/42/invoices lists them, GET /v1/invoices/inv_81 fetches one, and POST /v1/invoices/inv_81/refunds creates a refund, while every error comes back in the same JSON shape.
What goes wrong
- Verbs in the address
/getInvoices, /createRefund and /removeTeamMember make every endpoint something new to learn. Use nouns, and let GET, POST, PATCH and DELETE say what happens.
POST /api/getInvoicesForTeam - Returning 200 with an error inside
A 200 response with { "success": false } looks like success to every HTTP client, monitoring tool and retry rule. Use the status code that fits, such as 400, 401, 403, 404, 409 or 422.
- Exposing your tables as they are
If the API returns rows exactly as stored, every column rename breaks customers, and internal fields like stripe_customer_id leak out. Design the response for the client, and map your data to it.
What to tell your agent
Quick check
Sign in to earn +10 XP for itA Harbor endpoint returns status 200 with {"success": false, "error": "Invoice not found"}. What's the problem?