Sessions
Make a session for one Repp frame on your page: the messenger, or one of the single components. Call it from your server with your secret key, and hand only the client_secret to the page.
One session per frame: one for the messenger's whole panel, one for each single component. The SDK asks for each through your fetchClientSecret, with { component, classId }, and again when a session runs out.
The client_secret works once, for 5 minutes. The frame trades it for a token that lives only in its own memory, for 2 hours, and is sent as a bearer token to Repp; no cookie is ever set. A secret used twice revokes its session.
Everything about the business comes from your server, never from the browser: the business, the person and their role, the coming classes (about the next 14 days, up to 100) and the rooms (up to 50). Classes that already began are dropped.
Server to server only: no CORS, never from a page. Try it is not offered here, since the call needs your secret key; try the whole flow on the demo instead.
Request
curl -X POST "https://api.dev.repp.co.il/partner/v1/embed-sessions" \
-H "Authorization: Bearer $REPP_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"partner_business_id": "4012",
"partner_business_name": "סטודיו מרכז",
"partner_user": {
"id": "51751",
"role": "manager",
"display_name": "מיכל"
},
"component": "messenger",
"class": null,
"classes": [
{
"partner_class_id": "30146899",
"date": "2026-12-07",
"time": "18:00",
"duration_minutes": 60,
"style": "pilates",
"service_name": "פילאטיס מכשירים",
"branch_name": "סניף ראשי"
}
],
"rooms": [
{
"partner_room_id": "room-2",
"name": "סטודיו גדול",
"branch_name": "סניף ראשי",
"capacity": 20
}
]
}'const response = await fetch("https://api.dev.repp.co.il/partner/v1/embed-sessions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REPP_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"partner_business_id": "4012",
"partner_business_name": "סטודיו מרכז",
"partner_user": {
"id": "51751",
"role": "manager",
"display_name": "מיכל"
},
"component": "messenger",
"class": null,
"classes": [
{
"partner_class_id": "30146899",
"date": "2026-12-07",
"time": "18:00",
"duration_minutes": 60,
"style": "pilates",
"service_name": "פילאטיס מכשירים",
"branch_name": "סניף ראשי"
}
],
"rooms": [
{
"partner_room_id": "room-2",
"name": "סטודיו גדול",
"branch_name": "סניף ראשי",
"capacity": 20
}
]
}),
});
if (!response.ok) throw new Error((await response.json()).error.code);
const session = await response.json();
// Hand only session.client_secret to your page.interface SessionCreated {
id: string;
/** Hand it to your page as it is: it works once, for 5 minutes. */
client_secret: string;
expires_at: string;
component: "connect" | "substitute" | "class-status" | "messenger";
/** Whether this business already connected its Repp account. */
connected: boolean;
}
interface EmbedError {
error: { code: string; message: string };
}
const response = await fetch("https://api.dev.repp.co.il/partner/v1/embed-sessions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REPP_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"partner_business_id": "4012",
"partner_business_name": "סטודיו מרכז",
"partner_user": {
"id": "51751",
"role": "manager",
"display_name": "מיכל"
},
"component": "messenger",
"class": null,
"classes": [
{
"partner_class_id": "30146899",
"date": "2026-12-07",
"time": "18:00",
"duration_minutes": 60,
"style": "pilates",
"service_name": "פילאטיס מכשירים",
"branch_name": "סניף ראשי"
}
],
"rooms": [
{
"partner_room_id": "room-2",
"name": "סטודיו גדול",
"branch_name": "סניף ראשי",
"capacity": 20
}
]
}),
});
if (!response.ok) throw new Error(((await response.json()) as EmbedError).error.code);
const session = (await response.json()) as SessionCreated;
// Hand only session.client_secret to your page.import os
import requests
response = requests.post(
"https://api.dev.repp.co.il/partner/v1/embed-sessions",
headers={"Authorization": f"Bearer {os.environ['REPP_SECRET_KEY']}"},
json={
"partner_business_id": "4012",
"partner_business_name": "סטודיו מרכז",
"partner_user": {
"id": "51751",
"role": "manager",
"display_name": "מיכל",
},
"component": "messenger",
"class": None,
"classes": [
{
"partner_class_id": "30146899",
"date": "2026-12-07",
"time": "18:00",
"duration_minutes": 60,
"style": "pilates",
"service_name": "פילאטיס מכשירים",
"branch_name": "סניף ראשי",
},
],
"rooms": [
{
"partner_room_id": "room-2",
"name": "סטודיו גדול",
"branch_name": "סניף ראשי",
"capacity": 20,
},
],
},
timeout=30,
)
if not response.ok:
raise RuntimeError(response.json()["error"]["code"])
session = response.json()
# Hand only session["client_secret"] to your page.<?php
$ch = curl_init("https://api.dev.repp.co.il/partner/v1/embed-sessions");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("REPP_SECRET_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"partner_business_id" => "4012",
"partner_business_name" => "סטודיו מרכז",
"partner_user" => [
"id" => "51751",
"role" => "manager",
"display_name" => "מיכל",
],
"component" => "messenger",
"class" => null,
"classes" => [
[
"partner_class_id" => "30146899",
"date" => "2026-12-07",
"time" => "18:00",
"duration_minutes" => 60,
"style" => "pilates",
"service_name" => "פילאטיס מכשירים",
"branch_name" => "סניף ראשי",
],
],
"rooms" => [
[
"partner_room_id" => "room-2",
"name" => "סטודיו גדול",
"branch_name" => "סניף ראשי",
"capacity" => 20,
],
],
]),
]);
$session = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($session["error"]["code"]);
}
// Hand only $session["client_secret"] to your page.Response
{
"id": "7c1e2a90-4b3d-4f5e-8a6b-1c2d3e4f5a6b",
"client_secret": "res_5b1c2d3e4f5a6b7c8d9e0f1a_secret_3f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e",
"expires_at": "2026-12-07T08:10:00+02:00",
"component": "messenger",
"connected": true
}| Name | Type | Default | Description |
|---|---|---|---|
partner_business_idRequired | string | — | Your id of the business: letters, digits and . _ : -, up to 100. |
partner_business_nameRequired | string | — | Its name in your system, 1 to 120 characters. |
partner_userRequired | object | — | The person signed in to your system, who will use the frame. |
partner_user.idRequired | string | — | Your id of the person, up to 100 characters. |
partner_user.roleRequired | one of: owner, manager, staff | — | Only an owner connects and disconnects; an owner or a manager posts requests, opens rooms for rent and turns the business's text messages off or on; staff sees where things stand. |
partner_user.display_nameRequired | string | — | Their first name, 1 to 60 characters: the panel greets them by it. |
componentRequired | one of: connect, substitute, class-status, messenger | — | Which frame the session is for: what fetchClientSecret was asked. |
classRequired | object or null | — | One class, with the fields of classes[]: required for substitute and class-status, null for messenger and connect. |
classes | array, up to 100 | — | messenger only, and required there (may be []): the business's coming classes in your calendar, each partner_class_id once. Leave it out for the other components. |
classes[].partner_class_idRequired | string | — | Your id of the class: letters, digits and . _ : -, up to 100. |
classes[].dateRequired | YYYY-MM-DD | — | Its day, in Israel. |
classes[].timeRequired | HH:MM | — | Its start in Israel, on a quarter hour (18:00, 18:15). |
classes[].duration_minutesRequired | one of: 30, 45, 60, 75, 90, 120 | — | How long it is. |
classes[].styleRequired | string or null | — | The training style it matches, a key of the Catalog (pilates, barre…), or null: the panel then asks once. |
classes[].service_nameRequired | string | — | Your name of the class, 1 to 80 characters ("פילאטיס מכשירים"). |
classes[].branch_nameRequired | string or null | — | Its branch, 1 to 80 characters, or null. |
rooms | array, up to 50 | — | messenger only, may be [] or left out: the business's rooms in your system, each partner_room_id once. The panel offers each for rent as a space on Repp. |
rooms[].partner_room_idRequired | string | — | Your id of the room: letters, digits and . _ : -, up to 100. |
rooms[].nameRequired | string | — | Its name in your system, 1 to 80 characters ("סטודיו גדול"). |
rooms[].branch_nameRequired | string or null | — | Its branch, 1 to 80 characters, or null. |
rooms[].capacityRequired | integer 1–500 or null | — | How many people it holds, when you know. |
Response fields (5)
| Field | Type | Description |
|---|---|---|
id | uuid | The session's id. |
client_secret | string | Hand it to your page, which returns it from fetchClientSecret. Once, for 5 minutes. |
expires_at | string | When the client_secret stops working (ISO 8601). |
component | one of: connect, substitute, class-status, messenger | The component it is for. |
connected | boolean | Whether this business already connected its Repp account. When not, the panel offers to connect. |
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The body is not JSON, or a field is missing, too long or of the wrong shape. |
| 400 | bad_session | The component and its fields do not fit: class is needed for substitute and class-status, classes for messenger (and only there), neither for connect; or two classes share an id. |
| 403 | role_not_allowed | partner_user.role is none of owner, manager, staff. |
| 404 | unknown_partner | No secret key in Authorization, or one Repp does not know (revoked, mistyped, or a publishable key). |
| 405 | not_found | Any method but POST. |
| 409 | not_connected | substitute and class-status need a connected business. messenger and connect do not. |
| 429 | too_many | Over a limit (see Security). Wait a minute: the answer says Retry-After: 60. |
| 500 | failed | Something failed on Repp's side. Try again in a moment. |