Skip to content

Response format

All responses are JSON. Successful collection endpoints return arrays at the top level; single-resource endpoints return a single object.

Collection endpoint (GET /organizations/:id/collabs.json):

[
{ "id": 9, "name": "Spring lipsticks", "state": "published", ... },
{ "id": 10, "name": "Summer fragrances", "state": "draft", ... }
]

Single resource (GET /organizations/:id/collabs/9.json):

{ "id": 9, "name": "Spring lipsticks", "state": "published", "brief": "<p>...</p>" }

brief-style rich-text fields are returned as pre-rendered HTML and are typically only included on show, not on index.

For authorization / authentication errors:

{ "error": "Not authorized" }

For validation errors (422 Unprocessable Content):

{ "errors": { "name": ["can't be blank"] } }

The errors object is keyed by attribute name; each value is an array of human-readable messages.

Every JSON request must include:

Accept: application/json

Mutation requests (POST, PATCH, PUT) should also send:

Content-Type: application/json

Without Accept: application/json, endpoints respond with HTML — the same controllers serve both.