Skip to main content
GET
/
api
/
members
List Members
curl --request GET \
  --url https://api.example.com/api/members
{
  "members": [
    {
      "email": "<string>",
      "permission": "<string>",
      "name": "<string>",
      "picture": {},
      "hasLoggedIn": true,
      "isAdminByEnv": true
    }
  ],
  "error": {}
}

Authentication

This endpoint requires admin authentication. Include your session cookie in the request.

Response

Returns an array of workspace members, including both explicitly added members and environment-based admins.
members
array
Array of member objects

Error Responses

error
object

Examples

curl -X GET https://your-domain.com/api/members \
  -H "Cookie: your-session-cookie"

Example Response

[
  {
    "email": "[email protected]",
    "permission": "admin",
    "name": "Admin User",
    "picture": "https://lh3.googleusercontent.com/a/...",
    "hasLoggedIn": true,
    "isAdminByEnv": true
  },
  {
    "email": "[email protected]",
    "permission": "send",
    "name": "Support Team",
    "picture": "https://lh3.googleusercontent.com/a/...",
    "hasLoggedIn": true,
    "isAdminByEnv": false
  },
  {
    "email": "[email protected]",
    "permission": "view",
    "name": "viewer",
    "picture": null,
    "hasLoggedIn": false,
    "isAdminByEnv": false
  }
]

Implementation Details

  • Members are ordered by creation date (newest first)
  • Environment-based admins (from ADMIN_EMAILS) are always included at the top of the list
  • Environment-based admins always have admin permission regardless of database settings
  • User details (name, picture) are fetched from the users table if the member has logged in
  • Source: src/app/api/members/route.ts:10

Build docs developers (and LLMs) love