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

# Register

> Creates an end-user account in the guard's collection and returns a session. Send the login field under its field name, `password` (min 8), and any other fields. Assigns the guard's default `user` role. If email verification is on, the response includes `status: pending_verification` and a code is emailed. Limited to 10 requests per minute per IP.



## OpenAPI

````yaml /api-reference/openapi.json post /auth/{guard}/register
openapi: 3.1.0
info:
  title: Bludia Public API
  version: 1.0.0
  description: >-
    The Bludia public REST API (v1). Every request requires the
    `X-BLUDIA-API-KEY` header. With an `end_users` key, data and account routes
    also require `Authorization: Bearer <access_token>` from login. With a
    `platform` key, the API key alone grants full project access.
servers:
  - url: https://{host}/ext/api/v1
    description: Your Bludia API host. Copy it from a collection's API Endpoints panel.
    variables:
      host:
        default: YOUR_API_HOST
        description: API host shown in your dashboard
security:
  - ApiKey: []
    BearerAuth: []
  - ApiKey: []
tags:
  - name: Records
    description: Create, read, update, and delete records in a collection.
  - name: Authentication
    description: >-
      Register, log in, refresh, and log out end users through an authentication
      guard.
  - name: Account
    description: Endpoints for the signed-in end user.
paths:
  /auth/{guard}/register:
    post:
      tags:
        - Authentication
      summary: Register
      description: >-
        Creates an end-user account in the guard's collection and returns a
        session. Send the login field under its field name, `password` (min 8),
        and any other fields. Assigns the guard's default `user` role. If email
        verification is on, the response includes `status: pending_verification`
        and a code is emailed. Limited to 10 requests per minute per IP.
      operationId: register
      parameters:
        - name: guard
          in: path
          required: true
          description: Authentication guard slug, for example `users`.
          schema:
            type: string
          example: users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - password
              properties:
                password:
                  type: string
                  minLength: 8
                  format: password
              additionalProperties: true
              description: Login field (by field name), password, and other fields.
            example:
              email: sarah@example.com
              password: correct horse battery
              full_name: Sarah Ahmed
      responses:
        '201':
          description: Registered and signed in.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterResponse'
              example:
                session:
                  access_token: eyJhbGciOiJIUzI1NiIs...
                  refresh_token: q3Jx...
                  token_type: Bearer
                  expires_in: 900
                  record_id: 42
        '403':
          description: '`registration_disabled`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: '`duplicate_account`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - ApiKey: []
components:
  schemas:
    RegisterResponse:
      type: object
      properties:
        session:
          $ref: '#/components/schemas/Session'
        status:
          type: string
          enum:
            - pending_verification
          description: Present when email verification is on.
    AuthError:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable code, for example `invalid_credentials`.
        message:
          type: string
    Session:
      type: object
      properties:
        access_token:
          type: string
          description: JWT, valid for `expires_in` seconds.
        refresh_token:
          type: string
          description: Opaque token; rotates on every refresh.
        token_type:
          type: string
          const: Bearer
        expires_in:
          type: integer
          description: Seconds until the access token expires (default 900).
        record_id:
          type: integer
          description: The user's record ID.
    Error:
      type: object
      properties:
        status:
          type: boolean
          const: false
        message:
          type: string
        errors:
          description: Field errors, when available.
        request_id:
          type: string
    Message:
      type: object
      properties:
        message:
          type: string
  responses:
    NotFound:
      description: Collection, guard, or record not found (or not visible).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Message'
          example:
            message: Rate limit exceeded.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-BLUDIA-API-KEY
      description: Your project API key, for example `bludia_production_k3x9qa_...`.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        End-user access token from login, register, or refresh. Required with
        `end_users` keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.