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

# Generate Invitation Code

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

The code can be shared with a mobile app user who enters it to receive
SDK access and refresh tokens without manually entering user_id and tokens.

Previously generated codes for this user are marked as expired.

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 SDK user onboarding.


        The code can be shared with a mobile app user who enters it to receive

        SDK access and refresh tokens without manually entering user_id and
        tokens.


        Previously generated codes for this user are marked as expired.


        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

````