> ## 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.

# Overview

> Architecture for the Get User Businesses endpoint

## Purpose

Returns all businesses the authenticated user belongs to. Used for the business switcher in the dashboard.

## Architecture

```mermaid theme={null}
flowchart TD
    Request["GET /api/user/businesses"]
    
    subgraph auth [Authentication]
        GetUser["Get user_id from request.state"]
        GetOrg["Get org_id, org_slug from request.state"]
    end
    
    Request --> GetUser
    GetUser --> GetOrg
    GetOrg --> Response
```

## Response Format

```json theme={null}
{
  "businesses": [
    {
      "id": "org_abc123",
      "name": "Acme Corp",
      "slug": "acme-corp",
      "image_url": null,
      "role": "org:admin",
      "business_url": null,
      "subscription_status": "active",
      "created_at": 1702234567
    }
  ],
  "total": 1
}
```

## Code Location

```
src/app/apis/settings_overall/user_businesses/routes.py
```
