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

# Register a new user

> Creates a user account and automatically provisions a company for them. Returns a JWT token for immediate authentication.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/auth/register
openapi: 3.0.0
info:
  title: PlugToPay API
  description: API to make payments easy in multiple gateways.
  version: 1.0.0
servers:
  - url: http://localhost:7701
    description: Test Server
security: []
paths:
  /api/v1/auth/register:
    post:
      tags:
        - Auth
      summary: Register a new user
      description: >-
        Creates a user account and automatically provisions a company for them.
        Returns a JWT token for immediate authentication.
      operationId: 0568494a703cf27ca7d7c2f6e6f5bd0a
      parameters:
        - $ref: '#/components/parameters/XClientId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - name
                - email
                - password
                - password_confirmation
                - company_name
              properties:
                name:
                  type: string
                  example: John Doe
                email:
                  type: string
                  format: email
                  example: john@example.com
                password:
                  type: string
                  format: password
                  minLength: 8
                  example: secret123
                password_confirmation:
                  type: string
                  format: password
                  example: secret123
                company_name:
                  type: string
                  example: Acme Corp
                company_cnpj:
                  type: string
                  example: '12345678000190'
                  nullable: true
                company_financial_email:
                  type: string
                  example: fin@empresa.com
                  nullable: true
                company_phone:
                  type: string
                  example: '11900000000'
                  nullable: true
              type: object
      responses:
        '201':
          description: User and company created — JWT token returned
          content:
            application/json:
              schema:
                properties:
                  token:
                    type: string
                    example: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
                  token_type:
                    type: string
                    example: Bearer
                  expires_at:
                    type: string
                    format: date-time
                    example: '2026-05-27T12:00:00+00:00'
                  user:
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: John Doe
                      email:
                        type: string
                        example: john@example.com
                      company_id:
                        type: integer
                        example: 1
                    type: object
                  company:
                    properties:
                      name:
                        type: string
                        example: Acme Corp
                      client_id:
                        type: string
                        example: client_a1b2c3d4e5f6g7h8
                      api_key:
                        type: string
                        example: sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
                      warning:
                        type: string
                        example: Save your api_key safely, it won't be shown again.
                    type: object
                type: object
        '422':
          description: Validation Error
components:
  parameters:
    XClientId:
      name: x-client-id
      in: header
      description: Client identifier for the company in the request.
      required: true
      schema:
        type: string
        example: client_abc123

````