# Updates the specified absence region.

PUT https://api.awork.com/api/v1/absenceregions/{absenceRegionId}

Updates the region name, country, location, or default status. Names must remain unique, and marking this region as default clears the previous default region.

<Check title="Required Permissions" icon="key">The user must be an admin or have `user-planning-data:write` permissions.</Check>

## Request example

```sh
curl -X PUT --globoff 'https://api.awork.com/api/v1/absenceregions/{absenceRegionId}' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "Hamburg",
  "countryCode": "DE",
  "locationCode": "DE-HH",
  "isDefault": true
}'
```

- path parameter `absenceRegionId`: string (required). The id of the absence region to update.

## Request body (application/json)

- `name`: string (required)

- `countryCode`: string (required)

- `locationCode`: string or null

- `isDefault`: boolean

## Response 200

OK

application/json

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdOn": "2022-03-11T15:33:47.100Z",
  "createdBy": "123e4567-e89b-12d3-a456-426614174000",
  "updatedOn": "2022-03-11T21:15:00.100Z",
  "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Hamburg",
  "countryCode": "DE",
  "country": "Germany",
  "locationCode": "DE-HH",
  "location": "Hamburg",
  "isDefault": true,
  "numberOfPublicHolidays": 10,
  "assignedUsers": [
    "7b356284-d22b-4f74-980d-0a548d3b6318",
    "b37f07dd-6644-4271-9c8a-bb700cc21b63"
  ]
}
```

## Response 400

Bad Request

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```

## Response 404

Not Found

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```
