Response format
Successful API responses are JSON. Collection endpoints return arrays at the top level; single-resource endpoints return a single object.
Successful responses
Section titled “Successful responses”Collection endpoint (GET /organizations/:organization_id/collabs.json):
[ { "id": "qZmRpL", "name": "Spring lipsticks", "state": "published", ... }, { "id": "mxKbpQ", "name": "Summer fragrances", "state": "draft", ... }]Single resource (GET /organizations/:organization_id/collabs/:id.json):
{ "id": "qZmRpL", "name": "Spring lipsticks", "state": "published", "brief": "<p>...</p>" }id values are opaque strings (sqids), not integers — treat them as tokens.
brief-style rich-text fields are returned as pre-rendered HTML and are typically only included on show, not on index.
Error responses
Section titled “Error responses”Validation errors (422 Unprocessable Content) use a structured JSON envelope:
{ "errors": { "name": ["can't be blank"] } }The errors object is keyed by attribute name; each value is an array of human-readable messages.
Authorization and missing-resource responses are less uniform:
- Bearer-token failures (
401 Unauthorized) may be header-only or plain text rather than JSON. - Organization-scoped
403 Forbiddenresponses, and many organization-scoped404 Not Foundresponses, use:
{ "error": "Not authorized" }- Some user-scoped missing-resource responses return
404with no body. Example:GET /me/address.jsonbefore the user has saved an address.
Content-Type
Section titled “Content-Type”Use either of these to select JSON:
- Request a
.jsonURL, for example/organizations.json - Send
Accept: application/json
Using both is recommended, but either one is enough.
If you send a JSON request body on POST, PATCH, or PUT, also send:
Content-Type: application/jsonWithout a .json suffix or Accept: application/json, the same controllers fall back to HTML behavior.