Skip to main content

Internal API Reference

These endpoints are used for operating and managing the platform. They require admin access or are triggered by internal systems.

Base URL: https://rankfabric-edge.grocerybundles.workers.dev


Workflows​

Trigger Workflow​

POST /api/admin/workflow/:type

Types: domain-onboard, url-classify, keyword-classify, domain-classify, serp-tracking, app-details, asset-onboard, subscription-dispatch, crawl-run

Request (domain-onboard):

{
"domain": "example.com",
"project_id": "proj_abc123"
}

Response:

{
"success": true,
"workflow_id": "wf_xyz789",
"status": "running"
}

Get Workflow Status​

GET /api/admin/workflow/:type/:workflow_id

Response:

{
"id": "wf_xyz789",
"status": "running",
"steps": [
{"name": "fetch-backlinks", "status": "completed"},
{"name": "classify-urls", "status": "running"}
],
"output": null
}

Workflow Management​

POST /api/admin/workflow/:type/:id/pause
POST /api/admin/workflow/:type/:id/resume
DELETE /api/admin/workflow/:type/:id

List Workflows​

GET /api/admin/workflows/running
GET /api/admin/workflows/history
GET /api/admin/workflows/failures

Queue Management​

Queue Status​

GET /api/admin/queue-status

Response:

{
"queues": [
{
"name": "backlink-classify",
"messages": 150,
"consumers": 1
},
{
"name": "keyword-classify",
"messages": 42,
"consumers": 1
}
]
}

Purge Queue​

POST /api/admin/queue/:name/purge

Classification​

Classify URL​

POST /api/admin/classifier/classify

Request:

{
"url": "https://example.com/blog/seo-tips",
"use_workflow": true
}

Response:

{
"url": "https://example.com/blog/seo-tips",
"classification": {
"tier1_type": "media",
"content_type": "blog_post",
"topic": "seo",
"confidence": 0.87
},
"stages_completed": ["rules", "vectorize", "content", "llm"],
"cost": 0.0012
}

Classify Keyword​

POST /api/admin/classify-keyword

Request:

{
"keyword": "best seo tools 2025",
"use_workflow": true
}

Response:

{
"keyword": "best seo tools 2025",
"classification": {
"journey": "consideration",
"type": "product",
"branded": false,
"modifiers": ["time_sensitive"],
"confidence": 0.92
}
}

Classify Domain​

POST /api/admin/classifier/domain

Request:

{
"domain": "techcrunch.com",
"use_workflow": true
}

Domain Operations​

Domain Onboard​

POST /api/admin/domains/onboard

Request:

{
"domain": "example.com",
"project_id": "proj_abc123",
"options": {
"backlinks_limit": 100,
"keywords_limit": 500
}
}

Recategorize Domain​

POST /taxonomy/re-categorize

Request:

{
"project_id": "proj_abc123",
"domain": "example.com"
}

Bulk Operations​

Bulk Save Keywords​

Requires JWT authentication (internal use).

POST /keywords/bulk_save

Request:

{
"project_id": "proj_abc123",
"keywords": ["seo tools", "keyword research", "backlink checker"],
"source": "ui",
"parent_seed": "kw_parent123"
}

Response:

{
"saved": 3
}

Cost Tracking​

Get Costs Summary​

GET /api/admin/costs

Response:

{
"summary": {
"dataforseo": 45.23,
"llm": 12.50,
"vectorize": 0.85
},
"period": "2025-12"
}

Get Costs by Project​

GET /api/admin/costs/by-project

Get Daily Costs​

GET /api/admin/costs/daily

App Store Operations​

Trigger Taxonomy Crawl​

POST /api/admin/taxonomy-crawl

Request:

{
"platform": "apple",
"category_ids": [6014, 6016]
}

App Store Grouping​

POST /api/app-store/grouping

DataForSEO Operations​

Check Task Status​

GET /api/admin/dataforseo/tasks/:task_id

Debug DataForSEO​

POST /debug/dataforseo

Database Operations​

Debug Schema​

GET /api/debug/schema

Response:

{
"tables": [
{"name": "domains", "columns": 15},
{"name": "keywords", "columns": 20},
{"name": "urls", "columns": 18}
]
}

Run Migration​

POST /api/admin/migrate

Diagnostics​

Health Check​

GET /health

ClickHouse Status​

GET /test/clickhouse

Initialize ClickHouse​

POST /init/clickhouse

Keyword Diagnostics​

GET /diagnostics/keyword?keyword=test

Cron Jobs​

Subscription Dispatch (Daily)​

Triggered automatically at 2 AM UTC, or manually:

POST /api/admin/workflow/subscription-dispatch

Request:

{
"dry_run": false,
"project_id": "proj_abc123",
"limit": 1000
}

Authentication Notes​

Endpoint PatternAuth Type
/api/*API Key (Bearer or query)
/api/admin/*API Key
/keywords/bulk_saveJWT (BASE44_JWT_SECRET)
/generate-taxonomyJWT
/taxonomy/*JWT
/api/public/*None
/*webhook*None (webhook signature)

Internal Queues​

QueueBindingPurpose
rankfabric-tasks-v2QUEUEGeneral task queue
backlink-classifyBACKLINK_CLASSIFY_QUEUEURL classification
keyword-classifyKEYWORD_CLASSIFY_QUEUEKeyword classification
domain-classifyDOMAIN_CLASSIFY_QUEUEDomain classification
domain-onboardDOMAIN_ONBOARD_QUEUEDomain onboarding
llm-verificationLLM_VERIFY_QUEUELLM re-verification
app-info-fetchAPP_INFO_QUEUEApp metadata
app-keyword-searchAPP_KEYWORD_QUEUEApp keyword search
dlqDLQDead letter queue