My Gym Ops API reference
Members, memberships, payments, leads and reports for gyms.
- Version
- v1 (build fe013bc67ced) · How versions work
- Operations
- 12 operations
Download the OpenAPI document OpenAPI 3.1, JSON. The same file this page is built from.
Before you start
Availability
API access needs a plan that includes API & integrations. Ask support whether it is available for your business before you build on it.
Tokens
In the web app: Settings → API Tokens. Gym admins can create tokens, and so can anyone whose role may manage users. Partner and staff roles can't, unless the gym gives them that permission. Start here
API address
The API address for this product isn't published here yet. Ask support for it. The samples read it from API_BASE; the OpenAPI document uses https://api.example.com as a stand-in.
Testing
There is no public test environment for this product yet. Ask support how to test your integration safely. Testing safely
Import into Postman
Postman imports OpenAPI 3.1 directly: in Postman choose Import, then give it the file you downloaded (or this link). Set the collection's baseUrl variable to your API address and add your token as a Bearer token.
Rate limits
- 120 requests per minute per token, and 200 requests per minute per client address.
- Over a limit → 429
RATE_LIMITEDwithretry-after(seconds) anddata.retry_after_seconds. - Every answer carries
x-ratelimit-limit,x-ratelimit-remaining,x-ratelimit-resetandx-ratelimit-policy. - The server also limits every client address to 100 requests per 1 minute; repeated breaches ban the address for the window (403 with
data.codeRATE_LIMITED).
Scopes
Each operation names the scope its token needs; any one listed is enough. A token never does more than its owner may do now. How scopes work
Scope presets
When you create a token, a preset adds several scopes at once. Changing a preset's scopes later changes every token that holds it.
| Preset | Scope | Includes |
|---|---|---|
| Members — read | preset:members_read | page:members:view |
| Members — add and edit | preset:members_write | page:members:create, page:members:edit |
| Memberships — read | preset:memberships_read | page:memberships:view |
| Payments — read | preset:payments_read | page:payments:view |
| Leads — add (website enquiry forms) | preset:leads_write | page:leads:create |
| Reports — read | preset:reports_read | dashboard:gym_reports:view |
Scopes in use
| Scope | Used by |
|---|---|
dashboard:gym_reports:view | Reports data |
page:active_members:create | Add Member |
page:active_members:edit | Edit Member |
page:expired_members:create | Add Member |
page:expired_members:edit | Edit Member |
page:expiring_members:create | Add Member |
page:expiring_members:edit | Edit Member |
page:leads:create | Add Enquiry |
page:leads:view | List Leads, Get one Leads record |
page:leads_follow_up_today:create | Add Enquiry |
page:members:create | Add Member |
page:members:edit | Edit Member |
page:members:view | List Members, Get one Members record |
page:memberships:view | List Memberships, Get one Memberships record |
page:payments:view | List Payments, Get one Payments record |
Dashboards
Reports data#
GET/dashboard/gym_reports/data
The data of the “Reports” dashboard for the token's business.
Scope: dashboard:gym_reports:view (its owner must hold it too).
Needs the business feature advanced_analytics on; off → 404 FEATURE_DISABLED.
Scope: dashboard:gym_reports:view
Parameters
monthstringMonth (a dashboard filter).
in the query
branchstringBranch (name/code; blank/'all' = all branches) (a dashboard filter).
in the query
Answers
200The dashboard's data.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
metaobjectrequiredwidgetsobjectrequiredWidget key → its data. A widget the owner may not see is left out.
branch_comparisonanyBranch Comparison (table widget).
dues_countanyPending payments (memberships) (stat widget).
dues_totalanyPending payments amount (stat widget).
expense_breakdownanyExpense Breakdown (table widget).
leads_best_sourceanyBest Lead Source (stat widget).
leads_conversionanyEnquiry Conversion % (stat widget).
new_joinsanyNew Joins (stat widget).
renewals_doneanyRenewals Done (stat widget).
renewals_total_dueanyRenewals Due/Overdue (members) (stat widget).
revenue_by_plananyRevenue by Plan (payments received) (table widget).
revenue_trendanyMonthly Revenue Trend (6 Months) (series widget).
revenue_trend_chartanyMonthly Revenue Trend (6 Months) (chart widget).
warningsanyWarnings (alert widget).
May hold more fields than listed.
400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/dashboard/gym_reports/data" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/dashboard/gym_reports/data`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/dashboard/gym_reports/data",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/dashboard/gym_reports/data');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Leads
Add Enquiry#
POST/action/add_lead/run
Runs “Add Enquiry” as the token's owner, in the token's business.
Scope: page:leads:create or page:leads_follow_up_today:create (this action only creates records). The owner must hold it too.
Field limits (length, range, pattern, choices) are the ones the app's forms apply; send values within them.
Needs the business feature lead_enquiry_management on; off → 404 FEATURE_DISABLED.
The action also has its own access rule, checked per request.
Any one of these scopes: page:leads:create, page:leads_follow_up_today:create
Parameters
Idempotency-KeystringSend a new unique key per intended run. A retry with the same key and body answers the first run's result (header
Idempotent-Replayed: true) instead of running again; the same key with another body → 422, while the first run is still going → 409.- pattern: ^[A-Za-z0-9._:-]{1,128}$
header
Request bodyrequired
object
The form is built per request: these are the fields it can take, and which of them are required can differ per business (a missing one is answered 400 with the field named).
branch_idanyBranch ID.
branch_nameanyBranch. A value from
gym_branches(lookup).follow_up_atstringFollow-up Date.
- format: date
interestone of the values belowInterest. Shown as:
hot= Hot;warm= Warm;cold= Cold.One of:
hot,warm,coldinterested_plananyInterested Plan ID.
interested_plan_nameanyInterested Plan. A value from
gym_membership_plans(lookup).namestringName.
notestringNote.
phonestringPhone.
- pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
sourceone of the values belowSource. Shown as:
walk_in= Walk-in;phone= Phone;instagram= Instagram;referral= Referral.One of:
walk_in,phone,instagram,referral
May hold more fields than listed.
Example
{
"follow_up_at": "2026-01-15",
"interest": "hot",
"name": "text",
"note": "text",
"source": "walk_in"
}Answers
200The run finished.
Headers:
Idempotent-Replayed,x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
recordsarray of GymLeadsrequiredThe records the run wrote, as stored.
successconstantrequiredAlways:
truemetaobjectExtra outputs of the run (only when the run produced some).
Example
{ "records": [ { "_id": "64b000000000000000000001", "branch_id": "64b000000000000000000001", "follow_up_at": "2026-01-15T09:30:00.000Z", "followups_stopped_at": "2026-01-15T09:30:00.000Z", "interest": "hot", "interested_plan": "64b000000000000000000001", "isActive": true, "marketing_opt_out": true, "marketing_opt_out_at": "2026-01-15T09:30:00.000Z", "name": "text", "note": "text", "phone": "text", "source": "walk_in", "status": "open", "tenant_id": "64b000000000000000000001" } ], "success": true }400The action refused the input: `errors` names each field and what is wrong. see ValidationFailed
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription allows no changes now (grace period: read-only; ended: locked). see PaymentRequiredWrite
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
409Same Idempotency-Key: the first request is still running, or its result wasn't kept. see Conflict
422This Idempotency-Key was already used with a different body. see Unprocessable
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl -X POST "$API_BASE/action/add_lead/run" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"follow_up_at": "2026-01-15",
"interest": "hot",
"name": "text",
"note": "text",
"source": "walk_in"
}'Node.js
import { randomUUID } from "node:crypto";
const response = await fetch(`${process.env.API_BASE}/action/add_lead/run`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
"Content-Type": "application/json",
"Idempotency-Key": randomUUID(),
},
body: JSON.stringify({
"follow_up_at": "2026-01-15",
"interest": "hot",
"name": "text",
"note": "text",
"source": "walk_in"
}),
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import uuid
import requests
response = requests.post(
f"{os.environ['API_BASE']}/action/add_lead/run",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"follow_up_at": "2026-01-15",
"interest": "hot",
"name": "text",
"note": "text",
"source": "walk_in"
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/action/add_lead/run');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
$headers[] = 'Idempotency-Key: ' . bin2hex(random_bytes(16));
$headers[] = 'Content-Type: application/json';
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'follow_up_at' => '2026-01-15',
'interest' => 'hot',
'name' => 'text',
'note' => 'text',
'source' => 'walk_in'
]),
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);List Leads#
GET/page/leads/records
The records of “Leads” in the screen's own order unless sorted, from the token's business only. A role column limit leaves out the columns its owner can't see (filters and sort on them are ignored).
No free-text search here: filter a text column instead (contains, any case).
Scope: page:leads:view (its owner must hold it too).
Needs the business feature lead_enquiry_management on; off → 404 FEATURE_DISABLED.
The screen also has its own access rule, checked per request.
Scope: page:leads:view
Parameters
pageintegerPage number, from 1.
- minimum 1
- default: 1
in the query
per_pageintegerRecords per page (at most 100).
- minimum 1
- maximum 100
- default: 20
in the query
sortstringOne field to sort by; prefix
-for descending. Default: the page's own order (else newest first). Ties are broken by id, so pages never overlap.Columns:
name,phone,source,interest,status,follow_up_at,branch_display,interested_plan_display,note.- pattern: ^-?[a-zA-Z_][a-zA-Z0-9_]*$
in the query
fieldsarray of stringRead only these fields: the others come back as null (the id always comes).
in the query
namestringName: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
phonestringPhone: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
sourcestringSource: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them. Values:walk_in,phone,instagram,referral.in the query
intereststringInterest: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them. Values:hot,warm,cold.in the query
statusstringStatus: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
follow_up_atstringFollow-up On: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the
x-time-zoneheader, else UTC.- format: date
in the query
follow_up_at__fromstringFollow-up On: on or after this day.
- format: date
in the query
follow_up_at__tostringFollow-up On: on or before this day.
- format: date
in the query
branch_displaystringBranch: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
interested_plan_displaystringInterested Plan: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
notestringNote: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
follow_upstringFollow-up (a filter the server works out).
One of:
due,today,overduein the query
branchstringBranch (a filter the server works out).
in the query
Answers
200A page of records.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
pageintegerrequired- minimum 1
per_pageintegerrequired- minimum 1
recordsarray of GymLeadsrequiredtotalintegerrequiredRecords matching, on every page.
- minimum 0
applied_filtersarray of objectThe named filters this answer applied.
[ ]objectlabelstringparamstringvaluestring
Example
{ "applied_filters": [ { "label": "text", "param": "text", "value": "text" } ], "page": 1, "per_page": 1, "records": [ { "_id": "64b000000000000000000001", "branch_id": "64b000000000000000000001", "follow_up_at": "2026-01-15T09:30:00.000Z", "followups_stopped_at": "2026-01-15T09:30:00.000Z", "interest": "hot", "interested_plan": "64b000000000000000000001", "isActive": true, "marketing_opt_out": true, "marketing_opt_out_at": "2026-01-15T09:30:00.000Z", "name": "text", "note": "text", "phone": "text", "source": "walk_in", "status": "open", "tenant_id": "64b000000000000000000001" } ], "total": 1 }400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/page/leads/records?page=1&per_page=20" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/page/leads/records?page=1&per_page=20`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/page/leads/records?page=1&per_page=20",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/page/leads/records?page=1&per_page=20');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Get one Leads record#
GET/page/leads/records/{id}
One record of the token's business, by id; the stored record as kept (it may carry more fields than the list).
Scope: page:leads:view (its owner must hold it too).
Needs the business feature lead_enquiry_management on; off → 404 FEATURE_DISABLED.
The screen also has its own access rule, checked per request.
Scope: page:leads:view
Parameters
idstringrequiredThe record id.
- pattern: ^[0-9a-fA-F]{24}$
in the path
Answers
200The record.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
recordGymLeadsrequired
Example
{ "record": { "_id": "64b000000000000000000001", "branch_id": "64b000000000000000000001", "follow_up_at": "2026-01-15T09:30:00.000Z", "followups_stopped_at": "2026-01-15T09:30:00.000Z", "interest": "hot", "interested_plan": "64b000000000000000000001", "isActive": true, "marketing_opt_out": true, "marketing_opt_out_at": "2026-01-15T09:30:00.000Z", "name": "text", "note": "text", "phone": "text", "source": "walk_in", "status": "open", "tenant_id": "64b000000000000000000001" } }400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/page/leads/records/64b000000000000000000001" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/page/leads/records/64b000000000000000000001`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/page/leads/records/64b000000000000000000001",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/page/leads/records/64b000000000000000000001');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Members
Add Member#
POST/action/add_member/run
Runs “Add Member” as the token's owner, in the token's business.
Scope: page:members:create or page:active_members:create or page:expiring_members:create or page:expired_members:create (this action only creates records). The owner must hold it too.
Field limits (length, range, pattern, choices) are the ones the app's forms apply; send values within them.
The action also has its own access rule, checked per request.
Any one of these scopes: page:active_members:create, page:expired_members:create, page:expiring_members:create, page:members:create
Parameters
Idempotency-KeystringSend a new unique key per intended run. A retry with the same key and body answers the first run's result (header
Idempotent-Replayed: true) instead of running again; the same key with another body → 422, while the first run is still going → 409.- pattern: ^[A-Za-z0-9._:-]{1,128}$
header
Request bodyrequired
object
The form is built per request: these are the fields it can take, and which of them are required can differ per business (a missing one is answered 400 with the field named).
assigned_traineranyTrainer ID.
assigned_trainer_nameanyAssigned Trainer. A value from
gym_staff(lookup).blood_groupone of the values belowBlood Group. Shown as: `
= —;A+= A+;A-= A-;B+= B+;B-= B-;AB+= AB+;AB-= AB-;O+= O+;O-` = O-.One of:
,A+,A-,B+,B-,AB+,AB-,O+,O-discount_amountnumberDiscount. Between 0 and the plan price Used only when
start_membershipistrue.- minimum 0
emergency_contactstringEmergency Contact.
- pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
full_namestringFull Name.
- at least 2 characters
- at most 60 characters
- pattern: ^\s*\p{L}[\p{L}\p{M} .'-]*\s*$
genderone of the values belowGender. Shown as:
male= Male;female= Female;other= Other.One of:
male,female,othergoalstringGoal.
home_branchanyHome Branch ID.
home_branch_nameanyHome Branch. A value from
gym_branches(lookup).join_datestringJoin Date.
- format: date
marketing_consentbooleanOK to send offers on WhatsApp. The member agreed to get offers and news from the gym. They can reply STOP any time.
membership_start_datestringMembership Start Date. Used only when
start_membershipistrue.- format: date
payment_amountnumberAmount Paid Now. Leave blank to collect later. Up to the plan price after discount. Used only when
start_membershipistrue.- minimum 0
payment_modeone of the values belowPayment Mode. Shown as:
upi= UPI;cash= Cash;bank_transfer= Bank Transfer. Used only whenstart_membershipistrue.One of:
upi,cash,bank_transferphonestringWhatsApp Phone.
- pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
photoanyPhoto.
plan_idanyPlan ID.
plan_nameanyPlan. A value from
gym_membership_plans(lookup). Used only whenstart_membershipistrue.plan_priceanyPlan Price.
start_membershipbooleanStart a membership now. Pick a plan to make the member Active straight away
May hold more fields than listed.
Example
{
"blood_group": "",
"discount_amount": 0,
"gender": "male",
"goal": "text",
"join_date": "2026-01-15",
"marketing_consent": true,
"membership_start_date": "2026-01-15",
"payment_amount": 0,
"payment_mode": "upi",
"start_membership": true
}Answers
200The run finished.
Headers:
Idempotent-Replayed,x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
recordsarray of GymMembersrequiredThe records the run wrote, as stored.
successconstantrequiredAlways:
truemetaobjectExtra outputs of the run (only when the run produced some).
Example
{ "records": [ { "_id": "64b000000000000000000001", "assigned_trainer": "64b000000000000000000001", "blood_group": "text", "current_end_date": "2026-01-15T09:30:00.000Z", "current_expiring_from": "2026-01-15T09:30:00.000Z", "current_membership_id": "64b000000000000000000001", "emergency_contact": "text", "full_name": "text", "gender": "male", "goal": "text", "has_due": true, "home_branch": "64b000000000000000000001", "isActive": true, "join_date": "2026-01-15T09:30:00.000Z", "marketing_consent": true, "marketing_opt_out": true, "marketing_opt_out_at": "2026-01-15T09:30:00.000Z", "phone": "text", "photo": "text", "tenant_id": "64b000000000000000000001" } ], "success": true }400The action refused the input: `errors` names each field and what is wrong. see ValidationFailed
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription allows no changes now (grace period: read-only; ended: locked). see PaymentRequiredWrite
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
409Same Idempotency-Key: the first request is still running, or its result wasn't kept. see Conflict
422This Idempotency-Key was already used with a different body. see Unprocessable
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl -X POST "$API_BASE/action/add_member/run" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"blood_group": "",
"discount_amount": 0,
"gender": "male",
"goal": "text",
"join_date": "2026-01-15",
"marketing_consent": true,
"membership_start_date": "2026-01-15",
"payment_amount": 0,
"payment_mode": "upi",
"start_membership": true
}'Node.js
import { randomUUID } from "node:crypto";
const response = await fetch(`${process.env.API_BASE}/action/add_member/run`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
"Content-Type": "application/json",
"Idempotency-Key": randomUUID(),
},
body: JSON.stringify({
"blood_group": "",
"discount_amount": 0,
"gender": "male",
"goal": "text",
"join_date": "2026-01-15",
"marketing_consent": true,
"membership_start_date": "2026-01-15",
"payment_amount": 0,
"payment_mode": "upi",
"start_membership": true
}),
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import uuid
import requests
response = requests.post(
f"{os.environ['API_BASE']}/action/add_member/run",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"blood_group": "",
"discount_amount": 0,
"gender": "male",
"goal": "text",
"join_date": "2026-01-15",
"marketing_consent": True,
"membership_start_date": "2026-01-15",
"payment_amount": 0,
"payment_mode": "upi",
"start_membership": True
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/action/add_member/run');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
$headers[] = 'Idempotency-Key: ' . bin2hex(random_bytes(16));
$headers[] = 'Content-Type: application/json';
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'blood_group' => '',
'discount_amount' => 0,
'gender' => 'male',
'goal' => 'text',
'join_date' => '2026-01-15',
'marketing_consent' => true,
'membership_start_date' => '2026-01-15',
'payment_amount' => 0,
'payment_mode' => 'upi',
'start_membership' => true
]),
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Edit Member#
POST/action/edit_member/run
Runs “Edit Member” as the token's owner, in the token's business.
Scope: page:members:edit or page:active_members:edit or page:expiring_members:edit or page:expired_members:edit, with or without id. The owner must hold it too.
Field limits (length, range, pattern, choices) are the ones the app's forms apply; send values within them.
The action also has its own access rule, checked per request.
Any one of these scopes: page:active_members:edit, page:expired_members:edit, page:expiring_members:edit, page:members:edit
Parameters
Idempotency-KeystringSend a new unique key per intended run. A retry with the same key and body answers the first run's result (header
Idempotent-Replayed: true) instead of running again; the same key with another body → 422, while the first run is still going → 409.- pattern: ^[A-Za-z0-9._:-]{1,128}$
header
Request bodyrequired
object
The form is built per request: these are the fields it can take, and which of them are required can differ per business (a missing one is answered 400 with the field named).
assigned_traineranyTrainer ID.
assigned_trainer_nameanyAssigned Trainer. A value from
gym_staff(lookup).blood_groupone of the values belowBlood Group. Shown as: `
= —;A+= A+;A-= A-;B+= B+;B-= B-;AB+= AB+;AB-= AB-;O+= O+;O-` = O-.One of:
,A+,A-,B+,B-,AB+,AB-,O+,O-emergency_contactstringEmergency Contact.
- pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
full_namestringFull Name.
- at least 2 characters
- at most 60 characters
- pattern: ^\s*\p{L}[\p{L}\p{M} .'-]*\s*$
genderone of the values belowGender. Shown as:
male= Male;female= Female;other= Other.One of:
male,female,othergoalstringGoal.
home_branchanyHome Branch ID.
home_branch_nameanyHome Branch. A value from
gym_branches(lookup).idstringThe record to act on. Without it the run creates a new record.
- pattern: ^[0-9a-fA-F]{24}$
idsarray of stringThe records of a bulk run.
[ ]stringA record id.
- pattern: ^[0-9a-fA-F]{24}$
join_datestringJoin Date.
- format: date
marketing_consentbooleanOK to send offers on WhatsApp. The member agreed to get offers and news from the gym. They can reply STOP any time.
phonestringWhatsApp Phone.
- pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
photoanyPhoto.
May hold more fields than listed.
Example
{
"blood_group": "",
"gender": "male",
"goal": "text",
"join_date": "2026-01-15",
"marketing_consent": true
}Answers
200The run finished.
Headers:
Idempotent-Replayed,x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
recordsarray of GymMembersrequiredThe records the run wrote, as stored.
successconstantrequiredAlways:
truemetaobjectExtra outputs of the run (only when the run produced some).
Example
{ "records": [ { "_id": "64b000000000000000000001", "assigned_trainer": "64b000000000000000000001", "blood_group": "text", "current_end_date": "2026-01-15T09:30:00.000Z", "current_expiring_from": "2026-01-15T09:30:00.000Z", "current_membership_id": "64b000000000000000000001", "emergency_contact": "text", "full_name": "text", "gender": "male", "goal": "text", "has_due": true, "home_branch": "64b000000000000000000001", "isActive": true, "join_date": "2026-01-15T09:30:00.000Z", "marketing_consent": true, "marketing_opt_out": true, "marketing_opt_out_at": "2026-01-15T09:30:00.000Z", "phone": "text", "photo": "text", "tenant_id": "64b000000000000000000001" } ], "success": true }400The action refused the input: `errors` names each field and what is wrong. see ValidationFailed
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription allows no changes now (grace period: read-only; ended: locked). see PaymentRequiredWrite
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
409Same Idempotency-Key: the first request is still running, or its result wasn't kept. see Conflict
422This Idempotency-Key was already used with a different body. see Unprocessable
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl -X POST "$API_BASE/action/edit_member/run" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"blood_group": "",
"gender": "male",
"goal": "text",
"join_date": "2026-01-15",
"marketing_consent": true
}'Node.js
import { randomUUID } from "node:crypto";
const response = await fetch(`${process.env.API_BASE}/action/edit_member/run`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
"Content-Type": "application/json",
"Idempotency-Key": randomUUID(),
},
body: JSON.stringify({
"blood_group": "",
"gender": "male",
"goal": "text",
"join_date": "2026-01-15",
"marketing_consent": true
}),
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import uuid
import requests
response = requests.post(
f"{os.environ['API_BASE']}/action/edit_member/run",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"blood_group": "",
"gender": "male",
"goal": "text",
"join_date": "2026-01-15",
"marketing_consent": True
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/action/edit_member/run');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
$headers[] = 'Idempotency-Key: ' . bin2hex(random_bytes(16));
$headers[] = 'Content-Type: application/json';
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'blood_group' => '',
'gender' => 'male',
'goal' => 'text',
'join_date' => '2026-01-15',
'marketing_consent' => true
]),
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);List Members#
GET/page/members/records
The records of “Members” in the screen's own order unless sorted, from the token's business only. A role column limit leaves out the columns its owner can't see (filters and sort on them are ignored).
No free-text search here: filter a text column instead (contains, any case).
Scope: page:members:view (its owner must hold it too).
The screen also has its own access rule, checked per request.
Scope: page:members:view
Parameters
pageintegerPage number, from 1.
- minimum 1
- default: 1
in the query
per_pageintegerRecords per page (at most 100).
- minimum 1
- maximum 100
- default: 20
in the query
sortstringOne field to sort by; prefix
-for descending. Default: the page's own order (else newest first). Ties are broken by id, so pages never overlap.Columns:
full_name,phone,home_branch_display,trainer_display,status,current_valid_till,has_due,join_date,gender,blood_group,emergency_contact,goal,photo,current_end_date.- pattern: ^-?[a-zA-Z_][a-zA-Z0-9_]*$
in the query
fieldsarray of stringRead only these fields: the others come back as null (the id always comes).
in the query
full_namestringFull Name: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
phonestringPhone: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
home_branch_displaystringHome Branch: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
trainer_displaystringAssigned Trainer: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
statusstringStatus: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them. Values:no_membership.in the query
current_valid_tillstringValid till: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the
x-time-zoneheader, else UTC.- format: date
in the query
current_valid_till__fromstringValid till: on or after this day.
- format: date
in the query
current_valid_till__tostringValid till: on or before this day.
- format: date
in the query
has_duestringHas Due: true or false.
One of:
true,falsein the query
join_datestringJoin Date: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the
x-time-zoneheader, else UTC.- format: date
in the query
join_date__fromstringJoin Date: on or after this day.
- format: date
in the query
join_date__tostringJoin Date: on or before this day.
- format: date
in the query
genderstringGender: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them. Values:male,female,other.in the query
blood_groupstringBlood Group: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
emergency_contactstringEmergency Contact: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
goalstringGoal: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
photostringPhoto: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
current_end_datestringMembership Ends: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the
x-time-zoneheader, else UTC.- format: date
in the query
current_end_date__fromstringMembership Ends: on or after this day.
- format: date
in the query
current_end_date__tostringMembership Ends: on or before this day.
- format: date
in the query
filterstringFilter (a filter the server works out).
One of:
active,current,expiring_7d,renewals_week,expiring,expired,no_membershipin the query
branchstringBranch (a filter the server works out).
in the query
Answers
200A page of records.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
pageintegerrequired- minimum 1
per_pageintegerrequired- minimum 1
recordsarray of GymMembersrequiredtotalintegerrequiredRecords matching, on every page.
- minimum 0
applied_filtersarray of objectThe named filters this answer applied.
[ ]objectlabelstringparamstringvaluestring
Example
{ "applied_filters": [ { "label": "text", "param": "text", "value": "text" } ], "page": 1, "per_page": 1, "records": [ { "_id": "64b000000000000000000001", "assigned_trainer": "64b000000000000000000001", "blood_group": "text", "current_end_date": "2026-01-15T09:30:00.000Z", "current_expiring_from": "2026-01-15T09:30:00.000Z", "current_membership_id": "64b000000000000000000001", "emergency_contact": "text", "full_name": "text", "gender": "male", "goal": "text", "has_due": true, "home_branch": "64b000000000000000000001", "isActive": true, "join_date": "2026-01-15T09:30:00.000Z", "marketing_consent": true, "marketing_opt_out": true, "marketing_opt_out_at": "2026-01-15T09:30:00.000Z", "phone": "text", "photo": "text", "tenant_id": "64b000000000000000000001" } ], "total": 1 }400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/page/members/records?page=1&per_page=20" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/page/members/records?page=1&per_page=20`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/page/members/records?page=1&per_page=20",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/page/members/records?page=1&per_page=20');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Get one Members record#
GET/page/members/records/{id}
One record of the token's business, by id; the stored record as kept (it may carry more fields than the list).
Scope: page:members:view (its owner must hold it too).
The screen also has its own access rule, checked per request.
Scope: page:members:view
Parameters
idstringrequiredThe record id.
- pattern: ^[0-9a-fA-F]{24}$
in the path
Answers
200The record.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
recordGymMembersrequired
Example
{ "record": { "_id": "64b000000000000000000001", "assigned_trainer": "64b000000000000000000001", "blood_group": "text", "current_end_date": "2026-01-15T09:30:00.000Z", "current_expiring_from": "2026-01-15T09:30:00.000Z", "current_membership_id": "64b000000000000000000001", "emergency_contact": "text", "full_name": "text", "gender": "male", "goal": "text", "has_due": true, "home_branch": "64b000000000000000000001", "isActive": true, "join_date": "2026-01-15T09:30:00.000Z", "marketing_consent": true, "marketing_opt_out": true, "marketing_opt_out_at": "2026-01-15T09:30:00.000Z", "phone": "text", "photo": "text", "tenant_id": "64b000000000000000000001" } }400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/page/members/records/64b000000000000000000001" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/page/members/records/64b000000000000000000001`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/page/members/records/64b000000000000000000001",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/page/members/records/64b000000000000000000001');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Memberships
List Memberships#
GET/page/memberships/records
The records of “Memberships” in the screen's own order unless sorted, from the token's business only. A role column limit leaves out the columns its owner can't see (filters and sort on them are ignored).
No free-text search here: filter a text column instead (contains, any case).
Scope: page:memberships:view (its owner must hold it too).
The screen also has its own access rule, checked per request.
Scope: page:memberships:view
Parameters
pageintegerPage number, from 1.
- minimum 1
- default: 1
in the query
per_pageintegerRecords per page (at most 100).
- minimum 1
- maximum 100
- default: 20
in the query
sortstringOne field to sort by; prefix
-for descending. Default: the page's own order (else newest first). Ties are broken by id, so pages never overlap.Columns:
member_name,plan_name,branch_display,start_date,valid_till,status,total_amount,amount_paid,balance_amount,payment_status,discount_amount,trainer_display,branch_access,sessions_total,sessions_used,end_date.- pattern: ^-?[a-zA-Z_][a-zA-Z0-9_]*$
in the query
fieldsarray of stringRead only these fields: the others come back as null (the id always comes).
in the query
member_namestringMember: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
plan_namestringPlan: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
branch_displaystringBranch: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
start_datestringStart Date: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the
x-time-zoneheader, else UTC.- format: date
in the query
start_date__fromstringStart Date: on or after this day.
- format: date
in the query
start_date__tostringStart Date: on or before this day.
- format: date
in the query
valid_tillstringValid till: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the
x-time-zoneheader, else UTC.- format: date
in the query
valid_till__fromstringValid till: on or after this day.
- format: date
in the query
valid_till__tostringValid till: on or before this day.
- format: date
in the query
statusstringStatus: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
total_amountstringTotal: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
amount_paidstringPaid: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
balance_amountstringBalance: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
payment_statusstringPayment Status: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
discount_amountstringDiscount: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
trainer_displaystringTrainer: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
branch_accessstringBranch Access: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them. Values:home_only,all_branches,custom.in the query
sessions_totalnumberSessions Total: equal to this number. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
sessions_usednumberSessions Used: equal to this number. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
end_datestringEnd Date: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the
x-time-zoneheader, else UTC.- format: date
in the query
end_date__fromstringEnd Date: on or after this day.
- format: date
in the query
end_date__tostringEnd Date: on or before this day.
- format: date
in the query
Answers
200A page of records.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
pageintegerrequired- minimum 1
per_pageintegerrequired- minimum 1
recordsarray of GymMembershipsrequiredtotalintegerrequiredRecords matching, on every page.
- minimum 0
Example
{ "page": 1, "per_page": 1, "records": [ { "_id": "64b000000000000000000001", "addon_price_paid": 1, "amount_paid": 1, "balance_amount": 1, "branch_access": "home_only", "branch_access_list": [ "64b000000000000000000001" ], "branch_id": "64b000000000000000000001", "discount_amount": 1, "end_date": "2026-01-15T09:30:00.000Z", "expiry_reminder_refused_at": "2026-01-15T09:30:00.000Z", "invoice_due_at": "2026-01-15T09:30:00.000Z", "invoice_id": "64b000000000000000000001", "invoice_number": "text", "invoice_sync_due_at": "2026-01-15T09:30:00.000Z", "isActive": true, "last_dues_reminder_at": "2026-01-15T09:30:00.000Z", "last_expiry_reminder_at": "2026-01-15T09:30:00.000Z", "member_id": "64b000000000000000000001", "member_phone": "text", "payment_status": "pending", "plan_id": "64b000000000000000000001", "plan_kind": "membership", "plan_name": "text", "price_paid": 1, "reminder_days_before_expiry": 1, "replaces_membership_id": "64b000000000000000000001", "schedule_text": "text", "sessions_total": 1, "sessions_used": 1, "source": "new", "start_date": "2026-01-15T09:30:00.000Z", "tenant_id": "64b000000000000000000001", "total_amount": 1, "trainer_id": "64b000000000000000000001" } ], "total": 1 }400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/page/memberships/records?page=1&per_page=20" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/page/memberships/records?page=1&per_page=20`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/page/memberships/records?page=1&per_page=20",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/page/memberships/records?page=1&per_page=20');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Get one Memberships record#
GET/page/memberships/records/{id}
One record of the token's business, by id; the stored record as kept (it may carry more fields than the list).
Scope: page:memberships:view (its owner must hold it too).
The screen also has its own access rule, checked per request.
Scope: page:memberships:view
Parameters
idstringrequiredThe record id.
- pattern: ^[0-9a-fA-F]{24}$
in the path
Answers
200The record.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
recordGymMembershipsrequired
Example
{ "record": { "_id": "64b000000000000000000001", "addon_price_paid": 1, "amount_paid": 1, "balance_amount": 1, "branch_access": "home_only", "branch_access_list": [ "64b000000000000000000001" ], "branch_id": "64b000000000000000000001", "discount_amount": 1, "end_date": "2026-01-15T09:30:00.000Z", "expiry_reminder_refused_at": "2026-01-15T09:30:00.000Z", "invoice_due_at": "2026-01-15T09:30:00.000Z", "invoice_id": "64b000000000000000000001", "invoice_number": "text", "invoice_sync_due_at": "2026-01-15T09:30:00.000Z", "isActive": true, "last_dues_reminder_at": "2026-01-15T09:30:00.000Z", "last_expiry_reminder_at": "2026-01-15T09:30:00.000Z", "member_id": "64b000000000000000000001", "member_phone": "text", "payment_status": "pending", "plan_id": "64b000000000000000000001", "plan_kind": "membership", "plan_name": "text", "price_paid": 1, "reminder_days_before_expiry": 1, "replaces_membership_id": "64b000000000000000000001", "schedule_text": "text", "sessions_total": 1, "sessions_used": 1, "source": "new", "start_date": "2026-01-15T09:30:00.000Z", "tenant_id": "64b000000000000000000001", "total_amount": 1, "trainer_id": "64b000000000000000000001" } }400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/page/memberships/records/64b000000000000000000001" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/page/memberships/records/64b000000000000000000001`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/page/memberships/records/64b000000000000000000001",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/page/memberships/records/64b000000000000000000001');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Payments
List Payments#
GET/page/payments/records
The records of “Payments” in the screen's own order unless sorted, from the token's business only. A role column limit leaves out the columns its owner can't see (filters and sort on them are ignored).
No free-text search here: filter a text column instead (contains, any case).
Scope: page:payments:view (its owner must hold it too).
The screen also has its own access rule, checked per request.
Scope: page:payments:view
Parameters
pageintegerPage number, from 1.
- minimum 1
- default: 1
in the query
per_pageintegerRecords per page (at most 100).
- minimum 1
- maximum 100
- default: 20
in the query
sortstringOne field to sort by; prefix
-for descending. Default: the page's own order (else newest first). Ties are broken by id, so pages never overlap.Columns:
tenant_id,member_id,member_name,membership_id,plan_name,membership_snapshot,amount,mode,date,recorded_by,receipt_no,branch_id,pay_request_id,branch_display,trainer_share_amount,voided_at,voided_by,voided_by_name,void_reason,isActive.- pattern: ^-?[a-zA-Z_][a-zA-Z0-9_]*$
in the query
fieldsarray of stringRead only these fields: the others come back as null (the id always comes).
in the query
tenant_idstringTenant Id: this record id exactly. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
member_idstringMember Id: this record id exactly. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
member_namestringMember: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
membership_idstringMembership Id: this record id exactly. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
plan_namestringPlan: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
membership_snapshotstringMembership Snapshot: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
amountstringAmount: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
modestringMode: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them. Values:upi,cash,bank_transfer,online.in the query
datestringDate: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the
x-time-zoneheader, else UTC.- format: date
in the query
date__fromstringDate: on or after this day.
- format: date
in the query
date__tostringDate: on or before this day.
- format: date
in the query
recorded_bystringRecorded By: this record id exactly. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
receipt_nostringReceipt No: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
branch_idstringBranch Id: this record id exactly. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
pay_request_idstringPay Request Id: this record id exactly. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
branch_displaystringBranch: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
trainer_share_amountstringTrainer Share: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
voided_atstringVoided On: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
voided_bystringVoided By: this record id exactly. Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
voided_by_namestringVoided By: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
void_reasonstringReason: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
isActivestringIs Active: contains this text (any case). Several values (a JSON list such as
["a","b"], or the parameter repeated) match a record equal to any of them.in the query
periodstringPeriod (a filter the server works out).
One of:
today,this_monthin the query
branchstringBranch (a filter the server works out).
in the query
Answers
200A page of records.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
pageintegerrequired- minimum 1
per_pageintegerrequired- minimum 1
recordsarray of GymPaymentsrequiredtotalintegerrequiredRecords matching, on every page.
- minimum 0
applied_filtersarray of objectThe named filters this answer applied.
[ ]objectlabelstringparamstringvaluestring
Example
{ "applied_filters": [ { "label": "text", "param": "text", "value": "text" } ], "page": 1, "per_page": 1, "records": [ { "_id": "64b000000000000000000001", "amount": 1, "branch_id": "64b000000000000000000001", "date": "2026-01-15T09:30:00.000Z", "isActive": true, "member_id": "64b000000000000000000001", "membership_id": "64b000000000000000000001", "mode": "upi", "pay_request_id": "64b000000000000000000001", "plan_name": "text", "receipt_no": "text", "recorded_by": "64b000000000000000000001", "tenant_id": "64b000000000000000000001", "trainer_share_amount": 1, "void_reason": "text", "voided_at": "2026-01-15T09:30:00.000Z", "voided_by": "64b000000000000000000001", "voided_by_name": "text" } ], "total": 1 }400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/page/payments/records?page=1&per_page=20" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/page/payments/records?page=1&per_page=20`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/page/payments/records?page=1&per_page=20",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/page/payments/records?page=1&per_page=20');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Get one Payments record#
GET/page/payments/records/{id}
One record of the token's business, by id; the stored record as kept (it may carry more fields than the list).
Scope: page:payments:view (its owner must hold it too).
The screen also has its own access rule, checked per request.
Scope: page:payments:view
Parameters
idstringrequiredThe record id.
- pattern: ^[0-9a-fA-F]{24}$
in the path
Answers
200The record.
Headers:
x-ratelimit-limit,x-ratelimit-policy,x-ratelimit-remaining,x-ratelimit-resetobject
recordGymPaymentsrequired
Example
{ "record": { "_id": "64b000000000000000000001", "amount": 1, "branch_id": "64b000000000000000000001", "date": "2026-01-15T09:30:00.000Z", "isActive": true, "member_id": "64b000000000000000000001", "membership_id": "64b000000000000000000001", "mode": "upi", "pay_request_id": "64b000000000000000000001", "plan_name": "text", "receipt_no": "text", "recorded_by": "64b000000000000000000001", "tenant_id": "64b000000000000000000001", "trainer_share_amount": 1, "void_reason": "text", "voided_at": "2026-01-15T09:30:00.000Z", "voided_by": "64b000000000000000000001", "voided_by_name": "text" } }400The request is malformed (query, header or body). see BadRequest
401The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens. see Unauthorized
402The business's subscription has ended (locked). see PaymentRequiredRead
403Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now. see Forbidden
404Not found, or the feature behind it is off for this business. see NotFound
429Over a rate limit. Wait `retry-after` seconds (also in `data.retry_after_seconds`) and try again. see TooManyRequests
500Something failed on the server. The message is always generic; retry later. see ServerError
Code samples
curl
curl "$API_BASE/page/payments/records/64b000000000000000000001" \
-H "Authorization: Bearer $API_TOKEN"Node.js
const response = await fetch(`${process.env.API_BASE}/page/payments/records/64b000000000000000000001`, {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
});
const answer = await response.json();
if (!response.ok) throw new Error(`${response.status} ${answer.data?.code ?? ""} ${answer.message}`);Python
import os
import requests
response = requests.get(
f"{os.environ['API_BASE']}/page/payments/records/64b000000000000000000001",
headers={
"Authorization": f"Bearer {os.environ['API_TOKEN']}",
},
timeout=30,
)
answer = response.json()
response.raise_for_status()PHP
<?php
$ch = curl_init(getenv('API_BASE') . '/page/payments/records/64b000000000000000000001');
$headers = ['Authorization: Bearer ' . getenv('API_TOKEN')];
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);Error answers
Every error has the same shape (the Error schema). Branch on data.code, show message. How to handle errors
BadRequest
The request is malformed (query, header or body).
Example: A record id that isn't a valid id
{
"className": "bad-request",
"code": 400,
"data": {},
"errors": {
"id": "Invalid record id."
},
"message": "Invalid record id.",
"name": "BadRequest"
}Example: A query value outside the documented schema
{
"className": "bad-request",
"code": 400,
"errors": {},
"message": "Invalid request.",
"name": "BadRequest"
}Conflict
Same Idempotency-Key: the first request is still running, or its result wasn't kept.
Example: Still running
{
"className": "conflict",
"code": 409,
"data": {
"code": "IDEMPOTENCY_IN_PROGRESS"
},
"errors": {},
"message": "A request with this Idempotency-Key is still being processed. Try again shortly.",
"name": "Conflict"
}Example: Done, result not kept
{
"className": "conflict",
"code": 409,
"data": {
"code": "IDEMPOTENCY_RESULT_UNAVAILABLE"
},
"errors": {},
"message": "This request was already completed, but its result can't be shown again. Refresh to see it.",
"name": "Conflict"
}Forbidden
Not allowed: the token's scopes don't cover this operation, or its owner doesn't hold the permission now.
Example: The token's owner doesn't hold the permission
{
"className": "forbidden",
"code": 403,
"data": {
"code": "ACCESS_DENIED"
},
"errors": {},
"message": "You don't have permission to do this.",
"name": "Forbidden"
}Example: Too many refused requests from this address: banned for the window
{
"className": "forbidden",
"code": 403,
"data": {
"code": "RATE_LIMITED",
"retry_after_seconds": 30
},
"errors": {},
"message": "Rate limit exceeded, retry in 1 minute",
"name": "Forbidden"
}Example: Refused by the screen's own rule
{
"message": "Access denied"
}Example: Token scopes don't cover the permission
{
"className": "forbidden",
"code": 403,
"data": {
"code": "API_TOKEN_SCOPE_DENIED"
},
"errors": {},
"message": "This API token isn't allowed to do this.",
"name": "Forbidden"
}NotFound
Not found, or the feature behind it is off for this business.
Example: Feature off for this business
{
"className": "not-found",
"code": 404,
"data": {
"code": "FEATURE_DISABLED"
},
"errors": {},
"message": "Not found",
"name": "NotFound"
}Example: No such record
{
"message": "Record not found"
}PaymentRequiredPlanLimit
The subscription allows no changes now, or the plan's limit for this kind of record is reached.
Example: Subscription expired
{
"className": "payment-required",
"code": 402,
"data": {
"code": "SUBSCRIPTION_EXPIRED"
},
"errors": {},
"message": "This workspace is locked.",
"name": "PaymentRequired"
}Example: Plan limit reached
{
"className": "payment-required",
"code": 402,
"data": {
"code": "PLAN_LIMIT_REACHED",
"key": "records",
"limit": 100,
"used": 100
},
"errors": {},
"message": "Your plan's limit has been reached. Upgrade to add more.",
"name": "PaymentRequired"
}Example: Subscription in grace (read-only)
{
"className": "payment-required",
"code": 402,
"data": {
"code": "SUBSCRIPTION_READ_ONLY"
},
"errors": {},
"message": "This workspace is read-only.",
"name": "PaymentRequired"
}PaymentRequiredRead
The business's subscription has ended (locked).
Example: Subscription expired
{
"className": "payment-required",
"code": 402,
"data": {
"code": "SUBSCRIPTION_EXPIRED"
},
"errors": {},
"message": "This workspace is locked.",
"name": "PaymentRequired"
}PaymentRequiredWrite
The business's subscription allows no changes now (grace period: read-only; ended: locked).
Example: Subscription expired
{
"className": "payment-required",
"code": 402,
"data": {
"code": "SUBSCRIPTION_EXPIRED"
},
"errors": {},
"message": "This workspace is locked.",
"name": "PaymentRequired"
}Example: Subscription in grace (read-only)
{
"className": "payment-required",
"code": 402,
"data": {
"code": "SUBSCRIPTION_READ_ONLY"
},
"errors": {},
"message": "This workspace is read-only.",
"name": "PaymentRequired"
}ServerError
Something failed on the server. The message is always generic; retry later.
Example: Unexpected failure
{
"className": "internal-server-error",
"code": 500,
"errors": {},
"message": "Something went wrong. Please try again.",
"name": "InternalServerError"
}TooManyRequests
Over a rate limit. Wait retry-after seconds (also in data.retry_after_seconds) and try again.
Headers: retry-after, x-ratelimit-limit, x-ratelimit-policy, x-ratelimit-remaining, x-ratelimit-reset
Example: Per-token limit reached
{
"className": "too-many-requests",
"code": 429,
"data": {
"code": "RATE_LIMITED",
"retry_after_seconds": 30
},
"errors": {},
"message": "RATE_LIMITED",
"name": "TooManyRequests"
}Unauthorized
The API token can't be used: unknown, revoked, disabled or expired, its owner is no longer active, or this route isn't open to API tokens.
Example: Token unknown, revoked, expired or owner inactive
{
"className": "unauthorized",
"code": 401,
"data": {
"code": "API_TOKEN_OWNER_INACTIVE"
},
"errors": {},
"message": "This API token is no longer valid.",
"name": "Unauthorized"
}Example: This route isn't open to API tokens
{
"className": "unauthorized",
"code": 401,
"data": {
"code": "API_TOKEN_SCOPE_DENIED"
},
"errors": {},
"message": "This API token isn't allowed to do this.",
"name": "Unauthorized"
}Unprocessable
This Idempotency-Key was already used with a different body.
Example: Key reused with another body
{
"className": "unprocessable",
"code": 422,
"data": {
"code": "IDEMPOTENCY_KEY_REUSED"
},
"errors": {},
"message": "This Idempotency-Key was already used for a different request.",
"name": "Unprocessable"
}ValidationFailed
The action refused the input: errors names each field and what is wrong.
Example: Field errors
{
"className": "bad-request",
"code": 400,
"data": {},
"errors": {
"name": "Name is required."
},
"message": "Please fix the highlighted fields",
"name": "BadRequest"
}Example: A malformed Idempotency-Key (actions that use it)
{
"className": "bad-request",
"code": 400,
"data": {
"code": "IDEMPOTENCY_KEY_INVALID"
},
"errors": {},
"message": "The Idempotency-Key must be 1–128 letters, digits, '.', '_', ':' or '-'.",
"name": "BadRequest"
}Schemas
Error
object
An error answer. message is always there; the rest comes with every error the server's error handler shapes (a route's own refusal may carry message only).
messagestringrequiredReadable text; show it, never parse it.
classNamestringcodeintegerThe HTTP status again.
dataobjectcodeis the typed error code to branch on. Some codes add keys: RATE_LIMITED → retry_after_seconds; PLAN_LIMIT_REACHED → key, limit, used.codestringkeystringkindstringlimitnumberretry_after_secondsinteger- minimum 1
usednumber
May hold more fields than listed.
errorsobjectField key → what is wrong with it (validation refusals).
namestringError class, e.g. Unauthorized
May hold more fields than listed.
GymLeads
Used by: Add Enquiry, List Leads, Get one Leads record
object
_idstringrequiredA record id.
- pattern: ^[0-9a-fA-F]{24}$
branch_displayanyBranch Display value worked out by the server.
branch_idstring or nullBranch ID
- pattern: ^[0-9a-fA-F]{24}$
follow_up_atstring or nullFollow-up On
- format: date-time
followups_stopped_atstring or null- format: date-time
intereststring or nullShown as:
hot= Hot;warm= Warm;cold= Cold.One of:
hot,warm,cold,nullinterested_planstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
interested_plan_displayanyInterested Plan Display value worked out by the server.
isActiveboolean or nullmarketing_opt_outboolean or nullmarketing_opt_out_atstring or null- format: date-time
namestring or nullnotestring or nullphonestring or nullsourcestring or nullShown as:
walk_in= Walk-in;phone= Phone;instagram= Instagram;referral= Referral.One of:
walk_in,phone,instagram,referral,nullstatusstring or nullOne of:
open,joined,dropped,nulltenant_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
May hold more fields than listed.
GymMembers
Used by: Add Member, Edit Member, List Members, Get one Members record
object
_idstringrequiredA record id.
- pattern: ^[0-9a-fA-F]{24}$
assigned_trainerstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
blood_groupstring or nullcurrent_end_datestring or nullMembership Ends
- format: date-time
current_expiring_fromstring or null- format: date-time
current_membership_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
current_valid_tillanyValid till Display value worked out by the server.
emergency_contactstring or nullfull_namestring or nullgenderstring or nullShown as:
male= Male;female= Female;other= Other.One of:
male,female,other,nullgoalstring or nullhas_dueboolean or nullhome_branchstring or nullHome Branch ID
- pattern: ^[0-9a-fA-F]{24}$
home_branch_displayanyHome Branch Display value worked out by the server.
isActiveboolean or nulljoin_datestring or null- format: date-time
marketing_consentboolean or nullMarketing Messages OK
marketing_opt_outboolean or nullmarketing_opt_out_atstring or null- format: date-time
phonestring or nullphotostring or nullstatusanyDisplay value worked out by the server.
tenant_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
trainer_displayanyAssigned Trainer Display value worked out by the server.
May hold more fields than listed.
GymMemberships
Used by: List Memberships, Get one Memberships record
object
_idstringrequiredA record id.
- pattern: ^[0-9a-fA-F]{24}$
addon_price_paidnumber or nullAdd-on Price
amount_paidnumber or nullPaid
balance_amountnumber or nullBalance
branch_accessstring or nullShown as:
home_only= Home branch only;all_branches= All branches;custom= Custom.One of:
home_only,all_branches,custom,nullbranch_access_displayanyBranch Access List Display value worked out by the server.
branch_access_listarray of string or nullBranch Access List
[ ]stringA record id.
- pattern: ^[0-9a-fA-F]{24}$
branch_displayanyBranch Display value worked out by the server.
branch_idstring or nullBranch ID
- pattern: ^[0-9a-fA-F]{24}$
discount_amountnumber or nullDiscount
end_datestring or nullEnd Date
- format: date-time
expiry_reminder_refused_atstring or null- format: date-time
invoice_due_atstring or null- format: date-time
invoice_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
invoice_numberstring or nullInvoice
invoice_sync_due_atstring or null- format: date-time
isActiveboolean or nulllast_dues_reminder_atstring or null- format: date-time
last_expiry_reminder_atstring or null- format: date-time
member_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
member_nameanyMember Display value worked out by the server.
member_phonestring or nullMember Phone
next_pack_displayanyNext Pack Display value worked out by the server.
payment_statusstring or nullOne of:
pending,partial,paid,nullplan_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
plan_kindstring or nullOne of:
membership,pt_pack,nullplan_namestring or nullPlan
price_paidnumber or nullPlan Price
reminder_days_before_expirynumber or nullreplaces_membership_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
schedule_textstring or nullsessions_totalnumber or nullsessions_usednumber or nullsourcestring or nullShown as:
new= New;renewal= Renewal.One of:
new,renewal,nullstart_datestring or nullStart Date
- format: date-time
statusanyDisplay value worked out by the server.
tenant_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
total_amountnumber or nullTotal
trainer_displayanyTrainer Display value worked out by the server.
trainer_idstring or nullTrainer ID
- pattern: ^[0-9a-fA-F]{24}$
valid_tillanyValid till Display value worked out by the server.
May hold more fields than listed.
GymPayments
Used by: List Payments, Get one Payments record
object
_idstringrequiredA record id.
- pattern: ^[0-9a-fA-F]{24}$
amountnumber or nullbranch_displayanyBranch Display value worked out by the server.
branch_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
datestring or null- format: date-time
isActiveboolean or nullmember_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
member_nameanyMember Display value worked out by the server.
membership_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
membership_snapshotanymodestring or nullShown as:
upi= UPI;cash= Cash;bank_transfer= Bank transfer;online= Online.One of:
upi,cash,bank_transfer,online,nullpay_request_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
plan_namestring or nullPlan
receipt_nostring or nullrecorded_bystring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
tenant_idstring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
trainer_share_amountnumber or nullTrainer Share
void_reasonstring or nullReason
voided_atstring or nullVoided On
- format: date-time
voided_bystring or nullA record id.
- pattern: ^[0-9a-fA-F]{24}$
voided_by_namestring or nullVoided By
May hold more fields than listed.