> ## 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.

# Invite a user

> Adds a leader, Young Leader or trustee to your group and sends them the normal Scoutworks invitation email, unless you send `sendInvitation: false`. Someone who already uses Scoutworks elsewhere is added as an invitation they accept when they next sign in: the answer then has `status: invited`. A suspended person answers 409 `source_locked`: an admin reinstates them in Scoutworks. A key never adds, promotes to, changes or removes a group admin: that answers 403 `admin_protected`. An admin does it in Scoutworks. A key may send 20 invitations an hour, and your group’s keys 50 a day; every attempt counts, except a replay of an invitation already made. The change is recorded as made by the admin who created the key, marked with the key. Writes count towards the key’s usual limit and a second one of 30 changes a minute. A group whose subscription has lapsed answers 402.

You may send an `Idempotency-Key` header (unique per user) so a retry after a timeout cannot make it twice. For 24 hours, the same key with the same body answers 200 with the first user and an `Idempotent-Replayed: true` header; with a different body it answers 400; while the first request is still running it answers 409 `conflict`.



## OpenAPI

````yaml /api-reference/openapi/users.json post /users
openapi: 3.1.0
info:
  title: Scoutworks public API
  version: 1.32.0
  description: >-
    Read your Scout group’s data from your own tools: spreadsheets, scripts,
    Zapier or n8n, add members, waiting-list applications and draft events, keep
    its task boards up to date, and keep its books in step with your accounting
    tools. 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`, `accounting:read`, `expenses:read`, `suppliers:read`,
    `payments:read`, `gift-aid:read`, `adults:read`, `users:read`,
    `access:read`, `compliance:read`, `communications:read`, `hire:read`,
    `fundraising:read`, `moving-on:read`, `files:read`) open an area; a
    `.contacts`, `.people` or `.compliance` scope adds detail to that area’s
    responses. The `:write` scopes change data, as the admin who created the
    key: `members:write`, `waiting-list:write` and `events:write` add and update
    members, waiting-list applications and draft events, `tasks:write` adds and
    updates tasks, `accounting:write` changes the books and attaches receipts,
    and `files:write` uploads to the Knowledge Base, and `users:write` invites,
    changes, suspends and removes users, never a group admin, and `access:write`
    manages access policies and overrides, never an admin’s access. Uploads are
    virus scanned and count towards the group’s storage. A write never emails or
    notifies a family unless it sends `notify: true`. No scope moves money:
    nothing takes, changes, cancels or refunds a payment. 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.


    **Writing.** Send an `Idempotency-Key` with every `POST`, so a retry answers
    with the first record instead of making a second. Every record a write or a
    single-record `GET` returns carries an `ETag`: send it as `If-Match` on a
    `PATCH`, `PUT` or `DELETE` and a change made since answers 412
    `stale_write`. See https://developers.scoutworks.app/guides/writing-data.


    **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. Writes and uploads have smaller limits of their own: see
    https://developers.scoutworks.app/guides/rate-limits.
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: Users
    description: >-
      The people with a sign-in account and a role in the group: read, invite,
      change, suspend and remove, and each user’s access policies and overrides.
      Never a group admin.
paths:
  /users:
    post:
      tags:
        - Users
      summary: Invite a user
      description: >-
        Adds a leader, Young Leader or trustee to your group and sends them the
        normal Scoutworks invitation email, unless you send `sendInvitation:
        false`. Someone who already uses Scoutworks elsewhere is added as an
        invitation they accept when they next sign in: the answer then has
        `status: invited`. A suspended person answers 409 `source_locked`: an
        admin reinstates them in Scoutworks. A key never adds, promotes to,
        changes or removes a group admin: that answers 403 `admin_protected`. An
        admin does it in Scoutworks. A key may send 20 invitations an hour, and
        your group’s keys 50 a day; every attempt counts, except a replay of an
        invitation already made. The change is recorded as made by the admin who
        created the key, marked with the key. Writes count towards the key’s
        usual limit and a second one of 30 changes a minute. A group whose
        subscription has lapsed answers 402.


        You may send an `Idempotency-Key` header (unique per user) so a retry
        after a timeout cannot make it twice. For 24 hours, the same key with
        the same body answers 200 with the first user and an
        `Idempotent-Replayed: true` header; with a different body it answers
        400; while the first request is still running it answers 409 `conflict`.
      operationId: inviteUser
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Unique per user: any printable text up to 255 characters. A retry
            with the same key and body within 24 hours answers with the first
            user instead of making another. Recommended.
          schema:
            type: string
            minLength: 1
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1UserInvite'
      responses:
        '200':
          description: The user an earlier request with the same `Idempotency-Key` made.
          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
            ETag:
              description: >-
                The record’s version as this key reads it, totals included (a
                budget’s `spent` moves it). Send it as `If-Match` on your next
                change.
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                `true` when this answers an earlier request with the same
                `Idempotency-Key`.
              schema:
                type: string
                enum:
                  - 'true'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/V1User'
                required:
                  - data
                additionalProperties: {}
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/V1User'
                required:
                  - data
                additionalProperties: {}
          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
            ETag:
              description: >-
                The record’s version as this key reads it, totals included (a
                budget’s `spent` moves it). Send it as `If-Match` on your next
                change.
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                `true` when this answers an earlier request with the same
                `Idempotency-Key`.
              schema:
                type: string
                enum:
                  - 'true'
        '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'
        '402':
          description: >-
            The group’s subscription has lapsed, so the API cannot change data;
            reads still work (`subscription_required`).
          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 `users:write` or `users:read` (`insufficient_scope`),
            or the change touches a group admin (`admin_protected`): an admin
            makes it in Scoutworks.
          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'
        '409':
          description: >-
            The person is in a state only Scoutworks changes (`source_locked`):
            suspended, invited and not yet accepted, a parent only, a Network
            member, or already holding the role. Or a request with the same
            `Idempotency-Key` is still running (`conflict`), or a rule of the
            app refused it.
          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:
            - users:write
components:
  schemas:
    V1UserInvite:
      type: object
      properties:
        email:
          type: string
          maxLength: 254
          format: email
          pattern: >-
            ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        firstName:
          type: string
          minLength: 1
          maxLength: 100
        lastName:
          type: string
          maxLength: 100
        personType:
          type: string
          enum:
            - group_admin
            - leader
            - young_leader
            - trustee
          description: >-
            `leader`, `young_leader` or `trustee`. `group_admin` answers 403: an
            admin adds another admin in the Scoutworks app.
        sectionIds:
          maxItems: 30
          type: array
          items:
            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: >-
            The sections they help run, from `GET /sections`. For a Young
            Leader, the sections they help, not their own.
        memberId:
          description: >-
            For a Young Leader: their own member record, from `GET /members`.
            Required for `young_leader`.
          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)$
        alsoTrustee:
          description: Also make a leader or Young Leader a trustee.
          type: boolean
        sendInvitation:
          default: true
          description: >-
            Send the invitation email now (the default). With `false`, they are
            added and an admin sends the invitation later from Scoutworks.
          type: boolean
      required:
        - email
        - firstName
        - personType
      additionalProperties: {}
      description: >-
        Someone who already uses Scoutworks elsewhere is added as an invitation
        they accept when they next sign in. A field not listed here is refused
        with a 400.
    V1User:
      type: object
      properties:
        id:
          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: >-
            The person’s Scoutworks user id. It does not change when their roles
            change, and it is the same id `GET /adults` gives.
        firstName:
          description: Null until an invited person accepts.
          type:
            - string
            - 'null'
        lastName:
          type:
            - string
            - 'null'
        personType:
          type: string
          enum:
            - group_admin
            - leader
            - network
            - young_leader
            - trustee
            - parent
          description: Their most senior role in the group. More values may be added.
        roles:
          type: array
          items:
            type: string
            enum:
              - group_admin
              - leader
              - network
              - young_leader
              - trustee
              - parent
          description: Every role they hold in the group, most senior first.
        status:
          type: string
          enum:
            - active
            - suspended
            - invited
          description: >-
            The status of their most senior role: `active`, `suspended`, or
            `invited` while an invitation waits for them to accept.
        sections:
          type: array
          items:
            $ref: '#/components/schemas/V1UserSection'
          description: >-
            The sections they help run, as the Team page shows them. Empty for a
            parent and for someone who helps the whole group.
        joinedAt:
          type: string
          format: date-time
          description: When they took their first current role in the group.
        lastActiveAt:
          anyOf:
            - type: string
              format: date-time
              description: A UTC timestamp, ISO 8601.
            - type: 'null'
          description: >-
            When they last used Scoutworks. Null when they never have, or while
            an invitation waits for them.
        email:
          description: Only with the `users.contacts:read` scope.
          type: string
        phone:
          description: Only with the `users.contacts:read` scope. Null when they gave none.
          type:
            - string
            - 'null'
      required:
        - id
        - firstName
        - lastName
        - personType
        - roles
        - status
        - sections
        - joinedAt
        - lastActiveAt
    V1Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_api_key
                - insufficient_scope
                - invalid_request
                - subscription_required
                - not_found
                - conflict
                - period_closed
                - source_locked
                - over_refund
                - possible_duplicate
                - invalid_transition
                - admin_protected
                - stale_write
                - insufficient_stock
                - not_available
                - not_downloadable
                - file_too_large
                - storage_full
                - unsupported_file_type
                - file_infected
                - scan_unavailable
                - service_unavailable
                - 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
        matchingIds:
          description: >-
            On a 409 `possible_duplicate`: the ids of the records this one looks
            like, which `GET /members/{memberId}` or `GET
            /waiting-list/{entryId}` reads.
          type: array
          items:
            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)$
      required:
        - error
    V1UserSection:
      type: object
      properties:
        id:
          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:
          type: string
      required:
        - id
        - name
  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.