Skip to main content
GET
https://searchcompany-main.up.railway.app
/
api
/
organization
/
{org_id}
/
members
curl "https://searchcompany-main.up.railway.app/api/organization/org_2abc123/members" \
  -H "Authorization: Bearer <token>"
{
  "organization_id": "org_2abc123",
  "from_cache": true,
  "members": [
    {
      "membership_id": "orgmem_xyz789",
      "user_id": "user_abc123",
      "first_name": "Colin",
      "last_name": "Snyder",
      "email": "[email protected]",
      "image_url": "https://img.clerk.com/...",
      "role": "org:admin",
      "created_at": 1702234567
    },
    {
      "membership_id": "orgmem_def456",
      "user_id": "user_def456",
      "first_name": "Jane",
      "last_name": "Doe",
      "email": "[email protected]",
      "image_url": "https://img.clerk.com/...",
      "role": "org:member",
      "created_at": 1702345678
    }
  ],
  "total_members": 2,
  "pending_invitations": [
    {
      "id": "inv_pending123",
      "email": "[email protected]",
      "role": "org:member",
      "status": "pending",
      "created_at": 1702456789
    }
  ]
}
Returns all active team members and pending invitations for the Settings - Team page.
This endpoint uses intelligent caching. Member data is cached for 5 minutes and automatically refreshed via Clerk webhooks when members join/leave. Most requests respond in ~10ms using cached data.

Path Parameters

org_id
string
required
The Clerk organization ID

Query Parameters

limit
integer
default:"100"
Maximum number of members to return
offset
integer
default:"0"
Pagination offset
include_pending
boolean
default:"true"
Whether to include pending invitations
force_refresh
boolean
default:"false"
Bypass cache and fetch fresh data from Clerk API. Use sparingly as this is slower (~200ms vs ~10ms).

Response

organization_id
string
The organization ID
from_cache
boolean
Whether the data was served from cache (true) or fetched fresh from Clerk (false)
members
array
List of active team members
total_members
integer
Total count of active members
pending_invitations
array
List of pending invitations (if include_pending=true)

Member Object

FieldTypeDescription
membership_idstringMembership ID
user_idstringClerk user ID
first_namestringUser’s first name
last_namestringUser’s last name
emailstringUser’s email address
image_urlstringURL to user’s profile image
rolestring"org:admin" or "org:member"
created_atintegerUnix timestamp when user joined

Pending Invitation Object

FieldTypeDescription
idstringInvitation ID
emailstringInvited email address
rolestringRole they’ll have when they join
statusstring"pending"
created_atintegerUnix timestamp when invitation sent
curl "https://searchcompany-main.up.railway.app/api/organization/org_2abc123/members" \
  -H "Authorization: Bearer <token>"
{
  "organization_id": "org_2abc123",
  "from_cache": true,
  "members": [
    {
      "membership_id": "orgmem_xyz789",
      "user_id": "user_abc123",
      "first_name": "Colin",
      "last_name": "Snyder",
      "email": "[email protected]",
      "image_url": "https://img.clerk.com/...",
      "role": "org:admin",
      "created_at": 1702234567
    },
    {
      "membership_id": "orgmem_def456",
      "user_id": "user_def456",
      "first_name": "Jane",
      "last_name": "Doe",
      "email": "[email protected]",
      "image_url": "https://img.clerk.com/...",
      "role": "org:member",
      "created_at": 1702345678
    }
  ],
  "total_members": 2,
  "pending_invitations": [
    {
      "id": "inv_pending123",
      "email": "[email protected]",
      "role": "org:member",
      "status": "pending",
      "created_at": 1702456789
    }
  ]
}

Performance

This endpoint uses smart caching for optimal performance:
  • Cache Hit (~95% of requests): ~10-20ms response time
  • Cache Miss: ~200-300ms (fetches from Clerk, then caches)
  • Cache Duration: 5 minutes
  • Auto-Refresh: Clerk webhooks update cache in real-time when members change
Use force_refresh=true only when you need guaranteed fresh data (e.g., immediately after bulk operations).

Notes

  • Requires authentication with a valid Clerk JWT token
  • User must be a member of the organization to view members
  • Pending invitations are only returned if include_pending=true
  • Member data is automatically synced via Clerk webhook