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_LIMITED with retry-after (seconds) and data.retry_after_seconds.
  • Every answer carries x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset and x-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.code RATE_LIMITED).

How to handle limits

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.

PresetScopeIncludes
Members — readpreset:members_readpage:members:view
Members — add and editpreset:members_writepage:members:create, page:members:edit
Memberships — readpreset:memberships_readpage:memberships:view
Payments — readpreset:payments_readpage:payments:view
Leads — add (website enquiry forms)preset:leads_writepage:leads:create
Reports — readpreset:reports_readdashboard:gym_reports:view

Scopes in use

ScopeUsed by
dashboard:gym_reports:viewReports data
page:active_members:createAdd Member
page:active_members:editEdit Member
page:expired_members:createAdd Member
page:expired_members:editEdit Member
page:expiring_members:createAdd Member
page:expiring_members:editEdit Member
page:leads:createAdd Enquiry
page:leads:viewList Leads, Get one Leads record
page:leads_follow_up_today:createAdd Enquiry
page:members:createAdd Member
page:members:editEdit Member
page:members:viewList Members, Get one Members record
page:memberships:viewList Memberships, Get one Memberships record
page:payments:viewList 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

  • monthstring

    Month (a dashboard filter).

    in the query

  • branchstring

    Branch (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-reset

    object

    • metaobjectrequired

    • widgetsobjectrequired

      Widget key → its data. A widget the owner may not see is left out.

      • branch_comparisonany

        Branch Comparison (table widget).

      • dues_countany

        Pending payments (memberships) (stat widget).

      • dues_totalany

        Pending payments amount (stat widget).

      • expense_breakdownany

        Expense Breakdown (table widget).

      • leads_best_sourceany

        Best Lead Source (stat widget).

      • leads_conversionany

        Enquiry Conversion % (stat widget).

      • new_joinsany

        New Joins (stat widget).

      • renewals_doneany

        Renewals Done (stat widget).

      • renewals_total_dueany

        Renewals Due/Overdue (members) (stat widget).

      • revenue_by_planany

        Revenue by Plan (payments received) (table widget).

      • revenue_trendany

        Monthly Revenue Trend (6 Months) (series widget).

      • revenue_trend_chartany

        Monthly Revenue Trend (6 Months) (chart widget).

      • warningsany

        Warnings (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-Keystring

    Send 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_idany

    Branch ID.

  • branch_nameany

    Branch. A value from gym_branches (lookup).

  • follow_up_atstring

    Follow-up Date.

    • format: date
  • interestone of the values below

    Interest. Shown as: hot = Hot; warm = Warm; cold = Cold.

    One of: hot, warm, cold

  • interested_planany

    Interested Plan ID.

  • interested_plan_nameany

    Interested Plan. A value from gym_membership_plans (lookup).

  • namestring

    Name.

  • notestring

    Note.

  • phonestring

    Phone.

    • 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 below

    Source. 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-reset

    object

    • recordsarray of GymLeadsrequired

      The records the run wrote, as stored.

    • successconstantrequired

      Always: true

    • metaobject

      Extra 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

  • pageinteger

    Page number, from 1.

    • minimum 1
    • default: 1

    in the query

  • per_pageinteger

    Records per page (at most 100).

    • minimum 1
    • maximum 100
    • default: 20

    in the query

  • sortstring

    One 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 string

    Read only these fields: the others come back as null (the id always comes).

    in the query

  • namestring

    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

  • phonestring

    Phone: 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

  • sourcestring

    Source: 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

  • intereststring

    Interest: 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

  • statusstring

    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

  • follow_up_atstring

    Follow-up On: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the x-time-zone header, else UTC.

    • format: date

    in the query

  • follow_up_at__fromstring

    Follow-up On: on or after this day.

    • format: date

    in the query

  • follow_up_at__tostring

    Follow-up On: on or before this day.

    • format: date

    in the query

  • branch_displaystring

    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

  • interested_plan_displaystring

    Interested 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

  • notestring

    Note: 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_upstring

    Follow-up (a filter the server works out).

    One of: due, today, overdue

    in the query

  • branchstring

    Branch (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-reset

    object

    • pageintegerrequired

      • minimum 1
    • per_pageintegerrequired

      • minimum 1
    • recordsarray of GymLeadsrequired

    • totalintegerrequired

      Records matching, on every page.

      • minimum 0
    • applied_filtersarray of object

      The named filters this answer applied.

      • [ ]object

        • labelstring

        • paramstring

        • valuestring

    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

  • idstringrequired

    The 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-reset

    object

    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-Keystring

    Send 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_trainerany

    Trainer ID.

  • assigned_trainer_nameany

    Assigned Trainer. A value from gym_staff (lookup).

  • blood_groupone of the values below

    Blood 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_amountnumber

    Discount. Between 0 and the plan price Used only when start_membership is true.

    • minimum 0
  • emergency_contactstring

    Emergency Contact.

    • pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
  • full_namestring

    Full Name.

    • at least 2 characters
    • at most 60 characters
    • pattern: ^\s*\p{L}[\p{L}\p{M} .'-]*\s*$
  • genderone of the values below

    Gender. Shown as: male = Male; female = Female; other = Other.

    One of: male, female, other

  • goalstring

    Goal.

  • home_branchany

    Home Branch ID.

  • home_branch_nameany

    Home Branch. A value from gym_branches (lookup).

  • join_datestring

    Join Date.

    • format: date
  • marketing_consentboolean

    OK to send offers on WhatsApp. The member agreed to get offers and news from the gym. They can reply STOP any time.

  • membership_start_datestring

    Membership Start Date. Used only when start_membership is true.

    • format: date
  • payment_amountnumber

    Amount Paid Now. Leave blank to collect later. Up to the plan price after discount. Used only when start_membership is true.

    • minimum 0
  • payment_modeone of the values below

    Payment Mode. Shown as: upi = UPI; cash = Cash; bank_transfer = Bank Transfer. Used only when start_membership is true.

    One of: upi, cash, bank_transfer

  • phonestring

    WhatsApp Phone.

    • pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
  • photoany

    Photo.

  • plan_idany

    Plan ID.

  • plan_nameany

    Plan. A value from gym_membership_plans (lookup). Used only when start_membership is true.

  • plan_priceany

    Plan Price.

  • start_membershipboolean

    Start 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-reset

    object

    • recordsarray of GymMembersrequired

      The records the run wrote, as stored.

    • successconstantrequired

      Always: true

    • metaobject

      Extra 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-Keystring

    Send 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_trainerany

    Trainer ID.

  • assigned_trainer_nameany

    Assigned Trainer. A value from gym_staff (lookup).

  • blood_groupone of the values below

    Blood 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_contactstring

    Emergency Contact.

    • pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
  • full_namestring

    Full Name.

    • at least 2 characters
    • at most 60 characters
    • pattern: ^\s*\p{L}[\p{L}\p{M} .'-]*\s*$
  • genderone of the values below

    Gender. Shown as: male = Male; female = Female; other = Other.

    One of: male, female, other

  • goalstring

    Goal.

  • home_branchany

    Home Branch ID.

  • home_branch_nameany

    Home Branch. A value from gym_branches (lookup).

  • idstring

    The record to act on. Without it the run creates a new record.

    • pattern: ^[0-9a-fA-F]{24}$
  • idsarray of string

    The records of a bulk run.

    • [ ]string

      A record id.

      • pattern: ^[0-9a-fA-F]{24}$
  • join_datestring

    Join Date.

    • format: date
  • marketing_consentboolean

    OK to send offers on WhatsApp. The member agreed to get offers and news from the gym. They can reply STOP any time.

  • phonestring

    WhatsApp Phone.

    • pattern: ^\s*[ ().-]*(?:(?:(?:\+|00)?[ ().-]*9[ ().-]*1[ ().-]*|0[ ().-]*)?(?:[0-9][ ().-]*){9}[0-9]|(?:\+|00)[ ().-]*(?!9[ ().-]*1)[1-9](?:[ ().-]*[0-9]){6,14})[ ().-]*\s*$
  • photoany

    Photo.

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-reset

    object

    • recordsarray of GymMembersrequired

      The records the run wrote, as stored.

    • successconstantrequired

      Always: true

    • metaobject

      Extra 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

  • pageinteger

    Page number, from 1.

    • minimum 1
    • default: 1

    in the query

  • per_pageinteger

    Records per page (at most 100).

    • minimum 1
    • maximum 100
    • default: 20

    in the query

  • sortstring

    One 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 string

    Read only these fields: the others come back as null (the id always comes).

    in the query

  • full_namestring

    Full 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

  • phonestring

    Phone: 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_displaystring

    Home 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_displaystring

    Assigned 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

  • statusstring

    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. Values: no_membership.

    in the query

  • current_valid_tillstring

    Valid till: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the x-time-zone header, else UTC.

    • format: date

    in the query

  • current_valid_till__fromstring

    Valid till: on or after this day.

    • format: date

    in the query

  • current_valid_till__tostring

    Valid till: on or before this day.

    • format: date

    in the query

  • has_duestring

    Has Due: true or false.

    One of: true, false

    in the query

  • join_datestring

    Join Date: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the x-time-zone header, else UTC.

    • format: date

    in the query

  • join_date__fromstring

    Join Date: on or after this day.

    • format: date

    in the query

  • join_date__tostring

    Join Date: on or before this day.

    • format: date

    in the query

  • genderstring

    Gender: 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_groupstring

    Blood 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_contactstring

    Emergency 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

  • goalstring

    Goal: 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

  • photostring

    Photo: 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_datestring

    Membership Ends: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the x-time-zone header, else UTC.

    • format: date

    in the query

  • current_end_date__fromstring

    Membership Ends: on or after this day.

    • format: date

    in the query

  • current_end_date__tostring

    Membership Ends: on or before this day.

    • format: date

    in the query

  • filterstring

    Filter (a filter the server works out).

    One of: active, current, expiring_7d, renewals_week, expiring, expired, no_membership

    in the query

  • branchstring

    Branch (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-reset

    object

    • pageintegerrequired

      • minimum 1
    • per_pageintegerrequired

      • minimum 1
    • recordsarray of GymMembersrequired

    • totalintegerrequired

      Records matching, on every page.

      • minimum 0
    • applied_filtersarray of object

      The named filters this answer applied.

      • [ ]object

        • labelstring

        • paramstring

        • valuestring

    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

  • idstringrequired

    The 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-reset

    object

    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

  • pageinteger

    Page number, from 1.

    • minimum 1
    • default: 1

    in the query

  • per_pageinteger

    Records per page (at most 100).

    • minimum 1
    • maximum 100
    • default: 20

    in the query

  • sortstring

    One 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 string

    Read only these fields: the others come back as null (the id always comes).

    in the query

  • member_namestring

    Member: 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_namestring

    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

  • branch_displaystring

    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

  • start_datestring

    Start Date: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the x-time-zone header, else UTC.

    • format: date

    in the query

  • start_date__fromstring

    Start Date: on or after this day.

    • format: date

    in the query

  • start_date__tostring

    Start Date: on or before this day.

    • format: date

    in the query

  • valid_tillstring

    Valid till: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the x-time-zone header, else UTC.

    • format: date

    in the query

  • valid_till__fromstring

    Valid till: on or after this day.

    • format: date

    in the query

  • valid_till__tostring

    Valid till: on or before this day.

    • format: date

    in the query

  • statusstring

    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

  • total_amountstring

    Total: 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_paidstring

    Paid: 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_amountstring

    Balance: 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_statusstring

    Payment 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_amountstring

    Discount: 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_displaystring

    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

  • branch_accessstring

    Branch 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_totalnumber

    Sessions 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_usednumber

    Sessions 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_datestring

    End Date: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the x-time-zone header, else UTC.

    • format: date

    in the query

  • end_date__fromstring

    End Date: on or after this day.

    • format: date

    in the query

  • end_date__tostring

    End 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-reset

    object

    • pageintegerrequired

      • minimum 1
    • per_pageintegerrequired

      • minimum 1
    • recordsarray of GymMembershipsrequired

    • totalintegerrequired

      Records 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

  • idstringrequired

    The 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-reset

    object

    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

  • pageinteger

    Page number, from 1.

    • minimum 1
    • default: 1

    in the query

  • per_pageinteger

    Records per page (at most 100).

    • minimum 1
    • maximum 100
    • default: 20

    in the query

  • sortstring

    One 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 string

    Read only these fields: the others come back as null (the id always comes).

    in the query

  • tenant_idstring

    Tenant 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_idstring

    Member 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_namestring

    Member: 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_idstring

    Membership 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_namestring

    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

  • membership_snapshotstring

    Membership 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

  • amountstring

    Amount: 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

  • modestring

    Mode: 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

  • datestring

    Date: on this day (YYYY-MM-DD). Days are in the business's time zone when it sets one, else the x-time-zone header, else UTC.

    • format: date

    in the query

  • date__fromstring

    Date: on or after this day.

    • format: date

    in the query

  • date__tostring

    Date: on or before this day.

    • format: date

    in the query

  • recorded_bystring

    Recorded 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_nostring

    Receipt 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_idstring

    Branch 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_idstring

    Pay 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_displaystring

    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_share_amountstring

    Trainer 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_atstring

    Voided 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_bystring

    Voided 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_namestring

    Voided 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_reasonstring

    Reason: 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

  • isActivestring

    Is 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

  • periodstring

    Period (a filter the server works out).

    One of: today, this_month

    in the query

  • branchstring

    Branch (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-reset

    object

    • pageintegerrequired

      • minimum 1
    • per_pageintegerrequired

      • minimum 1
    • recordsarray of GymPaymentsrequired

    • totalintegerrequired

      Records matching, on every page.

      • minimum 0
    • applied_filtersarray of object

      The named filters this answer applied.

      • [ ]object

        • labelstring

        • paramstring

        • valuestring

    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

  • idstringrequired

    The 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-reset

    object

    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).

  • messagestringrequired

    Readable text; show it, never parse it.

  • classNamestring

  • codeinteger

    The HTTP status again.

  • dataobject

    code is the typed error code to branch on. Some codes add keys: RATE_LIMITED → retry_after_seconds; PLAN_LIMIT_REACHED → key, limit, used.

    • codestring

    • keystring

    • kindstring

    • limitnumber

    • retry_after_secondsinteger

      • minimum 1
    • usednumber

    May hold more fields than listed.

  • errorsobject

    Field key → what is wrong with it (validation refusals).

  • namestring

    Error class, e.g. Unauthorized

May hold more fields than listed.

GymLeads

Used by: Add Enquiry, List Leads, Get one Leads record

object

  • _idstringrequired

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • branch_displayany

    Branch Display value worked out by the server.

  • branch_idstring or null

    Branch ID

    • pattern: ^[0-9a-fA-F]{24}$
  • follow_up_atstring or null

    Follow-up On

    • format: date-time
  • followups_stopped_atstring or null

    • format: date-time
  • intereststring or null

    Shown as: hot = Hot; warm = Warm; cold = Cold.

    One of: hot, warm, cold, null

  • interested_planstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • interested_plan_displayany

    Interested Plan Display value worked out by the server.

  • isActiveboolean or null

  • marketing_opt_outboolean or null

  • marketing_opt_out_atstring or null

    • format: date-time
  • namestring or null

  • notestring or null

  • phonestring or null

  • sourcestring or null

    Shown as: walk_in = Walk-in; phone = Phone; instagram = Instagram; referral = Referral.

    One of: walk_in, phone, instagram, referral, null

  • statusstring or null

    One of: open, joined, dropped, null

  • tenant_idstring or null

    A 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

  • _idstringrequired

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • assigned_trainerstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • blood_groupstring or null

  • current_end_datestring or null

    Membership Ends

    • format: date-time
  • current_expiring_fromstring or null

    • format: date-time
  • current_membership_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • current_valid_tillany

    Valid till Display value worked out by the server.

  • emergency_contactstring or null

  • full_namestring or null

  • genderstring or null

    Shown as: male = Male; female = Female; other = Other.

    One of: male, female, other, null

  • goalstring or null

  • has_dueboolean or null

  • home_branchstring or null

    Home Branch ID

    • pattern: ^[0-9a-fA-F]{24}$
  • home_branch_displayany

    Home Branch Display value worked out by the server.

  • isActiveboolean or null

  • join_datestring or null

    • format: date-time
  • marketing_consentboolean or null

    Marketing Messages OK

  • marketing_opt_outboolean or null

  • marketing_opt_out_atstring or null

    • format: date-time
  • phonestring or null

  • photostring or null

  • statusany

    Display value worked out by the server.

  • tenant_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • trainer_displayany

    Assigned Trainer Display value worked out by the server.

May hold more fields than listed.

GymMemberships

Used by: List Memberships, Get one Memberships record

object

  • _idstringrequired

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • addon_price_paidnumber or null

    Add-on Price

  • amount_paidnumber or null

    Paid

  • balance_amountnumber or null

    Balance

  • branch_accessstring or null

    Shown as: home_only = Home branch only; all_branches = All branches; custom = Custom.

    One of: home_only, all_branches, custom, null

  • branch_access_displayany

    Branch Access List Display value worked out by the server.

  • branch_access_listarray of string or null

    Branch Access List

    • [ ]string

      A record id.

      • pattern: ^[0-9a-fA-F]{24}$
  • branch_displayany

    Branch Display value worked out by the server.

  • branch_idstring or null

    Branch ID

    • pattern: ^[0-9a-fA-F]{24}$
  • discount_amountnumber or null

    Discount

  • end_datestring or null

    End Date

    • format: date-time
  • expiry_reminder_refused_atstring or null

    • format: date-time
  • invoice_due_atstring or null

    • format: date-time
  • invoice_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • invoice_numberstring or null

    Invoice

  • invoice_sync_due_atstring or null

    • format: date-time
  • isActiveboolean or null

  • last_dues_reminder_atstring or null

    • format: date-time
  • last_expiry_reminder_atstring or null

    • format: date-time
  • member_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • member_nameany

    Member Display value worked out by the server.

  • member_phonestring or null

    Member Phone

  • next_pack_displayany

    Next Pack Display value worked out by the server.

  • payment_statusstring or null

    One of: pending, partial, paid, null

  • plan_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • plan_kindstring or null

    One of: membership, pt_pack, null

  • plan_namestring or null

    Plan

  • price_paidnumber or null

    Plan Price

  • reminder_days_before_expirynumber or null

  • replaces_membership_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • schedule_textstring or null

  • sessions_totalnumber or null

  • sessions_usednumber or null

  • sourcestring or null

    Shown as: new = New; renewal = Renewal.

    One of: new, renewal, null

  • start_datestring or null

    Start Date

    • format: date-time
  • statusany

    Display value worked out by the server.

  • tenant_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • total_amountnumber or null

    Total

  • trainer_displayany

    Trainer Display value worked out by the server.

  • trainer_idstring or null

    Trainer ID

    • pattern: ^[0-9a-fA-F]{24}$
  • valid_tillany

    Valid till Display value worked out by the server.

May hold more fields than listed.

GymPayments

Used by: List Payments, Get one Payments record

object

  • _idstringrequired

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • amountnumber or null

  • branch_displayany

    Branch Display value worked out by the server.

  • branch_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • datestring or null

    • format: date-time
  • isActiveboolean or null

  • member_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • member_nameany

    Member Display value worked out by the server.

  • membership_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • membership_snapshotany

  • modestring or null

    Shown as: upi = UPI; cash = Cash; bank_transfer = Bank transfer; online = Online.

    One of: upi, cash, bank_transfer, online, null

  • pay_request_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • plan_namestring or null

    Plan

  • receipt_nostring or null

  • recorded_bystring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • tenant_idstring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • trainer_share_amountnumber or null

    Trainer Share

  • void_reasonstring or null

    Reason

  • voided_atstring or null

    Voided On

    • format: date-time
  • voided_bystring or null

    A record id.

    • pattern: ^[0-9a-fA-F]{24}$
  • voided_by_namestring or null

    Voided By

May hold more fields than listed.