{"openapi":"3.0.0","info":{"version":"0.0.1","title":"0Wallet Game Service API","description":"\n![Version](https://img.shields.io/badge/version-0.0.1-blue)\n![OAS](https://img.shields.io/badge/OAS-3.0-green)\n\nAPI documentation for Game Services, Catalog, Promotions, and Provider Credentials.\n\n---\n\n## Architecture\n\n> Laravel 13 + RoadRunner  \n> The Laravel API layer handles REST requests and communicates with the Go game microservice via gRPC internally.\n\n---\n\n## Authentication\n\nJWT Bearer token via `tymon/jwt-auth`\n\n| Route Type | Guard | Login Endpoint |\n|------------|-------|----------------|\n| User | `auth:api` | `/v1/user/login` |\n| Admin | `auth:admin` | `/v1/admin/login` |\n\n---\n\n## Multi-tenancy\n\nResolved via the `X-Tenant-Id` request header on every request.\n\n---\n\n## Response Envelope\n\nAll responses use a standardised JSON envelope.\n"},"paths":{"/v1/admin/provider-api-logs":{"get":{"summary":"List provider API logs","description":"Returns a paginated list of provider API log records for the current tenant. Supports filtering by provider, username, status, and date range.\n","tags":["Admin / Provider API Logs"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","description":"Number of records per page (default 20)","required":false,"schema":{"type":"integer","default":20,"example":20}},{"name":"offset","in":"query","description":"Number of records to skip (used for pagination)","required":false,"schema":{"type":"integer","default":0,"example":0}},{"name":"provider_id","in":"query","description":"Filter by provider ID","required":false,"schema":{"type":"integer","example":3}},{"name":"username","in":"query","description":"Filter by player username","required":false,"schema":{"type":"string","example":"john_doe"}},{"name":"status","in":"query","description":"Filter by request status","required":false,"schema":{"type":"string","example":"success"}},{"name":"start_date","in":"query","description":"Filter logs created on or after this date (ISO 8601)","required":false,"schema":{"type":"string","format":"date","example":"2025-01-01"}},{"name":"end_date","in":"query","description":"Filter logs created on or before this date (ISO 8601)","required":false,"schema":{"type":"string","format":"date","example":"2025-01-31"}}],"responses":{"200":{"description":"Paginated list of provider API logs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProviderApiLogRecord"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}},"example":{"data":[{"id":"01JCHG2M8S2ABCDE1234567890","provider_id":3,"provider_name":"Mega888","user_id":"01JCHG2M8S2ABCDE0987654321","username":"john_doe","player_name":"John Doe","endpoint":"/api/v1/balance","request":{"action":"getBalance","playerId":"john_doe"},"response":{"balance":100.0,"currency":"MYR"},"status_code":200,"status":"success","created_at":"2025-01-15T10:30:00Z"}],"meta":{"pagination":{"total":22,"per_page":200,"current_page":1,"last_page":1,"from":1,"to":22,"has_more":false}}}}}},"400":{"description":"Failed to fetch provider API logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"status":"false","message":"Failed to fetch provider API logs","code":null}}}},"401":{"$ref":"#/components/responses/Unauthenticated"}}}},"/v1/admin/dashboard/summary-user-risk":{"get":{"summary":"User risk dashboard summary","description":"Returns an aggregated risk summary for the current period: total/flagged user counts, risk-level buckets (low / medium / high), and a per-type breakdown with period-over-period trend data. Defaults to the current calendar month when no dates are supplied.\n","tags":["Admin / User Risk"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"type","in":"query","description":"Filter to a single risk type (RiskType enum value)","required":false,"schema":{"$ref":"#/components/schemas/RiskType"}},{"name":"start_date","in":"query","description":"Start of the period to analyse (ISO 8601). Defaults to start of current month.","required":false,"schema":{"type":"string","format":"date","example":"2025-01-01"}},{"name":"end_date","in":"query","description":"End of the period to analyse (ISO 8601). Defaults to today.","required":false,"schema":{"type":"string","format":"date","example":"2025-01-31"}}],"responses":{"200":{"description":"Risk dashboard summary","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserRiskDashboard"}}},"example":{"data":{"summary":{"total_users":5000,"total_flagged_users":120},"risk_levels":[{"level":"low","label":"Low","user_count":80},{"level":"medium","label":"Medium","user_count":30},{"level":"high","label":"High","user_count":10}],"breakdown":[{"type":2,"type_label":"Login IP","user_count":45,"percentage":37.5,"trend":{"current_count":45,"previous_count":30,"change_percent":50.0,"direction":"up"}}]}}}}},"401":{"$ref":"#/components/responses/Unauthenticated"}}}},"/v1/admin/dashboard/top-user-risk":{"get":{"summary":"Top users by risk match count","description":"Returns a paginated list of users ranked by matched log count descending. Each record shows the matched users and their similarity scores for the given risk type. Bidirectional duplicates are deduplicated — only the canonical side is returned.\n","tags":["Admin / User Risk"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"type","in":"query","description":"Filter by risk type","required":false,"schema":{"$ref":"#/components/schemas/RiskType"}},{"name":"event","in":"query","description":"Filter by the event that triggered the risk score","required":false,"schema":{"$ref":"#/components/schemas/RiskEvent"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date","example":"2025-01-01"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string","format":"date","example":"2025-01-31"}},{"name":"per_page","in":"query","description":"Results per page (1–100, default 15)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":15}}],"responses":{"200":{"description":"Paginated top-risk user list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TopUserRiskRecord"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}},"example":{"data":[{"id":"01JCHG2M8S2ABCDE0987654321","name":"John Doe","type":2,"type_label":"Login IP","matched_count":12,"matched_users":[{"id":"01JCHG2M8S2ABCDE1111111111","name":"Jane Doe","username":"jane_doe","similarity_score":0.95,"event":1,"event_label":"Login"}]}],"meta":{"pagination":{"total":22,"per_page":200,"current_page":1,"last_page":1,"from":1,"to":22,"has_more":false}}}}}},"401":{"$ref":"#/components/responses/Unauthenticated"}}}},"/v1/admin/dashboard/user-risk-breakdown":{"get":{"summary":"Risk breakdown by shared attribute value","description":"Groups flagged users by the shared risk attribute (e.g. IP, device hash, account number) for a required risk type. Returns one row per unique shared value with the users involved. The value is masked for the Password type (first 2 chars + ***).\n","tags":["Admin / User Risk"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"type","in":"query","description":"Risk type to break down (required)","required":true,"schema":{"$ref":"#/components/schemas/RiskType"}},{"name":"event","in":"query","description":"Filter by the event that triggered the risk score","required":false,"schema":{"$ref":"#/components/schemas/RiskEvent"}},{"name":"min_score","in":"query","description":"Minimum similarity score threshold (0–1)","required":false,"schema":{"type":"number","format":"float","minimum":0,"maximum":1,"example":0.8}},{"name":"per_page","in":"query","description":"Results per page (1–100, default 15)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":15}}],"responses":{"200":{"description":"Paginated risk breakdown list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserRiskBreakdownRecord"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}},"example":{"data":[{"value":"192.168.1.1","user_count":3,"id":"01JCHG2M8S2ABCDE0987654321","name":"John Doe","event":1,"event_label":"Login","similarity_score":0.95,"matched_user":[{"id":"01JCHG2M8S2ABCDE1111111111","name":"Jane Doe","event":1,"event_label":"Login","similarity_score":0.93}]}],"meta":{"pagination":{"total":22,"per_page":200,"current_page":1,"last_page":1,"from":1,"to":22,"has_more":false}}}}}},"422":{"description":"Validation error (type is required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"}}}},"/v1/admin/users/{userId}/risks":{"get":{"summary":"Get risk profile for a specific user","description":"Returns all active risk entries for the given user, grouped by risk type. Each entry includes the count of distinct matched users and the individual match log records for the current risk run.\n","tags":["Admin / User Risk"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"userId","in":"path","description":"ULID of the target user","required":true,"schema":{"type":"string","example":"01JCHG2M8S2ABCDE0987654321"}},{"name":"type","in":"query","description":"Filter to a single risk type","required":false,"schema":{"$ref":"#/components/schemas/RiskType"}},{"name":"event","in":"query","description":"Filter logs by the triggering event","required":false,"schema":{"$ref":"#/components/schemas/RiskEvent"}},{"name":"matched_user","in":"query","description":"Search matched users by name or username (partial, case-insensitive)","required":false,"schema":{"type":"string","maxLength":255,"example":"john"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date","example":"2025-01-01"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string","format":"date","example":"2025-01-31"}},{"name":"per_page","in":"query","description":"Results per page (1–100, default 15)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":15}}],"responses":{"200":{"description":"User risk profile","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserRiskEntry"}}}},"example":{"data":[{"type":2,"type_label":"Login IP","current_run_id":"01JCHG2M8S2ABCDE9999999999","matched_user_count":2,"matched_users":[{"matched_user_id":"01JCHG2M8S2ABCDE1111111111","matched_user_name":"Jane Doe","matched_user_username":"jane_doe","similarity_score":0.95,"event":1,"event_label":"Login"}]}]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/admin/users/{userId}/risks/summary":{"get":{"summary":"Get risk summary for a specific user","description":"Returns an aggregated risk summary for the given user across all risk types, including how many distinct matched users were found per type.\n","tags":["Admin / User Risk"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"userId","in":"path","description":"ULID of the target user","required":true,"schema":{"type":"string","example":"01JCHG2M8S2ABCDE0987654321"}}],"responses":{"200":{"description":"User risk summary","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserRiskUserSummary"}}},"example":{"data":{"summary":{"total_risk_types":2,"total_matched_users":5},"risks":[{"type":2,"type_label":"Login IP","matched_user_count":3},{"type":4,"type_label":"Device","matched_user_count":2}]}}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/admin/dashboard/user-risk-records":{"get":{"summary":"List raw risk log records","description":"Returns a paginated list of individual risk log entries for a required risk type. Each row represents a single matched-user pairing from the most recent risk run. The shared attribute value is masked for the Password type (first 2 chars + ***).\n","tags":["Admin / User Risk"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"type","in":"query","description":"Risk type to filter by (required)","required":true,"schema":{"$ref":"#/components/schemas/RiskType"}},{"name":"value","in":"query","description":"Filter by the shared attribute value (exact match; prefix match for Password type)","required":false,"schema":{"type":"string","maxLength":255,"example":"192.168.1.1"}},{"name":"event","in":"query","description":"Filter by the event that triggered the log entry","required":false,"schema":{"$ref":"#/components/schemas/RiskEvent"}},{"name":"min_score","in":"query","description":"Minimum similarity score threshold (0–1)","required":false,"schema":{"type":"number","format":"float","minimum":0,"maximum":1,"example":0.8}},{"name":"per_page","in":"query","description":"Results per page (1–100, default 10)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}],"responses":{"200":{"description":"Paginated risk log records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserRiskLogRecord"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}},"example":{"data":[{"id":"01JCHG2M8S2ABCDE1234567890","value":"192.168.1.1","user_id":"01JCHG2M8S2ABCDE0987654321","user_name":"John Doe","user_username":"john_doe","event":1,"event_label":"Login","similarity_score":0.95,"created_at":"2025-01-15T10:30:00Z"}],"meta":{"pagination":{"total":22,"per_page":200,"current_page":1,"last_page":1,"from":1,"to":22,"has_more":false}}}}}},"422":{"description":"Validation error (type is required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"}}}},"/v1/admin/custom-hot-games":{"get":{"tags":["Admin / Custom Hot Games"],"summary":"List Custom Hot Games","parameters":[{"name":"status","in":"query","description":"Filter by status (true / false)","required":false,"schema":{"type":"boolean"}},{"name":"provider_id","in":"query","description":"Filter by provider","required":false,"schema":{"type":"integer"}},{"name":"category_id","in":"query","description":"Filter by category","required":false,"schema":{"type":"integer"}},{"name":"start_date","in":"query","description":"Filter by created_at (>=), format YYYY-MM-DD","required":false,"schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","description":"Filter by created_at (<=), format YYYY-MM-DD","required":false,"schema":{"type":"string","format":"date"}},{"name":"per_page","in":"query","description":"Results per page (default 10)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}],"responses":{"200":{"description":"Paginated list","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiSuccess"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomHotGameResource"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}]}}}}}},"post":{"tags":["Admin / Custom Hot Games"],"summary":"Create Custom Hot Games","description":"Bulk create or update custom hot games.\nIf the record exists, it will be updated.\nIf the record does not exist, it will be created.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","required":["id","service_id","sort_order"],"properties":{"id":{"type":"string","format":"uuid","description":"Existing Custom Hot Game ID. Omit or provide a new ULID/UUID for new records depending on implementation.","example":"019e8c65-1fc2-71ea-934b-9703ef41cd5e"},"service_id":{"type":"integer","minimum":1,"example":498},"rtp":{"type":"integer","minimum":1,"maximum":100,"example":58},"sort_order":{"type":"integer","minimum":1,"example":3}}}}}},"example":{"items":[{"id":"019e8c65-1fc2-71ea-934b-9703ef41cd5e","service_id":498,"sort_order":3,"rtp":59},{"id":"019e8c65-1fcf-7367-b432-9c096c9982a5","service_id":499,"sort_order":10,"rtp":89},{"id":"019e8c65-1fd7-71dd-8771-83dce5e25457","service_id":497,"sort_order":4,"rtp":60}]}}}},"responses":{"200":{"description":"Custom hot games successfully created or updated","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"message":{"type":"string","nullable":true,"example":null},"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomHotGameResource"}}}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Admin / Custom Hot Games"],"summary":"Bulk Update Custom Hot Games","description":"Update multiple custom hot games in a single request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid","example":"019e8c65-1fc2-71ea-934b-9703ef41cd5e"},"service_id":{"type":"integer","minimum":1,"description":"Must be unique among custom hot games.","example":498},"status":{"type":"boolean","example":true},"sort_order":{"type":"integer","nullable":true,"example":3}}}}}},"example":{"items":[{"id":"019e8c65-1fc2-71ea-934b-9703ef41cd5e","service_id":498,"status":true,"sort_order":3},{"id":"019e8c65-1fcf-7367-b432-9c096c9982a5","service_id":499,"status":true,"sort_order":10}]}}}},"responses":{"200":{"description":"Custom hot games updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"message":{"type":"string","nullable":true,"example":null},"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomHotGameResource"}}}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/admin/custom-hot-games/reorder":{"post":{"tags":["Admin / Custom Hot Games"],"summary":"Reorder Custom Hot Games","description":"Pass an ordered array of IDs. Missing IDs are appended automatically after the provided ones.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ordered_ids"],"properties":{"ordered_ids":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"Must be distinct"}}}}}}},"responses":{"200":{"description":"Full reordered list of custom hot games.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomHotGameResource"}}}}}}},"422":{"description":"Validation error (e.g. unknown ID in ordered_ids)."}}}},"/v1/admin/custom-hot-games/{id}":{"get":{"tags":["Admin / Custom Hot Games"],"summary":"Get a Custom Hot Game","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiSuccess"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomHotGameResource"}}}]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Admin / Custom Hot Games"],"summary":"Update a Custom Hot Game","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"service_id":{"type":"integer","minimum":1,"example":42},"status":{"type":"boolean","nullable":true,"example":true},"sort_order":{"type":"integer","nullable":true,"example":3},"rtp":{"type":"number","format":"float","minimum":0,"maximum":100,"nullable":true,"example":96.5}}}}}},"responses":{"200":{"description":"Custom hot game updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"service_id":{"type":"integer"},"status":{"type":"boolean"},"sort_order":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"service":{"type":"object","nullable":true,"description":"Enriched service data from the game service","properties":{"id":{"type":"integer"},"name":{"type":"object"},"rtp":{"type":"string","nullable":true,"example":"96.5"},"serviceTag":{"type":"integer","nullable":true},"status":{"type":"boolean"}}}}}}}}}}},"404":{"description":"Custom hot game not found"},"422":{"description":"Validation error"}}},"delete":{"tags":["Admin / Custom Hot Games"],"summary":"Delete a Custom Hot Game","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiSuccess"},{"type":"object","properties":{"message":{"type":"string","example":"Custom hot game deleted."},"data":{"nullable":true}}}]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/admin/seo":{"get":{"tags":["Admin / Seo"],"summary":"Get all Seo","parameters":[{"in":"query","name":"per_page","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":200}},{"in":"query","name":"all","required":false,"schema":{"type":"boolean","default":false},"description":"Return all rows without pagination"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SeoPage"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}},"example":{"data":[{"key":"home","title":"Welcome to 0Wallet","description":"The best digital wallet.","og_title":null,"og_description":null,"og_image":null,"og_image_alt":null,"canonical":null,"keywords":"wallet, deposit, withdraw","robots_index":true,"robots_follow":true,"icon_url":"https://pub-xxx.r2.dev/tenant_abc/seo/01J.png","updated_at":"2026-05-28T08:00:00Z"}],"meta":{"pagination":{"total":22,"per_page":200,"current_page":1,"last_page":1,"from":1,"to":22,"has_more":false}}}}}}}}},"/v1/admin/seo/{key}":{"put":{"tags":["Admin / Seo"],"summary":"Update specific SEO page (upsert)","parameters":[{"in":"path","name":"key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._-]+$"},"example":"home"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":300,"nullable":true,"example":"Welcome to 0Wallet"},"description":{"type":"string","maxLength":1000,"nullable":true,"example":"The best digital wallet."},"og_title":{"type":"string","maxLength":300,"nullable":true},"og_description":{"type":"string","maxLength":1000,"nullable":true},"og_image":{"type":"string","maxLength":1000,"nullable":true,"description":"URL to the OG image"},"og_image_alt":{"type":"string","maxLength":300,"nullable":true},"canonical":{"type":"string","maxLength":1000,"nullable":true},"keywords":{"type":"string","maxLength":1000,"nullable":true,"example":"wallet, deposit, withdraw"},"robots_index":{"type":"boolean","nullable":true,"example":true},"robots_follow":{"type":"boolean","nullable":true,"example":true},"icon":{"type":"string","format":"binary","nullable":true,"description":"Favicon/icon file. Accepted: jpg, jpeg, png, webp, gif, svg, ico. Max 5MB."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SeoPage"}}},"example":{"data":{"key":"home","title":"Welcome to 0Wallet","description":"The best digital wallet.","og_title":null,"og_description":null,"og_image":null,"og_image_alt":null,"canonical":null,"keywords":"wallet, deposit, withdraw","robots_index":true,"robots_follow":true,"icon_url":"https://pub-xxx.r2.dev/tenant_abc/seo/01J.png","updated_at":"2026-05-28T08:00:00Z"}}}}},"404":{"description":"SEO page not found","content":{"application/json":{"example":{"message":"SEO page not found."}}}}}},"get":{"tags":["Admin / Seo"],"summary":"Get specific SEO page","parameters":[{"in":"path","name":"key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._-]+$"},"example":"home"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SeoPage"}}},"example":{"data":{"key":"home","title":"Welcome to 0Wallet","description":"The best digital wallet.","og_title":null,"og_description":null,"og_image":null,"og_image_alt":null,"canonical":null,"keywords":"wallet, deposit, withdraw","robots_index":true,"robots_follow":true,"icon_url":"https://pub-xxx.r2.dev/tenant_abc/seo/01J.png","updated_at":"2026-05-28T08:00:00Z"}}}}},"404":{"description":"SEO page not found","content":{"application/json":{"example":{"message":"SEO page not found."}}}}}},"delete":{"tags":["Admin / Seo"],"summary":"Delete specific Seo","parameters":[{"in":"path","name":"key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._-]+$"},"example":"home"}],"responses":{"200":{"description":"SEO page deleted","content":{"application/json":{"example":{"data":null,"message":"SEO page deleted."}}}},"404":{"description":"SEO page not found","content":{"application/json":{"example":{"message":"SEO page not found."}}}},"401":{"$ref":"#/components/responses/Unauthenticated"}}}},"/v1/user/seo":{"get":{"tags":["User / Seo"],"summary":"Get all SEO pages keyed by route","description":"Unauthenticated endpoint. Returns all SEO rows as an object keyed by route key (e.g. `home`, `deposit`). No pagination — frontend SSR fetches this once and caches it in a Pinia store.\n","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SeoPage"}}}},"example":{"data":{"home":{"key":"home","title":"Welcome to 0Wallet","description":"The best digital wallet.","og_title":null,"og_description":null,"og_image":null,"og_image_alt":null,"canonical":null,"keywords":"wallet, deposit, withdraw","robots_index":true,"robots_follow":true,"icon_url":"https://pub-xxx.r2.dev/tenant_abc/seo/01J.png","updated_at":"2026-05-28T08:00:00Z"},"deposit":{"key":"deposit","title":"Deposit Funds","description":"Top up your wallet easily.","og_title":null,"og_description":null,"og_image":null,"og_image_alt":null,"canonical":null,"keywords":null,"robots_index":true,"robots_follow":true,"icon_url":null,"updated_at":"2026-05-28T08:00:00Z"}}}}}}}}},"/v1/user/seo/{key}":{"get":{"tags":["User / Seo"],"summary":"Get specific SEO page by route key","description":"Unauthenticated endpoint. Returns 404 if the key has not been seeded.","parameters":[{"in":"path","name":"key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._-]+$"},"example":"home"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SeoPage"}}},"example":{"data":{"key":"home","title":"Welcome to 0Wallet","description":"The best digital wallet.","og_title":null,"og_description":null,"og_image":null,"og_image_alt":null,"canonical":null,"keywords":"wallet, deposit, withdraw","robots_index":true,"robots_follow":true,"icon_url":"https://pub-xxx.r2.dev/tenant_abc/seo/01J.png","updated_at":"2026-05-28T08:00:00Z"}}}}},"404":{"description":"SEO page not found","content":{"application/json":{"example":{"status":false,"message":"SEO page not found.","code":"NOT_FOUND"}}}}}}}},"components":{"schemas":{"ApiSuccess":{"type":"object","properties":{"status":{"type":"boolean","example":true},"message":{"type":"string","nullable":true,"example":null}}},"ProviderApiLogRecord":{"type":"object","properties":{"id":{"type":"string","description":"Log record ID (ULID)","example":"01JCHG2M8S2ABCDE1234567890"},"provider_id":{"type":"integer","description":"Game provider ID","example":3},"provider_name":{"type":"string","description":"Game provider display name","example":"Mega888"},"user_id":{"type":"string","description":"Internal user ID (ULID); empty string if user not found","example":"01JCHG2M8S2ABCDE0987654321"},"username":{"type":"string","description":"Player's username at the provider","example":"john_doe"},"player_name":{"type":"string","description":"Player's display name; empty string if user not found","example":"John Doe"},"endpoint":{"type":"string","description":"Provider API endpoint that was called","example":"/api/v1/balance"},"request":{"description":"Request payload sent to the provider (parsed JSON object, or raw string if not valid JSON)","oneOf":[{"type":"object"},{"type":"string"}],"example":{"action":"getBalance","playerId":"john_doe"}},"response":{"description":"Response payload received from the provider (parsed JSON object, or raw string if not valid JSON)","oneOf":[{"type":"object"},{"type":"string"}],"example":{"balance":100.0,"currency":"MYR"}},"status_code":{"type":"integer","description":"HTTP status code from the provider API call","example":200},"status":{"type":"string","description":"Log status label (e.g. success, failed)","example":"success"},"created_at":{"type":"string","format":"date-time","description":"Timestamp when the log was recorded","example":"2025-01-15T10:30:00Z"}}},"PaginationMeta":{"type":"object","properties":{"total":{"type":"integer","example":22},"per_page":{"type":"integer","example":200},"current_page":{"type":"integer","example":1},"last_page":{"type":"integer","example":1},"from":{"type":"integer","example":1},"to":{"type":"integer","example":22},"has_more":{"type":"boolean","example":false}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","example":"False"},"message":{"type":"string","example":"Error Description"},"error_code":{"type":"string","example":"Error Code"}}},"RiskType":{"type":"integer","description":"- `1` Register IP\n- `2` Login IP\n- `3` Password\n- `4` Device\n- `5` User Name\n- `6` Account Holder Name\n- `7` Account Number\n","enum":[1,2,3,4,5,6,7],"example":2},"RiskEvent":{"type":"integer","description":"- `1` Login\n- `2` Register\n- `3` Password Change\n- `4` Password Reset\n- `5` Bank Account Create\n","enum":[1,2,3,4,5],"example":1},"UserRiskDashboard":{"type":"object","properties":{"summary":{"type":"object","properties":{"total_users":{"type":"integer","example":5000},"total_flagged_users":{"type":"integer","example":120}}},"risk_levels":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["low","medium","high"]},"label":{"type":"string"},"user_count":{"type":"integer"}}}},"breakdown":{"type":"array","items":{"$ref":"#/components/schemas/UserRiskTypeBreakdown"}}}},"UserRiskTypeBreakdown":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/RiskType"},"type_label":{"type":"string","example":"Login IP"},"user_count":{"type":"integer","example":45},"percentage":{"type":"number","format":"float","description":"Share of total flagged users for this type","example":37.5},"trend":{"type":"object","properties":{"current_count":{"type":"integer","example":45},"previous_count":{"type":"integer","example":30},"change_percent":{"type":"number","format":"float","example":50.0},"direction":{"type":"string","enum":["up","down","stable"],"example":"up"}}}}},"TopUserRiskRecord":{"type":"object","properties":{"id":{"type":"string","example":"01JCHG2M8S2ABCDE0987654321"},"name":{"type":"string","example":"John Doe"},"type":{"$ref":"#/components/schemas/RiskType"},"type_label":{"type":"string","example":"Login IP"},"matched_count":{"type":"integer","example":12},"matched_users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"01JCHG2M8S2ABCDE1111111111"},"name":{"type":"string","example":"Jane Doe"},"username":{"type":"string","example":"jane_doe"},"similarity_score":{"type":"number","format":"float","example":0.95},"event":{"$ref":"#/components/schemas/RiskEvent"},"event_label":{"type":"string","example":"Login"}}}}}},"UserRiskBreakdownRecord":{"type":"object","properties":{"value":{"type":"string","nullable":true,"description":"Shared attribute value. Masked for Password type (first 2 chars + ***).","example":"192.168.1.1"},"user_count":{"type":"integer","example":3},"id":{"type":"string","nullable":true,"description":"ULID of the primary (canonical) user in this group","example":"01JCHG2M8S2ABCDE0987654321"},"name":{"type":"string","nullable":true,"example":"John Doe"},"event":{"allOf":[{"$ref":"#/components/schemas/RiskEvent"}],"nullable":true},"event_label":{"type":"string","nullable":true,"example":"Login"},"similarity_score":{"type":"number","format":"float","nullable":true,"example":0.95},"matched_user":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"event":{"$ref":"#/components/schemas/RiskEvent"},"event_label":{"type":"string"},"similarity_score":{"type":"number","format":"float"}}}}}},"UserRiskEntry":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/RiskType"},"type_label":{"type":"string","example":"Login IP"},"current_run_id":{"type":"string","nullable":true,"description":"ULID of the most recent risk analysis run for this type","example":"01JCHG2M8S2ABCDE9999999999"},"matched_user_count":{"type":"integer","example":2},"matched_users":{"type":"array","items":{"type":"object","properties":{"matched_user_id":{"type":"string","nullable":true},"matched_user_name":{"type":"string","nullable":true},"matched_user_username":{"type":"string","nullable":true},"similarity_score":{"type":"number","format":"float","nullable":true,"example":0.95},"event":{"$ref":"#/components/schemas/RiskEvent"},"event_label":{"type":"string"}}}}}},"UserRiskUserSummary":{"type":"object","properties":{"summary":{"type":"object","properties":{"total_risk_types":{"type":"integer","description":"Number of risk types where at least one matched user was found","example":2},"total_matched_users":{"type":"integer","description":"Total matched user count across all risk types (may include duplicates across types)","example":5}}},"risks":{"type":"array","items":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/RiskType"},"type_label":{"type":"string","example":"Login IP"},"matched_user_count":{"type":"integer","example":3}}}}}},"UserRiskLogRecord":{"type":"object","properties":{"id":{"type":"string","description":"Log entry ID (ULID)","example":"01JCHG2M8S2ABCDE1234567890"},"value":{"type":"string","nullable":true,"description":"Shared attribute value. Masked for Password type (first 2 chars + ***).","example":"192.168.1.1"},"user_id":{"type":"string","nullable":true,"description":"ULID of the user who owns this log entry","example":"01JCHG2M8S2ABCDE0987654321"},"user_name":{"type":"string","nullable":true,"example":"John Doe"},"user_username":{"type":"string","nullable":true,"example":"john_doe"},"event":{"$ref":"#/components/schemas/RiskEvent"},"event_label":{"type":"string","example":"Login"},"similarity_score":{"type":"number","format":"float","nullable":true,"example":0.95},"created_at":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"}}},"ServiceObject":{"type":"object","description":"Game service data from the gRPC catalog","properties":{"id":{"type":"integer","example":509},"provider_id":{"type":"integer","example":500005},"provider_name":{"type":"string","example":"MegaH5"},"name":{"type":"object","properties":{"en":{"type":"string","example":"Halloween Fortune"},"zh":{"type":"string","example":""}}},"service_code":{"type":"string","example":50122},"category_id":{"type":"integer","example":3},"category_name":{"type":"string","example":"Slots"},"rtp":{"type":"string","example":"98"},"icon_url":{"type":"string","nullable":true,"example":"https://example.com/icon.png"},"status":{"type":"boolean","example":true},"service_tag":{"type":"integer","example":0},"provider_category_id":{"type":"integer","example":4},"wallet_type":{"type":"integer","example":2}}},"CustomHotGameResource":{"type":"object","properties":{"id":{"type":"string","example":"019e8c65-1fc2-71ea-934b-9703ef41cd5e"},"service_id":{"type":"integer","example":498},"status":{"type":"boolean","example":true},"sort_order":{"type":"integer","example":3},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"service":{"$ref":"#/components/schemas/ServiceObject","nullable":true,"description":"null if the gRPC catalog cannot resolve the service_id"}}},"SeoPage":{"type":"object","properties":{"key":{"type":"string","example":"home"},"title":{"type":"string","nullable":true,"example":"Welcome to 0Wallet"},"description":{"type":"string","nullable":true,"example":"The best digital wallet."},"og_title":{"type":"string","nullable":true},"og_description":{"type":"string","nullable":true},"og_image":{"type":"string","nullable":true},"og_image_alt":{"type":"string","nullable":true},"canonical":{"type":"string","nullable":true},"keywords":{"type":"string","nullable":true,"example":"wallet, deposit, withdraw"},"robots_index":{"type":"boolean","example":true},"robots_follow":{"type":"boolean","example":true},"icon_url":{"type":"string","nullable":true,"example":"https://pub-xxx.r2.dev/tenant_abc/seo/01J.png"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-28T08:00:00Z"}}}},"responses":{"Unauthenticated":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"status":"false","message":"Unauthenticated","error_code":null}}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/aaa-84a/0WalletApiResponse/0.0.1"}]}