{"openapi":"3.1.0","info":{"title":"Kommunsvar API","version":"1.0.0","description":"REST-API för statistik, samtal, källor och export från Kommunsvar. Utformat efter Diggs REST API-profil: versionsnummer i adressen, fält i camelCase, datum enligt RFC 3339, fel enligt RFC 7807 och sidindelning med page och limit. All trafik går över HTTPS med TLS 1.2 eller senare. Ändringar dokumenteras i ändringsloggen på dokumentationssidan, och en ny huvudversion (/v2) tas i bruk parallellt med den gamla.","contact":{"name":"Kommunsvar support","url":"https://chatt-test.stabilsajt.se/dokumentation"}},"servers":[{"url":"https://chatt-test.stabilsajt.se/api/v1"}],"components":{"securitySchemes":{"oauth2":{"type":"oauth2","description":"Klientuppgifter skapas av kommunens administratör under API-klienter. Åtkomsttoken gäller i 5 minuter; uppdateringstoken i 24 timmar och kan användas en gång.","flows":{"clientCredentials":{"tokenUrl":"https://chatt-test.stabilsajt.se/api/oauth/token","refreshUrl":"https://chatt-test.stabilsajt.se/api/oauth/token","scopes":{"statistics.read":"Läsa statistik och händelser (inga personuppgifter)","conversations.read":"Läsa maskerade samtal, obesvarade frågor och vidareskickade frågor","sources.write":"Läsa källor och starta inläsning","export.read":"Hämta fullständig export för arkivering och avslut","audit.read":"Läsa ändringsloggen"}}}}},"schemas":{"Problem":{"type":"object","description":"RFC 7807","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"reference":{"type":"string"}},"required":["title","status"]},"Meta":{"type":"object","properties":{"totalRecords":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"count":{"type":"integer"}}},"Links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"uri"}}},"first":{"type":"object","properties":{"href":{"type":"string","format":"uri"}}},"last":{"type":"object","properties":{"href":{"type":"string","format":"uri"}}},"next":{"type":"object","properties":{"href":{"type":"string","format":"uri"}}},"prev":{"type":"object","properties":{"href":{"type":"string","format":"uri"}}}}},"Summary":{"type":"object","properties":{"conversations":{"type":["integer","null"]},"questions":{"type":["integer","null"]},"answered":{"type":["integer","null"]},"noAnswer":{"type":["integer","null"]},"blocked":{"type":["integer","null"]},"escalated":{"type":["integer","null"]},"smallTalk":{"type":["integer","null"]},"refused":{"type":["integer","null"]},"errors":{"type":["integer","null"]},"withEscalation":{"type":["integer","null"]},"handoffs":{"type":["integer","null"]},"thumbsUp":{"type":["integer","null"]},"thumbsDown":{"type":["integer","null"]},"medianLatencyMs":{"type":["integer","null"]}}},"Day":{"type":"object","properties":{"date":{"type":"string","format":"date"},"conversations":{"type":"integer"},"questions":{"type":"integer"},"answered":{"type":"integer"},"noAnswer":{"type":"integer"},"escalated":{"type":"integer"}}},"Event":{"type":"object","description":"En statistikhändelse. Innehåller inga personuppgifter.","properties":{"eventId":{"type":"string","format":"uuid"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["conversation","question","feedback","handoff"]},"outcome":{"type":["string","null"],"enum":["answered","no_answer","blocked","escalated","small_talk","refused","error",null]},"topic":{"type":["string","null"]},"language":{"type":["string","null"]},"escalationReason":{"type":["string","null"],"enum":["no_answer","user_request","blocked_topic","repeated_failures",null]},"rating":{"type":["integer","null"],"enum":[1,-1,null]},"latencyMs":{"type":["integer","null"]},"sourceCount":{"type":["integer","null"]},"configVersion":{"type":["integer","null"]}}},"Message":{"type":"object","properties":{"messageId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string","description":"Personuppgifter maskerade, t.ex. [personnummer]"},"outcome":{"type":["string","null"]},"topic":{"type":["string","null"]},"escalationReason":{"type":["string","null"]},"sources":{"type":["array","null"],"items":{"type":"object","properties":{"n":{"type":"integer"},"title":{"type":"string"},"url":{"type":"string"}}}},"feedback":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}}},"Conversation":{"type":"object","properties":{"conversationId":{"type":"string","format":"uuid"},"startedAt":{"type":"string","format":"date-time"},"language":{"type":["string","null"]},"configVersion":{"type":["integer","null"]},"escalated":{"type":"boolean"},"pagePath":{"type":["string","null"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}},"Crawl":{"type":"object","properties":{"crawlId":{"type":"string","format":"uuid"},"sourceId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","done","failed","cancelled"]},"pagesTotal":{"type":"integer"},"pagesDone":{"type":"integer"},"pagesAdded":{"type":"integer"},"pagesUpdated":{"type":"integer"},"pagesUnchanged":{"type":"integer"},"pagesRemoved":{"type":"integer"},"pagesFailed":{"type":"integer"},"message":{"type":["string","null"]}}},"Export":{"type":"object","description":"Fullständig export (format kommunsvar-export/1) med inställningsversioner, källor, dokument, samtal, meddelanden, händelser, vidareskickade frågor och testresultat.","properties":{"format":{"type":"string"},"exportedAt":{"type":"string","format":"date-time"}},"additionalProperties":true}}},"paths":{"/api-info":{"get":{"summary":"Information om API:et","security":[],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/sites":{"get":{"summary":"Organisationens webbplatser","security":[{"oauth2":[]}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object","properties":{"sites":{"type":"array"}}}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/statistics":{"get":{"summary":"Sammanställning och antal per dag","security":[{"oauth2":["statistics.read"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Första dag (svensk tid). Förval: 29 dagar före to."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Sista dag (svensk tid). Förval: i dag."}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/Summary"},"days":{"type":"array","items":{"$ref":"#/components/schemas/Day"}}}}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/events":{"get":{"summary":"Statistikhändelser för löpande export","security":[{"oauth2":["statistics.read"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Första dag (svensk tid). Förval: 29 dagar före to."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Sista dag (svensk tid). Förval: i dag."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":20}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object","properties":{"_meta":{"$ref":"#/components/schemas/Meta"},"_links":{"$ref":"#/components/schemas/Links"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/topics":{"get":{"summary":"Frågor och hänvisningar per ämne","security":[{"oauth2":["statistics.read"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Första dag (svensk tid). Förval: 29 dagar före to."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Sista dag (svensk tid). Förval: i dag."}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/conversations":{"get":{"summary":"Maskerade samtal inom lagringstiden","security":[{"oauth2":["conversations.read"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Första dag (svensk tid). Förval: 29 dagar före to."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Sista dag (svensk tid). Förval: i dag."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":20}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object","properties":{"_meta":{"$ref":"#/components/schemas/Meta"},"_links":{"$ref":"#/components/schemas/Links"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}}}}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/unanswered":{"get":{"summary":"Frågor som chatten inte kunde besvara","security":[{"oauth2":["conversations.read"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Första dag (svensk tid). Förval: 29 dagar före to."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Sista dag (svensk tid). Förval: i dag."}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/handoffs":{"get":{"summary":"Frågor som skickats vidare (utan kontaktuppgifter)","security":[{"oauth2":["conversations.read"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":20}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/sources":{"get":{"summary":"Källor och deras status","security":[{"oauth2":["sources.write"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/sources/{sourceId}/crawls":{"post":{"summary":"Starta inläsning av en källa","security":[{"oauth2":["sources.write"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"},{"name":"sourceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Inläsningen är köad. Location pekar på statusen.","headers":{"Location":{"schema":{"type":"string"}},"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Crawl"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/crawls/{crawlId}":{"get":{"summary":"Status för en inläsning","security":[{"oauth2":["sources.write"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"},{"name":"crawlId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Crawl"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/config-versions":{"get":{"summary":"Publicerade versioner av inställningarna","security":[{"oauth2":["export.read"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sites/{siteId}/export":{"get":{"summary":"Fullständig export för arkivering eller avslut","security":[{"oauth2":["export.read"]}],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webbplatsens id (GET /sites)"}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Export"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/model-versions":{"get":{"summary":"AI-modeller och när de har använts","security":[{"oauth2":["statistics.read"]}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/audit-log":{"get":{"summary":"Ändringsloggen","security":[{"oauth2":["audit.read"]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":20}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Sekunder tills gränsen återställs"}},"content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Saknar eller ogiltig åtkomsttoken","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Klienten saknar scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resursen finns inte","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"För många anrop (600 per minut och klient)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internt fel. Svaret innehåller en referens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}}}