--- title: "Data source user in Connector builder | Supermetrics" slug: "data-source-user" description: "Learn how to configure the data source user in your connector to store access tokens and user info for seamless authentication and API requests." updated: 2026-10-22T13:20:35Z published: 2026-10-22T13:20:35Z canonical: "docs.supermetrics.com/data-source-user" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.supermetrics.com/llms.txt > Use this file to discover all available pages before exploring further. # Data source user Data source user defines how the access token and other user information received from the user during the authentication flow (like username or ID) is stored. If you have configured authentication in your connector, you should also configure the data source user object to store the access token and other user-related information, so you can use these values later in your connector through [placeholders](/v1/docs/placeholders). The data source user is configured by adding the `dataSourceUser` object in the connector configuration. You can also [configure a request](/v1/docs/request-configuration) under data source user object to fetch additional information about the user. For example, if the API provides a `/me` endpoint to fetch details of an authenticated user, configuring a request to that endpoint under data source user object is a good practice. > [!NOTE] > Note > > If your connector does not have authentication configured, you don’t need to include a data source user component in your configuration. ## Fields The `dataSourceUser` object has the following structure: | Field | Required | Description | | --- | --- | --- | | `userInfo` | Yes | Where to get the logged-in user's details, such as ID and label (see below). | | `request` | No | A request used to fetch additional user details from the data source API. | The `userInfo` object defines where each user detail comes from: | Field | Required | Description | | --- | --- | --- | | `id` | Yes | Where to get the user's unique identifier. Used to distinguish different connections. | | `label` | Yes | Where to get the user's display name. This is what identifies the connection to users in Supermetrics products. | | `accessToken` | No | Where to get the user's access token (if applicable). | | `properties` | No | A list of any other values you want to store for later use, beyond `id` and `label` | Each of these is a value source — it defines where the value comes from, for example `userInput` (a value from an input field), `jsonPath` (a value from a response), or `static` (a fixed or generated value). ## Example configuration The data source user component has two main objects under it: - `userInfo`: Object allowing you to configure what information and properties are stored for the user. Common examples of such information are: - User ID (`userId`) - Display name (`label` ) - Access token (`accessToken`) - `request`: Object allowing you to configure an additional request to be made for fetching user information programmatically via API ### Configuring userInfo object This object defines which information we store from the user and where the values come from. In general, these values can come from two sources: - User inputs during authentication (source: `userInput` ) - From the request configured under data source user (source: `jsonPath` ) #### Value from inputs Here is an example configuration where **values come from inputs** during the authentication flow, commonly used with [API key authentication:](/v1/docs/authentication#api-key-authentication) - `id` is generated programmatically using `{{identity()}}` placeholder - `label` , also known as display name, coming from a field with ID `account_name` configured in the authentication - `accessToken` , coming from the field with ID `api_key` configured in the authentication ```json  "dataSourceUser": {    "userInfo": {      "id": {        "source": "static",        "value": "{{identity()}}"      },      "label": {        "source": "userInput",        "value": "account_name"      },      "accessToken": {        "source": "userInput",        "value": "api_key"      }    }  } ``` **Note:** Using `{{ identity() }}` to generate the `id` works only with API key / user input authentication. With other authentication methods, use either some input value or fetch the `id` from request based on the example below. #### Value from JSON-formatted request Here is another example configuration where **values come from a JSON-formatted request**, for which you can find the configuration below: - `id` is read from the response field `id` - `label` , also known as display name, coming from the response field `display_name` - Note: In this case, we haven’t configured `accessToken`, as in this case, we’ve assumed it’s already stored as part of the [OAuth2 authentication flow](/v1/docs/authentication#oauth2-authentication) ```json  "dataSourceUser": {    "userInfo": {      "id": {        "source": "jsonPath",        "value": "$.id"      },      "label": {        "source": "jsonPath",        "value": "$.display_name"      }    }  } ``` ### Configuring request object Now, let’s look at an example for a case where we want to configure a request to fetch user information. We will use the Spotify API again as an example. The [Spotify API has an endpoint](https://developer.spotify.com/documentation/web-api/reference/get-current-users-profile) `https://api.spotify.com/v1/me` that can be used to get information about an authenticated user. It will return information like the display name and email of the user. Thus, we will configure `request` object under the `dataSourceUser` object, so data is fetched automatically when the user authenticates. We’ll configure: - GET request to the correct endpoint - Request headers, including the access token used via a placeholder - Response handling that defines how the response should be read A configuration would look like this: ```json "dataSourceUser": {    "request": {      "method": "GET",      "url": "https://api.spotify.com/v1/me",      "headers": [        {          "name": "Authorization",          "value": "Bearer {{user.access_token}}"        }      ],      "response": {        "type": "JSON",        "dataRows": {          "source": "jsonPath",          "value": "$"        }      }    } } ``` And now, when we combine it with the `userInfo` object, we have a full configuration for the Data source user: ```json "dataSourceUser": {    "request": {      "method": "GET",      "url": "https://api.spotify.com/v1/me",      "headers": [        {          "name": "Authorization",          "value": "Bearer {{user.access_token}}"        }      ],      "response": {        "type": "JSON",        "dataRows": {          "source": "jsonPath",          "value": "$"        }      }    },    "userInfo": {      "id": {        "source": "jsonPath",        "value": "$.id"      },      "label": {        "source": "jsonPath",        "value": "$.display_name"      }    }  } ``` ### Storing additional properties Beyond `id` and `label`, you can store any other values the user provided or the API returned, using the `properties` array under `userInfo`. Each entry is a value source with its own `id`, and becomes available later through the `{{user.properties.<id>}}` placeholder. This is useful for values you need in later requests — for example, a company name or region the user entered that forms part of a request URL. ```json "dataSourceUser": {  "userInfo": {    "id": {      "source": "static",      "value": "{{ identity() }}"    },    "label": {      "source": "userInput",      "value": "account_name"    },    "properties": [      {        "id": "company",        "source": "userInput",        "value": "company_input"      }    ]  } } ``` In this example, the company name the user entered is stored under the company property and can be referenced in requests as `{{user.properties.company}}`. ## How data source user is shown in Supermetrics products The information stored under data source user lives as a connection in the Supermetrics product. The `label` property in the data source user defines the value show to the user and can be used to identify different connections to the data source. ![](https://cdn.document360.io/a13cead5-eaae-456f-9bd1-0941d590c0e3/Images/Documentation/6778c530-3557-4810-8e66-ea14f8d37a6a.png)