Brixfit Developer API

v1 · REST · JSON · API Key auth

Get Your API Key

The Brixfit REST API lets you integrate your coaching CRM with any tool — landing pages, n8n, Zapier, Make, Google Sheets, WhatsApp, custom apps, and more. All endpoints return a consistent JSON envelope with data, meta, and error fields.

Base URL

https://brixfit.app/api/public/v1

Auth

X-API-Key header

Format

application/json

Authentication

Pass your API key in every request via the X-API-Key header (recommended) or as a Bearer token.

bash
# Recommended
curl -H "X-API-Key: brx_your_key_here" https://brixfit.app/api/public/v1/leads

# Alternative
curl -H "Authorization: Bearer brx_your_key_here" https://brixfit.app/api/public/v1/leads
Security: Never expose your API key in client-side JavaScript, browser extensions, or public repositories. Always call the API from your server.
Need an API key?Get Your API Key

Base URL & Versioning

All v1 endpoints live under:

text
https://brixfit.app/api/public/v1

The legacy endpoint /api/public/leads (POST only) remains active for backwards compatibility. New integrations should use /v1/.

Response Envelope

Every response follows this structure:

json
{
  "data":  { ... } | [ ... ],   // the resource or list
  "meta":  { "page": 1, "per_page": 20, "total": 143, "total_pages": 8 } | null,
  "error": null                 // string message on failure
}

Leads

GET/leads

List all leads. Supports pagination, search, and status filtering.

Query Parameters

FieldTypeRequiredDescription
pagenumberoptionalPage number (default: 1)
per_pagenumberoptionalResults per page (max 100, default: 20)
searchstringoptionalSearch name, email, or phone
statusstringoptionalFilter by status (new, contacted, etc.)
sortstringoptionalSort field:direction — e.g. created_at:desc
bash
curl -H "X-API-Key: brx_..." \
  "https://brixfit.app/api/public/v1/leads?page=1&per_page=20&status=new"
POST/leads

Create a new lead. Automatically triggers AI health report and analysis if enabled.

Body Fields

FieldTypeRequiredDescription
namestringrequiredFull name of the lead
emailstringoptionalEmail address
phonestringoptionalPhone number — any format, auto-normalized to international standard
statusstringoptionalPipeline status (defaults to "new")
weightnumberauto-calcBody weight in kg — used to auto-calculate BMI, BMR, TDEE
heightnumberauto-calcHeight in cm — used to auto-calculate BMI, BMR
agenumberauto-calcAge in years — used to auto-calculate BMR, TDEE, body fat
genderstringauto-calcmale / female (or m/f) — used for BMR & body fat formula
activity_levelstringauto-calcsedentary | light | moderate | active | very_active — used for TDEE
...anyoptionalAny custom fields defined in Brixfit → Lead Form (fetched via GET /fields/leads)
Auto-calculations: When weight + height are provided, BMI is calculated automatically. Add age and gender for BMR + body fat. Add activity_level for TDEE. Results are stored in raw_payload._calculated.

Phone normalization: Numbers are auto-formatted — trunk zeros stripped, 00XX+XX. Works for all countries.
bash
curl -X POST "https://brixfit.app/api/public/v1/leads" \
  -H "X-API-Key: brx_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Priya Sharma",
    "email": "[email protected]",
    "phone": "0091-9999999999",
    "weight": 78,
    "height": 162,
    "age": 28,
    "gender": "female",
    "activity_level": "moderate"
  }'

The response will include auto-calculated metrics in raw_payload._calculated with bmi, bmr, body_fat, and tdee.

GET/leads/:id

Get a single lead by ID.

bash
curl -H "X-API-Key: brx_..." "https://brixfit.app/api/public/v1/leads/lead-uuid-here"
PATCH/leads/:id

Update lead fields. Only send fields you want to change.

bash
curl -X PATCH "https://brixfit.app/api/public/v1/leads/lead-uuid-here" \
  -H "X-API-Key: brx_..." \
  -H "Content-Type: application/json" \
  -d '{ "status": "contacted", "phone": "+91-8888888888" }'
DELETE/leads/:id

Permanently delete a lead. This action cannot be undone.

bash
curl -X DELETE "https://brixfit.app/api/public/v1/leads/lead-uuid-here" -H "X-API-Key: brx_..."

Fields

GET/fields/leads

Fetch your custom lead field definitions. Use this to discover which fields to send when creating or updating leads.

bash
curl -H "X-API-Key: brx_..." "https://brixfit.app/api/public/v1/fields/leads"
json
{
  "data": [
    { "field_key": "weight", "label": "Weight (kg)", "field_type": "number", "is_required": true  },
    { "field_key": "height", "label": "Height (cm)", "field_type": "number", "is_required": true  },
    { "field_key": "goal",   "label": "Goal",        "field_type": "string", "is_required": false },
    { "field_key": "age",    "label": "Age",         "field_type": "number", "is_required": false },
    { "field_key": "gender", "label": "Gender",      "field_type": "string", "is_required": false }
  ],
  "meta": null,
  "error": null
}

Fields are returned in display order (sort_order). Each field_key maps directly to the body key used in POST /leads and PATCH /leads/:id. The n8n node uses this endpoint to automatically display your custom fields as individual inputs.

Clients

GET/clients

List all clients. Supports pagination, name/email search, and status filter.

FieldTypeRequiredDescription
pagenumberoptionalPage number (default: 1)
per_pagenumberoptionalResults per page (max 100)
searchstringoptionalSearch full name or email
statusstringoptionalactive | inactive | paused
bash
curl -H "X-API-Key: brx_..." "https://brixfit.app/api/public/v1/clients?status=active"
GET/clients/:id

Get a single client's full profile including health metrics.

bash
curl -H "X-API-Key: brx_..." "https://brixfit.app/api/public/v1/clients/client-uuid-here"
PATCH/clients/:id

Update a client's account status, goal, phone, end date, or notes.

FieldTypeRequiredDescription
account_statusstringoptionalactive | inactive | paused
goalstringoptionalFitness goal (e.g. weight_loss)
phonestringoptionalPhone number (auto-normalized)
end_datestringoptionalSubscription end date (ISO date)
notesstringoptionalCoach notes about the client
bash
curl -X PATCH "https://brixfit.app/api/public/v1/clients/client-uuid-here" \
  -H "X-API-Key: brx_..." \
  -H "Content-Type: application/json" \
  -d '{ "account_status": "paused", "notes": "On vacation until April" }'
DELETE/clients/:id

Deactivate a client account. Sets account_status to inactive — does not permanently delete the record.

bash
curl -X DELETE "https://brixfit.app/api/public/v1/clients/client-uuid-here" -H "X-API-Key: brx_..."

Check-ins

GET/checkins

List check-in instances. Filter by client, date range, or status.

FieldTypeRequiredDescription
client_idstringoptionalFilter by client ID
statusstringoptionalpending | completed | submitted | missed
from_datestringoptionalStart date (YYYY-MM-DD)
to_datestringoptionalEnd date (YYYY-MM-DD)
pagenumberoptionalPage number
per_pagenumberoptionalPer page (max 100)
bash
curl -H "X-API-Key: brx_..." \
  "https://brixfit.app/api/public/v1/checkins?from_date=2025-03-01&to_date=2025-03-31&status=completed"
GET/clients/:id/checkins

Fetch all check-ins for a specific client by their ID.

bash
curl -H "X-API-Key: brx_..." "https://brixfit.app/api/public/v1/clients/client-uuid-here/checkins"

Webhooks

Webhooks deliver real-time event notifications to your server via HTTP POST. Use them to trigger n8n workflows, update CRMs, send messages, and more — without polling.

POST/webhooks

Register a new webhook endpoint. The secret is returned once — save it securely.

FieldTypeRequiredDescription
urlstringrequiredHTTPS URL to receive events
eventsstring[]requiredArray of event names to subscribe to
descriptionstringoptionalOptional label for this webhook

Available Events

lead.createdlead.updatedlead.status_changedlead.convertedlead.deletedclient.createdclient.updatedcheckin.submitted
bash
curl -X POST "https://brixfit.app/api/public/v1/webhooks" \
  -H "X-API-Key: brx_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-n8n.example.com/webhook/brixfit",
    "events": ["lead.created", "lead.status_changed"],
    "description": "n8n lead pipeline"
  }'

Signature Verification

Every request includes an X-Brixfit-Signature header — an HMAC-SHA256 hash of the raw body using your webhook secret. Always verify this in production.

typescript
import { createHmac } from 'crypto'

function verifyBrixfitWebhook(
  rawBody: string,
  signature: string,
  secret: string,
): boolean {
  const expected = 'sha256=' + createHmac('sha256', secret)
    .update(rawBody)
    .digest('hex')
  return signature === expected
}

// Next.js App Router example
export async function POST(req: Request) {
  const rawBody = await req.text()
  const sig = req.headers.get('x-brixfit-signature') ?? ''
  if (!verifyBrixfitWebhook(rawBody, sig, process.env.BRIXFIT_WEBHOOK_SECRET!)) {
    return Response.json({ error: 'Invalid signature' }, { status: 401 })
  }
  const { event, data } = JSON.parse(rawBody)
  console.log('Event:', event, data)
  return Response.json({ ok: true })
}
GET/webhooks

List all registered webhooks.

PATCH/webhooks/:id

Enable or disable a webhook.

bash
curl -X PATCH "https://brixfit.app/api/public/v1/webhooks/webhook-uuid" \
  -H "X-API-Key: brx_..." \
  -H "Content-Type: application/json" \
  -d '{ "is_active": false }'
DELETE/webhooks/:id

Remove a webhook permanently.

Errors

On errors, data is null and error contains a message string.

StatusMeaning
401Missing, invalid, or revoked API key
400Malformed request body
404Resource not found (or not owned by you)
422Validation error — check "details" array for field errors
429Rate limit exceeded — see Retry-After header
500Internal server error
json
// 422 Validation error
{
  "data": null,
  "error": "Validation failed.",
  "details": [
    "\"phone\" (Phone Number) is required.",
    "\"age\" must be a valid number."
  ]
}

@brixfit/sdk

Official TypeScript/JavaScript SDK. Fully typed, works in Node.js and edge runtimes.

Installation

bash
npm install @brixfit/sdk
# or: yarn add @brixfit/sdk  |  pnpm add @brixfit/sdk

Quick Start

typescript
import { BrixfitClient } from '@brixfit/sdk'

const brixfit = new BrixfitClient({ apiKey: 'brx_your_key_here' })

// List leads
const { data: leads, meta } = await brixfit.leads.list({
  per_page: 20,
  status: 'new',
})
console.log(`${meta.total} total leads`)

// Create a lead
const lead = await brixfit.leads.create({
  name: 'Priya Sharma',
  email: '[email protected]',
  goal: 'weight_loss',
  weight: 78,
})

// Update status
await brixfit.leads.updateStatus(lead.id, 'contacted')

// List clients
const { data: clients } = await brixfit.clients.list({ status: 'active' })

// Get check-ins for a client
const { data: checkins } = await brixfit.checkins.list({
  client_id: clients[0].id,
  from_date: '2025-03-01',
})

Error Handling

typescript
import { BrixfitClient, BrixfitAuthError, BrixfitValidationError, BrixfitRateLimitError } from '@brixfit/sdk'

try {
  const lead = await brixfit.leads.create({ name: '' })
} catch (err) {
  if (err instanceof BrixfitAuthError)            console.error('Check your API key')
  else if (err instanceof BrixfitValidationError) console.error('Fields:', err.details)
  else if (err instanceof BrixfitRateLimitError)  console.log('Wait:', err.retryAfter, 's')
}

n8n Integration

Brixfit has an official n8n community node — n8n-nodes-brixfit — that gives you a drag-and-drop interface for all API operations and webhook triggers.

Brixfit node

Perform actions — create leads with dynamic fields, update/deactivate clients, get check-ins, manage webhooks.

Brixfit Trigger node

Start workflows when events fire — lead created, check-in submitted, etc.

Install the node

In n8n: Settings → Community Nodes → Install and enter:

text
n8n-nodes-brixfit

Or for self-hosted n8n:

bash
npm install n8n-nodes-brixfit

Step-by-step: receive leads from a landing page

  1. 1In n8n, create a new workflow. Add a Brixfit Trigger node.
  2. 2Activate the workflow — n8n shows you a webhook URL.
  3. 3In Brixfit → Developer → Webhooks, create a webhook pointing to that URL. Select lead.created.
  4. 4Copy the secret from Brixfit and paste it into the Trigger node's "Webhook Secret" field.
  5. 5Add downstream nodes: send a WhatsApp, append to Google Sheets, post to Slack — anything.
  6. 6Every new lead in Brixfit now triggers your workflow within seconds.

Example workflows

Facebook Lead Ads → Brixfit

Facebook Lead Ads Trigger → Set (map fields) → Brixfit: Create Lead

New lead → WhatsApp + Sheets

Brixfit Trigger (lead.created) → WhatsApp (send welcome) → Google Sheets (append row)

Daily check-in report

Schedule Trigger (9am) → Brixfit: Get All Check-ins (today) → Gmail (send summary to coach)

Lead converted → onboarding

Brixfit Trigger (lead.converted) → Create Client → Send welcome email → Slack (notify team)

Using HTTP Request node (no node install needed)

You can also use n8n's built-in HTTP Request node directly:

text
Method: POST
URL: https://brixfit.app/api/public/v1/leads
Header: X-API-Key = brx_your_key_here
Body (JSON):
{
  "name": "{{ $json.name }}",
  "email": "{{ $json.email }}",
  "phone": "{{ $json.phone }}"
}

Rate Limits

Rate limits are applied per API key. When exceeded, the API returns 429 with a Retry-After header indicating when to retry (in seconds).

EndpointLimit
All v1 endpoints120 requests / minute
POST /leads60 requests / minute
POST /webhooks10 webhooks total (active)

Ready to integrate?

Get your API key and start building in minutes.

Get Your API Key

Powered by world-class infrastructure

Supabase
Razorpay
DigitalOcean
n8n
Supabase
Razorpay
DigitalOcean
n8n
Supabase
Razorpay
DigitalOcean
n8n
Supabase
Razorpay
DigitalOcean
n8n

BrixFitistheall-in-oneoperatingsystemforfitnesscoachesbuilttoturneveryleadintoaloyalclientandeverysessionintoastoryworthtelling.