---
title: "Assign public holidays to a user"
method: PATCH
path: "/api/users/{userId}/publicholidays"
tags: ["Users"]
---

# Assign public holidays to a user

`PATCH /api/users/{userId}/publicholidays`

## Request

- Base URL: `https://app.timetastic.co.uk` (the document declares no server; this is the origin it was published from)
- URL: `https://app.timetastic.co.uk/api/users/{userId}/publicholidays`
- Auth: none declared

Use when you want to assign a set of public holidays to a user.  Will turn public holidays on for this user if they are not already.
           If you pick a country/region code that's already in use by your organisation (which may have customisations from Timetastic's UI) - that set will be used
           If you pick a country/region that's not already in use by your organisation you'll get the standard public holidays for that region.

## Path parameters

- `userId` integer, required

## Request body

- TimetasticWebApiResourceModelsAssignPublicHolidayModel
  - `regionCode` string, nullable: The full ISO-3166-1 alpha-2 region code for the region (e.g Andalucía, Spain: "ES-AN", Scotland, UK: "GB-SCT")
  - `countryCode` string, nullable: The ISO 3166-1 alpha-2 country code for the country (e.g. Spain: "ES")

## Response `200`

The public holiday set was assigned, or the user already had it.

## Other responses

- `400`: The request was rejected. This response has no body. It is returned when the body is missing or has no `countryCode`, when the country/region code is not recognised, when the user ID does not exist or belongs to another organisation, and when you are not allowed to manage that user.
- `401`: The request was not authenticated — the API token is missing or invalid.

---

[API](https://skmtc.dev/timetastic/apis/timetastic-api.md) · [All operations](https://skmtc.dev/timetastic/apis/timetastic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/timetastic/apis/timetastic-api/revisions/709ccb0412c3?raw)
