| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534 |
- {
- "info": {
- "_postman_id": "8c4d2b1f-3e1a-4a7d-9c2b-1d2a3b4c5d6e",
- "name": "IRDB — IP Reputation Database",
- "description": "Postman collection for the IRDB API. Mirrors the OpenAPI spec at `/api/v1/openapi.yaml` and the routes registered in `api/src/App/AppFactory.php`.\n\n## Variables\n\nUse the matching `IRDB Local` environment file or set these manually:\n\n- `baseUrl` — e.g. `http://localhost:8081`.\n- `adminToken` — `irdb_adm_…` token (kind=admin, role=admin). Default `Authorization` for the **Admin API** folder.\n- `serviceToken` — `irdb_svc_…` token. Used for the **Auth API** folder and for impersonated calls into the **Admin API** folder.\n- `actingUserId` — integer user id sent in the `X-Acting-User-Id` header when using the service token.\n- `reporterToken` — `irdb_rep_…` for posting reports.\n- `consumerToken` — `irdb_con_…` for pulling blocklists.\n- `internalJobToken` — value of the `INTERNAL_JOB_TOKEN` env var. Internal jobs are loopback / RFC1918 only; run Postman from the host that runs the api container.\n\n## Auth model\n\n- **Admin API** endpoints accept either `Authorization: Bearer <admin-kind-token>` OR `Authorization: Bearer <service-token>` plus `X-Acting-User-Id: <user_id>`. The collection defaults to the admin-kind token. To switch to service-token impersonation, override the request-level auth and add the header.\n- **Auth API** endpoints accept ONLY a `service` token; no impersonation.\n- **Internal Jobs** endpoints require `Authorization: Bearer <INTERNAL_JOB_TOKEN>` AND the request must arrive from loopback / RFC1918.\n\n## Chaining\n\nMost write requests save useful ids back to collection variables (`reporterId`, `consumerId`, `policyId`, `categoryId`, `manualBlockId`, `allowlistEntryId`, `tokenId`, `lastRawToken`) so a follow-up request can use them without manual copy/paste. Run requests in folder order on a fresh database for a smooth flow.\n",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
- },
- "auth": {
- "type": "bearer",
- "bearer": [
- {
- "key": "token",
- "value": "{{adminToken}}",
- "type": "string"
- }
- ]
- },
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "type": "text/javascript",
- "exec": [
- ""
- ]
- }
- },
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- ""
- ]
- }
- }
- ],
- "variable": [
- {
- "key": "baseUrl",
- "value": "http://localhost:8081",
- "type": "string"
- },
- {
- "key": "adminToken",
- "value": "",
- "type": "string"
- },
- {
- "key": "serviceToken",
- "value": "",
- "type": "string"
- },
- {
- "key": "actingUserId",
- "value": "1",
- "type": "string"
- },
- {
- "key": "reporterToken",
- "value": "",
- "type": "string"
- },
- {
- "key": "consumerToken",
- "value": "",
- "type": "string"
- },
- {
- "key": "internalJobToken",
- "value": "",
- "type": "string"
- },
- {
- "key": "reporterId",
- "value": "",
- "type": "string"
- },
- {
- "key": "consumerId",
- "value": "",
- "type": "string"
- },
- {
- "key": "policyId",
- "value": "",
- "type": "string"
- },
- {
- "key": "categoryId",
- "value": "",
- "type": "string"
- },
- {
- "key": "manualBlockId",
- "value": "",
- "type": "string"
- },
- {
- "key": "allowlistEntryId",
- "value": "",
- "type": "string"
- },
- {
- "key": "tokenId",
- "value": "",
- "type": "string"
- },
- {
- "key": "lastRawToken",
- "value": "",
- "type": "string"
- },
- {
- "key": "userId",
- "value": "",
- "type": "string"
- }
- ],
- "item": [
- {
- "name": "Health & Docs",
- "description": "Unauthenticated endpoints for liveness checks and the API spec.",
- "auth": {
- "type": "noauth"
- },
- "item": [
- {
- "name": "GET /healthz",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{baseUrl}}/healthz",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "healthz"
- ]
- },
- "description": "Liveness probe. Returns `{status, db: {connected, driver}, geoip: {…}}`."
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "pm.test('200 OK', () => pm.response.to.have.status(200));",
- "pm.test('returns ok status', () => pm.expect(pm.response.json().status).to.eql('ok'));"
- ]
- }
- }
- ]
- },
- {
- "name": "GET /api/v1/openapi.yaml",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{baseUrl}}/api/v1/openapi.yaml",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "openapi.yaml"
- ]
- },
- "description": "OpenAPI 3.0.3 document — canonical source of request/response schemas."
- }
- },
- {
- "name": "GET /api/docs",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{baseUrl}}/api/docs",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "docs"
- ]
- },
- "description": "Stoplight Elements / RapiDoc viewer (HTML)."
- }
- }
- ]
- },
- {
- "name": "Public — Reporter",
- "description": "`POST /api/v1/report`. Token kind must be `reporter`. Rate limited at 60 req/s/token.",
- "auth": {
- "type": "bearer",
- "bearer": [
- {
- "key": "token",
- "value": "{{reporterToken}}",
- "type": "string"
- }
- ]
- },
- "item": [
- {
- "name": "POST /api/v1/report",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"ip\": \"203.0.113.42\",\n \"category\": \"brute_force\",\n \"metadata\": {\n \"url\": \"/wp-login.php\",\n \"ua\": \"curl/8.0\"\n }\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/report",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "report"
- ]
- },
- "description": "Submit a single abuse report. The category must match an active `categories.slug`."
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "pm.test('202 Accepted', () => pm.response.to.have.status(202));",
- "const body = pm.response.json();",
- "pm.test('body has report_id', () => pm.expect(body.report_id).to.be.a('number'));"
- ]
- }
- }
- ]
- }
- ]
- },
- {
- "name": "Public — Consumer",
- "description": "`GET /api/v1/blocklist`. Token kind must be `consumer`. Default response is `text/plain`, one entry per line. Pass `?format=json` for structured rows. Cached internally for 30 s per consumer; honour `If-None-Match` for `304`.",
- "auth": {
- "type": "bearer",
- "bearer": [
- {
- "key": "token",
- "value": "{{consumerToken}}",
- "type": "string"
- }
- ]
- },
- "item": [
- {
- "name": "GET /api/v1/blocklist (text)",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{baseUrl}}/api/v1/blocklist",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "blocklist"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "pm.test('200 OK', () => pm.response.to.have.status(200));",
- "const etag = pm.response.headers.get('ETag');",
- "if (etag) pm.collectionVariables.set('lastBlocklistETag', etag);"
- ]
- }
- }
- ]
- },
- {
- "name": "GET /api/v1/blocklist?format=json",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{baseUrl}}/api/v1/blocklist?format=json",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "blocklist"
- ],
- "query": [
- {
- "key": "format",
- "value": "json"
- }
- ]
- }
- }
- },
- {
- "name": "GET /api/v1/blocklist (If-None-Match)",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "If-None-Match",
- "value": "{{lastBlocklistETag}}",
- "description": "Set automatically by the previous text-format request."
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/blocklist",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "blocklist"
- ]
- },
- "description": "Re-pulls the blocklist with the previously captured ETag. Expects `304 Not Modified` when the body is unchanged."
- }
- }
- ]
- },
- {
- "name": "Auth API (UI BFF)",
- "description": "Service-token-only. No `X-Acting-User-Id` header here — these endpoints exist to *produce* user records the UI can later impersonate.",
- "auth": {
- "type": "bearer",
- "bearer": [
- {
- "key": "token",
- "value": "{{serviceToken}}",
- "type": "string"
- }
- ]
- },
- "item": [
- {
- "name": "POST /api/v1/auth/users/upsert-oidc",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"subject\": \"00000000-0000-0000-0000-000000000001\",\n \"email\": \"alice@example.com\",\n \"display_name\": \"Alice Example\",\n \"groups\": [\"00000000-aaaa-bbbb-cccc-000000000001\"]\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/auth/users/upsert-oidc",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "auth",
- "users",
- "upsert-oidc"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 200) {",
- " const u = pm.response.json();",
- " if (u && u.id) pm.collectionVariables.set('userId', String(u.id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "POST /api/v1/auth/users/upsert-local",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"username\": \"admin\"\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/auth/users/upsert-local",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "auth",
- "users",
- "upsert-local"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 200) {",
- " const u = pm.response.json();",
- " if (u && u.id) pm.collectionVariables.set('userId', String(u.id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "GET /api/v1/auth/users/:id",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{baseUrl}}/api/v1/auth/users/{{userId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "auth",
- "users",
- "{{userId}}"
- ]
- }
- }
- }
- ]
- },
- {
- "name": "Admin — Identity",
- "item": [
- {
- "name": "GET /api/v1/admin/me",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "description": "Required when authenticating with the service token. Ignored otherwise.",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/me",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "me"
- ]
- },
- "description": "Returns the current acting identity: `{id, email, display_name, role, source, is_local}`."
- }
- }
- ]
- },
- {
- "name": "Admin — IPs & Stats",
- "item": [
- {
- "name": "GET /api/v1/admin/ips (search)",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/ips?q=&category=&min_score=&max_score=&country=&asn=&status=&page=1&page_size=50",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "ips"
- ],
- "query": [
- {
- "key": "q",
- "value": "",
- "description": "Free-text search (IP / CIDR / country / ASN substring)."
- },
- {
- "key": "category",
- "value": "",
- "description": "Category slug, e.g. `brute_force`."
- },
- {
- "key": "min_score",
- "value": "",
- "description": "Minimum aggregate score."
- },
- {
- "key": "max_score",
- "value": "",
- "description": "Maximum aggregate score."
- },
- {
- "key": "country",
- "value": "",
- "description": "ISO 3166-1 alpha-2 country code."
- },
- {
- "key": "asn",
- "value": "",
- "description": "ASN integer."
- },
- {
- "key": "status",
- "value": "",
- "description": "scored | manual | allowlisted | clean"
- },
- {
- "key": "page",
- "value": "1"
- },
- {
- "key": "page_size",
- "value": "50"
- }
- ]
- }
- }
- },
- {
- "name": "GET /api/v1/admin/ips/countries",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/ips/countries",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "ips",
- "countries"
- ]
- },
- "description": "Country code dropdown source — `[{code, count}]`."
- }
- },
- {
- "name": "GET /api/v1/admin/ips/:ip",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/ips/203.0.113.42",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "ips",
- "203.0.113.42"
- ]
- },
- "description": "Full per-IP detail: scores, enrichment, manual/allowlist status, history."
- }
- },
- {
- "name": "GET /api/v1/admin/stats/dashboard",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/stats/dashboard",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "stats",
- "dashboard"
- ]
- },
- "description": "Pre-built dashboard payload (~30 s cached)."
- }
- }
- ]
- },
- {
- "name": "Admin — Manual Blocks",
- "item": [
- {
- "name": "GET /api/v1/admin/manual-blocks",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/manual-blocks",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "manual-blocks"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/manual-blocks (ip)",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"kind\": \"ip\",\n \"ip\": \"198.51.100.7\",\n \"reason\": \"persistent SSH brute force\",\n \"expires_at\": null\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/manual-blocks",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "manual-blocks"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const b = pm.response.json();",
- " if (b && b.id) pm.collectionVariables.set('manualBlockId', String(b.id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "POST /api/v1/admin/manual-blocks (subnet)",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"kind\": \"subnet\",\n \"cidr\": \"198.51.100.0/24\",\n \"reason\": \"abuse cluster\",\n \"expires_at\": null\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/manual-blocks",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "manual-blocks"
- ]
- }
- }
- },
- {
- "name": "GET /api/v1/admin/manual-blocks/:id",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/manual-blocks/{{manualBlockId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "manual-blocks",
- "{{manualBlockId}}"
- ]
- }
- }
- },
- {
- "name": "DELETE /api/v1/admin/manual-blocks/:id",
- "request": {
- "method": "DELETE",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/manual-blocks/{{manualBlockId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "manual-blocks",
- "{{manualBlockId}}"
- ]
- }
- }
- }
- ]
- },
- {
- "name": "Admin — Allowlist",
- "item": [
- {
- "name": "GET /api/v1/admin/allowlist",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/allowlist",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "allowlist"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/allowlist (ip)",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"kind\": \"ip\",\n \"ip\": \"192.0.2.1\",\n \"reason\": \"office egress\"\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/allowlist",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "allowlist"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const b = pm.response.json();",
- " if (b && b.id) pm.collectionVariables.set('allowlistEntryId', String(b.id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "POST /api/v1/admin/allowlist (subnet)",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"kind\": \"subnet\",\n \"cidr\": \"192.0.2.0/24\",\n \"reason\": \"corporate range\"\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/allowlist",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "allowlist"
- ]
- }
- }
- },
- {
- "name": "GET /api/v1/admin/allowlist/:id",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/allowlist/{{allowlistEntryId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "allowlist",
- "{{allowlistEntryId}}"
- ]
- }
- }
- },
- {
- "name": "DELETE /api/v1/admin/allowlist/:id",
- "request": {
- "method": "DELETE",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/allowlist/{{allowlistEntryId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "allowlist",
- "{{allowlistEntryId}}"
- ]
- }
- }
- }
- ]
- },
- {
- "name": "Admin — Reporters",
- "item": [
- {
- "name": "GET /api/v1/admin/reporters",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/reporters",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "reporters"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/reporters",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"name\": \"web-prod-01\",\n \"description\": \"front-end webserver\",\n \"trust_weight\": 1.0,\n \"is_active\": true\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/reporters",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "reporters"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const r = pm.response.json();",
- " if (r && r.id) pm.collectionVariables.set('reporterId', String(r.id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "GET /api/v1/admin/reporters/:id",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/reporters/{{reporterId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "reporters",
- "{{reporterId}}"
- ]
- }
- }
- },
- {
- "name": "PATCH /api/v1/admin/reporters/:id",
- "request": {
- "method": "PATCH",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"trust_weight\": 1.25,\n \"description\": \"front-end webserver (raised trust)\"\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/reporters/{{reporterId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "reporters",
- "{{reporterId}}"
- ]
- }
- }
- },
- {
- "name": "DELETE /api/v1/admin/reporters/:id",
- "request": {
- "method": "DELETE",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/reporters/{{reporterId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "reporters",
- "{{reporterId}}"
- ]
- },
- "description": "Hard-deletes if no reports reference it; returns `409` and flags inactive otherwise."
- }
- }
- ]
- },
- {
- "name": "Admin — Consumers",
- "item": [
- {
- "name": "GET /api/v1/admin/consumers",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/consumers",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "consumers"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/consumers",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"name\": \"edge-fw-01\",\n \"description\": \"edge firewall\",\n \"policy_id\": {{policyId}},\n \"is_active\": true\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/consumers",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "consumers"
- ]
- },
- "description": "`policy_id` is required. Set the `policyId` collection var first by listing policies or creating one."
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const c = pm.response.json();",
- " if (c && c.id) pm.collectionVariables.set('consumerId', String(c.id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "GET /api/v1/admin/consumers/:id",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/consumers/{{consumerId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "consumers",
- "{{consumerId}}"
- ]
- }
- }
- },
- {
- "name": "PATCH /api/v1/admin/consumers/:id",
- "request": {
- "method": "PATCH",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"is_active\": false\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/consumers/{{consumerId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "consumers",
- "{{consumerId}}"
- ]
- }
- }
- },
- {
- "name": "DELETE /api/v1/admin/consumers/:id",
- "request": {
- "method": "DELETE",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/consumers/{{consumerId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "consumers",
- "{{consumerId}}"
- ]
- }
- }
- }
- ]
- },
- {
- "name": "Admin — Tokens",
- "description": "Service tokens are filtered out of the list and cannot be created here.",
- "item": [
- {
- "name": "GET /api/v1/admin/tokens",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/tokens",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "tokens"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/tokens (reporter)",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"kind\": \"reporter\",\n \"reporter_id\": {{reporterId}}\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/tokens",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "tokens"
- ]
- },
- "description": "Returns the raw token ONCE in `raw_token`. The response is also captured into the `lastRawToken` and `reporterToken` collection vars for chained tests."
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const t = pm.response.json();",
- " if (t && t.id) pm.collectionVariables.set('tokenId', String(t.id));",
- " if (t && t.raw_token) {",
- " pm.collectionVariables.set('lastRawToken', t.raw_token);",
- " pm.collectionVariables.set('reporterToken', t.raw_token);",
- " }",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "POST /api/v1/admin/tokens (consumer)",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"kind\": \"consumer\",\n \"consumer_id\": {{consumerId}}\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/tokens",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "tokens"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const t = pm.response.json();",
- " if (t && t.id) pm.collectionVariables.set('tokenId', String(t.id));",
- " if (t && t.raw_token) {",
- " pm.collectionVariables.set('lastRawToken', t.raw_token);",
- " pm.collectionVariables.set('consumerToken', t.raw_token);",
- " }",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "POST /api/v1/admin/tokens (admin)",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"kind\": \"admin\",\n \"role\": \"admin\",\n \"expires_at\": null\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/tokens",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "tokens"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const t = pm.response.json();",
- " if (t && t.id) pm.collectionVariables.set('tokenId', String(t.id));",
- " if (t && t.raw_token) pm.collectionVariables.set('lastRawToken', t.raw_token);",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "DELETE /api/v1/admin/tokens/:id",
- "request": {
- "method": "DELETE",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/tokens/{{tokenId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "tokens",
- "{{tokenId}}"
- ]
- }
- }
- }
- ]
- },
- {
- "name": "Admin — Categories",
- "item": [
- {
- "name": "GET /api/v1/admin/categories",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/categories",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "categories"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/categories",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"slug\": \"crypto_mining\",\n \"name\": \"Crypto Mining\",\n \"description\": \"Unauthorised crypto-mining traffic\",\n \"decay_function\": \"exponential\",\n \"decay_param\": 14.0,\n \"is_active\": true\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/categories",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "categories"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const c = pm.response.json();",
- " if (c && c.id) pm.collectionVariables.set('categoryId', String(c.id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "GET /api/v1/admin/categories/:id",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/categories/{{categoryId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "categories",
- "{{categoryId}}"
- ]
- }
- }
- },
- {
- "name": "PATCH /api/v1/admin/categories/:id",
- "request": {
- "method": "PATCH",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"decay_param\": 7.0\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/categories/{{categoryId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "categories",
- "{{categoryId}}"
- ]
- }
- }
- },
- {
- "name": "DELETE /api/v1/admin/categories/:id",
- "request": {
- "method": "DELETE",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/categories/{{categoryId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "categories",
- "{{categoryId}}"
- ]
- },
- "description": "`409 Conflict` if the category is referenced by reports — soft-delete via PATCH `is_active=false` instead."
- }
- }
- ]
- },
- {
- "name": "Admin — Policies",
- "item": [
- {
- "name": "GET /api/v1/admin/policies",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/policies",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "policies"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 200) {",
- " const list = pm.response.json();",
- " const items = Array.isArray(list) ? list : (list.items || []);",
- " const moderate = items.find(p => p.name === 'moderate');",
- " if (moderate && moderate.id) pm.collectionVariables.set('policyId', String(moderate.id));",
- " else if (items[0] && items[0].id) pm.collectionVariables.set('policyId', String(items[0].id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "POST /api/v1/admin/policies",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"name\": \"edge-default\",\n \"description\": \"sample policy\",\n \"include_manual_blocks\": true,\n \"thresholds\": {\n \"brute_force\": 1.0,\n \"scanner\": 2.0,\n \"web_attack\": 1.5\n }\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/policies",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "policies"
- ]
- }
- },
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.response.code === 201) {",
- " const p = pm.response.json();",
- " if (p && p.id) pm.collectionVariables.set('policyId', String(p.id));",
- "}"
- ]
- }
- }
- ]
- },
- {
- "name": "GET /api/v1/admin/policies/:id",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/policies/{{policyId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "policies",
- "{{policyId}}"
- ]
- }
- }
- },
- {
- "name": "GET /api/v1/admin/policies/:id/preview",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/policies/{{policyId}}/preview",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "policies",
- "{{policyId}}",
- "preview"
- ]
- },
- "description": "Returns the count and a sample of IPs that would land in the blocklist for this policy. Used by the UI policy editor."
- }
- },
- {
- "name": "GET /api/v1/admin/policies/:id/score-distribution",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/policies/{{policyId}}/score-distribution",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "policies",
- "{{policyId}}",
- "score-distribution"
- ]
- }
- }
- },
- {
- "name": "PATCH /api/v1/admin/policies/:id",
- "request": {
- "method": "PATCH",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"description\": \"sample policy (raised thresholds)\",\n \"thresholds\": {\n \"brute_force\": 1.5,\n \"scanner\": 2.5\n }\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/policies/{{policyId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "policies",
- "{{policyId}}"
- ]
- },
- "description": "When `thresholds` is present, the API replaces the entire threshold set wholesale."
- }
- },
- {
- "name": "DELETE /api/v1/admin/policies/:id",
- "request": {
- "method": "DELETE",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/policies/{{policyId}}",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "policies",
- "{{policyId}}"
- ]
- },
- "description": "`409 Conflict` if any consumer still references the policy."
- }
- }
- ]
- },
- {
- "name": "Admin — Audit Log",
- "item": [
- {
- "name": "GET /api/v1/admin/audit-log",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/audit-log?actor_kind=&actor_id=&action=&entity_type=&entity_id=&from=&to=&page=1&page_size=50",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "audit-log"
- ],
- "query": [
- {
- "key": "actor_kind",
- "value": "",
- "description": "user | admin-token | reporter | consumer | system"
- },
- {
- "key": "actor_id",
- "value": ""
- },
- {
- "key": "action",
- "value": "",
- "description": "e.g. `manual_block.created`"
- },
- {
- "key": "entity_type",
- "value": ""
- },
- {
- "key": "entity_id",
- "value": ""
- },
- {
- "key": "from",
- "value": "",
- "description": "ISO 8601 UTC"
- },
- {
- "key": "to",
- "value": ""
- },
- {
- "key": "page",
- "value": "1"
- },
- {
- "key": "page_size",
- "value": "50"
- }
- ]
- }
- }
- }
- ]
- },
- {
- "name": "Admin — Jobs",
- "item": [
- {
- "name": "GET /api/v1/admin/jobs/status",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/jobs/status",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "jobs",
- "status"
- ]
- },
- "description": "Per-job last-run + overdue flag. Viewer-readable."
- }
- },
- {
- "name": "POST /api/v1/admin/jobs/trigger/recompute-scores",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"full\": false,\n \"max_rows\": 5000\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/jobs/trigger/recompute-scores",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "jobs",
- "trigger",
- "recompute-scores"
- ]
- },
- "description": "Whitelisted body keys: `full`, `max_rows`, `reenrich`. Other keys are dropped."
- }
- },
- {
- "name": "POST /api/v1/admin/jobs/trigger/cleanup-audit",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/jobs/trigger/cleanup-audit",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "jobs",
- "trigger",
- "cleanup-audit"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/jobs/trigger/cleanup-expired-manual-blocks",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/jobs/trigger/cleanup-expired-manual-blocks",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "jobs",
- "trigger",
- "cleanup-expired-manual-blocks"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/jobs/trigger/enrich-pending",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"reenrich\": false\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/jobs/trigger/enrich-pending",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "jobs",
- "trigger",
- "enrich-pending"
- ]
- }
- }
- },
- {
- "name": "POST /api/v1/admin/jobs/trigger/refresh-geoip",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/jobs/trigger/refresh-geoip",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "jobs",
- "trigger",
- "refresh-geoip"
- ]
- },
- "description": "Returns `412 Precondition Failed` when the GeoIP provider isn't configured."
- }
- },
- {
- "name": "POST /api/v1/admin/jobs/trigger/tick",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/jobs/trigger/tick",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "jobs",
- "trigger",
- "tick"
- ]
- },
- "description": "Convenience: invokes any due job."
- }
- }
- ]
- },
- {
- "name": "Admin — Config & Maintenance",
- "item": [
- {
- "name": "GET /api/v1/admin/config",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/config",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "config"
- ]
- },
- "description": "Effective config grouped by section. Secrets are masked."
- }
- },
- {
- "name": "POST /api/v1/admin/maintenance/purge",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"confirm\": \"PURGE\"\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/maintenance/purge",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "maintenance",
- "purge"
- ]
- },
- "description": "DESTRUCTIVE. Deletes operational data (reports, scores, manual blocks, allowlist, audit log, jobs history, reporters, consumers, policies, non-service tokens). Requires literal `confirm: \"PURGE\"`."
- }
- },
- {
- "name": "POST /api/v1/admin/maintenance/seed-demo",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "X-Acting-User-Id",
- "value": "{{actingUserId}}",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/api/v1/admin/maintenance/seed-demo",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "api",
- "v1",
- "admin",
- "maintenance",
- "seed-demo"
- ]
- },
- "description": "Loads a demo dataset and triggers a full recompute. Returns `409` if demo data is already present, `412` if no categories are configured."
- }
- }
- ]
- },
- {
- "name": "Internal Jobs",
- "description": "Loopback / RFC1918-only. Run Postman from the host running the api container, and target the host port (`http://localhost:8081`). External callers receive `404`.",
- "auth": {
- "type": "bearer",
- "bearer": [
- {
- "key": "token",
- "value": "{{internalJobToken}}",
- "type": "string"
- }
- ]
- },
- "item": [
- {
- "name": "POST /internal/jobs/tick",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/internal/jobs/tick",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "internal",
- "jobs",
- "tick"
- ]
- }
- }
- },
- {
- "name": "POST /internal/jobs/recompute-scores",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"full\": false,\n \"max_rows\": 5000\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/internal/jobs/recompute-scores",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "internal",
- "jobs",
- "recompute-scores"
- ]
- }
- }
- },
- {
- "name": "POST /internal/jobs/cleanup-audit",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/internal/jobs/cleanup-audit",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "internal",
- "jobs",
- "cleanup-audit"
- ]
- }
- }
- },
- {
- "name": "POST /internal/jobs/cleanup-expired-manual-blocks",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/internal/jobs/cleanup-expired-manual-blocks",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "internal",
- "jobs",
- "cleanup-expired-manual-blocks"
- ]
- }
- }
- },
- {
- "name": "POST /internal/jobs/enrich-pending",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"reenrich\": false\n}"
- },
- "url": {
- "raw": "{{baseUrl}}/internal/jobs/enrich-pending",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "internal",
- "jobs",
- "enrich-pending"
- ]
- }
- }
- },
- {
- "name": "POST /internal/jobs/refresh-geoip",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "url": {
- "raw": "{{baseUrl}}/internal/jobs/refresh-geoip",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "internal",
- "jobs",
- "refresh-geoip"
- ]
- }
- }
- },
- {
- "name": "GET /internal/jobs/status",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{baseUrl}}/internal/jobs/status",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "internal",
- "jobs",
- "status"
- ]
- }
- }
- }
- ]
- }
- ]
- }
|