> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weya.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Toggle Holiday List

> Enable or disable a Holiday List without modifying its configuration.

Use this endpoint to enable or disable an existing Holiday List. Disabled Holiday Lists are ignored when scheduling outbound campaigns, while enabled Holiday Lists are automatically applied according to your campaign configuration.

<Note>
  Only authenticated users can enable or disable Holiday Lists within their workspace.
</Note>

### OpenAPI

```yaml theme={null}
openapi: 3.1.0
info:
  title: Toggle Holiday List
  version: 1.0.0

paths:
  /api/holiday-lists/toggle:
    patch:
      summary: Enable or disable a Holiday List
      description: Toggles the active status of an existing Holiday List.
      tags:
        - Holiday Lists

      security:
        - bearerAuth: []

      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - id
                - enabled
              properties:
                id:
                  type: string
                  description: Unique identifier of the Holiday List.
                  example: 6863f5ab1e4d7f0012345678
                enabled:
                  type: boolean
                  description: Enable or disable the Holiday List.
                  example: true

      responses:
        "200":
          description: Holiday List status updated successfully.

        "400":
          description: Invalid request.

        "401":
          description: Unauthorized.

        "404":
          description: Holiday List not found.

        "500":
          description: Internal Server Error.

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
```

## Authorizations

<ParamField header="Authorization" type="string" required>
  Bearer Token for the authenticated user.

  Format:

  `Authorization: Bearer YOUR_ACCESS_TOKEN`
</ParamField>

## Body Parameters

<ParamField body="id" type="string" required>
  Unique identifier of the Holiday List.
</ParamField>

<ParamField body="enabled" type="boolean" required>
  Whether the Holiday List should be enabled (`true`) or disabled (`false`).
</ParamField>

## Example Request

```bash theme={null}
curl --location --request PATCH '{{baseUrl}}/api/holiday-lists/toggle' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "id": "6863f5ab1e4d7f0012345678",
  "enabled": false
}'
```

## Successful Response

```json theme={null}
{
  "success": true,
  "message": "Holiday List status updated successfully.",
  "data": {
    "_id": "6863f5ab1e4d7f0012345678",
    "name": "India Public Holidays",
    "enabled": false,
    "updatedAt": "2026-07-21T15:42:18.000Z"
  }
}
```

## Response Fields

<ResponseField name="_id" type="string">
  Unique identifier of the Holiday List.
</ResponseField>

<ResponseField name="name" type="string">
  Name of the Holiday List.
</ResponseField>

<ResponseField name="enabled" type="boolean">
  Current status of the Holiday List. When set to `true`, the Holiday List will be considered during campaign scheduling. When set to `false`, it will be ignored.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Timestamp indicating when the Holiday List status was last updated.
</ResponseField>

## Error Responses

### Bad Request (400)

```json theme={null}
{
  "success": false,
  "message": "Invalid request payload."
}
```

### Unauthorized (401)

```json theme={null}
{
  "success": false,
  "message": "Unauthorized"
}
```

### Not Found (404)

```json theme={null}
{
  "success": false,
  "message": "Holiday List not found."
}
```

### Internal Server Error (500)

```json theme={null}
{
  "success": false,
  "message": "Failed to update Holiday List status."
}
```
