Skip to content

Endpoint reference

Base URL: https://phantombot.gg/api/v1

Every endpoint requires Authorization: Bearer phk_live_…. The scope column tells you which permission the token needs — see Authentication.

Collection endpoints accept ?page=1&per_page=25. per_page is capped at 100; the default is 25. Responses include has_more so you can drive pagination without parsing Link headers.

Meta

MethodPathScopeWhat it does
GET/meThe token's metadata (id, name, scopes, last-used).
GET/healthLiveness probe. Returns { "status": "ok" }.

GET /me

bash
curl https://phantombot.gg/api/v1/me \
  -H "Authorization: Bearer phk_live_…"
json
{
  "token": {
    "id": "42",
    "name": "Production deploy script",
    "preview": "phk_live_AbCdEfGh…0123",
    "guild_id": "123456789012345678",
    "scopes": ["cases:read", "cases:write"],
    "expires_at": null,
    "created_at": "2026-05-24T10:30:00+00:00",
    "last_used_at": "2026-05-24T11:15:42+00:00"
  },
  "api": { "version": "v1", "env": "live" }
}

Guild

MethodPathScope
GET/guildguild:readHeadline metadata.
GET/guild/settingsguild:readModule toggles + a few public knobs.

Cases

MethodPathScope
GET/casescases:readList cases. Filters: user_id, type, status, since.
GET/cases/{id}cases:readA single case.
POST/casescases:writeCreate a note or warn case.

Create a case

bash
curl -X POST https://phantombot.gg/api/v1/cases \
  -H "Authorization: Bearer phk_live_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "234567890123456789",
    "moderator_id": "345678901234567890",
    "type": "warn",
    "reason": "Posting referral spam"
  }'

type is restricted to note or warn via this endpoint — punishments that change Discord state (kick, ban, timeout, mute) are not exposed yet. Use the dashboard or wait for the next release.

Emits case.created to subscribed webhooks.

Economy

MethodPathScope
GET/economy/wallet/{userId}economy:readWallet for one member. Returns a zero-balance shell if they haven't earned anything yet.
GET/economy/leaderboardeconomy:readTop wallets, descending.
POST/economy/adjusteconomy:writeAtomic balance change with a ledger row.

Adjust balance

bash
curl -X POST https://phantombot.gg/api/v1/economy/adjust \
  -H "Authorization: Bearer phk_live_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "user_id": "234567890123456789", "delta": 500, "reason": "Tournament prize" }'
  • delta is integer, can be negative.
  • Negative deltas that would push the balance below zero return 422 balance_would_be_negative.
  • Every adjustment writes a row to the economy ledger with note: "api:token=<your token id>" so audits can trace back to source.

Emits economy.balance_changed.

Levelling

MethodPathScope
GET/levelling/user/{userId}levelling:readOne member's XP + level + progress to next level.
GET/levelling/leaderboardlevelling:readTop members by XP.

The user endpoint returns a sensible zero-shell for members who haven't sent a message yet (level 0, full bar empty).

Tickets

MethodPathScope
GET/ticketstickets:readList tickets. Filters: status, opener_id, claimed_by_id.
GET/tickets/{id}tickets:readA single ticket.

Write endpoints (reply, claim, close) are landing in the next release.

Giveaways

MethodPathScope
GET/giveawaysgiveaways:readList giveaways. Filter: status.
GET/giveaways/{id}giveaways:readA single giveaway.

Write endpoints (end / reroll) are landing in the next release.

Phantom Network

MethodPathScope
GET/network/lookup/{userId}network:readCross-guild ban-intel lookup.

Returns { "data": { "listed": false } } for clean users and the full public hit summary (trust score, report count, category, severity, first/last report) for listed ones.

Response envelopes

Collections always look like this:

json
{
  "data":     [ /* … */ ],
  "page":     1,
  "per_page": 25,
  "has_more": true
}

Singletons look like this:

json
{ "data": { /* … */ } }

Errors:

json
{ "error": { "code": "…", "message": "…" } }

Phantom is a product of Hydra Labs. The bot is run as a managed service; you do not need to host it yourself.