Documentation
Dragonite
API

Dragonite API

Dragonite has an HTTP API on api_host:api_port (default port 7272). Dragonite Admin uses it, and so can your own tools and scripts.

Each Dragonite instance serves interactive API docs at /docs with the full request and response schemas for your version (OpenAPI document at /openapi.json and /openapi.yaml). This page is an overview.

⚠️

Keep the Dragonite API on 127.0.0.1 or a private network ([general] api_host), and never expose it to the internet. People use Dragonite Admin with its login. Scripts and tools go through Dragonite Admin as well: set api_secret in the admin config and send it in the X-Dragonite-Admin-Secret header.

Most actions accept POST. The GET variants of actions are kept for older tools.

Status

MethodPathDescription
GET/healthHealth check.
GET/statusWorker counts per area, active schedules, pools and queues.
GET/status/quest-area/{area_id}Quest progress of an area.
GET/config/Instance name, version and whether Koji is available.

Control

MethodPathDescription
POST/reloadReload config.toml.
POST/reload/accountsReload accounts from the database.
POST/reload/proxyReload proxies from the database.
POST/log-rotateRotate log files.
GET/global-rate-limitGlobal rate limit state.
POST/global-rate-limit/pause, /global-rate-limit/resetPause or reset the global rate limit.

Areas

MethodPathDescription
GET, POST/v2/areas/List or create areas.
GET, PATCH, DELETE/v2/areas/{area_id}Read, update or delete an area.
POST/recalculate/{area_id}/pokemon, /fort, /questRecalculate a route with Koji.
POST/quest/{area_id}/start, /quest/{area_id}/stopStart or stop questing in an area. ?clear=false keeps existing quests.
POST/quest/all/start, /quest/all/stopStart or stop questing in all active areas.

The older /areas/ endpoints still exist. /v2/areas additionally accepts GeoJSON geofences, including multipolygons, and per-mode geofences. See Areas & Modes for the area options.

Accounts

MethodPathDescription
GET, POST, DELETE/v2/accounts/List, create or delete accounts.
POST/v2/accounts/bulkImport many accounts.
GET, PATCH, DELETE/v2/accounts/{username}Read, update or delete one account.
POST/v2/accounts/make-available, /v2/accounts/{username}/make-availableMake accounts available now.
POST/v2/accounts/clear-cooldown, /v2/accounts/{username}/clear-cooldownClear cooldowns.
POST/v2/accounts/reset-{banned,suspended,disabled,auth-banned,invalid} (also per {username})Reset an account state.
GET/accounts/stats, /accounts/level-statsAccount totals by state and by level.

Proxies

MethodPathDescription
GET, POST/proxies/List or add proxies.
POST/proxies/bulkAdd many proxies.
GET, PATCH, DELETE/proxies/{proxy_id}Read, update or delete a proxy.
GET/proxies/stats, /proxies/stats/{proxy_id}Proxy statistics.

Global modes

MethodPathDescription
GET, POST, PATCH, DELETE/modes/level/, /modes/scout/, /modes/invasion/Configure the global mode pools.
GET/modes/level/stats, /modes/scout/statsLevel and scout statistics.
DELETE/modes/scout/clear, /modes/invasion/clearClear the scout or invasion queue.

Scout

MethodPathDescription
POST/scout/v2Queue scouts at one or more coordinates.
GET/scout?lat=..&lon=..Queue a single scout.
GET/scout/queueNumber of queued scouts.
DELETE/scout/clearClear the scout queue.

Rare Pokémon

MethodPathDescription
GET/rare-pokemon/queue, /rare-pokemon/queue/{area_id}Queued rare Pokémon.
GET/rare-pokemon/rarity, /rare-pokemon/rarity/{area_id}Species rarity per area.

Scheduler

MethodPathDescription
GET, POST/scheduler/schedulesList or create schedules.
GET, PUT, DELETE/scheduler/schedules/{id}Read, replace or delete a schedule.
POST/scheduler/schedules/{id}/enable, /disableEnable or disable a schedule.
GET, POST/scheduler/groupsList or create groups.
GET, PUT, DELETE/scheduler/groups/{id}Read, replace or delete a group.
POST, DELETE/scheduler/groups/{id}/areas, /scheduler/groups/{id}/areas/{area_id}Add or remove an area.
GET/scheduler/runsRecent job runs.
POST/scheduler/runsRun a job action now.
GET/scheduler/activeCurrently active schedule effects.
GET/scheduler/areasAreas with the timezone used for schedules.
GET/scheduler/diagnosticsConfiguration problems.
POST/scheduler/quest-migrationConvert legacy quest hours into scheduler actions.

See Scheduler for the schedule format.

Metrics and debugging

MethodPathDescription
GET/metricsPrometheus metrics, when [prometheus] enabled = true.
GET/debug/logging/on, /debug/logging/offSwitch debug logging at runtime.
GET/debug/pprof/...Go profiling endpoints.