Creates an absence region.

POSThttps://api.awork.com/api/v1/absenceregions
POST https://api.awork.com/api/v1/absenceregions

Creates an absence region for an ISO 3166-1 alpha-2 country and location. Names must be unique. Marking the new region as default clears the previous default region. This operation requires a Standard workspace plan or higher.

Authentication

AuthorizationBearer

Send your token in the Authorization: Bearer <token> header. See Authentication for API keys and OAuth.

Request body Required

The model to create the absence region.

application/json

namestringRequired
minLength: 1 maxLength: 255

The name of the absence region. Must be unique.

countryCodestringRequired
minLength: 1 maxLength: 2

The ISO 3166-1 alpha-2 country code (e.g. 'DE' for Germany).

locationCodestring or nullOptional
maxLength: 25

The (optional) location code of the absence region in ISO 3166-2 format (e.g. 'DE-HH' for Hamburg, Germany).

isDefaultbooleanOptional

Indicates whether the absence region is the default absence region. A default absence region is automatically assigned to new employees.

Responses

200 OK

application/json

idstringOptional
format: uuid

The id of the entity.

createdOnstringOptional
format: date-time

The date this entity was created.

createdBystringOptional
format: uuid

The id of the user who created this entity.

updatedOnstringOptional
format: date-time

The date this entity was last modified.

updatedBystringOptional
format: uuid

The id of the user who last modified this entity.

namestring or nullOptional

The name of the absence region, as specified by the user. It must be unique within the workspace.

countryCodestring or nullOptional

The country code of the absence region. It must be a valid ISO 3166-1 alpha-2 country code.

countrystring or nullOptional

The english name of the country.

locationCodestring or nullOptional

The location code of the absence region. It should be a valid ISO 3166-2 country subdivision code.

locationstring or nullOptional

The name of the location. It will always be in the related country's language.

isDefaultbooleanOptional

Indicates whether the absence region is the default absence region. Any new user will be assigned to the default absence region.

numberOfPublicHolidaysintegerOptional
format: int32

The number of public holidays in the absence region.

assignedUsersarray of string or nullOptional

The list of user ids assigned to the absence region.

400 Bad Request

application/json

codestringRequired
minLength: 1

The error code.

descriptionstringRequired
minLength: 1

The description of the error.

linkstringRequired
minLength: 1

The link to the API documentation page.

detailsarray of string or nullOptional

A list of details describing the error.

validationErrorsarray of object or nullOptional

If a validation error occurred, this contains the validation errors for each property.

Show 2 properties
propertystring or nullOptional

The name of the property that failed validation.

messagestring or nullOptional

The reason why this property failed validation.

traceIdstring or nullOptional

The request trace id for tracking the request.

Search documentation