Create a new employee

POST /employees

Adds a new employee to the system

application/json

Body Required

  • name string Required

    Employee name

  • role string Required

    Employee role

Responses

  • 201 application/json

    OK

    Hide response attributes Show response attributes object
    • id integer(int64)

      Unique identifier which should not be shared publicly

    • name string Required

      Employee name

    • role string Required

      Employee role

  • 404 application/json

    Not Found

POST /employees
curl \
 --request POST 'http://localhost:8080/employees' \
 --header "Content-Type: application/json" \
 --data '{"name":"Bilbo Baggins","role":"Software Engineer"}'
Request examples
{
  "name": "Bilbo Baggins",
  "role": "Software Engineer"
}
Response examples (201)
{
  "id": 1234,
  "name": "Bilbo Baggins",
  "role": "Software Engineer"
}
Response examples (404)
string