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

# Register Local User

> Register a local user with optional tenant bootstrap.



## OpenAPI

````yaml /openapi.json post /auth/register
openapi: 3.1.0
info:
  title: Factio SRI API
  description: >-
    Plataforma headless, multi-tenant, API-first para emitir comprobantes
    electrónicos válidos ante el SRI de Ecuador.


    ## Autenticación


    Soporta tres métodos:

    - **JWT Bearer por Google OAuth**: `/auth/google/callback`

    - **JWT Bearer por email/password**: `/auth/login`

    - **API Key**: header `X-API-Key` con clave generada en `/auth/api-keys`


    ## Multi-tenant


    El aislamiento por tenant combina PostgreSQL RLS y validaciones explícitas
    en backend. El `tenant_id` se resuelve desde el contexto de autenticación.


    ## Flujo de Emisión


    1. `POST /documents` — reserva secuencial y encola el documento (responde
    202)

    2. `GET /documents/{id}` — consulta el estado actual por polling

    3. Cuando `status = AUTHORIZED`, el campo `authorization_number` contiene la
    clave de autorización del SRI


    Documentación completa en https://docs.factioapp.com
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Local
  - url: https://api.factioapp.com
    description: Producción
  - url: https://api.staging.factioapp.com
    description: Sandbox (datos de prueba, sin efecto fiscal real)
security: []
paths:
  /auth/register:
    post:
      tags:
        - Authentication
      summary: Register Local User
      description: Register a local user with optional tenant bootstrap.
      operationId: register_local_user_auth_register_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RegisterRequest:
      properties:
        email:
          type: string
          maxLength: 255
          title: Email
          description: User email
        password:
          type: string
          maxLength: 128
          minLength: 8
          title: Password
          description: User password
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
          description: Display name
        tenant_slug:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Tenant Slug
          description: Tenant slug to create or join
        tenant_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Tenant Name
          description: Tenant display name when creating a new tenant
      type: object
      required:
        - email
        - password
      title: RegisterRequest
    RegisterResponse:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
          description: Created user ID
        email:
          type: string
          title: Email
          description: Normalized user email
        tenant_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Tenant Id
          description: Tenant assigned during registration
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
          description: Assigned role in the tenant
        onboarding_ticket:
          anyOf:
            - type: string
            - type: 'null'
          title: Onboarding Ticket
          description: Short-lived onboarding ticket when user has no tenant assigned
      type: object
      required:
        - user_id
        - email
      title: RegisterResponse
    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

````