{ "openapi": "3.0.3", "info": { "title": "Bun + React API", "description": "Development documentation", "version": "1.0.0" }, "paths": { "/api/health": { "get": { "operationId": "getApiHealth", "responses": { "200": {} } } }, "/api/session": { "get": { "operationId": "getApiSession", "responses": { "200": {} } } }, "/api/apikey/": { "get": { "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKeys": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } } }, "required": [ "apiKeys" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "apiKeys": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } } }, "required": [ "apiKeys" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "apiKeys": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } } }, "required": [ "apiKeys" ] } } } }, "401": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } } }, "operationId": "getApiApikey", "summary": "Get all API keys", "description": "Get all API keys" }, "post": { "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKey": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } }, "required": [ "apiKey" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "apiKey": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } }, "required": [ "apiKey" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "apiKey": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } }, "required": [ "apiKey" ] } } } }, "401": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } } }, "operationId": "postApiApikey", "summary": "Create a new API key", "description": "Create a new API key", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "expiresAt": { "type": "string" } } } }, "multipart/form-data": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "expiresAt": { "type": "string" } } } }, "text/plain": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "expiresAt": { "type": "string" } } } } } } } }, "/api/apikey/update": { "post": { "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKey": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } }, "required": [ "apiKey" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "apiKey": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } }, "required": [ "apiKey" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "apiKey": { "type": "object", "required": [ "id", "name", "key", "isActive", "expiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "key": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" }, {} ] }, "createdAt": {}, "updatedAt": {} } } }, "required": [ "apiKey" ] } } } }, "401": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } }, "403": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } } }, "operationId": "postApiApikeyUpdate", "summary": "Update an API key", "description": "Update an API key", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "isActive" ], "properties": { "id": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "multipart/form-data": { "schema": { "type": "object", "required": [ "id", "isActive" ], "properties": { "id": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "text/plain": { "schema": { "type": "object", "required": [ "id", "isActive" ], "properties": { "id": { "type": "string" }, "isActive": { "type": "boolean" }, "expiresAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } } } } }, "/api/apikey/delete": { "post": { "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } }, "required": [ "success" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } }, "required": [ "success" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } }, "required": [ "success" ] } } } }, "401": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } }, "403": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } } }, "operationId": "postApiApikeyDelete", "summary": "Delete an API key", "description": "Delete an API key", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } }, "multipart/form-data": { "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } }, "text/plain": { "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } } } }, "/api/profile/update": { "post": { "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "user": { "type": "object", "required": [ "id", "name", "email", "image", "role" ], "properties": { "id": { "type": "string" }, "name": {}, "email": { "type": "string" }, "image": {}, "role": {} } } }, "required": [ "user" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "user": { "type": "object", "required": [ "id", "name", "email", "image", "role" ], "properties": { "id": { "type": "string" }, "name": {}, "email": { "type": "string" }, "image": {}, "role": {} } } }, "required": [ "user" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "user": { "type": "object", "required": [ "id", "name", "email", "image", "role" ], "properties": { "id": { "type": "string" }, "name": {}, "email": { "type": "string" }, "image": {}, "role": {} } } }, "required": [ "user" ] } } } }, "401": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] } } } } }, "operationId": "postApiProfileUpdate", "summary": "Update user profile", "description": "Update the authenticated user's name or profile image", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "image": { "type": "string" } } } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "image": { "type": "string" } } } }, "text/plain": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "image": { "type": "string" } } } } } } } }, "/api/division/": { "get": { "operationId": "getApiDivision", "summary": "Get all divisions", "responses": { "200": {} } } }, "/api/division/activities": { "get": { "operationId": "getApiDivisionActivities", "summary": "Get recent activities", "responses": { "200": {} } } }, "/api/division/metrics": { "get": { "operationId": "getApiDivisionMetrics", "summary": "Get division performance metrics", "responses": { "200": {} } } }, "/api/complaint/stats": { "get": { "operationId": "getApiComplaintStats", "summary": "Get complaint statistics", "responses": { "200": {} } } }, "/api/complaint/recent": { "get": { "operationId": "getApiComplaintRecent", "summary": "Get recent complaints", "responses": { "200": {} } } }, "/api/complaint/service-stats": { "get": { "operationId": "getApiComplaintService-stats", "summary": "Get service letter statistics by type", "responses": { "200": {} } } }, "/api/complaint/innovation-ideas": { "get": { "operationId": "getApiComplaintInnovation-ideas", "summary": "Get recent innovation ideas", "responses": { "200": {} } } }, "/api/resident/stats": { "get": { "operationId": "getApiResidentStats", "summary": "Get resident statistics", "responses": { "200": {} } } }, "/api/resident/banjar-stats": { "get": { "operationId": "getApiResidentBanjar-stats", "summary": "Get population data per banjar", "responses": { "200": {} } } }, "/api/resident/demographics": { "get": { "operationId": "getApiResidentDemographics", "summary": "Get demographics including religion, gender, occupation and age", "responses": { "200": {} } } }, "/api/event/": { "get": { "operationId": "getApiEvent", "summary": "Get upcoming events", "responses": { "200": {} } } }, "/api/event/today": { "get": { "operationId": "getApiEventToday", "summary": "Get events for today", "responses": { "200": {} } } } }, "components": { "schemas": {} } }