Get a List of Workgroups socialnetwork.api.workgroup.list

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: socialnetwork

Who can execute the method: any user

The method socialnetwork.api.workgroup.list returns a list of workgroups, projects, scrums, and collaborations based on the current user's permissions.

Method Parameters

Required parameters are marked with *

Name
type

Description

filter
object

An object for filtering in the format {"field_1": "value_1", ... "field_N": "value_N"}.

See below for the list of available fields for filtering.

An additional prefix can be specified for the key to clarify the filter's behavior. Possible prefix values:

  • >= — greater than or equal to
  • > — greater than
  • <= — less than or equal to
  • < — less than
  • % — LIKE, substring search. The % symbol in the filter value does not need to be passed
  • =% — LIKE, substring search. The % symbol needs to be passed in the value
  • %= — LIKE (similar to =%)
  • !% — NOT LIKE, substring search. The % symbol in the filter value does not need to be passed
  • !=% — NOT LIKE, substring search. The % symbol needs to be passed in the value
  • !%= — NOT LIKE (similar to !=%)
  • = — equal, exact match (used by default)
  • != — not equal
  • ! — not equal

If IS_ADMIN = Y is not passed in params, the method automatically adds a check for the current user's permissions CHECK_PERMISSIONS.

The method also always adds a filter by site:

  • for extranet users, the extranet site is used
  • for others — the site from params[siteId] or the current account site

select
array

An array containing the list of fields to select.

See below for the list of available fields for selection.

If the parameter is not passed or is empty, only ID is selected. The ID field is always returned even if it is not included in select. Unknown fields are ignored

order
object

A sorting object in the format {"field_1": "order_1", ..., "field_N": "order_N"}.

Possible values for field correspond to the fields from the list of available fields for filtering.

Possible values for order:

  • ASC — ascending order
  • DESC — descending order

params
object

Additional request parameters

start
integer

Pagination parameter.

The page size for results is 50 records.

To get the second page, pass 50; for the third — 100, and so on.

Formula: start = (N - 1) * 50, where N is the page number.

If -1 is passed, the response will not include the total field.

Available Fields for Filtering

Name
type

Description

ID
integer

Group identifier

NAME
string

Group name

OWNER_ID
integer

Owner identifier

ACTIVE
boolean

Group activity status: Y or N

VISIBLE
boolean

Group visibility in the general list: Y or N

OPENED
boolean

Is the group open for free membership: Y or N

CLOSED
boolean

Is the group archived: Y or N

PROJECT
boolean

Object type: Y — project, N — group

SUBJECT_ID
integer

Group subject identifier

SITE_ID
string

Group site identifier

DATE_CREATE
datetime

Group creation date

DATE_UPDATE
datetime

Group modification date

DATE_ACTIVITY
datetime

Last activity date

Available Fields for Selection

Name
type

Description

ID
integer

Group identifier

ACTIVE
boolean

Group activity status: Y or N

SUBJECT_ID
integer

Group subject identifier

NAME
string

Group name

DESCRIPTION
text

Group description

KEYWORDS
string

Group keywords

CLOSED
boolean

Archive group status: Y or N

VISIBLE
boolean

Group visibility status: Y or N

OPENED
boolean

Open group status: Y or N

PROJECT
boolean

Project status: Y or N

LANDING
boolean

Group for publication status: Y or N

DATE_CREATE
datetime

Creation date

DATE_UPDATE
datetime

Modification date

DATE_ACTIVITY
datetime

Last activity date

IMAGE_ID
integer

User avatar identifier

AVATAR_TYPE
string

System avatar type

OWNER_ID
integer

Owner identifier

NUMBER_OF_MEMBERS
integer

Number of participants

NUMBER_OF_MODERATORS
integer

Number of moderators

INITIATE_PERMS
enum

Who can invite participants:

  • A — group owner only
  • E — owner and moderators
  • K — all members

PROJECT_DATE_START
datetime

Project start date

PROJECT_DATE_FINISH
datetime

Project end date

SCRUM_OWNER_ID
integer

Scrum owner identifier

SCRUM_MASTER_ID
integer

Scrum master identifier

SCRUM_SPRINT_DURATION
integer

Sprint duration in seconds

SCRUM_TASK_RESPONSIBLE
enum

Default assignee in Scrum:

  • A — task creator
  • M — Scrum master

TYPE
string

Group type: group, project, scrum, collab

AVATAR
string

Avatar URL

Parameter params

Name
type

Description

IS_ADMIN
string

Disable permission check.

Possible values:

  • Y — disable permission check if the current user is an administrator

If Y is passed by a non-administrator, the value is ignored.

siteId
string

Identifier of the site to be used in the automatic filter SITE_ID for regular users.

For extranet users, this value is ignored: the method always uses the extranet site.

mode
string

Response mode.

Supported value:

  • mobile — adds the additionalData field to each list item

The additionalData field has the structure:

  • role — the current user's role in the group
  • initiatedByType — who initiated the user's connection to the group:
    • U — the user themselves (e.g., sent a request to join)
    • G — the group (e.g., the user was invited)
  • features — list of available group tools (returned if features/mandatoryFeatures are passed)

features
string[]

List of group tool codes to consider when forming additionalData in mobile mode

mandatoryFeatures
string[]

Tool codes from features to include in additionalData.features regardless of the current user's permissions

shouldSelectHasCollabers
boolean

Whether to add the hasCollabers external member indicator to additionalData.

Possible values:

  • true or Y — add the indicator
  • false or N — do not add the indicator

Default — false

shouldEnsureHasCollabers
boolean

Whether to recalculate hasCollabers before returning the response.

The parameter is used only if shouldSelectHasCollabers is true or Y.

Possible values:

  • true or Y — recalculate the indicator
  • false or N — return the saved value

Default — false

shouldSelectDialogId
string

Whether to add a field with the chat identifier dialogId to the list item.

Possible values:

  • Y — add dialogId
  • N — do not add dialogId

Default — N

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"filter":{"ACTIVE":"Y","CLOSED":"N","%NAME":"group"},"select":["ID","NAME","TYPE","AVATAR"],"order":{"ID":"DESC"},"params":{"mode":"mobile","shouldSelectDialogId":"Y"}}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/socialnetwork.api.workgroup.list
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"filter":{"ACTIVE":"Y","CLOSED":"N","%NAME":"group"},"select":["ID","NAME","TYPE","AVATAR"],"order":{"ID":"DESC"},"params":{"mode":"mobile","shouldSelectDialogId":"Y"},"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/socialnetwork.api.workgroup.list
        
// This snippet is an ES module: top-level await requires type="module" or a bundler.
        // $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
        import { Text } from '@bitrix24/b24jssdk'
        import type { B24Frame } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        type WorkgroupListResult = {
          workgroups: Workgroup[]
        }
        
        type Workgroup = {
          id: number
          name: string
          type: 'group' | 'project' | 'scrum' | 'collab' | null
          imageId: number
          avatarType: string | null
          avatar: string
          additionalData: {
            role: string
            initiatedByType: string
            features?: string[]
            hasCollabers?: boolean
          }
          dialogId: string
        }
        
        try {
          // socialnetwork.api.workgroup.list returns a single page (max 50 records). For the whole result set
          // use a list helper: $b24.actions.v2.callList.make() returns every record as one
          // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
          // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
          // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
          const response = await $b24.actions.v2.call.make<WorkgroupListResult>({
            method: 'socialnetwork.api.workgroup.list',
            params: {
              filter: { ACTIVE: 'Y', CLOSED: 'N', '%NAME': 'group' },
              select: ['ID', 'NAME', 'TYPE', 'AVATAR'],
              order: { ID: 'DESC' },
              params: { mode: 'mobile', shouldSelectDialogId: 'Y' },
              start: 0,
            },
            requestId: Text.getUuidRfc4122()
          })
        
          // The payload is available only on a successful response
          if (!response.isSuccess) {
            console.error(response.getErrorMessages().join('; '))
          } else {
            const result = response.getData()!.result
            console.info('Workgroups:', result.workgroups.length, result.workgroups)
          }
        } catch (error) {
          // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
          console.error(error)
        }
        
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
        <script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
        <script>
          async function fetchWorkgroupList() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              // socialnetwork.api.workgroup.list returns a single page (max 50 records). For the whole result set
              // use a list helper: $b24.actions.v2.callList.make() returns every record as one
              // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
              // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
              // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
              const response = await $b24.actions.v2.call.make({
                method: 'socialnetwork.api.workgroup.list',
                params: {
                  filter: { ACTIVE: 'Y', CLOSED: 'N', '%NAME': 'group' },
                  select: ['ID', 'NAME', 'TYPE', 'AVATAR'],
                  order: { ID: 'DESC' },
                  params: { mode: 'mobile', shouldSelectDialogId: 'Y' },
                  start: 0,
                },
                requestId: B24Js.Text.getUuidRfc4122()
              })
        
              // The payload is available only on a successful response
              if (!response.isSuccess) {
                console.error(response.getErrorMessages().join('; '))
                return
              }
        
              const result = response.getData().result
              console.info('Workgroups:', result.workgroups.length, result.workgroups)
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', fetchWorkgroupList)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.socialnetwork.api.workgroup.list(
                filter={
                    "ACTIVE": "Y",
                    "CLOSED": "N",
                    "%NAME": "group",
                },
                select=[
                    "ID",
                    "NAME",
                    "TYPE",
                    "AVATAR",
                ],
                order={
                    "ID": "DESC",
                },
                params={
                    "mode": "mobile",
                    "shouldSelectDialogId": "Y",
                },
            ).response
            result = bitrix_response.result
            print(result)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        

Example as_list

from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.socialnetwork.api.workgroup.list(
                filter={
                    "ACTIVE": "Y",
                    "CLOSED": "N",
                    "%NAME": "group",
                },
                select=[
                    "ID",
                    "NAME",
                    "TYPE",
                    "AVATAR",
                ],
                order={
                    "ID": "DESC",
                },
                params={
                    "mode": "mobile",
                    "shouldSelectDialogId": "Y",
                },
            ).as_list().response
            result = bitrix_response.result
            for item in result:
                print(item)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        

Example as_list_fast

from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.socialnetwork.api.workgroup.list(
                filter={
                    "ACTIVE": "Y",
                    "CLOSED": "N",
                    "%NAME": "group",
                },
                select=[
                    "ID",
                    "NAME",
                    "TYPE",
                    "AVATAR",
                ],
                order={
                    "ID": "DESC",
                },
                params={
                    "mode": "mobile",
                    "shouldSelectDialogId": "Y",
                },
            ).as_list_fast(descending=True).response
            result = bitrix_response.result
            for item in result:
                print(item)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'socialnetwork.api.workgroup.list',
                    [
                        'filter' => ['ACTIVE' => 'Y', 'CLOSED' => 'N', '%NAME' => 'group'],
                        'select' => ['ID', 'NAME', 'TYPE', 'AVATAR'],
                        'order' => ['ID' => 'DESC'],
                        'params' => [
                            'mode' => 'mobile',
                            'shouldSelectDialogId' => 'Y',
                        ],
                    ]
                );
        
            print_r($response->getResponseData()->getResult());
        } catch (\Throwable $exception) {
            echo $exception->getMessage();
        }
        
BX24.callMethod(
            'socialnetwork.api.workgroup.list',
            {
                filter: { ACTIVE: 'Y', CLOSED: 'N', '%NAME': 'group' },
                select: ['ID', 'NAME', 'TYPE', 'AVATAR'],
                order: { ID: 'DESC' },
                params: { mode: 'mobile', shouldSelectDialogId: 'Y' }
            },
            function(result) {
                if (result.error()) {
                    console.error(result.error());
                } else {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'socialnetwork.api.workgroup.list',
            [
                'filter' => ['ACTIVE' => 'Y', 'CLOSED' => 'N', '%NAME' => 'group'],
                'select' => ['ID', 'NAME', 'TYPE', 'AVATAR'],
                'order' => ['ID' => 'DESC'],
                'params' => [
                    'mode' => 'mobile',
                    'shouldSelectDialogId' => 'Y',
                ],
            ]
        );
        
        print_r($result);
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "socialnetwork.api.workgroup.list", b24.Params{
        	"filter": b24.Params{
        		"ACTIVE": "Y",
        		"CLOSED": "N",
        		"%NAME":  "group",
        	},
        	"select": []string{"ID", "NAME", "TYPE", "AVATAR"},
        	"order": b24.Params{
        		"ID": "DESC",
        	},
        	"params": b24.Params{
        		"mode":                 "mobile",
        		"shouldSelectDialogId": "Y",
        	},
        }, b24.WithIdempotent())
        if err != nil {
        	return fmt.Errorf("socialnetwork.api.workgroup.list: %w", err)
        }
        
        // The method wraps the response in an object with the "workgroups" key.
        raw, ok := b24.Unwrap(res.Result, "workgroups")
        if !ok {
        	return fmt.Errorf("no workgroups key in the response")
        }
        
        var items []struct {
        	ID       b24.ID `json:"id"`
        	Name     string `json:"name"`
        	Type     string `json:"type"`
        	ImageID  b24.ID `json:"imageId"`
        	Avatar   string `json:"avatar"`
        	DialogID string `json:"dialogId"`
        }
        if err := json.Unmarshal(raw, &items); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        for _, it := range items {
        	fmt.Println(it.ID)
        }
        

Response Handling

HTTP Status: 200

{
            "result": {
                "workgroups": [
                    {
                        "id": 5,
                        "name": "Open group for everyone",
                        "type": "group",
                        "imageId": 5,
                        "avatarType": null,
                        "avatar": "https://test.bitrix24.com/b13743910/resize_cache/5/7acf4caaf5d8/socialnetwork/8d6/8d2c04ece929572/3.png",
                        "additionalData": {
                            "role": "",
                            "initiatedByType": ""
                        },
                        "dialogId": ""
                    },
                    {
                        "id": 1,
                        "name": "Closed visible group",
                        "type": "group",
                        "imageId": 1,
                        "avatarType": null,
                        "avatar": "",
                        "additionalData": {
                            "role": "",
                            "initiatedByType": ""
                        },
                        "dialogId": "chat177"
                    }
                ]
            },
            "total": 2,
            "time": {
                "start": 1774357689,
                "finish": 1774357689.398272,
                "duration": 0.3982720375061035,
                "processing": 0,
                "date_start": "2026-03-24T16:08:09+02:00",
                "date_finish": "2026-03-24T16:08:09+02:00",
                "operating_reset_at": 1774358289,
                "operating": 0.12220001220703125
            }
        }
        

Returned Data

Name
type

Description

result
object

Root object of the response

workgroups
object[]

List of workgroups with field descriptions.

The structure of the object depends on the fields passed in select and the parameters in params.

If no groups are found by the filter, workgroups will return an empty array.

next
integer

Offset for the next page. The field is returned if there are more records.

total
integer

Total number of records. The field is not returned if the request is executed with start = -1.

time
time

Information about the execution time of the request.

workgroup Object Fields

Fields are passed in select in UPPER_SNAKE_CASE and returned in the response in camelCase. For example, DATE_CREATE corresponds to dateCreate, and NUMBER_OF_MEMBERS corresponds to numberOfMembers.

Response Field
type

select Field or Return Condition

Description

id
integer

ID

Group identifier. Always returned

active
boolean

ACTIVE

Group activity status: Y or N

subjectId
integer

SUBJECT_ID

Group subject identifier

name
string

NAME

Group name

description
text

DESCRIPTION

Group description

keywords
string

KEYWORDS

Group keywords

closed
boolean

CLOSED

Archive group status: Y or N

visible
boolean

VISIBLE

Group visibility status: Y or N

opened
boolean

OPENED

Open group status: Y or N

project
boolean

PROJECT

Project status: Y or N

landing
boolean

LANDING

Group for publication status: Y or N

dateCreate
datetime

DATE_CREATE

Group creation date

dateUpdate
datetime

DATE_UPDATE

Group modification date

dateActivity
datetime

DATE_ACTIVITY

Last activity date

imageId
integer

IMAGE_ID or AVATAR

Custom avatar identifier

avatarType
string | null

AVATAR_TYPE or AVATAR

System avatar type

avatar
string

AVATAR

Avatar URL. Returns an empty string if no avatar is set

ownerId
integer

OWNER_ID

Owner identifier

numberOfMembers
integer

NUMBER_OF_MEMBERS

Number of members

numberOfModerators
integer

NUMBER_OF_MODERATORS

Number of moderators

initiatePerms
enum

INITIATE_PERMS

Who can invite members: A — owner, E — owner and moderators, K — all members

projectDateStart
datetime | null

PROJECT_DATE_START

Project start date

projectDateFinish
datetime | null

PROJECT_DATE_FINISH

Project end date

scrumOwnerId
integer

SCRUM_OWNER_ID

Scrum owner identifier

scrumMasterId
integer

SCRUM_MASTER_ID

Scrum master identifier

scrumSprintDuration
integer

SCRUM_SPRINT_DURATION

Sprint duration in seconds

scrumTaskResponsible
enum

SCRUM_TASK_RESPONSIBLE

Default assignee: A — task creator, M — Scrum master

type
string | null

TYPE

Group type: group, project, scrum, collab

additionalData
object

params[mode] = mobile

Additional group and current user data (detailed description)

dialogId
string

params[shouldSelectDialogId] = Y

Group chat identifier. Returns an empty string if the chat is not found

additionalData Object

Name
type

Description

role
string

Current user's role in the group. Returns an empty string if the user is not associated with the group

initiatedByType
string

Who initiated the user's association with the group:

  • U — user
  • G — group

Returns an empty string if the user is not associated with the group

features
string[]

Available group tool codes. Returned if features or mandatoryFeatures are passed in params

hasCollabers
boolean

Whether the group has external members. Returned if params[shouldSelectHasCollabers] is true or Y

Error Handling

HTTP Status: 401

{
            "error": "insufficient_scope",
            "error_description": "The request requires higher privileges than provided by the webhook token"
        }
        

Name
type

Description

error
string

String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only error_description shows the reason

error_description
string

Error message for the developer. Do not show it to the end user without processing

Possible Error Codes

Code

Description

Value

insufficient_scope

Insufficient token scope

The token does not include the socialnetwork scope

Statuses and System Error Codes

HTTP Status: 4xx, 5xx

The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit

401

NO_AUTH_FOUND
Wrong authorization data

The request contains no authorization data: neither an access token nor a webhook code was passed

401

INVALID_REQUEST
Https required

Methods are called over the HTTPS protocol only

401

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support

401

ACCESS_DENIED
REST is available only on commercial plans

REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

No active webhook with the specified user identifier and secret code was found

404

ERROR_METHOD_NOT_FOUND
Method not found!

No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope

401

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with provided by the access token

401

expired_token
The access token provided has expired

The access token has expired

401

user_access_error
The user does not have access to the application

The application is installed, but the Bitrix24 administrator has granted access to it only to specific users

403

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open it on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site

Continue Learning