진보 JINBO API Documentation

World-Class Coaching Platform API • Version 2.2.0

🚀 API INTEGRATION GUIDE FOR BUSINESSES

Company: WE ARE HYBRID. IN
Owner: admin@legacy-integration.cloud
Date: October 2, 2025
API Base URL: https://jinbo.life/api


📋 TABLE OF CONTENTS

  1. Overview
  2. Authentication
  3. Step 1: Set Up Your Business
  4. Step 2: Get Your API Credentials
  5. Step 3: Create Classes via API
  6. Step 4: Assign Coaches to Classes
  7. Complete API Reference
  8. Examples & Code Samples

📖 OVERVIEW

What You Can Do

As WE ARE HYBRID. IN (business owner: admin@legacy-integration.cloud), you can:

Create Classes - Add new coaching classes via API
Manage Coaches - Assign/remove coaches from your classes
Add Students - Enroll students in classes
Track Progress - View session and student progress data
Manage Locations - Add venues/locations for classes
Access Analytics - Get reports on your business performance

Authentication Methods

JINBO Life API supports two authentication methods:

  1. JWT Tokens (Recommended) - From Legacy Integration login
  2. API Keys (For server-to-server) - Generated for your brand

🔐 AUTHENTICATION

Method 1: JWT Token (Recommended)

How it works:

  1. Login to Legacy Integration with your credentials
  2. Get JWT token from Legacy Integration
  3. Use token in Authorization header

Login Request:

curl -X POST https://legacy-integration.cloud/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@legacy-integration.cloud",
    "password": "your_password"
  }'

Response:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "uuid-here",
    "email": "admin@legacy-integration.cloud",
    "name": "Admin",
    "permissions": ["*"]
  }
}

Use Token in API Calls:

curl -X GET https://jinbo.life/api/classes \
  -H "Authorization: Bearer YOUR_JWT_TOKEN_HERE"

Method 2: API Key (For Automation)

How it works:

  1. Request API key from JINBO support
  2. Use API key in X-API-Key header
  3. API key is tied to your brand ID

Get Your API Key:

# Contact JINBO support or generate via admin panel
# Format: jinbo_live_1234567890abcdef

Use API Key in API Calls:

curl -X GET https://jinbo.life/api/classes \
  -H "X-API-Key: jinbo_live_YOUR_API_KEY_HERE"

🏢 STEP 1: SET UP YOUR BUSINESS

1.1 Create Brand Record

Endpoint: POST /api/brands

Request:

curl -X POST https://jinbo.life/api/brands \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "WE ARE HYBRID. IN",
    "domain": "wearehybrid.in",
    "owner_email": "admin@legacy-integration.cloud",
    "settings": {
      "timezone": "Asia/Kolkata",
      "currency": "INR",
      "language": "en"
    }
  }'

Response:

{
  "success": true,
  "brand": {
    "id": "brand_uuid_12345",
    "name": "WE ARE HYBRID. IN",
    "domain": "wearehybrid.in",
    "owner_email": "admin@legacy-integration.cloud",
    "api_key": "jinbo_live_abcd1234567890",
    "created_at": "2025-10-02T02:00:00Z"
  }
}

Save Your Brand ID: brand_uuid_12345
Save Your API Key: jinbo_live_abcd1234567890


1.2 Configure Brand Settings

Endpoint: PATCH /api/brands/:brandId

curl -X PATCH https://jinbo.life/api/brands/brand_uuid_12345 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "logo_url": "https://wearehybrid.in/logo.png",
    "primary_color": "#FF6B00",
    "terminology": {
      "coach": "Trainer",
      "student": "Member",
      "class": "Session"
    }
  }'

🔑 STEP 2: GET YOUR API CREDENTIALS

2.1 Option A: Use JWT Token

Login & Get Token:

// JavaScript Example
const response = await fetch('https://legacy-integration.cloud/auth/login', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: 'admin@legacy-integration.cloud',
    password: 'your_secure_password'
  })
});

const { token } = await response.json();
console.log('Your JWT Token:', token);

// Use this token for all API calls

2.2 Option B: Generate API Key

Request API Key:

curl -X POST https://jinbo.life/api/auth/api-key \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "WE ARE HYBRID API Key",
    "scopes": ["classes:write", "coaches:write", "students:write"]
  }'

Response:

{
  "api_key": "jinbo_live_abcd1234567890efgh",
  "brand_id": "brand_uuid_12345",
  "scopes": ["classes:write", "coaches:write", "students:write"],
  "created_at": "2025-10-02T02:00:00Z"
}

⚠️ IMPORTANT: Save this API key securely! It won't be shown again.


📚 STEP 3: CREATE CLASSES VIA API

3.1 Create a Single Class

Endpoint: POST /api/classes

Request:

curl -X POST https://jinbo.life/api/classes \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Yoga for Beginners",
    "description": "Beginner-friendly yoga sessions focusing on flexibility and breathing",
    "skill_id": "skill_uuid_yoga",
    "level": "beginner",
    "max_students": 15,
    "duration_minutes": 60,
    "location_id": "location_uuid_studio1",
    "schedule": {
      "type": "recurring",
      "days": ["monday", "wednesday", "friday"],
      "time": "18:00",
      "timezone": "Asia/Kolkata"
    },
    "pricing": {
      "amount": 5000,
      "currency": "INR",
      "billing_cycle": "monthly"
    }
  }'

Response:

{
  "success": true,
  "class": {
    "id": "class_uuid_12345",
    "name": "Yoga for Beginners",
    "description": "Beginner-friendly yoga sessions...",
    "skill_id": "skill_uuid_yoga",
    "level": "beginner",
    "max_students": 15,
    "enrolled_students": 0,
    "coach_id": null,
    "location_id": "location_uuid_studio1",
    "status": "active",
    "created_at": "2025-10-02T02:00:00Z"
  }
}

3.2 Bulk Create Classes

Endpoint: POST /api/classes/bulk

Request:

curl -X POST https://jinbo.life/api/classes/bulk \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "classes": [
      {
        "name": "Yoga for Beginners",
        "skill_id": "skill_yoga",
        "level": "beginner",
        "max_students": 15
      },
      {
        "name": "Advanced Pilates",
        "skill_id": "skill_pilates",
        "level": "advanced",
        "max_students": 10
      },
      {
        "name": "CrossFit Basics",
        "skill_id": "skill_crossfit",
        "level": "beginner",
        "max_students": 20
      }
    ]
  }'

Response:

{
  "success": true,
  "created": 3,
  "classes": [
    {
      "id": "class_uuid_1",
      "name": "Yoga for Beginners",
      "status": "created"
    },
    {
      "id": "class_uuid_2",
      "name": "Advanced Pilates",
      "status": "created"
    },
    {
      "id": "class_uuid_3",
      "name": "CrossFit Basics",
      "status": "created"
    }
  ]
}

3.3 Update Existing Class

Endpoint: PATCH /api/classes/:classId

curl -X PATCH https://jinbo.life/api/classes/class_uuid_12345 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "max_students": 20,
    "description": "Updated description",
    "pricing": {
      "amount": 6000,
      "currency": "INR"
    }
  }'

👥 STEP 4: ASSIGN COACHES TO CLASSES

4.1 First, Create/Invite Coach

Endpoint: POST /api/users/invite

Request:

curl -X POST https://jinbo.life/api/users/invite \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "coach@wearehybrid.in",
    "name": "Priya Sharma",
    "role": "coach",
    "skills": ["yoga", "pilates", "meditation"],
    "send_email": true
  }'

Response:

{
  "success": true,
  "user": {
    "id": "user_uuid_coach1",
    "email": "coach@wearehybrid.in",
    "name": "Priya Sharma",
    "role": "coach",
    "invitation_sent": true
  }
}

4.2 Assign Coach to Class

Endpoint: POST /api/classes/:classId/assign-coach

Request:

curl -X POST https://jinbo.life/api/classes/class_uuid_12345/assign-coach \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "coach_id": "user_uuid_coach1"
  }'

Response:

{
  "success": true,
  "class": {
    "id": "class_uuid_12345",
    "name": "Yoga for Beginners",
    "coach": {
      "id": "user_uuid_coach1",
      "name": "Priya Sharma",
      "email": "coach@wearehybrid.in"
    },
    "assigned_at": "2025-10-02T02:00:00Z"
  }
}

4.3 Update Coach Assignment

Replace Coach:

curl -X PATCH https://jinbo.life/api/classes/class_uuid_12345/coach \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "coach_id": "user_uuid_coach2"
  }'

Remove Coach:

curl -X DELETE https://jinbo.life/api/classes/class_uuid_12345/coach \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

📖 COMPLETE API REFERENCE

Classes Endpoints

Method Endpoint Description Auth Required
GET /api/classes List all classes
GET /api/classes/:id Get class details
POST /api/classes Create new class ✅ Admin
POST /api/classes/bulk Bulk create classes ✅ Admin
PATCH /api/classes/:id Update class ✅ Admin
DELETE /api/classes/:id Delete class ✅ Admin
POST /api/classes/:id/assign-coach Assign coach ✅ Admin
DELETE /api/classes/:id/coach Remove coach ✅ Admin
POST /api/classes/:id/enroll Enroll student ✅ Coach/Admin

Coaches Endpoints

Method Endpoint Description Auth Required
GET /api/coaches List all coaches
GET /api/coaches/:id Get coach details
POST /api/users/invite Invite new coach ✅ Admin
PATCH /api/coaches/:id Update coach ✅ Admin
DELETE /api/coaches/:id Delete coach ✅ Admin
GET /api/coaches/:id/classes Get coach's classes

Students Endpoints

Method Endpoint Description Auth Required
GET /api/students List all students ✅ Coach
GET /api/students/:id Get student details ✅ Coach
POST /api/students Add new student ✅ Coach/Admin
PATCH /api/students/:id Update student ✅ Coach/Admin
GET /api/students/:id/progress Get progress ✅ Coach

💻 EXAMPLES & CODE SAMPLES

Example 1: Complete Class Creation Flow (JavaScript)

// 1. Login and get token
async function loginAndCreateClass() {
  // Step 1: Login
  const loginResponse = await fetch('https://legacy-integration.cloud/auth/login', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      email: 'admin@legacy-integration.cloud',
      password: 'your_password'
    })
  });
  
  const { token } = await loginResponse.json();
  
  // Step 2: Create Class
  const classResponse = await fetch('https://jinbo.life/api/classes', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Yoga for Beginners',
      description: 'Beginner-friendly yoga sessions',
      skill_id: 'skill_yoga',
      level: 'beginner',
      max_students: 15,
      duration_minutes: 60
    })
  });
  
  const newClass = await classResponse.json();
  console.log('Created Class:', newClass);
  
  // Step 3: Assign Coach
  const assignResponse = await fetch(
    `https://jinbo.life/api/classes/${newClass.class.id}/assign-coach`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        coach_id: 'user_uuid_coach1'
      })
    }
  );
  
  const result = await assignResponse.json();
  console.log('Coach Assigned:', result);
}

loginAndCreateClass();

Example 2: Bulk Create Classes (Python)

import requests

# Configuration
API_BASE = 'https://jinbo.life/api'
JWT_TOKEN = 'your_jwt_token_here'

headers = {
    'Authorization': f'Bearer {JWT_TOKEN}',
    'Content-Type': 'application/json'
}

# Define classes to create
classes_data = {
    'classes': [
        {
            'name': 'Morning Yoga',
            'skill_id': 'skill_yoga',
            'level': 'beginner',
            'max_students': 15,
            'schedule': {
                'days': ['monday', 'wednesday', 'friday'],
                'time': '07:00'
            }
        },
        {
            'name': 'Evening Pilates',
            'skill_id': 'skill_pilates',
            'level': 'intermediate',
            'max_students': 12,
            'schedule': {
                'days': ['tuesday', 'thursday'],
                'time': '18:00'
            }
        },
        {
            'name': 'Weekend CrossFit',
            'skill_id': 'skill_crossfit',
            'level': 'advanced',
            'max_students': 20,
            'schedule': {
                'days': ['saturday', 'sunday'],
                'time': '09:00'
            }
        }
    ]
}

# Create classes in bulk
response = requests.post(
    f'{API_BASE}/classes/bulk',
    headers=headers,
    json=classes_data
)

if response.status_code == 200:
    result = response.json()
    print(f"✅ Created {result['created']} classes")
    for cls in result['classes']:
        print(f"  - {cls['name']} (ID: {cls['id']})")
else:
    print(f"❌ Error: {response.json()}")

Example 3: Assign Multiple Coaches (Node.js)

const axios = require('axios');

const API_BASE = 'https://jinbo.life/api';
const JWT_TOKEN = 'your_jwt_token_here';

const config = {
  headers: {
    'Authorization': `Bearer ${JWT_TOKEN}`,
    'Content-Type': 'application/json'
  }
};

// Class-Coach assignments
const assignments = [
  { class_id: 'class_uuid_1', coach_id: 'coach_uuid_1' },
  { class_id: 'class_uuid_2', coach_id: 'coach_uuid_2' },
  { class_id: 'class_uuid_3', coach_id: 'coach_uuid_1' }, // Same coach for 2 classes
];

async function assignCoaches() {
  for (const assignment of assignments) {
    try {
      const response = await axios.post(
        `${API_BASE}/classes/${assignment.class_id}/assign-coach`,
        { coach_id: assignment.coach_id },
        config
      );
      
      console.log(`✅ Assigned coach to class ${assignment.class_id}`);
    } catch (error) {
      console.error(`❌ Failed for class ${assignment.class_id}:`, error.message);
    }
  }
}

assignCoaches();

🔒 SECURITY BEST PRACTICES

1. Protect Your API Credentials

DON'T:

// Never hardcode in source code
const API_KEY = 'jinbo_live_1234567890'; // BAD!

DO:

// Use environment variables
const API_KEY = process.env.JINBO_API_KEY; // GOOD!

2. Use HTTPS Only

// Always use HTTPS
const API_BASE = 'https://jinbo.life/api'; // ✅ Secure
// const API_BASE = 'http://jinbo.life/api'; // ❌ Insecure

3. Implement Rate Limiting

// Add delays between bulk operations
async function createClassesWithDelay(classes) {
  for (const classData of classes) {
    await createClass(classData);
    await new Promise(resolve => setTimeout(resolve, 1000)); // 1 second delay
  }
}

4. Handle Errors Gracefully

async function safeAPICall(url, options) {
  try {
    const response = await fetch(url, options);
    
    if (!response.ok) {
      const error = await response.json();
      console.error('API Error:', error.message);
      return null;
    }
    
    return await response.json();
  } catch (error) {
    console.error('Network Error:', error.message);
    return null;
  }
}

📊 TESTING YOUR INTEGRATION

Test Checklist

# 1. Test authentication
curl -X POST https://legacy-integration.cloud/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"admin@legacy-integration.cloud","password":"your_password"}'

# 2. Test create class
curl -X POST https://jinbo.life/api/classes \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Test Class","skill_id":"test","level":"beginner"}'

# 3. Test assign coach
curl -X POST https://jinbo.life/api/classes/CLASS_ID/assign-coach \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"coach_id":"COACH_ID"}'

# 4. Test retrieve classes
curl -X GET https://jinbo.life/api/classes \
  -H "Authorization: Bearer YOUR_TOKEN"

🆘 SUPPORT & TROUBLESHOOTING

Common Errors

401 Unauthorized

{
  "error": "Authentication required",
  "message": "Please provide a valid JWT token"
}

Solution: Check your token is valid and not expired.

403 Forbidden

{
  "error": "Access denied",
  "message": "This resource requires admin role"
}

Solution: Your account needs admin permissions for this action.

404 Not Found

{
  "error": "Resource not found",
  "message": "Class with ID 'xyz' does not exist"
}

Solution: Verify the resource ID is correct.

429 Too Many Requests

{
  "error": "Rate limit exceeded",
  "message": "Please slow down your requests"
}

Solution: Add delays between API calls (see rate limiting section).


📞 CONTACT & SUPPORT

For API Support:

Documentation:


🎯 QUICK START SUMMARY

For WE ARE HYBRID. IN (admin@legacy-integration.cloud):

  1. Login → Get JWT token from Legacy Integration
  2. Create Brand → Register "WE ARE HYBRID. IN"
  3. Get API Key → For automated integrations
  4. Create Classes → Via POST /api/classes
  5. Invite Coaches → Via POST /api/users/invite
  6. Assign Coaches → Via POST /api/classes/:id/assign-coach
  7. Start Managing → Monitor via dashboard or API

Your credentials will be:


Last Updated: October 2, 2025
API Version: 2.2.0
JINBO Life Platform