absenceRegions

Creates an absence region.

Changed on

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.

<Note title="Subscription Level" icon="layer-group">This endpoint requires the Standard plan or higher.</Note>

<Check title="Required Permissions" icon="key">The user must be an admin or have user-planning-data:write permissions.</Check>

post/absenceregions

Request

  • Base URL: https://api.awork.com/api/v1
  • URL: https://api.awork.com/api/v1/absenceregions
  • Auth: HTTP bearer

Request body

namestring required

The name of the absence region. Must be unique.

countryCodestring required

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

locationCodestring nullable

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

isDefaultboolean

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

Response

OK

idstring uuid

The id of the entity.

createdOnstring date-time

The date this entity was created.

createdBystring uuid

The id of the user who created this entity.

updatedOnstring date-time

The date this entity was last modified.

updatedBystring uuid

The id of the user who last modified this entity.

namestring nullable

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

countryCodestring nullable

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

countrystring nullable

The english name of the country.

locationCodestring nullable

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

locationstring nullable

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

isDefaultboolean

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

numberOfPublicHolidaysinteger

The number of public holidays in the absence region.

assignedUsersstring[] nullable

The list of user ids assigned to the absence region.

Changes

    • warning

      deleted the header request parameter Authorization

    • info

      the endpoint scheme security oauth2 was added to the API

    • info

      api operation id PostAbsenceRegion removed and replaced with absenceRegions_PostAbsenceRegion