Skip to content

Retrieves a list of source groups.

Method get.sources_groups
Description Retrieves a list of source groups.
Who has access Agents and clients
Required components Data API for configuration
Method weight 1 point

Request parameters

Name Type Required Description
access_token string yes Access token used to authenticate the request.
user_id number no Unique ID of the client user on whose behalf the agent is making the request. Required for agents. To retrieve a list of client users, use "get.customer_users".
limit number no Maximum number of records to return. See the "Paging" section.
offset number no Number of records to skip before returning results. Default: 0. See the "Paging" section.
filter object no Filtering criteria. See the "Filters" section.
fields array no Fields to include in the response. See the "Viewing returned data" section.
sort array no Sorting criteria. See the "Data sorting" section.

Response parameters

Name Type Valid values Filtering Sorting Default response Description
id number yes yes yes Unique source group ID.
name string yes yes yes Source group name.
channel_id number yes yes yes Unique source channel ID.
channel_name string yes yes yes Source channel name.
channel_mnemonicstring yes yes yes Source channel mnemonic.
is_custom boolean yes yes yes Whether the source group was created by a client user.
state enum
  • active - Group active
  • off - Group disabled
  • removed - Group deleted
yes yes yes Source group status.

Example request

{
    "jsonrpc": "2.0",
    "id": "number",
    "method": "get.sources_groups",
    "params": {
        "access_token": "string",
        "user_id": "number",
        "offset": "number",
        "limit": "number",
        "filter": {},
        "sort": [
            {
                "field": "string",
                "order": "string"
            }
        ],
        "fields": [
            "string"
        ]
    }
}

Response structure

{
    "jsonrpc": "2.0",
    "id": "number",
    "result": {
        "metadata": {},
        "data": [
            {
                "id": "number",
                "name": "string",
                "channel_id": "number",
                "channel_name": "string",
                "channel_mnemonic": "string",
                "is_custom": "boolean",
                "state": "enum"
            }
        ]
    }
}

Example response

{
    "jsonrpc": "2.0",
    "id": "HXw4IeLYAfblv6FRkzRNd",
    "result": {
        "data": [
            {
                "id": -3,
                "name": "Bing Ads",
                "is_custom": false,
                "state": "active",
                "channel_id": -1,
                "channel_name": "Paid Search",
                "channel_mnemonic": "context"
            },
            {
                "id": -1,
                "name": "Google Ads",
                "is_custom": false,
                "state": "active",
                "channel_id": -1,
                "channel_name": "Paid Search",
                "channel_mnemonic": "context"
            },
            {
                "id": -4,
                "name": "Begun",
                "is_custom": false,
                "state": "active",
                "channel_id": -1,
                "channel_name": "Paid Search",
                "channel_mnemonic": "context"
            },
            {
                "id": -2,
                "name": "Yandex Direct",
                "is_custom": false,
                "state": "active",
                "channel_id": -1,
                "channel_name": "Paid Search",
                "channel_mnemonic": "context"
            }
        ],
        "metadata": {
            "total_items": 4,
            "version": null,
            "limits": {}
        }
    }
}

Possible errors

See the "Errors for get methods" section.