Skip to main content
GET
https://searchcompany-main.up.railway.app
/
api
/
user
/
businesses
curl "https://searchcompany-main.up.railway.app/api/user/businesses" \
  -H "Authorization: Bearer <clerk_jwt_token>"
{
  "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
}
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

businesses
array
List of businesses the user belongs to
total
integer
Total number of businesses

Business Object

FieldTypeDescription
idstringClerk organization ID
namestringBusiness display name
slugstringURL-friendly identifier
image_urlstringBusiness logo/image URL
rolestringUser’s role (org:admin or org:member)
business_urlstringPrimary website URL
subscription_statusstringactive, trialing, canceled, etc.
created_atintegerUnix timestamp
curl "https://searchcompany-main.up.railway.app/api/user/businesses" \
  -H "Authorization: Bearer <clerk_jwt_token>"
{
  "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
}

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