# [EXPERIMENTAL] Create Employee Unavailability

Create an unavailability for an employee, without providing an identifier. The generated identifier will be available in the response's `Location`
header, and/or response body if the appropriate `Prefer`-header is provided with the request.

Endpoint: POST /employee/{employee_id}/unavailability
Version: 1.30.1
Security: clientCredentials

## Security:

  - `clientCredentials` (unknown)
    oauth2

## Path parameters:

  - `employee_id` (string, required)
    A unique identifier of an Employee. Should only contain characters which do not need URL encoding.

## Header parameters:

  - `Prefer` (array)
    The RFC7240 Prefer header indicates that a particular server behavior
is preferred by the client but is not required for successful completion
of the request (see [RFC 7240](https://tools.ietf.org/html/rfc7240)).

The following behavior (see _Examples_) is supported by this API:
* **return=<minimal|representation>** is used to suggest the server to
  return using 204 without resource (minimal) or using 200 or 201 with
  resource (representation) in the response body on success.

## Request fields (application/json):

  - `from` (string, required)
    Example: 2021-01-01T06:00:00Z

  - `to` (string, required)
    Example: 2021-01-10T06:00:00Z

  - `description` (string)
    Example: holiday

## Response 201:

  - `201` (unknown)
    Employee Unavailability created

## Response 201 fields (application/json):

  - `id` (string)
    The unique `Unavailability` ID.
    Example: f22896d0-ed42-4a14-a935-7a29072bc5ac

  - `employee_id` (string)
    The unique `Employee` ID.
    Example: employee-42

  - `from` (string, required)
    Example: 2021-01-01T06:00:00Z

  - `to` (string, required)
    Example: 2021-01-10T06:00:00Z

  - `description` (string)
    Example: holiday

## Response 201 headers (application/json):

  - `ETag` (string)
    A weak Etag (ex `W/"<etag_value>"`) which contains the current version of the entity
    Example: W/"25"

  - `Preference-Applied` (string)
    Indicates whether a preference has been applied. (ex `return=representation`)

  - `Location` (string)
    A URI to access the result of the operation.

## Response 204:

  - `204` (unknown)
    Employee Unavailability created

## Response 204 headers:

  - `ETag` (string)
    A weak Etag (ex `W/"<etag_value>"`) which contains the current version of the entity
    Example: W/"25"

  - `Preference-Applied` (string)
    Indicates whether a preference has been applied. (ex `return=representation`)

  - `Location` (string)
    A URI to access the result of the operation.

## Response 400:

  - `400` (unknown)
    Bad request

## Response 400 fields (application/problem+json):

  - `title` (string)
    A short, summary of the problem.
    Example: Validation exception

  - `detail` (string)
    A detailed explanation specific to this problem.
    Example: The field contains invalid business formatting.

  - `violations` (array)

  - `violations.field` (string)
    Example: path.to.field

  - `violations.message` (string)
    Example: Field is required

## Response 401:

  - `401` (unknown)
    Authentication required

## Response 404:

  - `404` (unknown)
    Not found

## Response 404 fields (application/problem+json):

  - `title` (string)
    A short, summary of the problem.
    Example: Validation exception

  - `detail` (string)
    A detailed explanation specific to this problem.
    Example: The field contains invalid business formatting.

## Response 412:

  - `412` (unknown)
    This status is returned when an entity is updated with an outdated version in the If-Match header.

## Response 412 fields (application/problem+json):

  - `title` (string)
    A short, summary of the problem.
    Example: Validation exception

  - `detail` (string)
    A detailed explanation specific to this problem.
    Example: The field contains invalid business formatting.

