Skip to content
campaiDeveloper
campai.com

Connect · Teams

GET/connect/organizations/{organizationId}/teamsReads only

List teams

Returns a paginated list of teams for an organization, with a count and parent, subteam and activity information. You can filter by search term, parent team or up to 30 team IDs, and control pagination and sorting. The default and maximum page size is 30.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have organization access.
  • The caller must have team.read.

Request

Path parameters

  • organizationIdidrequired

Query parameters

  • sortobject of string
    asc desc
    Keys: one of 5 values
    createdAt name roleName contactCount latestActivityAt
  • limitinteger

    0–30 · default 30

  • offsetinteger

    at least 0 · default 0

  • returnCountboolean

    default false

  • searchTermstring
  • parentTeamidnullable
  • teamIdsid[]

    at most 30 items

Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request GET 'https://cloud.campai.com/api/connect/organizations/YOUR_ORGANIZATION_ID/teams' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • countinteger

    at least 0

  • teamsobject[]
    24 properties
    • _idid
    • updatedAtstring · date-timenullable
    • removedAtstring · date-timenullable
    • updatedByobjectnullable

      When an actor is masked, its name is replaced with a no-permission name. Depending on the actor field's schema, other actor details may be removed or its image set to null.

      A non-contact teams[].updatedBy actor other than the current actor is masked without user.read.

      An API teams[].updatedBy actor is masked without apiKey.read, even if it is the current actor.

    • removedByobjectnullable

      When an actor is masked, its name is replaced with a no-permission name. Depending on the actor field's schema, other actor details may be removed or its image set to null.

      A non-contact teams[].removedBy actor other than the current actor is masked without user.read.

      An API teams[].removedBy actor is masked without apiKey.read, even if it is the current actor.

    • __ignoreTriggersstringnullable
    • organizationid
    • namestring

      1–80 characters

    • parentTeamidnullable
    • descriptionstring

      at most 256 characters

    • avatarobjectnullable
      4 properties
      • resourcestring

        at least 1 characters

      • fileNamestring

        at most 128 characters

      • contentTypestring

        at most 75 characters

      • fileSizeBytesinteger

        at least 0

    • membershipobject
      4 properties
      • contactTypesstring[]
        member address customer sponsor contributor employee supplier
      • segmentsstring[]

        each 1–30 characters

      • departmentsid[]
      • tagsstring[]

        at most 20 items · each 1–40 characters

    • memberRoleid
    • roleNamestring

      1–32 characters

    • contactCountinteger

      at least 0

    • joinedContactCountinteger

      at least 0

    • userCountinteger

      at least 0

    • membershipRevisioninteger

      at least 0

    • latestActivityAtstring · date-timenullable
    • synchronizationobject
      4 properties
      • statusstring
        pending failed completed
      • revisioninteger

        at least 0

      • notifyUserIdstringnullable
      • contactCursoridnullable
    • deletionCleanupobject
      1 property
      • statusstring
        pending failed completed
    • activityCountsobject
      2 properties
      • messageinteger

        at least 0

      • interactiveinteger

        at least 0

    • subteamCountinteger

      at least 0

    • parentobjectnullable

      This is null when the team has no parent or its parent is not found.

      2 properties
      • _idid
      • namestring

        1–80 characters

Response200
{
  "count": 0,
  "teams": [
    {
      "_id": "000000000000000000000001",
      "organization": "000000000000000000000001",
      "name": "string",
      "parentTeam": "000000000000000000000001",
      "description": "string",
      "avatar": {
        "resource": "string"
      },
      "membership": {
        "contactTypes": [
          "member"
        ],
        "segments": [
          "string"
        ],
        "departments": [
          "000000000000000000000001"
        ],
        "tags": [
          "string"
        ]
      },
      "memberRole": "000000000000000000000001",
      "roleName": "string",
      "contactCount": 0,
      "joinedContactCount": 0,
      "userCount": 0,
      "membershipRevision": 0,
      "latestActivityAt": "2026-06-15T22:30:00Z",
      "activityCounts": {
        "message": 0,
        "interactive": 0
      },
      "subteamCount": 0,
      "parent": {
        "_id": "000000000000000000000001",
        "name": "string"
      }
    }
  ]
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.