Skip to content

Entorno en desarrollo activo: puedes notar cambios o funciones incompletas.

JAOT

Admin

Administrative endpoints for managing organizations, users, and credits at the system level. All admin endpoints are mounted at /api/v2/admin.

Danger: Admin endpoints modify system state. Use with caution in production. These endpoints require admin privileges -- requests from non-admin users receive a 403 Forbidden response.


Dashboard statistics

GET /api/v2/admin/stats

Returns aggregate statistics for the admin dashboard.

Authentication: API key (admin required)

import requests

response = requests.get(
    "https://jaot.io/api/v2/admin/stats",
    headers={"Authorization": "Bearer ok_live_admin_key..."}
)

stats = response.json()
print(f"Organizations: {stats['total_organizations']}")
print(f"Users: {stats['total_users']}")
print(f"Executions: {stats['total_executions']}")
print(f"Credits used: {stats['total_credits_used']}")
print(f"Active orgs (7d): {stats['active_organizations_7d']}")

Response (200)

{
  "total_organizations": 42,
  "total_users": 156,
  "total_executions": 8920,
  "total_credits_used": 15400,
  "active_organizations_7d": 18
}

Response fields

FieldTypeDescription
total_organizationsintTotal registered organizations
total_usersintTotal registered users
total_executionsintTotal solver executions across all orgs
total_credits_usedintTotal credits consumed across all orgs
active_organizations_7dintOrganizations with activity in the last 7 days

List organizations

GET /api/v2/admin/organizations

List all organizations in the system with pagination.

Authentication: API key (admin required)

Query parameters

ParameterTypeDefaultDescription
pageint1Page number
page_sizeint20Items per page
searchstring--Search by organization name
response = requests.get(
    "https://jaot.io/api/v2/admin/organizations",
    headers={"Authorization": "Bearer ok_live_admin_key..."},
    params={"search": "acme", "page_size": 10}
)

data = response.json()
for org in data["items"]:
    print(f"{org['name']} (plan={org['plan']}, credits={org['credits_balance']})")

Organization overview

GET /api/v2/admin/organizations/{organization_id}/overview

Returns a single, read-only aggregate of everything about one organization — its configuration and limits, a full credit breakdown, execution statistics, and its members, API keys, models, most-recent executions and most-recent credit movements. Designed for "viewing" an organization without editing it. No state is modified.

Authentication: API key (admin required)

response = requests.get(
    "https://jaot.io/api/v2/admin/organizations/org_b7e4d1a0/overview",
    headers={"Authorization": "Bearer ok_live_admin_key..."},
)

data = response.json()
org = data["organization"]
print(f"{org['name']} (plan={org['plan']}, BYOK={org['byok_configured']})")
print(f"Users: {data['counts']['users']}, executions: {data['counts']['executions']}")
for user in data["users"]:
    print(f"  - {user['name']} ({user['email']}) role_admin={user['is_admin']}")

Response (200)

FieldTypeDescription
organizationobjectOrg config & limits: plan, credits_balance, credits_subscription, credits_purchased, credits_earned, credits_used_month, monthly_quota, rate_limit_per_minute, rate_limit_per_day, ai_builder_enabled, byok_configured (bool — whether the org has its own LLM key; the key is never returned), max_private_plugins, currency, is_active, is_verified, is_public_profile, slug, billing_email, website_url, created_at, owner_user_id
ownerobject | nullThe owning user (id, name, email)
countsobjectusers, active_users, api_keys, active_api_keys, models, executions
execution_statsobjecttotal, completed, failed, running, credits_consumed_total
usersarrayThe org's users (id, name, email, is_admin, can_build_plugins, is_active, created_at)
api_keysarrayThe org's API keys — key_prefix only; the secret is never returned
modelsarrayThe org's models (display_name, source: marketplace/custom, total_executions, total_credits_used, last_executed_at)
recent_executionsarrayUp to 20 most-recent solve executions
recent_transactionsarrayUp to 20 most-recent credit movements

List users

GET /api/v2/admin/users

List all users in the system with pagination.

Authentication: API key (admin required)

Query parameters

ParameterTypeDefaultDescription
pageint1Page number
page_sizeint20Items per page
searchstring--Search by name or email
response = requests.get(
    "https://jaot.io/api/v2/admin/users",
    headers={"Authorization": "Bearer ok_live_admin_key..."},
    params={"search": "alice"}
)

data = response.json()
for user in data["items"]:
    print(f"{user['name']} ({user['email']}) - org: {user['organization_id']}")

List all credit transactions

GET /api/v2/admin/credits/transactions

List credit transactions across all organizations. Useful for auditing credit flow.

Authentication: API key (admin required)

Query parameters

ParameterTypeDefaultDescription
pageint1Page number
page_sizeint20Items per page
organization_idstring--Filter by organization
transaction_typestring--Filter by type: purchase, execution, sale_earning, withdrawal, refund, adjustment
response = requests.get(
    "https://jaot.io/api/v2/admin/credits/transactions",
    headers={"Authorization": "Bearer ok_live_admin_key..."},
    params={"organization_id": "org_b7e4d1a0", "transaction_type": "execution"}
)

data = response.json()
for txn in data["items"]:
    print(f"{txn['id']}: {txn['credits_amount']:+d} credits ({txn['transaction_type']})")

Adjust credits

POST /api/v2/admin/credits/adjust

Manually adjust an organization's credit balance. Use positive values to add credits (promotional, compensation) or negative values to deduct credits.

Authentication: API key (admin required)

Request body

FieldTypeRequiredDescription
organization_idstringYesTarget organization
credits_amountintYesCredits to add (positive) or deduct (negative)
descriptionstringYesReason for the adjustment
response = requests.post(
    "https://jaot.io/api/v2/admin/credits/adjust",
    headers={"Authorization": "Bearer ok_live_admin_key..."},
    json={
        "organization_id": "org_b7e4d1a0",
        "credits_amount": 500,
        "description": "Promotional credits for beta participation"
    }
)

print(response.json())

Errors

StatusDescription
401Missing or invalid API key
403User is not an admin (is_admin must be true)
404Organization or user not found