Skip to content

Mutations

37 root mutations.

  • createApp
    Create an app owned by the viewer. The handle is global and permanent; the sessions CLI creates one from sessions.app.json on first push.
  • updateApp
    Rename or describe an app the viewer owns, or set its icon to an uploaded image.
  • deleteApp
    Delete an app the viewer owns. Every business that installed it stops rendering its extensions.
  • createAppExtension
    Add an extension to an app the viewer owns.
  • updateAppExtension
  • deleteAppExtension
  • pushAppExtensionVersion
    Upload a new version of an extension: one bundled ES module per target it renders into, each with its live query. Creates a draft; publish it to make businesses run it.
  • publishAppExtensionVersion
    Make a pushed version the one businesses run.
  • createDeveloperAccessToken
    Mint a CLI credential for the viewer. The secret is returned once.
  • revokeDeveloperAccessToken
  • checkout
    Price a basket, mint the order, and — when money is owed — the PaymentIntent to pay for it. The single entry point for booking a session, buying a product, booking an appointment time, or entering a team or individual into a league: one mutation, any mix of items, one order.
  • completePurchase
    Fulfill a minted purchase once its payment has been confirmed: books the sessions, mints the entitlements, spends the credits, and records how the order was funded, all in one transaction.
  • collectPurchaseBalance
    Collect what a deferred order still owes.
  • cancelBooking
    Cancel a booking and, under the activity's cancellation policy, return the money and the credits it consumed. Booking.cancellationPreview says what this will do before it is called.
  • changeBookingSpot
    Move the viewer's own confirmed booking to another free spot on the same session — a different bike, mat or seat.
  • rescheduleBooking
    Move the viewer's own appointment or rental to another open time of the same activity. The booking keeps its length, its practitioner and everything it was paid with: nothing is charged and nothing is refunded.
  • respondToBookingAttendance
    Say whether the viewer's booking is still on — the answer to a reminder's "I'll be there" and "Can't make it" buttons. Answering again replaces the previous answer.
  • cancelBookingSeats
    Cancel some of a party's places and keep the rest of the booking.
  • shareTicket
    Hand one ticket of an order to somebody in the party: returns a link that opens that ticket alone, with its own check-in code, to whoever holds it.
  • stopSharingTicket
    Turn a ticket's share link off. The link stops opening at once; sharing the ticket again mints a new one. The booker's alone to call.
  • sendTicket
    Send one ticket to somebody by email. They get an email with the ticket's link; when the address belongs to a Sessions account, the ticket is also saved to it, so it shows among their tickets right away. The answer is the same either way, so it never says whether an address has an account. A ticket goes to one person: sending it stops any link already out for it, unless that link went to the same account. The booker's alone to call.
  • addBookingSeats
    Add seats more places to a party's booking — more people are coming.
  • joinBookingWaitlist
    Join the queue for a full session. Writes a waitlisted booking with no order behind it — nothing is charged until a place is offered and accepted, which is why this is not checkout.
  • acceptBookingOffer
    Accept an offered place. Re-enters checkout for the amount owed, so the result carries a CheckoutSession exactly as checkout does; the existing waitlisted booking is confirmed rather than a second one inserted beside it.
  • createAccount
    Request an email containing a 6-digit code to confirm a new account. Always returns success regardless of whether the email is already in use (anti-enumeration). If an account already exists for the email, a sign-in code is sent instead.
  • signIn
    Request a sign-in email containing a 6-digit code. Always returns success regardless of whether the email matches an existing account (anti-enumeration).
  • redeemAuthCode
    Redeem a 6-digit auth code and sign the user in. Returns the created or signed-in user, the JWT token, and the redirect URL stored on the code. Sets the auth cookie on success — except for codes that were issued with a business pin, which return a business-scoped token without touching the cookie session.
  • confirmSocialSignUp
    Create the account a social sign-in stopped short of creating, and sign in as it. token is the pending sign-up handed to a popup opener; omit it and the pending cookie is used instead (the popup-blocked flow, which has no opener to hand anything to). name is the viewer's chosen display name, falling back to whatever the provider shared.
  • cancelSocialSignUp
    Discard a pending social sign-up without creating anything. Clears the pending cookie so a later page load doesn't ask again.
  • signOut
    Clear the auth cookie and sign out the current user.
  • refreshSession
    Exchange a native app's session token for a fresh one. The token a sign-in returns stops being accepted after 15 minutes; send it here — expired or not, and without an Authorization header — and use the returned token from then on. Renews and rotates by the same rules as the auth cookie: each token renews once, and presenting one the session has already moved past signs that session out everywhere. Refused once the session is signed out, revoked, or unused for 30 days; the app should then sign out.
  • enterWaitingRoom
    The way into a high-demand session's waiting room.
  • createBankDebitMandateSetup
    Mint a SetupIntent on the business's connected account so the buyer can authorize a bank-debit mandate before the membership they're paying for exists.
  • addFavorite
    Add a business, staff member (instructor), or activity to the authenticated user's favorites. Idempotent — adding an existing favorite is a no-op.
  • removeFavorite
    Remove a business, staff member, or activity from the authenticated user's favorites. Idempotent — removing a favorite that isn't set is a no-op.
  • setMyEmailMarketingConsent
    Set the signed-in viewer's own email-marketing consent for a business they participate in. grant records an affirmative opt-in and freezes the compliant disclosure the viewer was shown (only allowed while the business is collecting consent); withdraw unsubscribes. Recorded as an immutable ledger event with source = participant.
  • setMySmsReminderConsent
    Agree to, or stop, a business texting the viewer session reminders — the "Text me reminders" box at checkout, written once the booking lands, the way setMyEmailMarketingConsent is. phone (as typed) sets the number first; it is saved to the account too when the account has none. A grant freezes the disclosure the viewer was shown into the consent ledger. Refused for a grant with no number.