Take an offer back
Takes back your offer on a class while the business has not chosen anyone. It costs nothing, as on the site.
action_refused with no_pending_offer when you have no offer waiting on that class (none, or a trainer was already chosen).
Needs a key made as read and actions on the site; a read-only key gets 403 read_only_key. An AI app's sign-in acts through the MCP server only, never here. Send an Idempotency-Key header: the same key sent again does nothing and answers the first result.
Changes something · needs a read-and-actions key
Request
IDEMPOTENCY_KEY=$(uuidgen) # send the same one again to retry this action
curl -X DELETE "https://api.dev.repp.co.il/v1/open-classes/a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b/offer" \
-H "Authorization: Bearer $REPP_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY"// One key per action: send the same one again to retry it, and it is done once.
const idempotencyKey = crypto.randomUUID();
const response = await fetch("https://api.dev.repp.co.il/v1/open-classes/a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b/offer", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.REPP_API_KEY}`,
"Idempotency-Key": idempotencyKey,
},
});
if (!response.ok) throw new Error((await response.json()).error.message);
const data = await response.json();/** Your offer, taken back before anyone was chosen. */
interface OfferWithdrawn {
offer_id: string;
class_id: string;
status: "withdrawn";
}
interface ApiError {
error: { code: string; message: string; reason?: string };
}
// One key per action: send the same one again to retry it, and it is done once.
const idempotencyKey = crypto.randomUUID();
const response = await fetch("https://api.dev.repp.co.il/v1/open-classes/a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b/offer", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.REPP_API_KEY}`,
"Idempotency-Key": idempotencyKey,
},
});
if (!response.ok) throw new Error(((await response.json()) as ApiError).error.message);
const data = (await response.json()) as OfferWithdrawn;import os
import uuid
import requests
# One key per action: send the same one again to retry it, and it is done once.
idempotency_key = str(uuid.uuid4())
response = requests.delete(
"https://api.dev.repp.co.il/v1/open-classes/a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b/offer",
headers={
"Authorization": f"Bearer {os.environ['REPP_API_KEY']}",
"Idempotency-Key": idempotency_key,
},
timeout=30,
)
if not response.ok:
raise RuntimeError(response.json()["error"]["message"])
data = response.json()<?php
// One key per action: send the same one again to retry it, and it is done once.
$idempotencyKey = bin2hex(random_bytes(16));
$ch = curl_init("https://api.dev.repp.co.il/v1/open-classes/a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b/offer");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("REPP_API_KEY"),
"Idempotency-Key: " . $idempotencyKey,
],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($data["error"]["message"]);
}Response
200 · application/json
{
"offer_id": "f6a7b8c9-d0e1-4f2a-8b3c-4d5e6f7a8b9c",
"class_id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
"status": "withdrawn"
}| Name | Type | Default | Description |
|---|---|---|---|
idRequired | uuid | — | The class's id. |
Response fields (3)
| Field | Type | Description |
|---|---|---|
offer_id | string | Identifier. |
class_id | string | Identifier. |
status | one of: withdrawn | withdrawn: taken back. |
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_body | The request body is not a JSON object (or a field in it is missing or malformed). The message names it. |
| 401 | missing_key | The endpoint needs a key and no Authorization header came. |
| 401 | bad_key | The key is not one of ours, was revoked, or its account was closed or blocked. |
| 403 | read_only_key | The key only reads. Actions need a key made with "read and actions" (or an app signed in with the scope repp.write). |
| 403 | not_a_trainer | The endpoint is for trainers and the key's account has no trainer profile. |
| 404 | not_found | No such endpoint, or no such item for this caller. |
| 409 | idempotency_conflict | The Idempotency-Key was already used by this key for a different action. |
| 409 | action_refused | The site's own rules refused the action; reason says which (for example class_not_available, already_offered, booking_not_available). |
| 429 | too_many_actions | The key ran 200 actions in the last 24 hours. Reads still work. |
| 429 | too_many_requests | Over the rate limit. Wait the seconds in Retry-After (60) and go on. |
| 500 | server_error | Something failed on our side. Try again shortly. |