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

# Generate Invitation Code

> Generate a single-use invitation code for standalone SDK onboarding.

Issues a single-use code that a mobile app can redeem (via
`POST /api/v1/invitation-code/redeem`) to receive SDK access and refresh
tokens - without your backend having to mint and forward a token itself.
Any previously generated codes for this user are marked as expired.

This is a convenience mechanism for apps with no backend of their own (for
example the Open Wearables app or quick manual testing). It is not the
standard integration path: if your app authenticates users against your own
backend, mint a token directly with `POST /api/v1/users/{user_id}/token`
instead.

Requires developer authentication.



## OpenAPI

````yaml https://api.openwearables.io/openapi.json post /api/v1/users/{user_id}/invitation-code
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/users/{user_id}/invitation-code:
    post:
      tags:
        - 'External: Mobile SDK'
      summary: Generate Invitation Code
      description: >-
        Generate a single-use invitation code for standalone SDK onboarding.


        Issues a single-use code that a mobile app can redeem (via

        `POST /api/v1/invitation-code/redeem`) to receive SDK access and refresh

        tokens - without your backend having to mint and forward a token itself.

        Any previously generated codes for this user are marked as expired.


        This is a convenience mechanism for apps with no backend of their own
        (for

        example the Open Wearables app or quick manual testing). It is not the

        standard integration path: if your app authenticates users against your
        own

        backend, mint a token directly with `POST /api/v1/users/{user_id}/token`

        instead.


        Requires developer authentication.
      operationId: generate_invitation_code_api_v1_users__user_id__invitation_code_post
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInvitationCodeRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    UserInvitationCodeRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        code:
          type: string
          title: Code
        user_id:
          type: string
          format: uuid
          title: User Id
        expires_at:
          type: string
          format: date-time
          title: Expires At
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - code
        - user_id
        - expires_at
        - created_at
      title: UserInvitationCodeRead
      description: Response schema after generating an invitation code.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /api/v1/auth/login

````