1
0

openapi.yaml 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822
  1. openapi: '3.0.3'
  2. info:
  3. title: IRDB — IP Reputation Database
  4. version: '1.0.0'
  5. description: |
  6. Self-hosted IP reputation service: ingest abuse reports, distribute tailored block lists.
  7. ## Versioning
  8. Single major version `v1`. Changes within `v1` are additive only — new endpoints, new optional fields, new optional query params. Breaking changes ship as `v2`.
  9. ## Endpoint groups
  10. - **Public**: machine clients (reporters, consumers).
  11. - **Admin**: UI BFF + admin-kind tokens. RBAC enforced server-side.
  12. - **Auth**: UI BFF only — bridges browser auth to user records. Marked `x-internal: true`.
  13. - **Internal jobs**: not in this spec. Scheduler-only, network-restricted.
  14. ## Authentication
  15. Bearer token in the `Authorization` header. Four token kinds: `reporter`, `consumer`, `admin`, `service`. See `doc/auth-flows.md`.
  16. ## Errors
  17. Uniform envelope: `{"error":"<code>","details":{...}}`. Validation errors include `details`. Authentication failures return `401` `unauthorized`. Authorization failures return `403`.
  18. ## Rate limiting
  19. Public endpoints: 60 req/s/token (configurable). On exhaustion: `429` with `Retry-After: 1`.
  20. license:
  21. name: TBD
  22. servers:
  23. - url: http://localhost:8081
  24. description: Default compose deployment
  25. - url: https://reputation-api.example.com
  26. description: Production (replace hostname)
  27. tags:
  28. - name: Public
  29. description: 'Machine clients: reporters and blocklist consumers.'
  30. - name: Admin
  31. description: UI BFF + admin-kind tokens.
  32. - name: Auth
  33. description: UI BFF only. Service token required, no impersonation.
  34. security:
  35. - BearerAuth: []
  36. paths:
  37. '/api/v1/report':
  38. post:
  39. tags:
  40. - Public
  41. summary: Submit an abuse report
  42. description: |
  43. Token kind: `reporter`. Rate limit: 60 req/s per token (configurable).
  44. Returns `202 Accepted` on success.
  45. security:
  46. - BearerAuth: []
  47. requestBody:
  48. required: true
  49. content:
  50. 'application/json':
  51. schema:
  52. '$ref': '#/components/schemas/ReportRequest'
  53. responses:
  54. '202':
  55. description: Report accepted
  56. content:
  57. 'application/json':
  58. schema:
  59. '$ref': '#/components/schemas/ReportResponse'
  60. '400':
  61. description: Validation failed
  62. content:
  63. 'application/json':
  64. schema:
  65. '$ref': '#/components/schemas/Error'
  66. '401':
  67. description: Bad / wrong-kind token
  68. content:
  69. 'application/json':
  70. schema:
  71. '$ref': '#/components/schemas/Error'
  72. '429':
  73. description: Rate limited
  74. headers:
  75. Retry-After:
  76. schema:
  77. type: integer
  78. description: Seconds to wait before retrying.
  79. content:
  80. 'application/json':
  81. schema:
  82. '$ref': '#/components/schemas/Error'
  83. '/api/v1/blocklist':
  84. get:
  85. tags:
  86. - Public
  87. summary: Pull a tailored blocklist
  88. description: |
  89. Token kind: `consumer`. The consumer's bound policy decides which IPs/CIDRs land in the output.
  90. Cached internally for 30 s per consumer. Honour `If-None-Match` to skip retransfer.
  91. `?format=json` returns structured rows; default is `text/plain`, one entry per line.
  92. security:
  93. - BearerAuth: []
  94. parameters:
  95. - name: format
  96. in: query
  97. schema:
  98. type: string
  99. enum:
  100. - text
  101. - json
  102. default: text
  103. - name: If-None-Match
  104. in: header
  105. schema:
  106. type: string
  107. responses:
  108. '200':
  109. description: Current blocklist
  110. headers:
  111. ETag:
  112. schema:
  113. type: string
  114. X-Blocklist-Generated-At:
  115. schema:
  116. type: string
  117. format: date-time
  118. X-Blocklist-Entries:
  119. schema:
  120. type: integer
  121. X-Blocklist-Policy:
  122. schema:
  123. type: string
  124. content:
  125. 'text/plain':
  126. schema:
  127. type: string
  128. example: |
  129. 203.0.113.42
  130. 198.51.100.0/24
  131. 'application/json':
  132. schema:
  133. '$ref': '#/components/schemas/BlocklistJson'
  134. '304':
  135. description: Not modified — body matches `If-None-Match`
  136. '401':
  137. description: Bad / wrong-kind token
  138. '/api/v1/admin/me':
  139. get:
  140. tags:
  141. - Admin
  142. summary: Current acting identity
  143. security:
  144. - BearerAuth: []
  145. parameters:
  146. - '$ref': '#/components/parameters/ActingUserId'
  147. responses:
  148. '200':
  149. description: Identity info
  150. content:
  151. 'application/json':
  152. schema:
  153. '$ref': '#/components/schemas/User'
  154. '/api/v1/admin/ips':
  155. get:
  156. tags:
  157. - Admin
  158. summary: Search IPs
  159. security:
  160. - BearerAuth: []
  161. parameters:
  162. - '$ref': '#/components/parameters/ActingUserId'
  163. - name: q
  164. in: query
  165. schema:
  166. type: string
  167. - name: category
  168. in: query
  169. schema:
  170. type: string
  171. - name: min_score
  172. in: query
  173. schema:
  174. type: number
  175. format: float
  176. - name: max_score
  177. in: query
  178. schema:
  179. type: number
  180. format: float
  181. - name: country
  182. in: query
  183. schema:
  184. type: string
  185. - name: asn
  186. in: query
  187. schema:
  188. type: integer
  189. - name: status
  190. in: query
  191. schema:
  192. type: string
  193. enum:
  194. - scored
  195. - manual
  196. - allowlisted
  197. - clean
  198. - '$ref': '#/components/parameters/Page'
  199. - '$ref': '#/components/parameters/PageSize'
  200. responses:
  201. '200':
  202. description: Page of IPs
  203. content:
  204. 'application/json':
  205. schema:
  206. type: object
  207. properties:
  208. page:
  209. type: integer
  210. minimum: 1
  211. example: 1
  212. page_size:
  213. type: integer
  214. minimum: 1
  215. maximum: 200
  216. example: 50
  217. total:
  218. type: integer
  219. minimum: 0
  220. example: 1284
  221. items:
  222. type: array
  223. items:
  224. type: object
  225. '/api/v1/admin/ips/countries':
  226. get:
  227. tags:
  228. - Admin
  229. summary: Country code dropdown source
  230. security:
  231. - BearerAuth: []
  232. parameters:
  233. - '$ref': '#/components/parameters/ActingUserId'
  234. responses:
  235. '200':
  236. description: '`[{code, count}]`'
  237. content:
  238. 'application/json':
  239. schema:
  240. type: object
  241. properties:
  242. items:
  243. type: array
  244. items:
  245. type: object
  246. properties:
  247. code:
  248. type: string
  249. count:
  250. type: integer
  251. '/api/v1/admin/ips/{ip}':
  252. get:
  253. tags:
  254. - Admin
  255. summary: IP detail
  256. security:
  257. - BearerAuth: []
  258. parameters:
  259. - '$ref': '#/components/parameters/ActingUserId'
  260. - name: ip
  261. in: path
  262. required: true
  263. schema:
  264. type: string
  265. responses:
  266. '200':
  267. description: IP detail
  268. content:
  269. 'application/json':
  270. schema:
  271. '$ref': '#/components/schemas/IpDetail'
  272. '404':
  273. description: Invalid IP / not found
  274. '/api/v1/admin/stats/dashboard':
  275. get:
  276. tags:
  277. - Admin
  278. summary: Dashboard stats (30s cached)
  279. security:
  280. - BearerAuth: []
  281. parameters:
  282. - '$ref': '#/components/parameters/ActingUserId'
  283. responses:
  284. '200':
  285. description: Dashboard payload
  286. content:
  287. 'application/json':
  288. schema:
  289. type: object
  290. '/api/v1/admin/manual-blocks':
  291. get:
  292. tags:
  293. - Admin
  294. summary: List manual blocks
  295. security:
  296. - BearerAuth: []
  297. parameters:
  298. - '$ref': '#/components/parameters/ActingUserId'
  299. responses:
  300. '200':
  301. description: list
  302. post:
  303. tags:
  304. - Admin
  305. summary: Create manual block
  306. description: Operator+ role required. `kind=ip` requires `ip`; `kind=subnet` requires `cidr`.
  307. security:
  308. - BearerAuth: []
  309. parameters:
  310. - '$ref': '#/components/parameters/ActingUserId'
  311. requestBody:
  312. required: true
  313. content:
  314. 'application/json':
  315. schema:
  316. type: object
  317. properties:
  318. kind:
  319. type: string
  320. enum:
  321. - ip
  322. - subnet
  323. ip:
  324. type: string
  325. cidr:
  326. type: string
  327. reason:
  328. type: string
  329. expires_at:
  330. type: string
  331. format: date-time
  332. responses:
  333. '201':
  334. description: Created
  335. content:
  336. 'application/json':
  337. schema:
  338. '$ref': '#/components/schemas/ManualBlock'
  339. '/api/v1/admin/manual-blocks/{id}':
  340. get:
  341. tags:
  342. - Admin
  343. summary: Show manual block
  344. security:
  345. - BearerAuth: []
  346. parameters:
  347. - '$ref': '#/components/parameters/ActingUserId'
  348. - name: id
  349. in: path
  350. required: true
  351. schema:
  352. type: integer
  353. responses:
  354. '200':
  355. description: manual block
  356. content:
  357. 'application/json':
  358. schema:
  359. '$ref': '#/components/schemas/ManualBlock'
  360. delete:
  361. tags:
  362. - Admin
  363. summary: Delete manual block
  364. security:
  365. - BearerAuth: []
  366. parameters:
  367. - '$ref': '#/components/parameters/ActingUserId'
  368. - name: id
  369. in: path
  370. required: true
  371. schema:
  372. type: integer
  373. responses:
  374. '204':
  375. description: Deleted
  376. '/api/v1/admin/allowlist':
  377. get:
  378. tags:
  379. - Admin
  380. summary: List allowlist
  381. security:
  382. - BearerAuth: []
  383. parameters:
  384. - '$ref': '#/components/parameters/ActingUserId'
  385. responses:
  386. '200':
  387. description: list
  388. post:
  389. tags:
  390. - Admin
  391. summary: Create allowlist entry
  392. security:
  393. - BearerAuth: []
  394. parameters:
  395. - '$ref': '#/components/parameters/ActingUserId'
  396. requestBody:
  397. required: true
  398. content:
  399. 'application/json':
  400. schema:
  401. type: object
  402. properties:
  403. kind:
  404. type: string
  405. enum:
  406. - ip
  407. - subnet
  408. ip:
  409. type: string
  410. cidr:
  411. type: string
  412. reason:
  413. type: string
  414. responses:
  415. '201':
  416. description: Created
  417. content:
  418. 'application/json':
  419. schema:
  420. '$ref': '#/components/schemas/AllowlistEntry'
  421. '/api/v1/admin/allowlist/{id}':
  422. get:
  423. tags:
  424. - Admin
  425. summary: Show allowlist entry
  426. security:
  427. - BearerAuth: []
  428. parameters:
  429. - '$ref': '#/components/parameters/ActingUserId'
  430. - name: id
  431. in: path
  432. required: true
  433. schema:
  434. type: integer
  435. responses:
  436. '200':
  437. description: allowlist entry
  438. content:
  439. 'application/json':
  440. schema:
  441. '$ref': '#/components/schemas/AllowlistEntry'
  442. delete:
  443. tags:
  444. - Admin
  445. summary: Delete allowlist entry
  446. security:
  447. - BearerAuth: []
  448. parameters:
  449. - '$ref': '#/components/parameters/ActingUserId'
  450. - name: id
  451. in: path
  452. required: true
  453. schema:
  454. type: integer
  455. responses:
  456. '204':
  457. description: Deleted
  458. '/api/v1/admin/reporters':
  459. get:
  460. tags:
  461. - Admin
  462. summary: List reporters
  463. security:
  464. - BearerAuth: []
  465. parameters:
  466. - '$ref': '#/components/parameters/ActingUserId'
  467. responses:
  468. '200':
  469. description: list
  470. post:
  471. tags:
  472. - Admin
  473. summary: Create reporter
  474. security:
  475. - BearerAuth: []
  476. parameters:
  477. - '$ref': '#/components/parameters/ActingUserId'
  478. requestBody:
  479. required: true
  480. content:
  481. 'application/json':
  482. schema:
  483. '$ref': '#/components/schemas/Reporter'
  484. responses:
  485. '201':
  486. description: Created
  487. content:
  488. 'application/json':
  489. schema:
  490. '$ref': '#/components/schemas/Reporter'
  491. '/api/v1/admin/reporters/{id}':
  492. get:
  493. tags:
  494. - Admin
  495. summary: Show reporter
  496. security:
  497. - BearerAuth: []
  498. parameters:
  499. - '$ref': '#/components/parameters/ActingUserId'
  500. - name: id
  501. in: path
  502. required: true
  503. schema:
  504. type: integer
  505. responses:
  506. '200':
  507. description: reporter
  508. content:
  509. 'application/json':
  510. schema:
  511. '$ref': '#/components/schemas/Reporter'
  512. patch:
  513. tags:
  514. - Admin
  515. summary: Update reporter
  516. security:
  517. - BearerAuth: []
  518. parameters:
  519. - '$ref': '#/components/parameters/ActingUserId'
  520. - name: id
  521. in: path
  522. required: true
  523. schema:
  524. type: integer
  525. requestBody:
  526. content:
  527. 'application/json':
  528. schema:
  529. '$ref': '#/components/schemas/Reporter'
  530. responses:
  531. '200':
  532. description: Updated
  533. content:
  534. 'application/json':
  535. schema:
  536. '$ref': '#/components/schemas/Reporter'
  537. delete:
  538. tags:
  539. - Admin
  540. summary: Soft-delete reporter
  541. security:
  542. - BearerAuth: []
  543. parameters:
  544. - '$ref': '#/components/parameters/ActingUserId'
  545. - name: id
  546. in: path
  547. required: true
  548. schema:
  549. type: integer
  550. responses:
  551. '204':
  552. description: Deleted
  553. '409':
  554. description: Has reports — flagged inactive instead.
  555. '/api/v1/admin/consumers':
  556. get:
  557. tags:
  558. - Admin
  559. summary: List consumers
  560. security:
  561. - BearerAuth: []
  562. parameters:
  563. - '$ref': '#/components/parameters/ActingUserId'
  564. responses:
  565. '200':
  566. description: list
  567. post:
  568. tags:
  569. - Admin
  570. summary: Create consumer
  571. security:
  572. - BearerAuth: []
  573. parameters:
  574. - '$ref': '#/components/parameters/ActingUserId'
  575. requestBody:
  576. required: true
  577. content:
  578. 'application/json':
  579. schema:
  580. '$ref': '#/components/schemas/Consumer'
  581. responses:
  582. '201':
  583. description: Created
  584. content:
  585. 'application/json':
  586. schema:
  587. '$ref': '#/components/schemas/Consumer'
  588. '/api/v1/admin/consumers/{id}':
  589. get:
  590. tags:
  591. - Admin
  592. summary: Show consumer
  593. security:
  594. - BearerAuth: []
  595. parameters:
  596. - '$ref': '#/components/parameters/ActingUserId'
  597. - name: id
  598. in: path
  599. required: true
  600. schema:
  601. type: integer
  602. responses:
  603. '200':
  604. description: consumer
  605. content:
  606. 'application/json':
  607. schema:
  608. '$ref': '#/components/schemas/Consumer'
  609. patch:
  610. tags:
  611. - Admin
  612. summary: Update consumer
  613. security:
  614. - BearerAuth: []
  615. parameters:
  616. - '$ref': '#/components/parameters/ActingUserId'
  617. - name: id
  618. in: path
  619. required: true
  620. schema:
  621. type: integer
  622. requestBody:
  623. content:
  624. 'application/json':
  625. schema:
  626. '$ref': '#/components/schemas/Consumer'
  627. responses:
  628. '200':
  629. description: Updated
  630. delete:
  631. tags:
  632. - Admin
  633. summary: Soft-delete consumer
  634. security:
  635. - BearerAuth: []
  636. parameters:
  637. - '$ref': '#/components/parameters/ActingUserId'
  638. - name: id
  639. in: path
  640. required: true
  641. schema:
  642. type: integer
  643. responses:
  644. '204':
  645. description: Deleted
  646. '/api/v1/admin/tokens':
  647. get:
  648. tags:
  649. - Admin
  650. summary: List tokens
  651. description: Service tokens are filtered out unconditionally.
  652. security:
  653. - BearerAuth: []
  654. parameters:
  655. - '$ref': '#/components/parameters/ActingUserId'
  656. responses:
  657. '200':
  658. description: list
  659. post:
  660. tags:
  661. - Admin
  662. summary: Create token
  663. description: Returns the raw token ONCE in `raw_token`. Service tokens are not creatable here.
  664. security:
  665. - BearerAuth: []
  666. parameters:
  667. - '$ref': '#/components/parameters/ActingUserId'
  668. requestBody:
  669. required: true
  670. content:
  671. 'application/json':
  672. schema:
  673. type: object
  674. properties:
  675. kind:
  676. type: string
  677. enum:
  678. - reporter
  679. - consumer
  680. - admin
  681. reporter_id:
  682. type: integer
  683. consumer_id:
  684. type: integer
  685. role:
  686. type: string
  687. enum:
  688. - viewer
  689. - operator
  690. - admin
  691. expires_at:
  692. type: string
  693. format: date-time
  694. responses:
  695. '201':
  696. description: Created
  697. content:
  698. 'application/json':
  699. schema:
  700. '$ref': '#/components/schemas/TokenCreated'
  701. '/api/v1/admin/tokens/{id}':
  702. delete:
  703. tags:
  704. - Admin
  705. summary: Revoke token
  706. security:
  707. - BearerAuth: []
  708. parameters:
  709. - '$ref': '#/components/parameters/ActingUserId'
  710. - name: id
  711. in: path
  712. required: true
  713. schema:
  714. type: integer
  715. responses:
  716. '204':
  717. description: Revoked
  718. '/api/v1/admin/tokens/{id}/purge':
  719. delete:
  720. tags:
  721. - Admin
  722. summary: Permanently delete a revoked token
  723. description: |
  724. Hard-deletes the row. Requires the token to be already revoked
  725. (`revoked_at` set); active tokens return 409 to keep "revoke first,
  726. then prune" the only path that removes data. Service tokens cannot
  727. be deleted.
  728. security:
  729. - BearerAuth: []
  730. parameters:
  731. - '$ref': '#/components/parameters/ActingUserId'
  732. - name: id
  733. in: path
  734. required: true
  735. schema:
  736. type: integer
  737. responses:
  738. '204':
  739. description: Deleted
  740. '403':
  741. description: Service token; not deletable via API
  742. '404':
  743. description: Not found
  744. '409':
  745. description: Token still active; revoke it first
  746. '/api/v1/admin/categories':
  747. get:
  748. tags:
  749. - Admin
  750. summary: List categories
  751. security:
  752. - BearerAuth: []
  753. parameters:
  754. - '$ref': '#/components/parameters/ActingUserId'
  755. responses:
  756. '200':
  757. description: list
  758. post:
  759. tags:
  760. - Admin
  761. summary: Create category
  762. security:
  763. - BearerAuth: []
  764. parameters:
  765. - '$ref': '#/components/parameters/ActingUserId'
  766. requestBody:
  767. required: true
  768. content:
  769. 'application/json':
  770. schema:
  771. '$ref': '#/components/schemas/Category'
  772. responses:
  773. '201':
  774. description: Created
  775. content:
  776. 'application/json':
  777. schema:
  778. '$ref': '#/components/schemas/Category'
  779. '/api/v1/admin/categories/{id}':
  780. get:
  781. tags:
  782. - Admin
  783. summary: Show category
  784. security:
  785. - BearerAuth: []
  786. parameters:
  787. - '$ref': '#/components/parameters/ActingUserId'
  788. - name: id
  789. in: path
  790. required: true
  791. schema:
  792. type: integer
  793. responses:
  794. '200':
  795. description: category
  796. content:
  797. 'application/json':
  798. schema:
  799. '$ref': '#/components/schemas/Category'
  800. patch:
  801. tags:
  802. - Admin
  803. summary: Update category
  804. security:
  805. - BearerAuth: []
  806. parameters:
  807. - '$ref': '#/components/parameters/ActingUserId'
  808. - name: id
  809. in: path
  810. required: true
  811. schema:
  812. type: integer
  813. requestBody:
  814. content:
  815. 'application/json':
  816. schema:
  817. '$ref': '#/components/schemas/Category'
  818. responses:
  819. '200':
  820. description: Updated
  821. delete:
  822. tags:
  823. - Admin
  824. summary: Hard-delete category (refused if in use)
  825. security:
  826. - BearerAuth: []
  827. parameters:
  828. - '$ref': '#/components/parameters/ActingUserId'
  829. - name: id
  830. in: path
  831. required: true
  832. schema:
  833. type: integer
  834. responses:
  835. '204':
  836. description: Deleted
  837. '409':
  838. description: Category in use; soft-delete via PATCH `is_active=false`.
  839. '/api/v1/admin/policies':
  840. get:
  841. tags:
  842. - Admin
  843. summary: List policies
  844. security:
  845. - BearerAuth: []
  846. parameters:
  847. - '$ref': '#/components/parameters/ActingUserId'
  848. responses:
  849. '200':
  850. description: list
  851. post:
  852. tags:
  853. - Admin
  854. summary: Create policy
  855. security:
  856. - BearerAuth: []
  857. parameters:
  858. - '$ref': '#/components/parameters/ActingUserId'
  859. requestBody:
  860. required: true
  861. content:
  862. 'application/json':
  863. schema:
  864. '$ref': '#/components/schemas/Policy'
  865. responses:
  866. '201':
  867. description: Created
  868. content:
  869. 'application/json':
  870. schema:
  871. '$ref': '#/components/schemas/Policy'
  872. '/api/v1/admin/policies/{id}':
  873. get:
  874. tags:
  875. - Admin
  876. summary: Show policy
  877. security:
  878. - BearerAuth: []
  879. parameters:
  880. - '$ref': '#/components/parameters/ActingUserId'
  881. - name: id
  882. in: path
  883. required: true
  884. schema:
  885. type: integer
  886. responses:
  887. '200':
  888. description: policy
  889. content:
  890. 'application/json':
  891. schema:
  892. '$ref': '#/components/schemas/Policy'
  893. patch:
  894. tags:
  895. - Admin
  896. summary: Update policy (replaces thresholds wholesale when present)
  897. security:
  898. - BearerAuth: []
  899. parameters:
  900. - '$ref': '#/components/parameters/ActingUserId'
  901. - name: id
  902. in: path
  903. required: true
  904. schema:
  905. type: integer
  906. requestBody:
  907. content:
  908. 'application/json':
  909. schema:
  910. '$ref': '#/components/schemas/Policy'
  911. responses:
  912. '200':
  913. description: Updated
  914. delete:
  915. tags:
  916. - Admin
  917. summary: Delete policy (refused if used by consumers)
  918. security:
  919. - BearerAuth: []
  920. parameters:
  921. - '$ref': '#/components/parameters/ActingUserId'
  922. - name: id
  923. in: path
  924. required: true
  925. schema:
  926. type: integer
  927. responses:
  928. '204':
  929. description: Deleted
  930. '409':
  931. description: Policy in use
  932. '/api/v1/admin/policies/{id}/preview':
  933. get:
  934. tags:
  935. - Admin
  936. summary: Preview policy (count + sample)
  937. security:
  938. - BearerAuth: []
  939. parameters:
  940. - '$ref': '#/components/parameters/ActingUserId'
  941. - name: id
  942. in: path
  943. required: true
  944. schema:
  945. type: integer
  946. responses:
  947. '200':
  948. description: Preview
  949. '/api/v1/admin/audit-log':
  950. get:
  951. tags:
  952. - Admin
  953. summary: Filtered audit log
  954. security:
  955. - BearerAuth: []
  956. parameters:
  957. - '$ref': '#/components/parameters/ActingUserId'
  958. - name: actor_kind
  959. in: query
  960. schema:
  961. type: string
  962. enum:
  963. - user
  964. - admin-token
  965. - reporter
  966. - consumer
  967. - system
  968. - name: actor_id
  969. in: query
  970. schema:
  971. type: integer
  972. - name: action
  973. in: query
  974. schema:
  975. type: string
  976. - name: entity_type
  977. in: query
  978. schema:
  979. type: string
  980. - name: entity_id
  981. in: query
  982. schema:
  983. type: string
  984. - name: from
  985. in: query
  986. schema:
  987. type: string
  988. format: date-time
  989. - name: to
  990. in: query
  991. schema:
  992. type: string
  993. format: date-time
  994. - '$ref': '#/components/parameters/Page'
  995. - '$ref': '#/components/parameters/PageSize'
  996. responses:
  997. '200':
  998. description: Audit page
  999. content:
  1000. 'application/json':
  1001. schema:
  1002. type: object
  1003. properties:
  1004. page:
  1005. type: integer
  1006. minimum: 1
  1007. example: 1
  1008. page_size:
  1009. type: integer
  1010. minimum: 1
  1011. maximum: 200
  1012. example: 50
  1013. total:
  1014. type: integer
  1015. minimum: 0
  1016. example: 1284
  1017. items:
  1018. type: array
  1019. items:
  1020. '$ref': '#/components/schemas/AuditEntry'
  1021. '/api/v1/admin/jobs/status':
  1022. get:
  1023. tags:
  1024. - Admin
  1025. summary: Jobs status (Viewer)
  1026. security:
  1027. - BearerAuth: []
  1028. parameters:
  1029. - '$ref': '#/components/parameters/ActingUserId'
  1030. responses:
  1031. '200':
  1032. description: Jobs status
  1033. content:
  1034. 'application/json':
  1035. schema:
  1036. type: object
  1037. properties:
  1038. now:
  1039. type: string
  1040. format: date-time
  1041. jobs:
  1042. type: object
  1043. additionalProperties:
  1044. '$ref': '#/components/schemas/JobStatus'
  1045. '/api/v1/admin/jobs/trigger/{name}':
  1046. post:
  1047. tags:
  1048. - Admin
  1049. summary: Manually trigger a job (Admin)
  1050. description: 'Whitelisted params: `full`, `max_rows`, `reenrich`. Other body fields are dropped.'
  1051. security:
  1052. - BearerAuth: []
  1053. parameters:
  1054. - '$ref': '#/components/parameters/ActingUserId'
  1055. - name: name
  1056. in: path
  1057. required: true
  1058. schema:
  1059. type: string
  1060. requestBody:
  1061. content:
  1062. 'application/json':
  1063. schema:
  1064. type: object
  1065. properties:
  1066. full:
  1067. type: boolean
  1068. max_rows:
  1069. type: integer
  1070. reenrich:
  1071. type: boolean
  1072. responses:
  1073. '200':
  1074. description: Job ran
  1075. content:
  1076. 'application/json':
  1077. schema:
  1078. '$ref': '#/components/schemas/JobOutcome'
  1079. '404':
  1080. description: Unknown job
  1081. '409':
  1082. description: Lock held; status=`skipped_locked`
  1083. '412':
  1084. description: refresh-geoip without credential
  1085. '/api/v1/admin/config':
  1086. get:
  1087. tags:
  1088. - Admin
  1089. summary: Effective config (secrets masked)
  1090. description: Admin only.
  1091. security:
  1092. - BearerAuth: []
  1093. parameters:
  1094. - '$ref': '#/components/parameters/ActingUserId'
  1095. responses:
  1096. '200':
  1097. description: Config sections
  1098. content:
  1099. 'application/json':
  1100. schema:
  1101. type: object
  1102. properties:
  1103. sections:
  1104. type: object
  1105. additionalProperties:
  1106. type: object
  1107. '/api/v1/admin/app-settings':
  1108. get:
  1109. tags:
  1110. - Admin
  1111. summary: Runtime feature flags (Admin)
  1112. description: |
  1113. Returns the runtime-mutable feature flags. Currently exposes the
  1114. audit-emission toggles for high-volume public endpoints
  1115. (`audit_report_received_enabled`, `audit_blocklist_request_enabled`).
  1116. security:
  1117. - BearerAuth: []
  1118. parameters:
  1119. - '$ref': '#/components/parameters/ActingUserId'
  1120. responses:
  1121. '200':
  1122. description: Current toggle state
  1123. content:
  1124. 'application/json':
  1125. schema:
  1126. type: object
  1127. additionalProperties:
  1128. type: boolean
  1129. patch:
  1130. tags:
  1131. - Admin
  1132. summary: Update runtime feature flags (Admin)
  1133. description: |
  1134. Updates one or more runtime feature flags. Body keys not listed are left
  1135. untouched. Returns the post-update snapshot.
  1136. security:
  1137. - BearerAuth: []
  1138. parameters:
  1139. - '$ref': '#/components/parameters/ActingUserId'
  1140. requestBody:
  1141. required: true
  1142. content:
  1143. 'application/json':
  1144. schema:
  1145. type: object
  1146. properties:
  1147. audit_report_received_enabled:
  1148. type: boolean
  1149. audit_blocklist_request_enabled:
  1150. type: boolean
  1151. responses:
  1152. '200':
  1153. description: Updated snapshot
  1154. content:
  1155. 'application/json':
  1156. schema:
  1157. type: object
  1158. additionalProperties:
  1159. type: boolean
  1160. '400':
  1161. description: Validation error
  1162. '/api/v1/admin/maintenance/purge':
  1163. post:
  1164. tags:
  1165. - Admin
  1166. summary: Wipe operational data (Admin)
  1167. description: |
  1168. Deletes reports, scores, enrichment, manual blocks, allowlist, audit log, job history, reporters, consumers, policies, and non-service tokens. Preserves users, OIDC role mappings, abuse categories, and the `service`-kind token.
  1169. Requires `confirm: "PURGE"` in the body — any other value returns 400.
  1170. security:
  1171. - BearerAuth: []
  1172. parameters:
  1173. - '$ref': '#/components/parameters/ActingUserId'
  1174. requestBody:
  1175. required: true
  1176. content:
  1177. 'application/json':
  1178. schema:
  1179. type: object
  1180. required:
  1181. - confirm
  1182. properties:
  1183. confirm:
  1184. type: string
  1185. enum:
  1186. - PURGE
  1187. responses:
  1188. '200':
  1189. description: Purge succeeded
  1190. content:
  1191. 'application/json':
  1192. schema:
  1193. type: object
  1194. properties:
  1195. status:
  1196. type: string
  1197. example: purged
  1198. deleted:
  1199. type: object
  1200. additionalProperties:
  1201. type: integer
  1202. '400':
  1203. description: Missing or wrong `confirm` value
  1204. '/api/v1/admin/maintenance/seed-demo':
  1205. post:
  1206. tags:
  1207. - Admin
  1208. summary: Load demo dataset (Admin)
  1209. description: 'Populates reporters, consumers, IPs, reports, manual blocks, allowlist, and synthetic GeoIP for demos and screenshots. Triggers a full score recompute on completion. Idempotent: returns 409 if demo data is already present.'
  1210. security:
  1211. - BearerAuth: []
  1212. parameters:
  1213. - '$ref': '#/components/parameters/ActingUserId'
  1214. responses:
  1215. '200':
  1216. description: Demo data inserted
  1217. content:
  1218. 'application/json':
  1219. schema:
  1220. type: object
  1221. properties:
  1222. status:
  1223. type: string
  1224. example: seeded
  1225. summary:
  1226. type: object
  1227. additionalProperties:
  1228. type: integer
  1229. recompute:
  1230. '$ref': '#/components/schemas/JobOutcome'
  1231. '409':
  1232. description: Demo data already present
  1233. '412':
  1234. description: No categories configured
  1235. '/api/v1/auth/users/upsert-oidc':
  1236. post:
  1237. tags:
  1238. - Auth
  1239. summary: Upsert an OIDC-authenticated user
  1240. description: |
  1241. **UI BFF only.** Service-token-required, no impersonation header.
  1242. Resolves the user record + role (via `oidc_role_mappings`) for a freshly-validated ID token.
  1243. x-internal: true
  1244. security:
  1245. - BearerAuth: []
  1246. requestBody:
  1247. required: true
  1248. content:
  1249. 'application/json':
  1250. schema:
  1251. type: object
  1252. properties:
  1253. subject:
  1254. type: string
  1255. email:
  1256. type: string
  1257. display_name:
  1258. type: string
  1259. groups:
  1260. type: array
  1261. items:
  1262. type: string
  1263. responses:
  1264. '200':
  1265. description: User record
  1266. content:
  1267. 'application/json':
  1268. schema:
  1269. '$ref': '#/components/schemas/User'
  1270. '/api/v1/auth/users/upsert-local':
  1271. post:
  1272. tags:
  1273. - Auth
  1274. summary: Upsert the local-admin user
  1275. description: '**UI BFF only.** Called after the UI validates the local-admin password.'
  1276. x-internal: true
  1277. security:
  1278. - BearerAuth: []
  1279. requestBody:
  1280. required: true
  1281. content:
  1282. 'application/json':
  1283. schema:
  1284. type: object
  1285. properties:
  1286. username:
  1287. type: string
  1288. responses:
  1289. '200':
  1290. description: User record
  1291. content:
  1292. 'application/json':
  1293. schema:
  1294. '$ref': '#/components/schemas/User'
  1295. '/api/v1/auth/users/{id}':
  1296. get:
  1297. tags:
  1298. - Auth
  1299. summary: Refetch a user record
  1300. description: '**UI BFF only.** Used to refresh role / display_name during a session.'
  1301. x-internal: true
  1302. security:
  1303. - BearerAuth: []
  1304. parameters:
  1305. - name: id
  1306. in: path
  1307. required: true
  1308. schema:
  1309. type: integer
  1310. responses:
  1311. '200':
  1312. description: User record
  1313. content:
  1314. 'application/json':
  1315. schema:
  1316. '$ref': '#/components/schemas/User'
  1317. components:
  1318. securitySchemes:
  1319. BearerAuth:
  1320. type: http
  1321. scheme: bearer
  1322. description: |
  1323. Token in the form `irdb_<kind>_<32 base32 chars>`.
  1324. See `doc/auth-flows.md` for the four token kinds.
  1325. parameters:
  1326. Page:
  1327. name: page
  1328. in: query
  1329. schema:
  1330. type: integer
  1331. minimum: 1
  1332. default: 1
  1333. PageSize:
  1334. name: page_size
  1335. in: query
  1336. schema:
  1337. type: integer
  1338. minimum: 1
  1339. maximum: 200
  1340. default: 50
  1341. ActingUserId:
  1342. name: X-Acting-User-Id
  1343. in: header
  1344. description: |
  1345. Required when authenticating with a `service` token.
  1346. The api applies RBAC for the named user. Ignored on other token kinds.
  1347. schema:
  1348. type: integer
  1349. schemas:
  1350. Error:
  1351. type: object
  1352. required:
  1353. - error
  1354. properties:
  1355. error:
  1356. type: string
  1357. example: unauthorized
  1358. details:
  1359. type: object
  1360. description: Field-level errors for `validation_failed`.
  1361. additionalProperties:
  1362. type: string
  1363. ReportRequest:
  1364. type: object
  1365. required:
  1366. - ip
  1367. - category
  1368. properties:
  1369. ip:
  1370. type: string
  1371. example: '203.0.113.42'
  1372. category:
  1373. type: string
  1374. example: brute_force
  1375. metadata:
  1376. type: object
  1377. description: Free-form per-report data, max 4 KB after json_encode.
  1378. additionalProperties: true
  1379. ReportResponse:
  1380. type: object
  1381. properties:
  1382. report_id:
  1383. type: integer
  1384. example: 12345
  1385. ip:
  1386. type: string
  1387. example: '203.0.113.42'
  1388. received_at:
  1389. type: string
  1390. format: date-time
  1391. BlocklistEntry:
  1392. type: object
  1393. properties:
  1394. ip_or_cidr:
  1395. type: string
  1396. example: '203.0.113.42'
  1397. categories:
  1398. type: array
  1399. items:
  1400. type: string
  1401. score:
  1402. type: number
  1403. format: float
  1404. example: 1.42
  1405. reason:
  1406. type: string
  1407. enum:
  1408. - scored
  1409. - manual
  1410. example: scored
  1411. BlocklistJson:
  1412. type: object
  1413. properties:
  1414. count:
  1415. type: integer
  1416. example: 42
  1417. generated_at:
  1418. type: string
  1419. format: date-time
  1420. policy:
  1421. type: string
  1422. example: moderate
  1423. entries:
  1424. type: array
  1425. items:
  1426. '$ref': '#/components/schemas/BlocklistEntry'
  1427. Token:
  1428. type: object
  1429. properties:
  1430. id:
  1431. type: integer
  1432. kind:
  1433. type: string
  1434. enum:
  1435. - reporter
  1436. - consumer
  1437. - admin
  1438. prefix:
  1439. type: string
  1440. example: irdb_adm
  1441. reporter_id:
  1442. type: integer
  1443. nullable: true
  1444. consumer_id:
  1445. type: integer
  1446. nullable: true
  1447. role:
  1448. type: string
  1449. nullable: true
  1450. enum:
  1451. - viewer
  1452. - operator
  1453. - admin
  1454. - null
  1455. expires_at:
  1456. type: string
  1457. format: date-time
  1458. nullable: true
  1459. revoked_at:
  1460. type: string
  1461. format: date-time
  1462. nullable: true
  1463. last_used_at:
  1464. type: string
  1465. format: date-time
  1466. nullable: true
  1467. TokenCreated:
  1468. allOf:
  1469. - '$ref': '#/components/schemas/Token'
  1470. - type: object
  1471. properties:
  1472. raw_token:
  1473. type: string
  1474. description: Returned ONCE on creation — copy it now, never displayed again.
  1475. example: irdb_adm_AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDD
  1476. Reporter:
  1477. type: object
  1478. properties:
  1479. id:
  1480. type: integer
  1481. name:
  1482. type: string
  1483. example: web-prod-01
  1484. description:
  1485. type: string
  1486. nullable: true
  1487. trust_weight:
  1488. type: number
  1489. format: float
  1490. minimum: 0
  1491. maximum: 2
  1492. is_active:
  1493. type: boolean
  1494. audit_enabled:
  1495. type: boolean
  1496. description: When false, suppresses `report.received` audit rows for this reporter even if the global toggle is on.
  1497. Consumer:
  1498. type: object
  1499. properties:
  1500. id:
  1501. type: integer
  1502. name:
  1503. type: string
  1504. example: edge-fw-01
  1505. description:
  1506. type: string
  1507. nullable: true
  1508. policy_id:
  1509. type: integer
  1510. is_active:
  1511. type: boolean
  1512. audit_enabled:
  1513. type: boolean
  1514. description: When false, suppresses `blocklist.requested` audit rows for this consumer even if the global toggle is on.
  1515. last_pulled_at:
  1516. type: string
  1517. format: date-time
  1518. nullable: true
  1519. Category:
  1520. type: object
  1521. properties:
  1522. id:
  1523. type: integer
  1524. slug:
  1525. type: string
  1526. example: brute_force
  1527. name:
  1528. type: string
  1529. description:
  1530. type: string
  1531. nullable: true
  1532. decay_function:
  1533. type: string
  1534. enum:
  1535. - linear
  1536. - exponential
  1537. decay_param:
  1538. type: number
  1539. format: float
  1540. is_active:
  1541. type: boolean
  1542. Policy:
  1543. type: object
  1544. properties:
  1545. id:
  1546. type: integer
  1547. name:
  1548. type: string
  1549. example: moderate
  1550. description:
  1551. type: string
  1552. nullable: true
  1553. include_manual_blocks:
  1554. type: boolean
  1555. thresholds:
  1556. type: object
  1557. description: '`{category_slug: threshold}`'
  1558. additionalProperties:
  1559. type: number
  1560. format: float
  1561. ManualBlock:
  1562. type: object
  1563. properties:
  1564. id:
  1565. type: integer
  1566. kind:
  1567. type: string
  1568. enum:
  1569. - ip
  1570. - subnet
  1571. ip:
  1572. type: string
  1573. nullable: true
  1574. cidr:
  1575. type: string
  1576. nullable: true
  1577. reason:
  1578. type: string
  1579. nullable: true
  1580. expires_at:
  1581. type: string
  1582. format: date-time
  1583. nullable: true
  1584. created_at:
  1585. type: string
  1586. format: date-time
  1587. AllowlistEntry:
  1588. type: object
  1589. properties:
  1590. id:
  1591. type: integer
  1592. kind:
  1593. type: string
  1594. enum:
  1595. - ip
  1596. - subnet
  1597. ip:
  1598. type: string
  1599. nullable: true
  1600. cidr:
  1601. type: string
  1602. nullable: true
  1603. reason:
  1604. type: string
  1605. nullable: true
  1606. created_at:
  1607. type: string
  1608. format: date-time
  1609. IpDetail:
  1610. type: object
  1611. properties:
  1612. ip:
  1613. type: string
  1614. is_ipv4:
  1615. type: boolean
  1616. scores:
  1617. type: array
  1618. items:
  1619. type: object
  1620. properties:
  1621. category:
  1622. type: string
  1623. score:
  1624. type: number
  1625. format: float
  1626. last_report_at:
  1627. type: string
  1628. format: date-time
  1629. nullable: true
  1630. report_count_30d:
  1631. type: integer
  1632. enrichment:
  1633. type: object
  1634. properties:
  1635. country_code:
  1636. type: string
  1637. nullable: true
  1638. asn:
  1639. type: integer
  1640. nullable: true
  1641. as_org:
  1642. type: string
  1643. nullable: true
  1644. enriched_at:
  1645. type: string
  1646. format: date-time
  1647. nullable: true
  1648. status:
  1649. type: string
  1650. enum:
  1651. - scored
  1652. - manually_blocked
  1653. - allowlisted
  1654. - clean
  1655. manual_block:
  1656. type: object
  1657. nullable: true
  1658. allowlist:
  1659. type: object
  1660. nullable: true
  1661. history:
  1662. type: array
  1663. items:
  1664. type: object
  1665. has_more:
  1666. type: boolean
  1667. AuditEntry:
  1668. type: object
  1669. properties:
  1670. id:
  1671. type: integer
  1672. occurred_at:
  1673. type: string
  1674. format: date-time
  1675. actor_kind:
  1676. type: string
  1677. enum:
  1678. - user
  1679. - admin-token
  1680. - reporter
  1681. - consumer
  1682. - system
  1683. actor_id:
  1684. type: string
  1685. nullable: true
  1686. action:
  1687. type: string
  1688. example: manual_block.created
  1689. entity_type:
  1690. type: string
  1691. nullable: true
  1692. entity_id:
  1693. type: string
  1694. nullable: true
  1695. entity_label:
  1696. type: string
  1697. nullable: true
  1698. description: Human-readable identifier for the target (name, slug, IP, CIDR, prefix). Frozen at write time.
  1699. details:
  1700. type: object
  1701. nullable: true
  1702. additionalProperties: true
  1703. description: 'For update events, contains a `changes` map of `{field: {from, to}}` for every modified field.'
  1704. source_ip:
  1705. type: string
  1706. nullable: true
  1707. JobStatus:
  1708. type: object
  1709. properties:
  1710. name:
  1711. type: string
  1712. default_interval_seconds:
  1713. type: integer
  1714. max_runtime_seconds:
  1715. type: integer
  1716. overdue:
  1717. type: boolean
  1718. last_run:
  1719. type: object
  1720. nullable: true
  1721. properties:
  1722. id:
  1723. type: integer
  1724. status:
  1725. type: string
  1726. enum:
  1727. - success
  1728. - failure
  1729. - skipped_locked
  1730. - running
  1731. items_processed:
  1732. type: integer
  1733. triggered_by:
  1734. type: string
  1735. enum:
  1736. - schedule
  1737. - manual
  1738. - api
  1739. started_at:
  1740. type: string
  1741. format: date-time
  1742. nullable: true
  1743. finished_at:
  1744. type: string
  1745. format: date-time
  1746. nullable: true
  1747. error_message:
  1748. type: string
  1749. nullable: true
  1750. JobOutcome:
  1751. type: object
  1752. properties:
  1753. job:
  1754. type: string
  1755. status:
  1756. type: string
  1757. enum:
  1758. - success
  1759. - failure
  1760. - skipped_locked
  1761. - running
  1762. items_processed:
  1763. type: integer
  1764. duration_ms:
  1765. type: integer
  1766. run_id:
  1767. type: integer
  1768. nullable: true
  1769. error:
  1770. type: string
  1771. nullable: true
  1772. User:
  1773. type: object
  1774. properties:
  1775. id:
  1776. type: integer
  1777. email:
  1778. type: string
  1779. nullable: true
  1780. display_name:
  1781. type: string
  1782. role:
  1783. type: string
  1784. enum:
  1785. - viewer
  1786. - operator
  1787. - admin
  1788. source:
  1789. type: string
  1790. enum:
  1791. - oidc
  1792. - local
  1793. - admin-token
  1794. is_local:
  1795. type: boolean
  1796. Pagination:
  1797. type: object
  1798. properties:
  1799. page:
  1800. type: integer
  1801. minimum: 1
  1802. example: 1
  1803. page_size:
  1804. type: integer
  1805. minimum: 1
  1806. maximum: 200
  1807. example: 50
  1808. total:
  1809. type: integer
  1810. minimum: 0
  1811. example: 1284