> ## Documentation Index
> Fetch the complete documentation index at: https://docs.searchcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get User Businesses

> Get all businesses the authenticated user belongs to

Returns all organizations (businesses) that the authenticated user is a member of. Used for the business switcher toggle to allow users to switch between their different businesses.

Each business is completely independent with its own:

* Billing and subscription
* Team members
* Products and tracking data
* Visibility scores

## Authentication

Requires a valid Clerk JWT token in the Authorization header.

## Response

<ResponseField name="businesses" type="array">
  List of businesses the user belongs to
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of businesses
</ResponseField>

### Business Object

| Field                 | Type    | Description                               |
| --------------------- | ------- | ----------------------------------------- |
| `id`                  | string  | Clerk organization ID                     |
| `name`                | string  | Business display name                     |
| `slug`                | string  | URL-friendly identifier                   |
| `image_url`           | string  | Business logo/image URL                   |
| `role`                | string  | User's role (`org:admin` or `org:member`) |
| `business_url`        | string  | Primary website URL                       |
| `subscription_status` | string  | `active`, `trialing`, `canceled`, etc.    |
| `created_at`          | integer | Unix timestamp                            |

<RequestExample>
  ```bash cURL theme={null}
  curl "https://searchcompany-main.up.railway.app/api/user/businesses" \
    -H "Authorization: Bearer <clerk_jwt_token>"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "businesses": [
      {
        "id": "org_2abc123",
        "name": "Nike",
        "slug": "nike-123456",
        "image_url": null,
        "role": "org:admin",
        "business_url": "https://nike.com",
        "subscription_status": "active",
        "created_at": 1702234567
      },
      {
        "id": "org_2def456",
        "name": "Adidas",
        "slug": "adidas-789012",
        "image_url": null,
        "role": "org:admin",
        "business_url": "https://adidas.com",
        "subscription_status": "active",
        "created_at": 1702345678
      }
    ],
    "total": 2
  }
  ```
</ResponseExample>

## Use Cases

1. **Business Switcher**: Populate the dropdown showing all businesses a user can access
2. **Multi-tenant Dashboard**: Allow users to manage multiple independent businesses
3. **Role-based Access**: Show different UI based on user's role in each org

## Notes

* A user can belong to multiple organizations
* Each organization is billed separately
* Switching between orgs is instant (no page reload needed)
* New businesses are created via the onboarding flow with `?new=true` parameter
