> ## Documentation Index
> Fetch the complete documentation index at: https://docs.teamcaredental.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monthly stats

> Resolves the location from the `X-Vendor-Request-Key` header (slot); no `location_id` in the path.

This endpoint retrieves monthly stats for a specific location and month.

#### Parameters

- page: A parameter to specify pagination.
- items: A parameter to specify the number of items to be returned.
- date: A start of the month date parameter to specifiy the month and year to get data from, following the format **YYYY-MM-DD**.
- daily_goals: true Include this parameter to get all the daily stats within month.
- The `q[fetch_modified_since]` is used to capture the delta changes, pass the datetime in UTC as shown in example below. This parameter will help you identifying only those month goals which were changed since your last sync, so you won't need to load all the data over again.

```json
{
    "q": {
        "fetch_modified_since": "2025-12-02T01:58:00.164Z"
    }
}
```



## OpenAPI

````yaml https://app.teamcaredental.com/openapi-vendors-v2.json get /monthly/stats
openapi: 3.1.0
info:
  title: TeamCare Vendor API (v2)
  version: 2.0.0
  description: >-
    Version 2 of the TeamCare Vendor API. HIPAA-compliant and opt-in.


    ## What changed from v1


    The data endpoints and response shapes are identical to v1 — **only how you
    address a location changes.** In v1 the location lived in every URL
    (`/locations/{location_id}/patients`). In v2 you request a **slot** for a
    location once, then send the returned `request_key` in the
    `X-Vendor-Request-Key` header; `location_id` is gone from the data routes.


    ## Request cycle


    1. `POST /auth/token` → JWT (unchanged from v1).

    2. `GET /organizations`, `GET /locations` → pick a `location_id`.

    3. `POST /locations/{location_id}/slots` → `{ request_key, expires_at }`.

    4. Call any data endpoint with header `X-Vendor-Request-Key: <request_key>`
    (no `location_id` in the path).


    ## Minimal changes to migrate


    - Point your base URL at `https://api.teamcaredental.com/api/v2/vendors` (v2
    is served from `api.teamcaredental.com`, not `app.teamcaredental.com`).

    - Call the slot endpoint **once per location**.

    - Drop `/locations/{location_id}` from your data paths and add the
    `X-Vendor-Request-Key` header.

    - Everything else — authentication, Ransack `q` filters, pagination,
    response shapes — is unchanged.


    ## Slot validity, cooldown & quota


    - **Validity:** a `request_key` is valid for **6 hours** — the same lifetime
    as the access token. After that it stops authorizing and you must request a
    new slot.

    - **Cooldown:** you can only re-request the **same** location's slot once
    every **2 minutes**. Within the cooldown the slot endpoint returns `429`
    with a `retry_after` (seconds).

    - **Quota:** each firm may hold up to its `concurrent_slots` quota (default
    **10**) active request keys at once, so data for at most 10 locations can be
    pulled concurrently. Requesting an 11th slot trims the oldest key, so its
    `request_key` stops authorizing immediately and any in-flight requests using
    it fail with `401`. To raise the quota above 10, contact TeamCare support.

    - **Rate limit:** the slot endpoint accepts at most 10 requests per 10
    seconds per token.


    ## Recommended usage


    Request a slot for a location and pull **all** of that location's data in
    one pass before moving on — don't re-request slots per call or churn between
    locations. If you fan out across locations in parallel, keep the fan-out at
    or below your quota: once an 11th slot is requested, the oldest
    `request_key` is invalidated even if a sync is still running on it.


    See the [changelog](https://docs.teamcaredental.com/changelog) for the full
    list of changes from v1.
servers:
  - url: https://api.teamcaredental.com/api/v2/vendors
security:
  - bearerAuth: []
paths:
  /monthly/stats:
    get:
      tags:
        - Monthly
      summary: Monthly stats
      description: >-
        Resolves the location from the `X-Vendor-Request-Key` header (slot); no
        `location_id` in the path.


        This endpoint retrieves monthly stats for a specific location and month.


        #### Parameters


        - page: A parameter to specify pagination.

        - items: A parameter to specify the number of items to be returned.

        - date: A start of the month date parameter to specifiy the month and
        year to get data from, following the format **YYYY-MM-DD**.

        - daily_goals: true Include this parameter to get all the daily stats
        within month.

        - The `q[fetch_modified_since]` is used to capture the delta changes,
        pass the datetime in UTC as shown in example below. This parameter will
        help you identifying only those month goals which were changed since
        your last sync, so you won't need to load all the data over again.


        ```json

        {
            "q": {
                "fetch_modified_since": "2025-12-02T01:58:00.164Z"
            }
        }

        ```
      operationId: locations_resources_stats_monthly_stats
      parameters:
        - name: page
          in: query
          required: false
          description: A parameter to specify pagination.
          schema:
            type: integer
            example: 1
        - name: date
          in: query
          required: false
          description: >-
            A start of the month date parameter to specifiy the month and year
            to get data from, following the format **YYYY-MM-DD**.
          schema:
            type: string
            format: date
            example: '2023-05-01'
        - name: items
          in: query
          required: false
          description: A parameter to specify the number of items to be returned.
          schema:
            type: integer
            example: 6
        - name: daily_goals
          in: query
          required: false
          description: true Include this parameter to get all the daily stats within month.
          schema:
            type: boolean
            example: true
        - name: q
          in: query
          required: false
          style: deepObject
          explode: true
          schema:
            type: object
            properties:
              fetch_modified_since:
                type: string
                format: date-time
                example: '2025-06-26T01:58:00.164Z'
          example:
            fetch_modified_since: '2025-06-26T01:58:00.164Z'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  tenant:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: string
                          type:
                            type: string
                          attributes:
                            type: object
                            properties:
                              title:
                                type: string
                              third_party_id:
                                type: string
                              owner:
                                type: object
                                properties:
                                  data:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      type:
                                        type: string
                                      attributes:
                                        type: object
                                        properties:
                                          name:
                                            type: string
                  month_goals:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            type:
                              type: string
                            attributes:
                              type: object
                              properties:
                                entityable_type:
                                  type: string
                                entityable_id:
                                  type: integer
                                year:
                                  type: integer
                                month:
                                  type: integer
                                title:
                                  type: string
                                role:
                                  type: string
                                days_worked:
                                  type: string
                                  example: integer array
                                kpis:
                                  type: object
                                  properties:
                                    data:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                          type:
                                            type: string
                                          attributes:
                                            type: object
                                            properties:
                                              goal_type:
                                                type: string
                                              goal_value:
                                                type: integer
                                              actual_value:
                                                type: integer
                                              variance_value:
                                                type: integer
                                              variance_pct:
                                                type: string
                                                example: float
                  pagy:
                    type: object
                    properties:
                      items:
                        type: number
                      count:
                        type: number
                      page:
                        type: number
                      next:
                        type: number
                      prev:
                        type: number
              example:
                tenant:
                  data:
                    id: string
                    type: string
                    attributes:
                      title: string
                      third_party_id: string
                      owner:
                        data:
                          id: string
                          type: string
                          attributes:
                            name: string
                month_goals:
                  data:
                    - id: string
                      type: string
                      attributes:
                        entityable_type: string
                        entityable_id: 0
                        year: 0
                        month: 0
                        title: string
                        role: string
                        days_worked: integer array
                        kpis:
                          data:
                            - id: string
                              type: string
                              attributes:
                                goal_type: string
                                goal_value: 0
                                actual_value: 0
                                variance_value: 0
                                variance_pct: float
                pagy:
                  items: 0
                  count: 0
                  page: 0
                  next: 0
                  prev: 0
        '401':
          description: >-
            Missing/invalid/expired JWT, or missing/invalid/expired
            X-Vendor-Request-Key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: string
              example:
                errors: not authorized
        '403':
          description: The credential may not access this resource.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: string
              example:
                errors: access Denied
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: string
              example:
                errors: resource not found
        '422':
          description: The request could not be processed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: string
              example:
                errors: ...
      security:
        - bearerAuth: []
          vendorRequestKey: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT returned by POST /auth/token. Valid for six hours.
    vendorRequestKey:
      type: apiKey
      in: header
      name: X-Vendor-Request-Key
      description: >-
        Request key returned by POST /locations/{location_id}/slots. Identifies
        the practice for a data request; valid for 6 hours (the access token's
        lifetime) and subject to the firm's concurrent-slot quota.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.