> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# BulkSetAttendance

# Package: bookings

# Namespace: AttendanceService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/attendance/bulk-set-attendance?apiView=SDK.md

## Permission Scopes:
Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS

## Introduction

Sets or updates attendance information for multiple booking sessions.


Refer to Set Attendance for detailed behavior of individual attendance
entries.

The call fails entirely if any entry in `attendanceDetails` is missing a
required field.

If attendance details are provided for a non-existent session, the call
succeeds for valid sessions while marking the unavailable session as a
failure in the response.

---

## REST API

### Schema

```
 Method: bulkSetAttendance
 Description: Sets or updates attendance information for multiple booking sessions.   Refer to Set Attendance for detailed behavior of individual attendance entries.  The call fails entirely if any entry in `attendanceDetails` is missing a required field.  If attendance details are provided for a non-existent session, the call succeeds for valid sessions while marking the unavailable session as a failure in the response.
 URL: https://www.wixapis.com/bookings/v2/bulk/attendance/set
 Method: POST
 Method parameters:
   param name: attendanceDetails | type: array<attendanceDetails> | description: List of attendance details for booking sessions to create or update.  | validation: maxItems 8
              - name: attendance | type: Attendance | description: Created or updated attendance information for a booking session.  
                 - name: bookingId | type: string | description: Corresponding booking GUID.  | validation: format GUID
                 - name: status | type: AttendanceStatus | description: Status indicating if any participants attended the session.  
                         - enum:
                         -     NOT_SET: There is no available attendance information.
                         -     ATTENDED: At least a single participant attended the session.
                         -     NOT_ATTENDED: No participants attended the session.
                 - name: numberOfAttendees | type: integer | description: Total number of participants that attended the session. By default, the number of attendees is set to `1`, but you can set a number to greater than `1` if multiple participants attended.  Do not set to `0` to indicate that no one attended the session. Instead, set the `status` field to `NOT_ATTENDED`.  Default: 1  
                 - name: eventId | type: string | description: Corresponding [event GUID](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/event-object.md). Use this field instead of the deprecated `sessionId`. You can retrieve the event GUID from the booking's slot `booking.bookedEntity.slot.eventId`.  | validation: minLength 36, maxLength 250
              - name: participantNotification | type: ParticipantNotification | description: Information about whether to send a message to the customer after their attendance was set.  
                 - name: notifyParticipants | type: boolean | description: Specify whether to send a message about the changes to the customer.  Default: `false`  
                 - name: message | type: string | description: Optional custom message to send to the participants about the changes to the booking.  | validation: minLength 1, maxLength 5000
   param name: returnFullEntity | type: returnFullEntity    
 Return type: BulkSetAttendanceResponse
  - name: results | type: array<BulkAttendanceResult> | description: List of created or updated `attendance` objects.  | validation: minItems 1, maxItems 8
     - name: item | type: Attendance | description: Created or updated `attendance` object.  
        - name: id | type: string | description: GUID of the `attendance` object.  | read-only: true | validation: format GUID
        - name: bookingId | type: string | description: Corresponding booking GUID.  | validation: format GUID
        - name: status | type: AttendanceStatus | description: Status indicating if any participants attended the session.  
             - enum:
             -     NOT_SET: There is no available attendance information.
             -     ATTENDED: At least a single participant attended the session.
             -     NOT_ATTENDED: No participants attended the session.
        - name: numberOfAttendees | type: integer | description: Total number of participants that attended the session. By default, the number of attendees is set to `1`, but you can set a number to greater than `1` if multiple participants attended.  Do not set to `0` to indicate that no one attended the session. Instead, set the `status` field to `NOT_ATTENDED`.  Default: 1  
        - name: eventId | type: string | description: Corresponding [event GUID](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/event-object.md). Use this field instead of the deprecated `sessionId`. You can retrieve the event GUID from the booking's slot `booking.bookedEntity.slot.eventId`.  | validation: minLength 36, maxLength 250
     - name: itemMetadata | type: ItemMetadata | description: Metadata for the created or updated `attendance` object.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Information about the total number of successes and failures for the Bulk Set Attendance call.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ATTENDANCES_MISSING_IN_REQUEST | Description: No attendance records were provided in the request. Include at least 1 attendance record.


```

### Examples

### Mark multiple booking sessions as attended
```curl
curl -X POST \
'https://www.wixapis.com/bookings-attendance/v2/bulk/attendance/set' \
-H 'Authorization: <AUTH>' \
-d '{
  "attendanceDetails": [
    {
      "attendance": {
        "bookingId": "88214716-6ed1-4273-b089-8015c4ab2f4b",
        "sessionId": "2mmoW0vwKcSFyxtOfCdMqTntk7dVhOyHRtg53bu4e0cvIFpCA9sAC0M0ZiAJcAcni80UUc0DZWeZiSWqQEpqEHzb6cLa99kNRZDp",
        "status": "ATTENDED",
        "numberOfAttendees": 1
      }
    },
    {
      "attendance": {
        "bookingId": "99125827-7fe2-5384-c19a-9026d5bc3f5c",
        "sessionId": "3nnpX1wxLdTGzyuPgDeNrVouk8eWiPzISuh64cv5f1dwJHqDB0tBD1N1AjBKdBdoj91VVd1EAfXfAjXTFRrqFIzc7dMb00lOSZEq",
        "status": "ATTENDED",
        "numberOfAttendees": 2
      }
    }
  ]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.bookings.attendance.bulkSetAttendance(options)
 Description: Sets or updates attendance information for multiple booking sessions.   Refer to Set Attendance for detailed behavior of individual attendance entries.  The call fails entirely if any entry in `attendanceDetails` is missing a required field.  If attendance details are provided for a non-existent session, the call succeeds for valid sessions while marking the unavailable session as a failure in the response.
 Method parameters:
   param name: options | type: BulkSetAttendanceOptions  none  
        - name: returnFullEntity | type: boolean | description:   
        - name: attendanceDetails | type: array<AttendanceDetails> | description: List of attendance details for booking sessions to create or update.  | validation: maxItems 8
           - name: attendance | type: Attendance | description: Created or updated attendance information for a booking session.  
              - name: bookingId | type: string | description: Corresponding booking GUID.  | validation: format GUID
              - name: status | type: AttendanceStatus | description: Status indicating if any participants attended the session.  
                     - enum:
                     -     NOT_SET: There is no available attendance information.
                     -     ATTENDED: At least a single participant attended the session.
                     -     NOT_ATTENDED: No participants attended the session.
              - name: numberOfAttendees | type: integer | description: Total number of participants that attended the session. By default, the number of attendees is set to `1`, but you can set a number to greater than `1` if multiple participants attended.  Do not set to `0` to indicate that no one attended the session. Instead, set the `status` field to `NOT_ATTENDED`.  Default: 1  
              - name: eventId | type: string | description: Corresponding [event GUID](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/event-object.md). Use this field instead of the deprecated `sessionId`. You can retrieve the event GUID from the booking's slot `booking.bookedEntity.slot.eventId`.  | validation: minLength 36, maxLength 250
           - name: participantNotification | type: ParticipantNotification | description: Information about whether to send a message to the customer after their attendance was set.  
              - name: notifyParticipants | type: boolean | description: Specify whether to send a message about the changes to the customer.  Default: `false`  
              - name: message | type: string | description: Optional custom message to send to the participants about the changes to the booking.  | validation: minLength 1, maxLength 5000
 Return type: PROMISE<BulkSetAttendanceResponse>
  - name: results | type: array<BulkAttendanceResult> | description: List of created or updated `attendance` objects.  | validation: minItems 1, maxItems 8
     - name: item | type: Attendance | description: Created or updated `attendance` object.  
        - name: _id | type: string | description: GUID of the `attendance` object.  | read-only: true | validation: format GUID
        - name: bookingId | type: string | description: Corresponding booking GUID.  | validation: format GUID
        - name: status | type: AttendanceStatus | description: Status indicating if any participants attended the session.  
             - enum:
             -     NOT_SET: There is no available attendance information.
             -     ATTENDED: At least a single participant attended the session.
             -     NOT_ATTENDED: No participants attended the session.
        - name: numberOfAttendees | type: integer | description: Total number of participants that attended the session. By default, the number of attendees is set to `1`, but you can set a number to greater than `1` if multiple participants attended.  Do not set to `0` to indicate that no one attended the session. Instead, set the `status` field to `NOT_ATTENDED`.  Default: 1  
        - name: eventId | type: string | description: Corresponding [event GUID](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/event-object.md). Use this field instead of the deprecated `sessionId`. You can retrieve the event GUID from the booking's slot `booking.bookedEntity.slot.eventId`.  | validation: minLength 36, maxLength 250
     - name: itemMetadata | type: ItemMetadata | description: Metadata for the created or updated `attendance` object.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Information about the total number of successes and failures for the Bulk Set Attendance call.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ATTENDANCES_MISSING_IN_REQUEST | Description: No attendance records were provided in the request. Include at least 1 attendance record.


```

### Examples

### Set attendance for multiple sessions in bulk
```javascript
import { attendance } from "@wix/bookings";

async function bulkSetAttendance() {
  const response = await attendance.bulkSetAttendance({
    returnFullEntity: true,
    attendanceDetails: [
      {
        attendance: {
          bookingId: "12345678-1234-1234-1234-123456789abc",
          eventId: "11111111-1111-1111-1111-111111111111",
          status: "ATTENDED",
          numberOfAttendees: 3,
        },
      },
      {
        attendance: {
          bookingId: "12345678-1234-1234-1234-123456789abc",
          eventId: "22222222-2222-2222-2222-222222222222",
          status: "NOT_ATTENDED",
        },
      },
    ],
  });
  return response;
}

```

### bulkSetAttendance (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { attendance } from '@wix/bookings';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { attendance },
  // Include the auth strategy and host as relevant
});


async function bulkSetAttendance(options) {
  const response = await myWixClient.attendance.bulkSetAttendance(options);
};
```

---