User Registration

POST /auth/register

Registers a new user. In a real app, this might require admin privileges or an invitation system.

application/json

Body Required

User Registration Details

  • email string Required
  • first_name string Required
  • last_name string Required
  • organization_id integer Required

    Made optional, otherwise: binding:"required"

  • password string Required

    Minimum length is 8.

  • role string Required

Responses

  • 201 application/json

    message: User registered successfully, user_id: uint64

    Additional properties are allowed.

  • 400 application/json

    Invalid request data or registration failed (e.g., email exists)

    Hide response attribute Show response attribute object
    • * string Additional properties
POST /auth/register
curl \
 --request POST 'http://api.example.com/auth/register' \
 --header "Content-Type: application/json" \
 --data '{"email":"string","first_name":"string","last_name":"string","organization_id":42,"password":"string","role":"string"}'
Request examples
{
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "organization_id": 42,
  "password": "string",
  "role": "string"
}
Response examples (201)
{}
Response examples (400)
{
  "additionalProperty1": "string",
  "additionalProperty2": "string"
}