---
title: "User registration"
method: POST
path: "/api/auth/register"
tags: ["Auth"]
---

# User registration

`POST /api/auth/register`

# Errors
Returns an error if input validation fails, user already exists, or database operations fail.

## Request body

- RegisterRequest — Request body for user registration.
  - `displayName` string, nullable — Optional display name for the user
  - `email` string, required — Email address for new user registration
  - `password` string, required — User's password (minimum 8 characters)

## Response `200`

Registration successful

- RegisterResponse — Response for successful user registration
  - `message` string, required — Registration confirmation message
  - `user` UserInfo, required — User information for API responses and internal use
    - `authProvider` 'google' | 'email' | 'both', required — Authentication provider types supported by the system
    - `avatarUrl` string, nullable — URL to user's avatar image
    - `banner` string, nullable — URL to user's banner image
    - `createdAt` string, date-time, nullable — User account creation timestamp
    - `description` string, nullable — User's description or bio
    - `displayName` string, nullable — User's display name
    - `email` string, required — User's registered email address
    - `emailVerified` boolean, required — Whether the user's email has been verified
    - `id` string, uuid, required — User's unique identifier
    - `lastLogin` string, date-time, nullable — Timestamp of user's last login

## Other responses

- `400` — Invalid input or email already exists
- `500` — Registration service error or email delivery failed

## Changes

- **2025-10-14** `8ba031a48387` — 2 info
  - added the optional property `user/banner` to the response with the `200` status
  - added the optional property `user/description` to the response with the `200` status
- **2025-09-22** `861532a21ad9` — 2 breaking, 5 warning, 7 info
  - removed the required property `user/auth_provider` from the response with the `200` status
  - removed the required property `user/email_verified` from the response with the `200` status
  - removed the request property `display_name`
  - removed the optional property `user/avatar_url` from the response with the `200` status
  - …10 more
- **2025-09-09** `6b878ba0237d` — 1 breaking, 1 info
  - removed the required property `user_id` from the response with the `200` status
  - added the required property `user` to the response with the `200` status
- **2025-09-07** `c110c24f7ffe` — 1 info
  - added the new optional request property `display_name`
- **2025-09-01** `1d20aeaaa6cf` — 2 breaking, 2 info
  - removed the media type `text/plain` for the response with the status `400`
  - removed the media type `text/plain` for the response with the status `500`
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `500`

[Full history](https://skmtc.dev/patroninc/apis/patron-api/changes/api/auth/register/post.md)

---

[API](https://skmtc.dev/patroninc/apis/patron-api.md) · [All operations](https://skmtc.dev/patroninc/apis/patron-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/patroninc/patron-api/revisions/1583b1f4c97d/schema)
