bitcain docs
API Reference

Admin

Admin dashboard - user management, platform statistics, and system configuration (requires admin role)

List Users

GET
/api/admin/users

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

page?integer

Page number

Default1
Range1 <= value
limit?integer

Items per page

Default10
Range1 <= value <= 100
search?|

Search email or name

role?|

Filter by role

status?|

Filter by status

subscriptionTier?|

Filter by tier

Response Body

application/json

application/json

curl -X GET "https://loading/api/admin/users"
{
  "users": [
    {
      "id": "string",
      "email": "string",
      "firstName": "",
      "lastName": "",
      "role": "admin",
      "subscriptionTier": "free",
      "status": "active",
      "createdAt": "string",
      "lastLogin": "string",
      "emailVerified": false,
      "twoFactorEnabled": false,
      "totalTrades": 0,
      "accountBalance": 0,
      "avatar": "string"
    }
  ],
  "total": 0,
  "page": 0,
  "limit": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get User

GET
/api/admin/users/{user_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

user_id*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/admin/users/string"
{
  "id": "string",
  "email": "string",
  "firstName": "",
  "lastName": "",
  "role": "admin",
  "subscriptionTier": "free",
  "status": "active",
  "createdAt": "string",
  "lastLogin": "string",
  "emailVerified": false,
  "twoFactorEnabled": false,
  "totalTrades": 0,
  "accountBalance": 0,
  "avatar": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Update User

PATCH
/api/admin/users/{user_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

user_id*string

Request Body

application/json

role?|
subscriptionTier?|
status?|
emailVerified?|
twoFactorEnabled?|

Response Body

application/json

application/json

curl -X PATCH "https://loading/api/admin/users/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "email": "string",
  "firstName": "",
  "lastName": "",
  "role": "admin",
  "subscriptionTier": "free",
  "status": "active",
  "createdAt": "string",
  "lastLogin": "string",
  "emailVerified": false,
  "twoFactorEnabled": false,
  "totalTrades": 0,
  "accountBalance": 0,
  "avatar": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Delete User

DELETE
/api/admin/users/{user_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

user_id*string

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/admin/users/string"
{
  "property1": true,
  "property2": true
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Stats

GET
/api/admin/stats

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/admin/stats"
{
  "totalUsers": 0,
  "activeUsers": 0,
  "suspendedUsers": 0,
  "newUsersThisMonth": 0,
  "totalRevenue": 0
}

Bulk Action

POST
/api/admin/users/bulk-action

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

userIds*array<>
action*string
Value in"activate" | "suspend" | "delete" | "export"

Response Body

application/json

application/json

curl -X POST "https://loading/api/admin/users/bulk-action" \  -H "Content-Type: application/json" \  -d '{    "userIds": [      "string"    ],    "action": "activate"  }'
{
  "property1": true,
  "property2": true
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Reset Password

POST
/api/admin/users/reset-password

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

userId*string

User ID

email*string

User email

sendEmail?boolean

Send email with new password

Defaulttrue

Response Body

application/json

application/json

curl -X POST "https://loading/api/admin/users/reset-password?userId=string&email=string"
{
  "property1": true,
  "property2": true
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get User Activity

GET
/api/admin/users/{user_id}/activity

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

user_id*string

Query Parameters

limit?integer
Default20
Range1 <= value <= 100

Response Body

application/json

application/json

curl -X GET "https://loading/api/admin/users/string/activity"
[
  {}
]
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Create Command Center Task

POST
/api/admin/command-center/tasks

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

title*string
Length3 <= length <= 200
description?|
priority?string
Default"medium"
Value in"critical" | "high" | "medium" | "low"
assignee?|
repo?|
Default"bitcainnet/bitcainnet"
source_type?|
Default"human"
source_id?|
goal_id?|
parent_task_id?|
blocked_by?array<>
comment?|

Response Body

application/json

application/json

curl -X POST "https://loading/api/admin/command-center/tasks" \  -H "Content-Type: application/json" \  -d '{    "title": "string"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Update Command Center Task

PATCH
/api/admin/command-center/tasks/{task_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

task_id*string

agent_tasks UUID

Request Body

application/json

status?|
assignee?|
priority?|
goal_id?|
parent_task_id?|
result?|
comment?|

Response Body

application/json

application/json

curl -X PATCH "https://loading/api/admin/command-center/tasks/string" \  -H "Content-Type: application/json" \  -d '{}'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Create Command Center Task Comment

POST
/api/admin/command-center/tasks/{task_id}/comments

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

task_id*string

agent_tasks UUID

Request Body

application/json

body*string
Length1 <= length <= 5000

Response Body

application/json

application/json

curl -X POST "https://loading/api/admin/command-center/tasks/string/comments" \  -H "Content-Type: application/json" \  -d '{    "body": "string"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Rag Settings

GET
/api/v1/admin/rag-settings

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/v1/admin/rag-settings"
{
  "id": "string",
  "enabled_sources": {
    "property1": true,
    "property2": true
  },
  "collection_limits": {
    "property1": 0,
    "property2": 0
  },
  "collection_interval_minutes": 5,
  "auto_expiration_days": 1,
  "max_posts_per_run": 100,
  "version": 0,
  "created_at": "string",
  "updated_at": "string",
  "updated_by": "string"
}

Update Rag Settings

PUT
/api/v1/admin/rag-settings

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

enabled_sources?|

Map of source names to enabled status

collection_limits?|

Map of source names to max post limits

collection_interval_minutes?|

Collection interval in minutes (5-180)

auto_expiration_days?|

Auto-expiration in days (1-365)

max_posts_per_run?|

Max posts per collection run (100-10000)

version?|

Current version for optimistic locking (prevents conflicts)

Response Body

application/json

application/json

curl -X PUT "https://loading/api/v1/admin/rag-settings" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "enabled_sources": {
    "property1": true,
    "property2": true
  },
  "collection_limits": {
    "property1": 0,
    "property2": 0
  },
  "collection_interval_minutes": 5,
  "auto_expiration_days": 1,
  "max_posts_per_run": 100,
  "version": 0,
  "created_at": "string",
  "updated_at": "string",
  "updated_by": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

List Api Keys

GET
/api/v1/admin/api-keys

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

include_inactive?boolean
Defaultfalse

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/admin/api-keys"
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "provider": "openai",
    "key_prefix": "string",
    "is_active": true,
    "last_used_at": "2019-08-24T14:15:22Z",
    "usage_count": 0,
    "last_rotated_at": "2019-08-24T14:15:22Z",
    "rotation_reminder_days": 90,
    "next_rotation_date": "2019-08-24T14:15:22Z",
    "notes": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
    "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
  }
]
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Create Api Key

POST
/api/v1/admin/api-keys

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

provider*string
Value in"openai" | "anthropic" | "gemini" | "openrouter" | "perplexity" | "brave" | "duckduckgo"
api_key*string

Plaintext API key to encrypt

Length10 <= length
rotation_reminder_days?integer

Days between rotation reminders (30-365)

Default90
Range30 <= value <= 365
notes?|

Optional notes

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/admin/api-keys" \  -H "Content-Type: application/json" \  -d '{    "provider": "openai",    "api_key": "stringstri"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "provider": "openai",
  "key_prefix": "string",
  "is_active": true,
  "last_used_at": "2019-08-24T14:15:22Z",
  "usage_count": 0,
  "last_rotated_at": "2019-08-24T14:15:22Z",
  "rotation_reminder_days": 90,
  "next_rotation_date": "2019-08-24T14:15:22Z",
  "notes": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
  "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Delete Api Key

DELETE
/api/v1/admin/api-keys/{key_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

key_id*string
Formatuuid

Response Body

application/json

curl -X DELETE "https://loading/api/v1/admin/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Update Api Key

PUT
/api/v1/admin/api-keys/{key_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

key_id*string
Formatuuid

Request Body

application/json

is_active?|

Activate or deactivate key

rotation_reminder_days?|

Update rotation reminder interval

notes?|

Update notes

last_rotated_at?|

Mark key as rotated (updates next_rotation_date)

Response Body

application/json

application/json

curl -X PUT "https://loading/api/v1/admin/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "provider": "openai",
  "key_prefix": "string",
  "is_active": true,
  "last_used_at": "2019-08-24T14:15:22Z",
  "usage_count": 0,
  "last_rotated_at": "2019-08-24T14:15:22Z",
  "rotation_reminder_days": 90,
  "next_rotation_date": "2019-08-24T14:15:22Z",
  "notes": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
  "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Test Api Key

POST
/api/v1/admin/api-keys/{key_id}/test

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

key_id*string
Formatuuid

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/admin/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/test"
{
  "provider": "openai",
  "is_valid": true,
  "error_message": "string",
  "response_time_ms": 0,
  "tested_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Rotation Reminders

GET
/api/v1/admin/api-keys/rotation-reminders

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/v1/admin/api-keys/rotation-reminders"
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "provider": "openai",
    "key_prefix": "string",
    "next_rotation_date": "2019-08-24T14:15:22Z",
    "days_until_rotation": 0
  }
]