1. Hosted Sessions
Bardge API (V3)
  • Introduction
  • Authentication
  • Errors
  • Idempotent Requests
  • Pagination
  • Passes
    • Introduction
    • Get All Reseller Passes
      GET
    • Issue a pass
      POST
    • Update user's pass
      POST
    • Update user's pass expiry
      POST
    • Renew a prepaid pass
      POST
    • Get User Pass Details
      GET
  • Providers
    • Introduction
    • Get providers
      GET
    • Get providers for a pass
      GET
  • Access Codes
    • Introduction
    • Generate dynamic access code
      POST
  • Bookings
    • Introduction
    • Get class categories
      GET
    • Get classes
      GET
    • Get class with instances
      GET
    • Initiate a class booking
      POST
    • Confirm a class booking
      POST
    • Initiate a spa booking
      POST
    • Confirm a spa booking
      POST
    • Get client bookings
      GET
    • Get booking status
      GET
    • Cancel a booking
      POST
  • Credits
    • Introduction
    • Purchase credits
    • Get credit packages
  • Lookup
    • Introduction
    • Get issuers
    • Initiate a lookup
    • Verify a lookup
    • Get a user
    • Get a user's credits
  • Webhooks
    • Introduction
    • List Webhook Endpoints
    • Register Webhook Endpoint
    • Delete Webhook Endpoint
  • Hosted Sessions
    • Introduction
    • Create a hosted session
      POST
  • Schemas
    • RegisterWebhookV3Request
    • PasscodeV3Request
    • PurchaseSpaCoPayV3Request
    • RegisterWebhookEndpointRequest
    • WebviewSessionExchangeRequest
    • ErrorDetail
    • ResellerV3PasscodeResponse
    • ResellerV3ErrorResponse
    • ResellerV3WebhookEndpointResponse
    • ResellerV3WebhookResponse
    • LookupInitiateV3Request
    • ResellerV3SpaCoPayPurchaseResponse
    • LookupV3Response
    • SpaCoPayQuoteV3Request
    • PassRef
    • LookupVerifyV3Request
    • ResellerV3SpaCoPayQuoteResponse
    • CategoryDetails
    • IssuePassV3Request
    • RenewPrepaidPassV3Request
    • UpdateLookupEnabledRequest
    • ResellerV3IssuedPassResponse
    • UpdateIssuedPassExpiryV3Request
    • PurchaseCoPayPackageV3Request
    • PurchaseGymCoPayV3Request
    • ResellerV3IssuedPassMessageResponse
    • ResellerV3PassRenewalResponse
    • ResellerV3GymCoPayPurchaseResponse
    • ResellerV3CoPayPurchaseResponse
    • UpdateIssuedPassV3Request
    • RescheduleBookingV3Request
    • PurchaseCreditsV3Request
    • PasscodeInfo
    • WebviewSessionMintRequest
    • RefundInfo
    • BookSpaV3Request
    • ResellerV3CreditPurchaseResponse
    • UpdateClientDetailsV3Request
    • ResellerV3SpaBookingInitiateResponse
    • ResellerV3ProviderResponse
    • ResellerV3ClientResponse
    • BookClassV3Request
    • ResellerV3ServiceResponse
    • SetClientIdV3Request
    • CopayOption
    • ResellerV3SpaResponse
    • ServicePreview
    • ResellerV3ClassBookingInitiateResponse
    • ResellerV3AvailabilityResponse
    • ConfirmClassBookingV3Request
    • ResellerV3AccessCodeSessionResponse
    • ResellerV3BookingResponse
    • ConfirmAccessCodeV3Request
    • CategoryDetail
    • AccessCodeV3Request
    • ResellerV3PassResponse
    • ResellerV3ListResponse
    • ResellerV3CreditsResponse
    • ResellerV3AccessCodeResponse
    • ResellerV3BookingStatusResponse
    • ResellerV3ClassInstanceResponse
    • ResellerV3ClassResponse
  1. Hosted Sessions

Introduction

A hosted session is a Bardge-hosted web experience that you open inside your own app for an already-provisioned member — letting them view their pass, discover providers, and generate a check-in code without you building any of that UI yourself. It is not an SDK: your backend creates the session, and your app opens the returned link in a webview. Create a session for a member only after a pass has been (or should be) issued for them through the Passes API.
Demo video — watch a hosted session end to end, from the member opening the link to checking in at a provider.

What you can do#

Create a hosted session for a client

Key concepts#

Creating a session
POST /hosted_sessions
Authenticates the same way as every other endpoint in this API — see Authentication. Request body:
{"client_id": "your-client-id"}
Response — active pass
{
  "object": "hosted_session",
  "url": "https://bardge-webview.vercel.app/<session-token>",
  "message": "SUCCESS"
}
Open url inside a webview in your app. It's opaque and contains no raw client or reseller identifiers.
This plain shape — no status, no resolution — is what you get for a client whose pass is currently active. If the client's pass isn't usable, the same call still returns a valid url, plus fields that tell you what's wrong and how to fix it.
When the pass isn't usable — resolution steps included
The session is always created, so url is always valid and safe to open. But when the client's pass isn't currently usable, the response carries three extra fields — status, is_error, and resolution — so you can fix the problem from your backend without waiting for the member to open the webview and report a dead end.
statusWhat it meansresolution.action
no_entitlementNo pass has ever been assigned to this client, or their only pass is unusable (e.g. cancelled)issue_pass
pass_expiredThe client has a pass, but it has lapsed past its expiry daterenew_pass
is_error is always false on both — neither is a failure, and the call is still a 200.
no_entitlement — no pass to render
If no pass has ever been assigned to the client, or their only pass sits in some other unusable state, the response surfaces the fix directly:
{
  "object": "hosted_session",
  "url": "https://bardge-webview.vercel.app/xO9IT8bnVasaN2P2NBbLrIz0i05p4O48",
  "message": "SUCCESS",
  "status": "no_entitlement",
  "is_error": false,
  "resolution": {
    "action": "issue_pass",
    "required_fields": ["pass_id", "client_id"],
    "next_step": "After issuing, reopen the session URL for this member."
  },
  "member": {"client_id": "bardge9370"},
  "businessName": "Meridian Health"
}
resolution tells you exactly what to do: issue a pass for this member using the listed fields (see Passes), then reopen the session URL for them. businessName is your business name as the member sees it, for copy like "Reach out to {businessName}".
pass_expired — pass has lapsed
If the client's most recent pass has run past its expiry date, the response says so and points at renewal rather than issuance — the member already has a pass record, so you don't need to (and shouldn't) issue a new one:
{
  "object": "hosted_session",
  "url": "https://bardge-webview.vercel.app/xO9IT8bnVasaN2P2NBbLrIz0i05p4O48",
  "message": "SUCCESS",
  "status": "pass_expired",
  "is_error": false,
  "resolution": {
    "action": "renew_pass",
    "required_fields": ["client_id"],
    "next_step": "Renew this member's pass — POST /issued_passes/{client_id}/renew for a prepaid pass, or POST /issued_passes/{client_id}/expiry for a pay-as-you-go pass — then reopen the session URL for this member."
  },
  "member": {"client_id": "bardge9370"},
  "businessName": "Meridian Health"
}
Which renewal call applies depends on the pass's payment model:
Prepaid pass — POST /issued_passes/{client_id}/renew extends the pass by one billing cycle at its current price.
Pay-as-you-go pass — POST /issued_passes/{client_id}/expiry sets a new expiry date.
Calling the wrong one returns 403 permission_denied telling you to use the other, so it's safe to attempt one and fall through. If you don't know which model your clients are on, reach out to your business relationship manager. Either way, reopen the session URL for the member once the pass is back in force.
If the member opens the session before you renew, they see an "expired pass" state in the webview rather than an error — so this response is a heads-up, not something you must act on before handing over the url.
Accepts an Idempotency-Key header — see Idempotent Requests. Retrying the same request with the same key returns the original session URL instead of minting a new one.
Session validity
A session link is valid for a limited window from creation and may be opened more than once within it. Once opened, the session is managed entirely by Bardge — no further action is required on your end.
Errors
{
  "error": {
    "type": "authentication_error",
    "code": "session_expired",
    "message": "Session link is invalid or has expired",
    "request_id": "req_..."
  }
}
StatuscodeWhen
401authentication_requiredInvalid API key (create-session call)
403permission_deniedReseller account is not enabled (create-session call)
404not_foundThe client_id isn't recognized for this reseller (create-session call)
400invalid_requestA required field is missing or invalid
401session_expiredThe session token is unrecognized or past its validity window (resolve call)
409idempotency_conflictSame Idempotency-Key, different request body (create-session call)

Related sections#

Passes — issue a pass before creating a session for a client who doesn't have one, or renew one that has expired
Authentication — how the create-session call authenticates
Idempotent Requests — safely retry a create-session call
Providers — the hosted session lets members discover providers covered by their pass
Access Codes — the hosted session lets members generate a check-in code for their visit
Modified at 2026-08-21 12:25:28
Previous
Delete Webhook Endpoint
Next
Create a hosted session
Built with