Skip to content

Accounts API

Fresh

Source: BIBLE.md (Accounts Store routes)

16 routes for the account store.

Routes

MethodRouteBody / Query
GET/accounts?status=&clientId=&phase=&minHealth=&limit=
GET/accounts/army-status-
GET/accounts/ready?minHealth=
GET/accounts/by-client/:clientId-
GET/accounts/by-status/:status-
GET/accounts/:id-
POST/accounts{ email, ... }
PUT/accounts/:idpartial update
DELETE/accounts/:id-
POST/accounts/:id/lock{ campaignId }
POST/accounts/:id/unlock-
POST/accounts/:id/quarantine{ reason }
POST/accounts/:id/unquarantine-
POST/accounts/:id/mark-action{ type, result }
POST/accounts/:id/advance-phase-
POST/accounts/import{ registryPath, dryRun?, overwrite? }

List with filter

bash
curl "http://localhost:4700/accounts?status=active&phase=2&minHealth=50"

Army status

bash
curl http://localhost:4700/accounts/army-status

Aggregate counts by status, phase, client, and health bucket.

Lock/unlock for a campaign

bash
curl -X POST http://localhost:4700/accounts/abc123/lock \
  -H "Content-Type: application/json" \
  -H "x-api-key: ghost-engine-key" \
  -d '{ "campaignId":"dallas-junk-removal" }'

curl -X POST http://localhost:4700/accounts/abc123/unlock \
  -H "x-api-key: ghost-engine-key"

Mark action

bash
curl -X POST http://localhost:4700/accounts/abc123/mark-action \
  -H "Content-Type: application/json" \
  -d '{ "type": "ctr", "result": "success", "position": 7 }'

Bulk import

bash
curl -X POST http://localhost:4700/accounts/import \
  -H "Content-Type: application/json" \
  -d '{
    "registryPath": "./data/account-identity/registry.json",
    "dryRun": false,
    "overwrite": false
  }'