Docs/Guides/Infraction Importing
Infraction Importing
Bring another bot's moderation history into HepBoat over the API.
Requires the WEB_API feature and an API key with the import scope.
If your server has years of history in another bot, import it: searches, escalation decisions and appeals all get better when the past is on the record.
The shape
Import is a bulk API endpoint that accepts JSON arrays of historical
infractions - type, target, moderator, reason, timestamps, and (for timed
actions) expiry. Imported records are numbered into your server's sequence.
To keep provenance, put your own marker in each record's metadata (for
example {"source": "old-bot"}) - the API stores it verbatim, and nothing
is added for you. That marker is worth setting: it is the thing that makes a
batch identifiable afterwards if you ever need it picked out again.
Types. Send the type as a NAME rather than a number - ban, unban,
kick, mute, tempmute, mutehard, tempmutehard, tempban, softban,
cleanban, warning, note, timeout, selfmute. Names are the safe form:
every bot numbers its own types differently, so a numeric type copied straight
out of another tool usually maps to the wrong thing here, and the import will
happily accept it. Note warning rather than "warn", and that some tools have
an unmute type with no equivalent here - drop those records or bring them over
as notes.
Active bans. Imported records default to inactive, because an import is history. If a ban is still in force and you want it to behave like one - which includes being appealable through the self-serve appeal page
- set
activeto true on that record.
The process
- Export from your old bot (most can produce JSON or CSV; massage it to the import shape).
- Create an API key with the
importscope on the dashboard's API page. - POST batches to the import endpoint - the exact body shape, batch size, and quota rules are in the Web API reference.
- Spot-check with
!infractions searchagainst members whose history you know.
Send one batch at a time and wait for each response before sending the next. An import is a single request rather than a queued job, so a connection lost mid-import can leave part of that batch already written. If one fails, check what actually landed before retrying - sending the same batch twice inserts it twice.
Getting your data out again
The same page issues export-scoped keys; export produces the complete
infraction set as JSON. Your data stays yours in both directions.