# Update an official holiday

`PUT /api/official-holiday/{id}`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, string, required)
  Type: string

Request body: application/json (required)

Type: object

Schema: [UpdateOfficialHolidayDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updateofficialholidaydto/index.md)

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (optional)
  Type: object

- `organizationId` (optional)
  Type: string

- `sentTo` (optional)
  Type: string

- `deletedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `createdAt` (optional)
  Type: string, date-time
  
  The creation timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `updatedAt` (optional)
  Type: string, date-time
  
  The last update timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `id` (optional)
  Type: string

- `isActive` (optional)
  Type: boolean
  
  default: true

- `isArchived` (optional)
  Type: boolean
  
  default: false

- `archivedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `name` (optional)
  Type: string
  
  Display name of the holiday, e.g. "Christmas Day"

- `countryCode` (optional)
  Type: string
  
  ISO 3166-1 alpha-2 country code, e.g. "US", "DE"

- `date` (optional)
  Type: string, date-time
  
  The holiday date, or the first day of a multi-day holiday

- `endDate` (optional)
  Type: string, date-time
  
  Last day of a multi-day holiday

- `isRecurring` (optional)
  Type: boolean
  
  Whether the holiday falls on the same date every year

Responses:

- 202: The holiday has been updated.

- 404: Record not found

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/official-holiday/string' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "name": "string",
  "countryCode": "string",
  "date": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "isRecurring": true
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "name": "string",
  "countryCode": "string",
  "date": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "isRecurring": true
}`;

const response = await fetch('http://localhost:3000/api/official-holiday/string', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "name": "string",
  "countryCode": "string",
  "date": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "isRecurring": true
}'''

response = requests.put(
    'http://localhost:3000/api/official-holiday/string',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
