Skip to main content

Overview

  • Version: v1
  • Endpoints: 3
  • Base path: /api/partner/v1/core-chat
  • Source: Migrated from https://www.brek.ai/docs/partner-core-chat on February 19, 2026.

Onboard now action

  1. Contact leo@pageonelab.com.
  2. Brek will issue your partner API key (and sandbox base URL).
  3. Start testing with Postman or your own HTTP client.

Authentication (API key usage)

Send one of these headers on every request (POST /sessions, POST /events, GET /sessions/{sessionId}):
  • x-partner-api-key: <partner_api_key> (recommended)
  • Authorization: Bearer <partner_api_key>
  • api-key: <partner_api_key>
Example:
POST /events uses the same auth header:

Base path

/api/partner/v1/core-chat

Common response headers

  • x-request-id: request trace ID
  • x-ratelimit-limit
  • x-ratelimit-remaining
  • x-partner-id

POST /sessions

Creates a new partner chat session. Input variables (field | definition | required):
  • actor.actorId | Stable end-user ID in your partner system (for profile/history continuity). | Yes
  • actor.timezoneOffsetMinutes | End-user timezone offset in minutes (for date parsing like “tomorrow”). | No
  • channel.workspaceId | Optional partner workspace/group identifier used for routing/analytics. | No
  • conversation.channelId | Optional conversation bucket key from your client app. | No
  • conversation.id | Optional explicit conversation ID for your own traceability. | No
  • conversation.threadTs | Optional explicit thread key for your own thread model. | No
Auth header:
  • x-partner-api-key: <partner_api_key> (or Authorization: Bearer <partner_api_key>, or api-key)
Request body:
Example response (201):

POST /events

Sends one event into an existing session. Input variables (field | definition | required):
  • sessionId | Session ID returned by POST /sessions. | Yes
  • actor.actorId | Optional safety check. If provided, it must match the actor bound to the session. | No
  • text | Natural-language user message. | Yes for natural-language flow
  • kind | Explicit event type (for action-based integrations). | No (but required for explicit action-kind calls)
  • payload | Structured action payload (for example optionId, bookingId, paymentMethodId). | No (but required by certain kind values)
  • idempotencyKey | Client idempotency token to make write retries safe. | No (required for write kinds listed below)
Auth header:
  • x-partner-api-key: <partner_api_key> (or Authorization: Bearer <partner_api_key>, or api-key)
Request body:
Integration rule:
  • Persist sessionId by actorId on your side. Reusing one session across different actors will mix user state.
kind behavior:
  • Optional for normal natural-language messages.
  • Required only when you explicitly call action kinds (for example: action_book_option, action_cancel_booking).
Partner UI mapping:
  • data.result.status = action/state code for your UI logic.
  • data.result.message.text = assistant text to render to end users.
  • data.result.artifacts = structured payload (shortlist, payment setup URL, booking confirmation, etc.).
Idempotency key is required for write kinds:
  • command_book_by_option_id
  • action_book_option
  • action_confirm_price_change
  • action_confirm_payment_card
  • action_cancel_booking
Example response (200):

GET /sessions/{sessionId}

Returns current session snapshot and event history. Input variables (field | definition | required):
  • sessionId (path) | Existing session ID. Must belong to your partner tenant. | Yes
Auth header:
  • x-partner-api-key: <partner_api_key> (or Authorization: Bearer <partner_api_key>, or api-key)
Example response (200):

Golden path example (search -> booking intent -> guest name -> payment setup -> done -> booked)

The sequence below was captured from a real sandbox run on February 18, 2026.

Step 0: Create session

Variables for this step (field | definition | required):
  • actor.actorId | Stable end-user ID in your partner system. | Yes
  • actor.timezoneOffsetMinutes | User timezone offset in minutes. | No
  • channel.workspaceId | Optional partner workspace/group identifier. | No
  • conversation.channelId | Optional conversation key in your client app. | No
Input (POST /sessions):
Output (201):

Step 1: Search request

Variables for this step (field | definition | required):
  • sessionId | Session ID returned in Step 0. | Yes
  • text | Natural-language search request from the user. | Yes
  • idempotencyKey | Retry-safe dedupe key from partner side. | Recommended
Input (POST /events):
Output (status=shortlist):

Step 2: User asks to book option 1

Variables for this step (field | definition | required):
  • sessionId | Session ID returned in Step 0. | Yes
  • text | User booking-intent message. | Yes
Input (POST /events):
Output (status=guest_name_required):

Step 3: User provides guest name

Variables for this step (field | definition | required):
  • sessionId | Session ID returned in Step 0. | Yes
  • text | Guest-name message (for example: “guest name is John Doe”). | Yes
Input (POST /events):
Output (status=payment_setup_required):

Step 3.5: User finishes card setup in payment portal

This happens outside Partner Core Chat endpoints (in Brek payment stack), but shown here for end-to-end clarity. Variables for this step (field | definition | required):
  • portalToken | Payment setup token returned in artifacts.payment.setupUrl. | Yes
  • paymentMethodId | Payment method token from payment provider. | Yes
  • cardBrand | Card brand (for example visa). | Yes
  • cardLast4 | Last 4 digits of card. | Yes
  • expMonth | Card expiration month. | Yes
  • expYear | Card expiration year. | Yes
  • setAsDefault | Whether to set this card as default. | No
Input (POST /v1/hotel-ea/payment-methods/attach on Brek payment backend):
Output:

Step 4: User returns to chat and says “Done”

Variables for this step (field | definition | required):
  • sessionId | Session ID returned in Step 0. | Yes
  • text | Completion message after card setup (for example: “Done”). | Yes
Input (POST /events):
Output (status=payment_confirmation_required):

Step 5: User confirms payment and booking

Variables for this step (field | definition | required):
  • sessionId | Session ID returned in Step 0. | Yes
  • text | Confirmation message (for example: “yes, use this card”). | Yes
Input (POST /events):
Output (status=booked + confirmationUrl):

More scenarios and outputs

Scenario A: user says “Done” but card is not attached yet

Variables for this scenario (field | definition | required):
  • sessionId | Existing session ID. | Yes
  • text | Completion message (for example: “Done”). | Yes
Input (POST /events):
Output (status=payment_setup_required again):

Scenario B: user already has a saved card

Variables for this scenario (field | definition | required):
  • sessionId | Existing session ID. | Yes
  • text | Guest-name message after booking intent. | Yes
Input (POST /events, after guest name):
Output (status=payment_confirmation_required, no setup URL):

Scenario C: user declines payment confirmation

Variables for this scenario (field | definition | required):
  • sessionId | Existing session ID. | Yes
  • text | Decline message (for example: “no”). | Yes
Input (POST /events):
Output:

Error responses

Missing API key (401):
Invalid API key (403):
Missing idempotency key for write action (400):
Unknown session (404):

Retry guidance

  • Retry 429 and 5xx with exponential backoff.
  • Reuse the same idempotencyKey when retrying write actions.
  • Log x-request-id for every failed request.

Security requirements

  • Keep partner API keys server-side only.
  • Use HTTPS/TLS for all requests.
  • Do not send raw PCI card data in chat payloads.