Get Organizations
Retrieve all organizations that an account belongs to. Used for organization selector dropdowns and access control.
Endpoint
GET https://api.recoupable.com/api/organizationsParameters
| Name | Type | Required | Description |
|---|---|---|---|
| accountId | string | Yes | The unique identifier of the account |
Request Examples
cURL
curl -X GET "https://api.recoupable.com/api/organizations?accountId=123e4567-e89b-12d3-a456-426614174000" \
-H "Content-Type: application/json"Response Format
{
"status": "success",
"organizations": [
{
"id": "row-uuid-1",
"organization_id": "org-account-uuid-1",
"organization_name": "Rostrum Records",
"organization_image": "https://example.com/rostrum-logo.jpg"
},
{
"id": "row-uuid-2",
"organization_id": "org-account-uuid-2",
"organization_name": "Fat Beats",
"organization_image": "https://example.com/fatbeats-logo.jpg"
}
]
}{
"status": "success",
"organizations": []
}Response Properties
| Property | Type | Description |
|---|---|---|
| status | string | Status of the request ("success" or "error") |
| organizations | array | List of organizations the account belongs to |
| organizations[].id | string | UUID of the membership record |
| organizations[].organization_id | string | UUID of the organization account |
| organizations[].organization_name | string | Display name of the organization |
| organizations[].organization_image | string | null | Organization logo/image URL |
| message | string | Error message (only present if status is "error") |
Use Cases
- Organization Selector: Display dropdown of account's organizations in the UI
- Context Switching: Allow accounts to switch between personal and organization contexts
- Access Control: Verify account membership before showing organization data