Create

POST /api/users

Create a new user

application/json

Body Required

  • firstName string Required

    Minimum length is 2, maximum length is 50.

  • lastName string Required

    Minimum length is 2, maximum length is 50.

  • email string | null Required

    Minimum length is 3, maximum length is 254.

  • primaryPhone string | null Required

    Minimum length is 6, maximum length is 20.

  • secondaryPhone string | null Required

    Minimum length is 6, maximum length is 20.

  • isWhatsappEnabled boolean | null
  • isCaptain boolean | null
  • isEnabled boolean | null
  • congregation object Required
    Hide congregation attribute Show congregation attribute object
    • id string Required

      Minimum length is 26, maximum length is 26.

  • mate object | null Required
    Hide mate attribute Show mate attribute object | null
    • id string Required

      Minimum length is 26, maximum length is 26.

  • role integer Required

    Values are 100, 50, 40, 30, 20, or 10.

  • labels array[object] | null
    Hide labels attribute Show labels attribute object
    • id string Required

      Minimum length is 26, maximum length is 26.

Responses

  • 201 application/json

    Successful Response

    Hide response attributes Show response attributes object
  • 422 application/json

    Validation Error

    Hide response attribute Show response attribute object
    • detail array[object]
      Hide detail attributes Show detail attributes object
POST /api/users
curl \
 -X POST https://metropolitanabogota.org/api/users \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"firstName":"string","lastName":"string","email":"string","primaryPhone":"string","secondaryPhone":"string","isWhatsappEnabled":true,"isCaptain":true,"isEnabled":true,"congregation":{"id":"string"},"mate":{"id":"string"},"role":100,"labels":[{"id":"string"}]}'
Request example
{
  "firstName": "string",
  "lastName": "string",
  "email": "string",
  "primaryPhone": "string",
  "secondaryPhone": "string",
  "isWhatsappEnabled": true,
  "isCaptain": true,
  "isEnabled": true,
  "congregation": {
    "id": "string"
  },
  "mate": {
    "id": "string"
  },
  "role": 100,
  "labels": [
    {
      "id": "string"
    }
  ]
}
Response examples (201)
{
  "firstName": "string",
  "lastName": "string",
  "email": "string",
  "primaryPhone": "string",
  "secondaryPhone": "string",
  "isWhatsappEnabled": true,
  "isCaptain": true,
  "isEnabled": true,
  "id": "string",
  "name": "string",
  "username": "string",
  "role": 100,
  "congregation": {
    "id": "string",
    "name": "string",
    "city": "string",
    "state": "string"
  },
  "mate": {
    "id": "string",
    "name": "string",
    "congregation": {
      "id": "string",
      "name": "string",
      "city": "string",
      "state": "string"
    }
  },
  "availabilityCount": 42,
  "availability": [
    {
      "id": "string",
      "shift": {
        "startTime": "09:42:00+00:00",
        "endTime": "09:42:00+00:00",
        "dayOfWeek": 42,
        "seatsCount": 42,
        "isEnabled": true,
        "id": "string",
        "location": {
          "id": "string",
          "name": "string"
        }
      }
    }
  ],
  "whatsappPrimaryPhone": "string",
  "lastSignedInAt": "2024-05-04T09:42:00+00:00",
  "labels": [
    {
      "name": "string",
      "bgColor": "string",
      "id": "string"
    }
  ],
  "createdAt": "2024-05-04T09:42:00+00:00",
  "updatedAt": "2024-05-04T09:42:00+00:00"
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}