--- title: "Session and Reporting" slug: "session-and-reporting" updated: 2025-09-30T01:15:29Z published: 2025-09-30T01:15:29Z canonical: "usercentrics.com/session-and-reporting" --- > ## Documentation Index > Fetch the complete documentation index at: https://usercentrics.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Session and Reporting The API includes *two* endpoints that can be used to fetch Session and Usage data for certain Settings. > **Important** While the impact on our systems is normal it’s nothing that should run for every setting on everyday basis, due to the number of requests/data. - Endpoint `sessionsBySettings` returns the session count for a particular setting-id daily for a specific timeframe. The maximum timeframe allowed is 90 days. > Should only be used when you are explicitly checking your session (e.g. in an overview). It's best if it's cached on a daily basis, since we only update the values once a day. Although the individual query isn’t very resource-intensive, it becomes so if a Partner runs it 10k times a day (due to 10k settings). - Endpoint `totalSessionsForAllSettingsByTimeframe` returns the accumulated session count for all setting-ids across the specified timeframe. Maximum Timeframe 60 days. > The use case for this endpoint is rather to do e.g. monthly reports/billing and as such should rather run on a Monthly/Weekly basis, but not every day. **Example Request** ```plaintext query {    TotalSessionsForAllSettingsByTimeframe(       from: "2022-01-01",       to: "2022-01-31"    ) {       sessions,       settingsId      } } ``` **Example Response** ```plaintext {  "data": {    "totalSessionsForAllSettingsByTimeframe": [      {        "sessions": 12521,        "settingsId": "ABCDEF111"      },      {        "sessions": 195,        "settingsId": "ABCDEF222"      }    ]  } } ``` ### Common error messages and resolutions > Format is Authorization: Bearer [token] (Code: UNAUTHENTICATED) Please check if you are sending the HTTP header `authorization` in the format `Bearer eyJhbGciO…`. This token can be retrieved using the `authorization` endpoint described in this documentation. > Field \"x\" of type \"X\" must have a selection of subfields. Did you mean \"x { ... }\"? In most cases, GraphQL requires you to specify the data you want to have returned from the API. This is also the case for mutation operations. Therefore you MUST specify at least one return value after the mutation parameters, e.g. `mutation { setting(paramA: "123") {settingsId} }` You will also see this error when requesting a non-scalar data type (e.g. `consentTemplates` in settings) and not defining any sub-parameter. > Field \"x\" argument \"y\" of type \"String!\" is required, but it was not provided. If a GraphQL node supports arguments (e.g. `setting()`) some of the arguments might be `required`. You can identify required arguments in the playground documentation by an exclamation mark next to the type. ![usercentrics](https://cdn.document360.io/17f91ed2-e9be-4746-9f2b-1fa43f97e9b5/Images/Documentation/requiredExample.png?sv=2026-02-06&spr=https&st=2026-11-19T07%3A56%3A53Z&se=2026-11-19T08%3A56%3A53Z&sr=b&sp=r&sig=h%2F9ZC2h9rGodCSnMV7d31wNanOwwMWFGWaAwsIb0HlM%3D)