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

# Register a new patient

> Starts a signup and emails a one-time code. Returns **200, not 201** — no account exists yet; the registration is held pending until the code is verified.

Requires the `X-Brand-Slug: hi-doctor` header. Registering an address that belongs to an **active** account is refused; only an inactive, unverified signup resumes and is reissued a code. A `406` (`REGISTRATION_EMAIL_UNDELIVERABLE`) is permanent for that address.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/users/register/
openapi: 3.0.3
info:
  title: Hi-Doctor API
  version: 1.0.0
  description: >-
    Patient-facing REST API for Hi-Doctor.


    Authenticate with email and password to receive a JWT pair, then send the
    access token as `Authorization: Bearer <token>` on every subsequent request.


    Only patient-accessible endpoints are documented here. Clinician and
    back-office endpoints are intentionally omitted.
  contact:
    name: Hi-Doctor
    email: hello@hi-doctor.ai
    url: https://hi-doctor.ai
servers:
  - url: https://api.hi-doctor.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Registration, email verification, sign-in and profile.
  - name: Questionnaires
    description: Complete a consultation questionnaire and submit it for medical review.
  - name: Consultations
    description: Consultations a doctor has reviewed or is reviewing.
  - name: Prescriptions
    description: Prescriptions and reissue requests.
  - name: Billing
    description: Checkout, subscription management and the Stripe billing portal.
  - name: Records
    description: Orders, invoices and side-effect reports.
  - name: Messages
    description: The patient's private thread with their medical team.
  - name: Progress
    description: Weight, injection and note tracking. Requires an active treatment plan.
  - name: Referrals
    description: Referral summary and transactions.
paths:
  /v1/users/register/:
    post:
      tags:
        - Account
      summary: Register a new patient
      description: >-
        Starts a signup and emails a one-time code. Returns **200, not 201** —
        no account exists yet; the registration is held pending until the code
        is verified.


        Requires the `X-Brand-Slug: hi-doctor` header. Registering an address
        that belongs to an **active** account is refused; only an inactive,
        unverified signup resumes and is reissued a code. A `406`
        (`REGISTRATION_EMAIL_UNDELIVERABLE`) is permanent for that address.
      operationId: users_register_create
      parameters:
        - in: header
          name: X-Brand-Slug
          required: true
          schema:
            type: string
            enum:
              - hi-doctor
            default: hi-doctor
          description: >-
            Identifies the Hi-Doctor brand. Required; the request is rejected
            without it.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
            example:
              email: patient@example.com
              password: a-strong-password
              first_name: Alex
              last_name: Moreno
              locale: en
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                message: Please verify your email with OTP
        '400':
          description: Weak password, or the address belongs to an active account.
          content:
            application/json:
              example:
                password:
                  - This password is too short.
        '406':
          description: >-
            The address is permanently undeliverable (hard bounce or spam
            complaint). Retrying can never succeed.
          content:
            application/json:
              example:
                error: undeliverable
                code: registration_email_undeliverable
                error_name: REGISTRATION_EMAIL_UNDELIVERABLE
        '429':
          description: >-
            Rate limited. Honour Retry-After; an earlier code may still be valid
            in the inbox.
          content:
            application/json:
              example:
                detail: Too many registration attempts. Please try again later.
                code: registration_rate_limited
                error_name: REGISTRATION_RATE_LIMITED
      security: []
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        email:
          type: string
          format: email
          maxLength: 254
        password:
          type: string
          writeOnly: true
        first_name:
          type: string
          default: ''
          maxLength: 150
        last_name:
          type: string
          default: ''
          maxLength: 150
        locale:
          type: string
          writeOnly: true
          default: en
      required:
        - email
        - id
        - password
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /v1/users/token/

````