AddUser

POST /users

Create a new user.

application/json

Body

Post the necessary fields for the API to create a new user.

  • email string(email) Required
  • dateOfBirth string(date) Required
  • password string Required

    Minimum length is 12.

  • lastName string Required

    Minimum length is 2, maximum length is 30.

  • firstName string Required

    Minimum length is 2, maximum length is 30.

Responses

  • 201 application/json

    User Created

    Hide response attributes Show response attributes object
    • _id string Required

      Unique identifier for the given user.

    • firstName string Required

      Minimum length is 2, maximum length is 30.

    • email string(email) Required
    • username string Required

      Unique identifier for the given user.

    • password string(password) Required
    • lastName string Required

      Minimum length is 2, maximum length is 30.

    • dateOfBirth string(date-time) Required
    • emailVerified boolean

      Set to true if the user's email has been verified.

    • createDate string(date)

      The date that the user was created.

    • location string
    • image string
  • 400

    Missing Required Information

  • 409

    Ese correo ya existe

  • 500

    Internal Server Error

POST /users
curl \
 --request POST 'https://garden-to-yours.herokuapp.com/users' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"email":"user@example.com","lastName":"pepito","password":"asdasd\u0026%$\u0026fsdf5SDF","firstName":"geremi","dateOfBirth":"2000-08-24"}'
Request example
{
  "email": "user@example.com",
  "lastName": "pepito",
  "password": "asdasd&%$&fsdf5SDF",
  "firstName": "geremi",
  "dateOfBirth": "2000-08-24"
}
Response examples (201)
{
  "_id": "string",
  "firstName": "string",
  "email": "hello@example.com",
  "username": "string",
  "password": "string",
  "lastName": "string",
  "dateOfBirth": "2000-08-24T00:00:00.000Z",
  "emailVerified": true,
  "createDate": "2025-05-04",
  "location": "string",
  "image": "string"
}