Access

Get a workspace and its groups

GET
/api/workspaces/{workspaceId}

Authorization

sessionCookie
cookiebetter-auth.session_token<token>

The Better Auth email/password session cookie used by the web application.

Path Parameters

workspaceId*string
Length1 <= length

Response Body

Response for status 200

application/json
  1. response
workspace*
membership*
members*array<>
teams*array<>
Example Request
curl -X GET 'https://postbot.example/api/workspaces/string'
Example Response
{
  "workspace": {
    "id": "string",
    "name": "string",
    "slug": "string",
    "isDefault": true,
    "createdAt": 0,
    "updatedAt": 0
  },
  "membership": {
    "role": "owner"
  },
  "members": [
    {
      "id": "string",
      "userId": "string",
      "email": "string",
      "name": "string",
      "image": "string",
      "role": "string",
      "createdAt": 0
    }
  ],
  "teams": [
    {
      "id": "string",
      "name": "string",
      "memberCount": 0,
      "isDefault": true,
      "createdAt": 0,
      "updatedAt": 0
    }
  ]
}

Was this page helpful?