> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-mintlify-docs-update-1787370745474.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new account via SSO

> Creates a new user and family from a previously issued linking code. Links the SSO identity via OidcIdentity, logs the JIT account creation via SsoAuditLog, and issues mobile OAuth tokens. The linking code must have allow_account_creation enabled.



## OpenAPI

````yaml /openapi.yaml post /api/v1/auth/sso_create_account
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation generated from executable request specs.
servers:
  - url: https://app.sure.am
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/auth/sso_create_account:
    post:
      tags:
        - Auth
      summary: Create a new account via SSO
      description: >-
        Creates a new user and family from a previously issued linking code.
        Links the SSO identity via OidcIdentity, logs the JIT account creation
        via SsoAuditLog, and issues mobile OAuth tokens. The linking code must
        have allow_account_creation enabled.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                linking_code:
                  type: string
                  description: One-time linking code from mobile SSO onboarding redirect
                first_name:
                  type: string
                  description: First name (overrides value from SSO provider if provided)
                last_name:
                  type: string
                  description: Last name (overrides value from SSO provider if provided)
              required:
                - linking_code
        required: true
      responses:
        '200':
          description: account created and tokens issued
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  refresh_token:
                    type: string
                  token_type:
                    type: string
                  expires_in:
                    type: integer
                  created_at:
                    type: integer
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      email:
                        type: string
                      first_name:
                        type: string
                      last_name:
                        type: string
                      ui_layout:
                        type: string
                        enum:
                          - dashboard
                          - intro
                      ai_enabled:
                        type: boolean
        '400':
          description: missing linking code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: invalid or expired linking code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: account creation disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: user validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        details:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          nullable: true
        errors:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Validation error messages (alternative to details used by trades,
            valuations, etc.)

````