Get accounts

Retrieve a list of available data source logins (authentications) and their accounts.

GET https://api.supermetrics.com/enterprise/v2/query/accounts
  • api_key string
    Conditional. API key when not using an authorization header. See authentication for more.
  • ds_id string
    Required. Data source ID. See data sources for more.
  • ds_users string | string[]
    Optional. List of data source login usernames to target. Case-insensitive.
  • cache_minutes integer
    Optional. Maximum allowed age of cache in minutes. Defaults to none for last fetched information. Value range of 60 minutes and 1440 minutes is enforced. Minimum and maximum values are subject to license restrictions.
Request
GET https://api.supermetrics.com/enterprise/v2/query/accounts?json={
    "api_key": "<api key>",
    "ds_id": "GA",
    "ds_users": "info@supermetrics.com,support@supermetrics.com"
}
Response
PropertyTypeDescription
meta > request_idstring API request ID
meta > query > cache_minutesinteger Requested maximum age of cache in minutes with minimum and maximum value enforced. Defaults to null.
data > * > ds_userstring Data source login username. Can be used as optional ds_user parameter in queries.
data > * > display_namestring Display name for login
data > * > cache_timestring ISO 8601 datetime for the last time the login data was fetched and cached. Defaults to null when no cache was used.
data > * > accounts > * > account_idstring Account ID
data > * > accounts > * > account_namestring Account name
data > * > accounts > * > group_namestring Account group name. Empty string when not available.
HTTP 200 OK
{
    "meta": {
        "request_id": "CLg60nHFw2LCOmM7mMfgVgpuURpr00iY",
        "query": {
            "cache_minutes": null
        }
    },
    "data": [
        {
            "ds_user": "35168435154",
            "display_name": "info@supermetrics.com (ID: 35168435154)",
            "cache_time": "2020-09-05T13:30:52+00:00",
            "accounts": [
                {
                    "account_id": "35135152",
                    "account_name": "Website tracking",
                    "group_name": "Supermetrics MCC"
                },
                {
                    "account_id": "2513515",
                    "account_name": "Application tracking",
                    "group_name": "Supermetrics MCC"
                }
            ]
        },
        {
            "ds_user": "5678909873",
            "display_name": "support@supermetrics.com (ID: 1351815122)",
            "cache_time": "2020-09-02T11:01:17+00:00",
            "accounts": [
                {
                    "account_id": "45678976",
                    "account_name": "Support site events",
                    "group_name": "Supermetrics"
                }
            ]
        }
    ]
}
Last updated 2022-06-22 UTC.