Teams

List teams with cursor-based pagination

Changed on

Returns teams the current user has access to with cursor pagination

get/teams

Request

  • Base URL
    https://api.session.services
  • Auth
    API key in header x-tenant-id

Query parameters

userId, string

Filter teams by user membership. If omitted, returns all teams (tenant admin only). If provided, returns teams where the specified user is a member

approval, 'PENDING' | 'APPROVED' | 'REJECTED'

Filter teams by approval status. PENDING: awaiting review, APPROVED: can operate, REJECTED: cannot operate

query, string

Optional search query for filtering teams by name or slug

sort, 'createdAt'

Optional list sort field. Use createdAt to return newest or oldest teams first.

Example:createdAt
direction, 'asc' | 'desc'

Sort direction for team lists. Defaults to desc when sort is provided.

Example:desc
limit, integer

Maximum number of teams to return per request (1-100, default: 20)

Example:20
cursor, string

Pagination cursor from previous response. Used to fetch next page of results

Response

OK

object required
teams, object[] required

Array of teams for the current result set

before, string nullable

Cursor for navigating backward in the result set. Omitted when there are no prior results.

after, string nullable

Cursor for navigating forward in the result set. Omitted when there are no subsequent results.

limit, number required

Maximum number of items to return in each result set

Example response

{
  "teams": [
    {
      "publicBaseUrl": "https://sash.net.au",
      "image": {
        "src": "https://assets.session.services/my-image.jpg",
        "alt": "My Image",
        "width": 1080,
        "height": 1080
      },
      "member": {
        "permissions": []
      }
    }
  ],
  "before": "eyJ2ZXJzaW9uIjoxLCJpbnRlbnQiOnsic291cmNlIjoiZGVtbyJ9LCJwb3MiOnsicHJpbWFyeUtleSI6InBybV8wMXM4NTNqIn19",
  "after": "eyJ2ZXJzaW9uIjoxLCJpbnRlbnQiOnsic291cmNlIjoiZGVtbyJ9LCJwb3MiOnsicHJpbWFyeUtleSI6InBybV8wMXM4NTNkIn19",
  "limit": 20
}

Changes

    • info

      added the optional property teams/items/gateway/readiness to the response with the status

    • breaking

      added the pattern ^usr_[0-9a-z]{26}$ to the query request parameter userId

    • breaking

      for the query request parameter limit, the type changed from number to integer

    6 more changes in this revision