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

# List the nightly totals for your area

> One row per figure for your own node and for each group or node below it that shares data with you, from one night’s build (`day`, the latest by default). Each row carries the `groupId` it counts, its `parentId` that night, and `asOf`. Narrow to one of them with `childId`. By default each row is a total (`section` `all`); ask for a section’s part with `section`. Counts are exact, section counts included. Built each night. A group that stops sharing with you, or moves to another district, leaves these rows at once and your totals at the next build, within 24 hours.



## OpenAPI

````yaml /api-reference/openapi.json get /nodes/metrics
openapi: 3.1.0
info:
  title: Scoutworks public API
  version: 1.10.0
  description: >-
    Read your Scout group’s data from your own tools: spreadsheets, scripts,
    Zapier or n8n, and keep its task boards up to date. Every request is scoped
    to the group that owns the key.


    **Authentication.** Send a group API key as a Bearer token. Keys are created
    by a group admin and shown once.


    **Scopes.** Each operation names the scope it needs. Area scopes
    (`members:read`, `events:read`, `badges:read`, `waiting-list:read`,
    `tasks:read`) open an area; a `.contacts` scope adds dates of birth and
    parent details to that area’s responses. `tasks:write` is the one scope that
    changes data: it adds and updates tasks, as the admin who created the key.
    Fields a key may not see are left out, not sent as null. Health, bank
    details and free-text notes are never available.


    **Pagination.** Lists return `{ data, nextCursor }`. Pass `nextCursor` back
    as `?cursor=`, with the same filters, until it is null. `limit` is 1 to 200.


    **Errors.** Every error is `{ error: { code, message } }`. Branch on `code`;
    `message` is for people and may change.


    **Compatibility.** We aim to change v1 only by addition: new endpoints, new
    optional parameters, new response fields and new enum values. Ignore fields
    you do not know and treat an unknown enum value as “other”. We will try to
    warn you before a breaking change, but one can still happen without notice,
    so check responses and fail loudly on an error. Changes are listed in the
    changelog at https://developers.scoutworks.app/changelog.


    **Rate limits.** 120 requests a minute per key. `RateLimit-*` headers report
    what is left.
servers:
  - url: https://api.scoutworks.app/api/v1
    description: Live
  - url: https://api-demo.scoutworks.app/api/v1
    description: Demo (sample data, reset weekly)
security:
  - bearerAuth: []
tags:
  - name: Keys
    description: Check a key and see what it can reach.
  - name: Members
    description: Young people in the group.
  - name: Sections
    description: The group’s sections and units, and their ids.
  - name: Events
    description: Meetings, trips and camps, and who is going.
  - name: Badges
    description: Badge progress and awards.
  - name: Waiting list
    description: Applications waiting for a place.
paths:
  /nodes/metrics:
    get:
      tags:
        - Nodes
      summary: List the nightly totals for your area
      description: >-
        One row per figure for your own node and for each group or node below it
        that shares data with you, from one night’s build (`day`, the latest by
        default). Each row carries the `groupId` it counts, its `parentId` that
        night, and `asOf`. Narrow to one of them with `childId`. By default each
        row is a total (`section` `all`); ask for a section’s part with
        `section`. Counts are exact, section counts included. Built each night.
        A group that stops sharing with you, or moves to another district,
        leaves these rows at once and your totals at the next build, within 24
        hours.
      operationId: listNodeMetrics
      parameters:
        - name: cursor
          in: query
          required: false
          description: >-
            Opaque. Pass the `nextCursor` of the previous page, with the same
            filters, to get the next one. Do not build or parse it.
          schema:
            type: string
            minLength: 1
            maxLength: 512
        - name: limit
          in: query
          required: false
          description: Page size, 1 to 200. Defaults to 50.
          schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 200
        - name: childId
          in: query
          required: false
          description: >-
            Only this group or node below yours. It must share data with you;
            any other id answers 404.
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - name: metric
          in: query
          required: false
          description: Only this figure.
          schema:
            type: string
            enum:
              - member_count
              - waiting_count
              - net_growth_12m
              - young_people_count
        - name: day
          in: query
          required: false
          description: >-
            The night to read, `YYYY-MM-DD` (UTC). Defaults to the latest night
            your own node was built.
          schema:
            type: string
            format: date
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
        - name: section
          in: query
          required: false
          description: >-
            Which section’s rows. Defaults to `all`, the totals: one row per
            node, figure and night. A section (`cubs`) gives that section’s rows
            only. `any` gives every row, the totals and each section. A row’s
            `value` already includes everything below it, so to total a set of
            rows add their `ownValue`, or read your own node’s `value`. Adding
            `value` across nodes counts a young person twice.
          schema:
            default: all
            type: string
            enum:
              - all
              - squirrels
              - beavers
              - cubs
              - scouts
              - explorers
              - network
              - unassigned
              - any
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1NodeMetricPage'
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        '400':
          description: >-
            A query parameter, cursor or request body is not acceptable
            (`invalid_request`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '401':
          description: >-
            No API key, or one that is unknown, revoked or expired
            (`invalid_api_key`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '403':
          description: The key lacks the scope this operation needs (`insufficient_scope`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '404':
          description: No such record in the key’s group (`not_found`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '429':
          description: Too many requests; wait `retryAfter` seconds (`rate_limited`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
            Retry-After:
              description: Seconds to wait before trying again.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '500':
          description: Our fault; quote `errorRef` to support (`internal_error`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
      security:
        - bearerAuth:
            - nodes:metrics:read
components:
  schemas:
    V1NodeMetricPage:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/V1NodeMetric'
        nextCursor:
          description: Pass as `?cursor=` for the next page. Null on the last. Opaque.
          type:
            - string
            - 'null'
      required:
        - data
        - nextCursor
    V1Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_api_key
                - insufficient_scope
                - invalid_request
                - subscription_required
                - not_found
                - conflict
                - rate_limited
                - internal_error
            message:
              type: string
          required:
            - code
            - message
        errorRef:
          description: 'On a 500: a reference to quote to Scoutworks support.'
          type: string
        retryAfter:
          description: 'On a 429: seconds to wait before trying again.'
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - error
    V1NodeMetric:
      type: object
      properties:
        groupId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: >-
            Whose figure this is: your own node, or a group or node below it
            that shares data with you.
        parentId:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
          description: >-
            The node directly above `groupId` on the night the row was built,
            even if it has moved since. `null` at the top of the tree, under a
            node that has been deleted, and on every row built before version
            1.8.0 was deployed, when the parent was not recorded. On a night
            before a node moved into your tree, it names its old parent, which
            your key cannot read.
        tier:
          type: string
          enum:
            - group
            - district
            - county
            - area
            - region
            - country
            - national
        metric:
          type: string
          enum:
            - member_count
            - waiting_count
            - net_growth_12m
            - young_people_count
          description: >-
            `member_count`: Active memberships of young people. A young person
            in two groups counts once in each. `waiting_count`: Open waiting
            list entries. `net_growth_12m`: Memberships that started minus
            memberships that ended, over the 12 calendar months (UTC) up to and
            including the month the figure was built. `young_people_count`:
            Young people with an active membership, each counted once, however
            many groups they belong to. Full definitions:
            https://developers.scoutworks.app/guides/data-definitions. Treat an
            unknown value as a new figure, not an error.
        section:
          type: string
          enum:
            - all
            - squirrels
            - beavers
            - cubs
            - scouts
            - explorers
            - network
            - unassigned
          description: >-
            `all`: the total. Otherwise one section’s part of it, by the
            section’s age group: `squirrels`, `beavers`, `cubs`, `scouts`,
            `explorers`, `network`, or `unassigned` for rows with no section.
            `member_count`, `waiting_count` and `young_people_count` have every
            section. `net_growth_12m` has `all` only. `member_count` and
            `waiting_count` sum their sections to `all` exactly.
            `young_people_count` counts a young person in each section they are
            in, so its sections can add up to more than `all`.
        day:
          type: string
          format: date
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
          description: The night the figure was built.
        value:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
          description: >-
            The total for this group or node and everything below it that shares
            data with it. `null` when `stale` is true.
        ownValue:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
          description: >-
            The part counted on the row’s own records, for a node its own units.
            For a group, the same as `value`.
        stale:
          type: boolean
          description: >-
            True when a figure below it was missing that night, so no total was
            built. Read the previous `day`.
        asOf:
          type: string
          format: date-time
          description: >-
            When the oldest figure in the total was counted. A consent change or
            a move shows in totals built after it, within 24 hours.
      required:
        - groupId
        - parentId
        - tier
        - metric
        - section
        - day
        - value
        - ownValue
        - stale
        - asOf
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A group API key, sent as `Authorization: Bearer sw_live_…`. Keys from
        staging and the demo start `sw_test_` instead. A group admin creates
        keys in Settings → Integrations → API keys.

````

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