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

# Register

Create a new user account with email and password.

### Body

<ParamField body="email" type="string" required>
  User's email address
</ParamField>

<ParamField body="password" type="string" required>
  User's password (minimum 8 characters, must contain uppercase, lowercase, and digit)
</ParamField>

<ParamField body="full_name" type="string">
  User's full name (optional) - Used for personalized greetings and profile display
</ParamField>

### Headers

The role is determined server-side based on request headers:

<ParamField header="X-Operator-Key" type="string">
  Platform operator key - Required for **developer** registration
</ParamField>

<ParamField header="X-Developer-Key" type="string">
  Developer API key - Required for **end\_user** registration
</ParamField>

<ParamField header="X-Project-ID" type="string">
  Project UUID - **Required** when registering end users with developer key
</ParamField>

<Note>
  The system automatically determines the user role from headers:

  * `X-Operator-Key` present → Creates **developer** account
  * `X-Developer-Key` + `X-Project-ID` present → Creates **end\_user** account in specified project
  * No special headers → Registration rejected (public registration disabled)
</Note>

### Response

<ResponseField name="id" type="string">
  Unique user identifier (UUID)
</ResponseField>

<ResponseField name="email" type="string">
  User's email address
</ResponseField>

<ResponseField name="full_name" type="string">
  User's full name (null if not provided)
</ResponseField>

<ResponseField name="role" type="string">
  User's role: `platform_operator`, `developer`, or `end_user`
</ResponseField>

<ResponseField name="is_active" type="boolean">
  Account activation status (false by default, requires email verification)
</ResponseField>

<ResponseField name="created_at" type="string">
  Account creation timestamp (ISO 8601)
</ResponseField>

<ResponseField name="project_id" type="string">
  Project UUID (only present for end\_user accounts)
</ResponseField>

<ResponseField name="provisioning" type="object">
  One-time provisioning data for developers (only returned for developer registration)

  <Expandable title="Provisioning Object">
    <ResponseField name="project_id" type="string">
      Auto-created project UUID
    </ResponseField>

    <ResponseField name="developer_key" type="string">
      Developer API key (full key shown once)
    </ResponseField>

    <ResponseField name="api_key" type="string">
      Project API key (full key shown once)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="access_token" type="string">
  JWT access token (optional, returned for end\_user registration for immediate authentication)
</ResponseField>

<ResponseField name="refresh_token" type="string">
  JWT refresh token (optional, returned for end\_user registration)
</ResponseField>

<ResponseField name="token_type" type="string">
  Token type, typically "bearer" (optional)
</ResponseField>

## Example Requests

### Register End User

```bash theme={null}
curl -X POST https://api.vibecoding.ad/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -H "X-Developer-Key: ak_your_developer_key_here" \
  -H "X-Project-ID: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "email": "user@example.com",
    "password": "SecurePass123",
    "full_name": "Jane Doe"
  }'
```

**Response:**

```json theme={null}
{
  "id": "660e8400-e29b-41d4-a716-446655440001",
  "email": "user@example.com",
  "full_name": "Jane Doe",
  "role": "end_user",
  "is_active": false,
  "created_at": "2025-12-07T10:30:00Z",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer"
}
```

### Register Developer

```bash theme={null}
curl -X POST https://api.vibecoding.ad/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -H "X-Operator-Key: your_operator_key_here" \
  -d '{
    "email": "developer@example.com",
    "password": "SecurePass123",
    "full_name": "John Smith"
  }'
```

**Response:**

```json theme={null}
{
  "id": "770e8400-e29b-41d4-a716-446655440002",
  "email": "developer@example.com",
  "full_name": "John Smith",
  "role": "developer",
  "is_active": false,
  "created_at": "2025-12-07T10:35:00Z",
  "provisioning": {
    "project_id": "880e8400-e29b-41d4-a716-446655440003",
    "developer_key": "ak_abc123XYZ-_789def456ghi012jkl345",
    "api_key": "ak_xyz789ABC-_123ghi456jkl789mno012"
  }
}
```

## Password Requirements

Passwords must meet the following criteria:

* Minimum 8 characters
* At least one uppercase letter (A-Z)
* At least one lowercase letter (a-z)
* At least one digit (0-9)

Example valid passwords: `Password123`, `SecurePass456`, `MyP@ssw0rd`

## Email Uniqueness

Email uniqueness rules vary by role:

* **End Users**: Email must be unique within the project (same email can exist in different projects)
* **Developers/Operators**: Email must be globally unique

(((REPLACE\_THIS\_WITH\_IMAGE: cloud-api-registration-flow-diagram.png: Diagram showing registration flow for developers and end users with role determination based on headers)))

## Related Pages

<CardGroup cols={2}>
  <Card title="Login" icon="right-to-bracket" href="/cloud-api/auth/login">
    Authenticate existing users
  </Card>

  <Card title="Verify Email" icon="envelope-circle-check" href="/cloud-api/auth/verify-email">
    Complete email verification
  </Card>

  <Card title="Developer Keys" icon="key" href="/cloud-api/auth/list-developer-keys">
    Manage developer API keys
  </Card>

  <Card title="Cloud Admin Registration" icon="browser" href="/cloud-admin/getting-started">
    Register via web interface
  </Card>

  <Card title="Starter Kit Auth" icon="code" href="/starter-kit/auth/registration-login">
    Implement registration in your app
  </Card>

  <Card title="Quick Start" icon="bolt" href="/cloud-api/quickstart">
    Complete registration tutorial
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /api/v1/auth/register
openapi: 3.1.0
info:
  title: Dev Kit for AI API
  description: 'API for Dev Kit for AI: Developer Toolkit for AI-Powered Web Applications'
  version: 1.6.1
servers:
  - url: https://api.devkit4ai.com
    description: Dev Kit for AI Production Server
  - url: https://api.vibecoding.ad
    description: Vibe Coding Production Server
security: []
paths:
  /api/v1/auth/register:
    post:
      tags:
        - Authentication
      summary: Register
      operationId: register_api_v1_auth_register_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistrationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UserCreateRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
        password:
          type: string
          minLength: 8
          title: Password
          description: Password must be at least 8 characters long
        full_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Full Name
      type: object
      required:
        - email
        - password
      title: UserCreateRequest
    RegistrationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        email:
          type: string
          title: Email
        full_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Full Name
        role:
          type: string
          title: Role
        is_active:
          type: boolean
          title: Is Active
        created_at:
          type: string
          format: date-time
          title: Created At
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        provisioning:
          anyOf:
            - $ref: '#/components/schemas/ProvisioningData'
            - type: 'null'
        access_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Access Token
        refresh_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Refresh Token
        token_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Token Type
          default: bearer
      type: object
      required:
        - id
        - email
        - role
        - is_active
        - created_at
      title: RegistrationResponse
      description: Enhanced registration response with role and provisioning data
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProvisioningData:
      properties:
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Key
        developer_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Developer Key
      type: object
      title: ProvisioningData
      description: Provisioning data for developers (one-time response)
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````