# Session actions tools

[All tool areas](/docs/tools.md). Each tool acts within your access.

## Session actions

### cancel_session

Cancel a session: it comes off sale and frees its resources. Each confirmed booking is canceled with a credit for everything paid (`outcome: "credit"`) or a refund of everything paid, service charge included (`"refund"`); left out, the sessionCancelOutcome setting decides (a credit unless set). `bookings` names exceptions; a booking with nothing paid is simply canceled. Guests' holds are released and checkouts waiting on payment canceled (a payment that still comes through is refunded in full). Each guest is emailed what happened (creditEmail, sessionRefundEmail, cancellationEmail), and the kitchen is told if it had the sheet. Bookings need bookings:write; credits and refunds need refunds:create and orders:amounts, and refunds are held to your refund cap per order: over it, the preview says so and suggests a credit. A person applies it, never an agent on its own. Undo puts a session with no bookings back on; once bookings are canceled it can't be undone. Returns a preview to confirm.

Changes · Members of an organization · Needs sessions:write

#### Input

- `sessionId` — string; required. The session's id, from list_sessions
- `outcome` — string; optional. What every confirmed booking gets: a credit for everything paid, or a refund of everything paid, service charge included. Left out: the sessionCancelOutcome setting (a credit unless set). `bookings` names exceptions Allowed: "credit", "refund"
- `bookings` — array; optional. Bookings that get the other outcome than `outcome` (or the setting's) maxItems: 500; default: \[\]
  - `bookings[]` — object; optional. 
    - `bookings[].orderId` — string; required. The order's id, from list_bookings or list_orders
    - `bookings[].outcome` — string; required. credit: a credit for everything paid (stored value with a code, the guest's to use later); refund: everything paid back to the card, service charge included Allowed: "credit", "refund"

#### Output

- `id` — string; required. 
- `status` — string; required.  Value: "canceled"
- `bookings` — array; optional. What happened to each booking. Always present
  - `bookings[]` — object; optional. 
    - `bookings[].booking` — string or null; required. 
    - `bookings[].order` — string; required. 
    - `bookings[].outcome` — string; required.  Allowed: "move", "credit", "refund", "cancel"
    - `bookings[].amount` — integer or null; required. What was credited or refunded, in minor units; null without orders:amounts minimum: -9007199254740991; maximum: 9007199254740991
    - `bookings[].credit` — string; optional. 

### message_session

Email everyone booked on a session: one email to each confirmed booking's organizer, with your subject and text quoted as you wrote them (plain text) beside the booking's details and manage link. The preview says how many get it as of now, and applying sends only to those bookings (one made after the preview isn't messaged; one canceled since is skipped); bookings with no email address get nothing. Needs sessions:write as well as bookings:write. Logged with who sent it. A mass guest message: a person applies it, never an agent on its own. Can't be undone. Returns a preview to confirm.

Changes · Members of an organization · Needs bookings:write, sessions:write

#### Input

- `sessionId` — string; required. The session's id, from list_sessions
- `subject` — string; required. The email's subject, one line minLength: 1; maxLength: 120; pattern: "^\[^\\\\r\\\\n\]\*$"
- `text` — string; required. What to tell them, as plain text (blank lines between paragraphs). Shown to guests as written minLength: 1; maxLength: 5000

#### Output

- `sessionId` — string; required. 
- `sent` — integer; required. Bookings it goes to minimum: -9007199254740991; maximum: 9007199254740991

### move_session

Move a session to a new local date and start time (and optionally length) at the same location and product. Closures, blocks, and resources another session holds at the new time are conflicts. Every confirmed booking moves with it at the price it paid, unless `bookings` names it for a credit or a refund of everything paid (service charge included); one with nothing paid simply comes off. Guests' holds are released and checkouts waiting on payment canceled. Reminders and the kitchen sheet follow the new time. Each booking's guest is emailed what happened to it (sessionMovedEmail, creditEmail, sessionRefundEmail). A refund needs refunds:create and orders:amounts and is held to your refund cap per order; a credit needs the same two. A person applies it, never an agent on its own. Undo moves it back while the old time is free and nothing was booked at the new one; a move that took bookings off can't be undone. Returns a preview to confirm.

Changes · Members of an organization · Needs sessions:write

#### Input

- `sessionId` — string; required. The session's id, from list_sessions
- `date` — string; required. The new local date at the session's location format: "date"
- `startTime` — string; required. The new local start time, HH:MM pattern: "^(\[01\]\\\\d\|2\[0-3\]):\[0-5\]\\\\d$"
- `durationMinutes` — integer; optional. A new length; the session keeps its own by default minimum: 1; maximum: 1440
- `bookings` — array; optional. Bookings that don't move with the session: each canceled with a credit or a refund of everything paid. Every other confirmed booking moves with it maxItems: 500; default: \[\]
  - `bookings[]` — object; optional. 
    - `bookings[].orderId` — string; required. The order's id, from list_bookings or list_orders
    - `bookings[].outcome` — string; required. credit: a credit for everything paid (stored value with a code, the guest's to use later); refund: everything paid back to the card, service charge included Allowed: "credit", "refund"
- `credit` — object; optional. A credit for every booking that moves with the session, to make up for the move: stored value with a code, a liability of the entity that sold it, emailed to the guest (creditEmail). Each is that percent of what its guest paid, rounded to the cent, and held to your refund cap per order with the other credits you've given on it; it needs refunds:create and orders:amounts. A booking with nothing paid gets none. Undo voids them while they're unused
  - `credit.percent` — integer; required. The share of what each guest paid (and hasn't had back), in percent: 15 is 15% minimum: 1; maximum: 100
  - `credit.reason` — string; optional. service_recovery (making up for the move, the default) or goodwill Allowed: "service\_recovery", "goodwill"; default: "service\_recovery"

#### Output

- `session` — object; required. 
  - `session.id` — string; required. 
  - `session.productId` — string; required. 
  - `session.productName` — string; required. 
  - `session.hasMenu` — boolean; required. Whether its product has an active menu where this session is offered (the location's own, else one for all its locations): a dining session, with menu choices and a kitchen sheet. Without one, the session has no kitchen sheet.
  - `session.locationId` — string; required. 
  - `session.timeZone` — string; required. 
  - `session.scheduleId` — string or null; required. Null for a session created outside a schedule
  - `session.status` — string; required.  Allowed: "scheduled", "canceled"
  - `session.startsAt` — string; required.  format: "date-time"
  - `session.endsAt` — string; required.  format: "date-time"
  - `session.localStart` — string; required. 
  - `session.capacity` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
  - `session.seatsHeld` — integer; required. In checkouts not yet paid minimum: -9007199254740991; maximum: 9007199254740991
  - `session.seatsBooked` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
  - `session.checkedIn` — integer; optional. Guests checked in on its confirmed bookings, for the calendar and the run sheet. Always present minimum: -9007199254740991; maximum: 9007199254740991
  - `session.wholeSession` — boolean; optional. Held or booked whole by a group option (a private booking): no seats left for anyone else, staff included
  - `session.private` — object or null; optional. A private session's terms and booking link; null for a session on sale to everyone
    - `session.private.name` — string or null; required. Whose it is
    - `session.private.pricing` — string; required.  Allowed: "flat", "per\_person"
    - `session.private.amount` — integer or null; required. Minor units, before fees and tax: for the party (flat) or a person (per_person). Null without pricing:read minimum: -9007199254740991; maximum: 9007199254740991
    - `session.private.partySizeMax` — integer or null; required. The largest party; null: the session's capacity minimum: -9007199254740991; maximum: 9007199254740991
    - `session.private.token` — string or null; required. The private booking link's token. Share it only with the party: it books the session. Null without pricing:write, which setting its price needs too
  - `session.block` — object or null; optional. The closure or product block it's inside, which takes it off sale (its bookings stay); null when none. Always present in list_sessions
    - `session.block.id` — string; required. 
    - `session.block.kind` — string; required.  Allowed: "closure", "product"
    - `session.block.note` — string or null; required. 
  - `session.settings` — object; required. Overrides set on this session
    - `session.settings.*` — any value; optional. 
- `previousStartsAt` — string; required.  format: "date-time"
- `bookings` — array; required. 
  - `bookings[]` — object; optional. 
    - `bookings[].booking` — string or null; required. 
    - `bookings[].order` — string; required. 
    - `bookings[].outcome` — string; required.  Allowed: "move", "credit", "refund", "cancel"
    - `bookings[].amount` — integer or null; required. What was credited or refunded, in minor units; null without orders:amounts minimum: -9007199254740991; maximum: 9007199254740991
    - `bookings[].credit` — string; optional. 
