Organizations
An organization the authenticated user belongs to.
Operations
Section titled “Operations”| Operation | Method + path | Token scope | Role | Notes |
|---|---|---|---|---|
| List organizations | GET /organizations.json | read or write | Authenticated user | Paginated |
| Show organization | GET /organizations/:id.json | read or write | Organization member | ETag on show |
| Create organization | POST /organizations.json | write | Authenticated user | Creator becomes owner |
| Update organization | PATCH /organizations/:id.json | write | Organization admin | purge_logo removes logo |
| Delete organization | DELETE /organizations/:id.json | write | Organization owner | Guarded by subscription and resource checks |
Resource shape
Section titled “Resource shape”{ "id": "gKpMxN", "name": "Acme Cosmetics", "privacy_setting": "public", "website": "https://acme.example.com", "created_at": "2026-04-01T10:00:00Z", "updated_at": "2026-05-01T10:00:00Z", "url": "https://hypemarket.ai/organizations/gKpMxN.json", "logo_url": "https://hypemarket.ai/rails/active_storage/..."}privacy_setting is one of public, private, restricted. logo_url is omitted when no logo is attached.
GET /organizations.jsonReturns the organizations the authenticated user belongs to. Paginated — see Pagination.
GET /organizations/:id.jsonReturns one organization. Sets an ETag — supply If-None-Match for 304 Not Modified. Returns 404 if the organization exists but you’re not a member.
Create
Section titled “Create”POST /organizations.json
{ "organization": { "name": "Hot new organization", "privacy_setting": "public" } }Requires a write-scoped token. The authenticated user becomes the organization’s owner. Returns 201 Created with the new organization. Logo upload requires a multipart request.
Update
Section titled “Update”PATCH /organizations/:id.json
{ "organization": { "name": "Renamed", "website": "https://new.example.com" } }Requires write scope and an admin role on the organization. To remove an existing logo, include "purge_logo": "1" inside the organization payload.
Delete
Section titled “Delete”DELETE /organizations/:id.jsonReturns 204 No Content. Fails with 422 if the organization still has an active subscription, any campaigns, or any collabs.
Errors
Section titled “Errors”| Code | When |
|---|---|
401 | Missing token, or read token attempting a write |
403 | Authenticated, but role does not permit this action |
404 | Organization does not exist for you |
422 | Validation failed, or a delete guard blocked the operation |