---
title: "Create a new user"
method: POST
path: "/createUser"
tags: ["Users"]
---

# Create a new user

`POST /createUser`

Create a new user with the provided user information

## Request body

- RequestUserRequest — Structure containing the required fields for creating a new user.
  - `age` integer, required — User's age (required, must be between 1 and 140). @json @jsonTag age @jsonExample 30
  - `email` string, required — User's email (required and must be a valid email address). Example: user@example.com @json @jsonTag email @jsonExample user@example.com @binding required,email
  - `name` string, required — User's name (required, minimum of 4 characters, maximum of 100 characters). Example: John Doe @json @jsonTag name @jsonExample John Doe @binding required,min=4,max=100
  - `password` string, required — User's password (required, minimum of 6 characters, and must contain at least one of the characters: !@#$%*). @json @jsonTag password @jsonExample P@ssw0rd! @binding required,min=6,containsany=!@#$%*

## Response `200`

OK

- ResponseUserResponse
  - `age` integer
  - `email` string
  - `id` string
  - `name` string

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

---

[API](https://skmtc.net/huncoding/apis/meu-primeiro-crud-em-go-huncoding.md) · [All operations](https://skmtc.net/huncoding/apis/meu-primeiro-crud-em-go-huncoding/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/huncoding/meu-primeiro-crud-em-go-huncoding/versions/5947d1adf479/schema)
