{"openapi":"3.0.3","info":{"title":"opn.onl URL Shortener API","description":"A modern, feature-rich URL shortening service with analytics, teams, and real-time updates.","contact":{"name":"opn.onl Support","url":"https://opn.onl","email":"support@opn.onl"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"version":"1.0.0"},"servers":[{"url":"http://localhost:3000","description":"Local development server"},{"url":"https://api.opn.onl","description":"Production server"}],"paths":{"/analytics/dashboard":{"get":{"tags":["Analytics"],"summary":"Get dashboard analytics","operationId":"get_dashboard_stats","responses":{"200":{"description":"Dashboard statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStats"}}}},"401":{"description":"Unauthorized"}}}},"/auth/change-password":{"post":{"tags":["Authentication"],"summary":"Change password for authenticated user","operationId":"change_password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Password changed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Invalid request or wrong current password"},"401":{"description":"Unauthorized"}},"security":[{"bearer_auth":[]}]}},"/auth/delete-account":{"post":{"tags":["Authentication"],"summary":"Delete own account (self-service, if enabled)","operationId":"delete_account","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}},"required":true},"responses":{"200":{"description":"Account deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Invalid request or wrong password"},"401":{"description":"Unauthorized"},"403":{"description":"Account deletion is disabled"}},"security":[{"bearer_auth":[]}]}},"/auth/login":{"post":{"tags":["Authentication"],"summary":"Login with email and password","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"Invalid credentials"}}}},"/auth/register":{"post":{"tags":["Authentication"],"summary":"Register a new user","operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"User registered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"description":"Invalid request"},"409":{"description":"Email already exists"}}}},"/folders":{"get":{"tags":["Folders"],"summary":"Get user's folders","operationId":"get_folders","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"List of folders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FolderResponse"}}}}},"401":{"description":"Unauthorized"}}},"post":{"tags":["Folders"],"summary":"Create a new folder","operationId":"create_folder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolderRequest"}}},"required":true},"responses":{"201":{"description":"Folder created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderResponse"}}}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"}}}},"/folders/{folder_id}":{"get":{"tags":["Folders"],"summary":"Get folder by ID","operationId":"get_folder","parameters":[{"name":"folder_id","in":"path","description":"Folder ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Folder details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"put":{"tags":["Folders"],"summary":"Update folder","operationId":"update_folder","parameters":[{"name":"folder_id","in":"path","description":"Folder ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderRequest"}}},"required":true},"responses":{"200":{"description":"Folder updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"tags":["Folders"],"summary":"Delete folder","operationId":"delete_folder","parameters":[{"name":"folder_id","in":"path","description":"Folder ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"Folder deleted"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/folders/{folder_id}/links":{"get":{"tags":["Folders"],"summary":"Get links in folder","operationId":"get_folder_links","parameters":[{"name":"folder_id","in":"path","description":"Folder ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Links in folder"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Folder not found"}}},"post":{"tags":["Folders"],"summary":"Move links to folder","operationId":"move_links_to_folder","parameters":[{"name":"folder_id","in":"path","description":"Folder ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveLinkToFolderRequest"}}},"required":true},"responses":{"200":{"description":"Links moved","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Folder not found"}}}},"/links":{"get":{"tags":["Links"],"summary":"Get user's links with filtering","operationId":"get_user_links","parameters":[{"name":"folder_id","in":"query","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"org_id","in":"query","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"tag_id","in":"query","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"search","in":"query","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List of links","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LinkResponse"}}}}},"401":{"description":"Unauthorized"}}},"post":{"tags":["Links"],"summary":"Create a new shortened link","operationId":"create_link","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkRequest"}}},"required":true},"responses":{"201":{"description":"Link created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkResponse"}}}},"400":{"description":"Invalid request"},"409":{"description":"Alias already exists"}}}},"/links/bulk":{"post":{"tags":["Links"],"summary":"Bulk create links","operationId":"bulk_create_links","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateLinkRequest"}}},"required":true},"responses":{"200":{"description":"Links created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateLinkResponse"}}}}}}},"/links/bulk/delete":{"post":{"tags":["Links"],"summary":"Bulk delete links","operationId":"bulk_delete_links","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Links deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteResponse"}}}},"401":{"description":"Unauthorized"}}}},"/links/bulk/update":{"post":{"tags":["Links"],"summary":"Bulk update links","operationId":"bulk_update_links","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Links updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateResponse"}}}},"401":{"description":"Unauthorized"}}}},"/links/export":{"get":{"tags":["Links"],"summary":"Export links to CSV","operationId":"export_links_csv","responses":{"200":{"description":"CSV file"},"401":{"description":"Unauthorized"}}}},"/links/{id}":{"put":{"tags":["Links"],"summary":"Update a link","operationId":"update_link","parameters":[{"name":"id","in":"path","description":"Link ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLinkRequest"}}},"required":true},"responses":{"200":{"description":"Link updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"tags":["Links"],"summary":"Delete a link","operationId":"delete_link","parameters":[{"name":"id","in":"path","description":"Link ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Link deleted"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/links/{id}/clicks/realtime":{"get":{"tags":["Analytics"],"summary":"Get real-time click count for a link","operationId":"get_realtime_clicks","parameters":[{"name":"id","in":"path","description":"Link ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Current click count"},"404":{"description":"Link not found"}}}},"/links/{id}/qr":{"get":{"tags":["Links"],"summary":"Get QR code for a link","operationId":"get_qr_code","parameters":[{"name":"id","in":"path","description":"Link ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"QR code image"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Link not found"}}}},"/links/{id}/stats":{"get":{"tags":["Analytics"],"summary":"Get detailed stats for a specific link","operationId":"get_link_stats","parameters":[{"name":"id","in":"path","description":"Link ID","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","format":"int64","nullable":true}}],"responses":{"200":{"description":"Link statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkStatsResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/links/{link_id}/tags":{"post":{"tags":["Tags"],"summary":"Add tags to a link","operationId":"add_tags_to_link","parameters":[{"name":"link_id","in":"path","description":"Link ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddTagsToLinkRequest"}}},"required":true},"responses":{"200":{"description":"Tags added","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Link not found"}}},"delete":{"tags":["Tags"],"summary":"Remove tags from a link","operationId":"remove_tags_from_link","parameters":[{"name":"link_id","in":"path","description":"Link ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveTagsFromLinkRequest"}}},"required":true},"responses":{"200":{"description":"Tags removed","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Link not found"}}}},"/orgs":{"get":{"tags":["Organizations"],"summary":"Get user's organizations","operationId":"get_user_organizations","responses":{"200":{"description":"List of organizations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrgResponse"}}}}},"401":{"description":"Unauthorized"}}},"post":{"tags":["Organizations"],"summary":"Create a new organization","operationId":"create_organization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgRequest"}}},"required":true},"responses":{"201":{"description":"Organization created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResponse"}}}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"},"409":{"description":"Slug already exists"}}}},"/orgs/{org_id}":{"get":{"tags":["Organizations"],"summary":"Get organization by ID","operationId":"get_organization","parameters":[{"name":"org_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Organization details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"put":{"tags":["Organizations"],"summary":"Update organization","operationId":"update_organization","parameters":[{"name":"org_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgRequest"}}},"required":true},"responses":{"200":{"description":"Organization updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"tags":["Organizations"],"summary":"Delete organization","operationId":"delete_organization","parameters":[{"name":"org_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"Organization deleted"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/orgs/{org_id}/audit":{"get":{"tags":["Organizations"],"summary":"Get organization audit log","operationId":"get_audit_log","parameters":[{"name":"org_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Audit log entries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogResponse"}}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/orgs/{org_id}/members":{"get":{"tags":["Organizations"],"summary":"Get organization members","operationId":"get_organization_members","parameters":[{"name":"org_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"List of members","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrgMemberResponse"}}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}},"post":{"tags":["Organizations"],"summary":"Invite member to organization","operationId":"invite_member","parameters":[{"name":"org_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberRequest"}}},"required":true},"responses":{"201":{"description":"Member invited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberResponse"}}}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"User not found"},"409":{"description":"Already a member"}}}},"/orgs/{org_id}/members/{member_id}":{"put":{"tags":["Organizations"],"summary":"Update member role","operationId":"update_member_role","parameters":[{"name":"org_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"member_id","in":"path","description":"Member ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRoleRequest"}}},"required":true},"responses":{"200":{"description":"Member role updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberResponse"}}}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Member not found"}}},"delete":{"tags":["Organizations"],"summary":"Remove member from organization","operationId":"remove_member","parameters":[{"name":"org_id","in":"path","description":"Organization ID","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"member_id","in":"path","description":"Member ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"Member removed"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Member not found"}}}},"/tags":{"get":{"tags":["Tags"],"summary":"Get user's tags","operationId":"get_tags","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"List of tags","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TagResponse"}}}}},"401":{"description":"Unauthorized"}}},"post":{"tags":["Tags"],"summary":"Create a new tag","operationId":"create_tag","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagRequest"}}},"required":true},"responses":{"201":{"description":"Tag created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponse"}}}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"}}}},"/tags/{tag_id}":{"get":{"tags":["Tags"],"summary":"Get tag by ID","operationId":"get_tag","parameters":[{"name":"tag_id","in":"path","description":"Tag ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Tag details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"put":{"tags":["Tags"],"summary":"Update tag","operationId":"update_tag","parameters":[{"name":"tag_id","in":"path","description":"Tag ID","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagRequest"}}},"required":true},"responses":{"200":{"description":"Tag updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"tags":["Tags"],"summary":"Delete tag","operationId":"delete_tag","parameters":[{"name":"tag_id","in":"path","description":"Tag ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"Tag deleted"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/tags/{tag_id}/links":{"get":{"tags":["Tags"],"summary":"Get links by tag","operationId":"get_links_by_tag","parameters":[{"name":"tag_id","in":"path","description":"Tag ID","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Links with tag"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Tag not found"}}}},"/{code}":{"get":{"tags":["Links"],"summary":"Redirect to original URL","operationId":"redirect_link","parameters":[{"name":"code","in":"path","description":"Short link code","required":true,"schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to original URL"},"401":{"description":"Password required"},"404":{"description":"Link not found"},"410":{"description":"Link expired or inactive"}}}},"/{code}/verify":{"post":{"tags":["Links"],"summary":"Verify password for protected link","operationId":"verify_link_password","parameters":[{"name":"code","in":"path","description":"Short link code","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Password verified"},"401":{"description":"Invalid password"},"404":{"description":"Link not found"},"410":{"description":"Link expired"}}}}},"components":{"schemas":{"AddTagsToLinkRequest":{"type":"object","required":["tag_ids"],"properties":{"tag_ids":{"type":"array","items":{"type":"integer","format":"int32"}}}},"AnalyticsQuery":{"type":"object","properties":{"days":{"type":"integer","format":"int64","nullable":true}}},"AuditLogResponse":{"type":"object","required":["id","action","resource_type","created_at"],"properties":{"action":{"type":"string"},"created_at":{"type":"string"},"details":{"nullable":true},"id":{"type":"integer","format":"int32"},"ip_address":{"type":"string","nullable":true},"resource_id":{"type":"integer","format":"int32","nullable":true},"resource_type":{"type":"string"},"user_email":{"type":"string","nullable":true},"user_id":{"type":"integer","format":"int32","nullable":true}}},"AuthResponse":{"type":"object","required":["token","user_id","email","email_verified","is_admin"],"properties":{"email":{"type":"string"},"email_verified":{"type":"boolean"},"is_admin":{"type":"boolean"},"token":{"type":"string"},"user_id":{"type":"integer","format":"int32"}}},"BrowserStats":{"type":"object","required":["browser","count","percentage"],"properties":{"browser":{"type":"string"},"count":{"type":"integer","format":"int64"},"percentage":{"type":"number","format":"double"}}},"BulkCreateLinkRequest":{"type":"object","required":["urls"],"properties":{"folder_id":{"type":"integer","format":"int32","nullable":true},"org_id":{"type":"integer","format":"int32","nullable":true},"urls":{"type":"array","items":{"type":"string"}}}},"BulkCreateLinkResponse":{"type":"object","required":["links","errors"],"properties":{"errors":{"type":"array","items":{"type":"string"}},"links":{"type":"array","items":{"$ref":"#/components/schemas/CreateLinkResponse"}}}},"BulkDeleteRequest":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"integer","format":"int32"}}}},"BulkDeleteResponse":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"integer","format":"int64","minimum":0}}},"BulkUpdateRequest":{"type":"object","required":["ids"],"properties":{"expires_at":{"type":"string","format":"date-time","nullable":true},"folder_id":{"type":"integer","format":"int32","nullable":true},"ids":{"type":"array","items":{"type":"integer","format":"int32"}},"remove_expiration":{"type":"boolean","nullable":true}}},"BulkUpdateResponse":{"type":"object","required":["updated"],"properties":{"updated":{"type":"integer","format":"int64","minimum":0}}},"CityStats":{"type":"object","required":["city","count","percentage"],"properties":{"city":{"type":"string"},"count":{"type":"integer","format":"int64"},"country":{"type":"string","nullable":true},"percentage":{"type":"number","format":"double"}}},"CountryStats":{"type":"object","required":["country","count","percentage"],"properties":{"count":{"type":"integer","format":"int64"},"country":{"type":"string"},"percentage":{"type":"number","format":"double"}}},"CreateFolderRequest":{"type":"object","required":["name"],"properties":{"color":{"type":"string","nullable":true},"name":{"type":"string"},"org_id":{"type":"integer","format":"int32","nullable":true}}},"CreateLinkRequest":{"type":"object","properties":{"burn_after_reading":{"type":"boolean","nullable":true},"custom_alias":{"type":"string","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"folder_id":{"type":"integer","format":"int32","nullable":true},"max_clicks":{"type":"integer","format":"int32","nullable":true},"notes":{"type":"string","nullable":true},"org_id":{"type":"integer","format":"int32","nullable":true},"original_url":{"type":"string"},"password":{"type":"string","nullable":true},"safe_link_interstitial":{"type":"boolean","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"tag_ids":{"type":"array","items":{"type":"integer","format":"int32"},"nullable":true},"title":{"type":"string","nullable":true}}},"CreateLinkResponse":{"type":"object","required":["id","code","short_url"],"properties":{"code":{"type":"string"},"id":{"type":"integer","format":"int32"},"short_url":{"type":"string"}}},"CreateOrgRequest":{"type":"object","required":["name","slug"],"properties":{"name":{"type":"string"},"slug":{"type":"string"}}},"CreateTagRequest":{"type":"object","required":["name"],"properties":{"color":{"type":"string","nullable":true},"name":{"type":"string"},"org_id":{"type":"integer","format":"int32","nullable":true}}},"DashboardStats":{"type":"object","required":["total_links","total_clicks","active_links","clicks_today","clicks_this_week","clicks_this_month","top_links","clicks_by_day","top_countries","top_browsers"],"properties":{"active_links":{"type":"integer","format":"int64"},"clicks_by_day":{"type":"array","items":{"$ref":"#/components/schemas/DayStats"}},"clicks_this_month":{"type":"integer","format":"int64"},"clicks_this_week":{"type":"integer","format":"int64"},"clicks_today":{"type":"integer","format":"int64"},"top_browsers":{"type":"array","items":{"$ref":"#/components/schemas/BrowserStats"}},"top_countries":{"type":"array","items":{"$ref":"#/components/schemas/CountryStats"}},"top_links":{"type":"array","items":{"$ref":"#/components/schemas/TopLink"}},"total_clicks":{"type":"integer","format":"int64"},"total_links":{"type":"integer","format":"int64"}}},"DayStats":{"type":"object","required":["date","count"],"properties":{"count":{"type":"integer","format":"int64"},"date":{"type":"string"}}},"DeviceStats":{"type":"object","required":["device","count","percentage"],"properties":{"count":{"type":"integer","format":"int64"},"device":{"type":"string"},"percentage":{"type":"number","format":"double"}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"FolderQuery":{"type":"object","properties":{"org_id":{"type":"integer","format":"int32","nullable":true}}},"FolderResponse":{"type":"object","required":["id","name","created_at","link_count"],"properties":{"color":{"type":"string","nullable":true},"created_at":{"type":"string"},"id":{"type":"integer","format":"int32"},"link_count":{"type":"integer","format":"int64"},"name":{"type":"string"},"org_id":{"type":"integer","format":"int32","nullable":true},"user_id":{"type":"integer","format":"int32","nullable":true}}},"GeoPoint":{"type":"object","required":["latitude","longitude","count"],"properties":{"city":{"type":"string","nullable":true},"count":{"type":"integer","format":"int64"},"country":{"type":"string","nullable":true},"latitude":{"type":"number","format":"double"},"longitude":{"type":"number","format":"double"}}},"InviteMemberRequest":{"type":"object","required":["email","role"],"properties":{"email":{"type":"string"},"role":{"type":"string"}}},"LinkResponse":{"type":"object","required":["id","code","short_url","api_url","original_url","click_count","created_at","has_password","burn_after_reading","safe_link_interstitial","bio_visible","is_active","is_pinned","tags"],"properties":{"api_url":{"type":"string"},"bio_visible":{"type":"boolean"},"burn_after_reading":{"type":"boolean"},"burned_at":{"type":"string","nullable":true},"click_count":{"type":"integer","format":"int32"},"code":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string","nullable":true},"folder_id":{"type":"integer","format":"int32","nullable":true},"has_password":{"type":"boolean"},"id":{"type":"integer","format":"int32"},"is_active":{"type":"boolean"},"is_pinned":{"type":"boolean"},"max_clicks":{"type":"integer","format":"int32","nullable":true},"notes":{"type":"string","nullable":true},"org_id":{"type":"integer","format":"int32","nullable":true},"original_url":{"type":"string"},"safe_link_interstitial":{"type":"boolean"},"short_url":{"type":"string"},"starts_at":{"type":"string","nullable":true},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"}},"title":{"type":"string","nullable":true}}},"LinkStatsResponse":{"type":"object","required":["link_id","code","original_url","total_clicks","unique_visitors","clicks_by_day","clicks_by_country","clicks_by_city","clicks_by_device","clicks_by_browser","clicks_by_os","clicks_by_referer","recent_clicks","geo_data"],"properties":{"clicks_by_browser":{"type":"array","items":{"$ref":"#/components/schemas/BrowserStats"}},"clicks_by_city":{"type":"array","items":{"$ref":"#/components/schemas/CityStats"}},"clicks_by_country":{"type":"array","items":{"$ref":"#/components/schemas/CountryStats"}},"clicks_by_day":{"type":"array","items":{"$ref":"#/components/schemas/DayStats"}},"clicks_by_device":{"type":"array","items":{"$ref":"#/components/schemas/DeviceStats"}},"clicks_by_os":{"type":"array","items":{"$ref":"#/components/schemas/OsStats"}},"clicks_by_referer":{"type":"array","items":{"$ref":"#/components/schemas/RefererStats"}},"code":{"type":"string"},"geo_data":{"type":"array","items":{"$ref":"#/components/schemas/GeoPoint"}},"link_id":{"type":"integer","format":"int32"},"original_url":{"type":"string"},"recent_clicks":{"type":"array","items":{"$ref":"#/components/schemas/RecentClick"}},"total_clicks":{"type":"integer","format":"int32"},"unique_visitors":{"type":"integer","format":"int32"}}},"LinksQuery":{"type":"object","properties":{"folder_id":{"type":"integer","format":"int32","nullable":true},"limit":{"type":"integer","format":"int64","nullable":true,"minimum":0},"offset":{"type":"integer","format":"int64","nullable":true,"minimum":0},"org_id":{"type":"integer","format":"int32","nullable":true},"search":{"type":"string","nullable":true},"tag_id":{"type":"integer","format":"int32","nullable":true}}},"LoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string"}}},"MoveLinkToFolderRequest":{"type":"object","required":["link_ids"],"properties":{"link_ids":{"type":"array","items":{"type":"integer","format":"int32"}}}},"OrgMemberResponse":{"type":"object","required":["id","user_id","email","role","joined_at"],"properties":{"email":{"type":"string"},"id":{"type":"integer","format":"int32"},"joined_at":{"type":"string"},"role":{"type":"string"},"user_id":{"type":"integer","format":"int32"}}},"OrgResponse":{"type":"object","required":["id","name","slug","owner_id","created_at","member_count","link_count"],"properties":{"created_at":{"type":"string"},"id":{"type":"integer","format":"int32"},"link_count":{"type":"integer","format":"int64"},"member_count":{"type":"integer","format":"int64"},"name":{"type":"string"},"owner_id":{"type":"integer","format":"int32"},"slug":{"type":"string"}}},"OsStats":{"type":"object","required":["os","count","percentage"],"properties":{"count":{"type":"integer","format":"int64"},"os":{"type":"string"},"percentage":{"type":"number","format":"double"}}},"RecentClick":{"type":"object","required":["id","timestamp"],"properties":{"browser":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"device":{"type":"string","nullable":true},"id":{"type":"integer","format":"int32"},"os":{"type":"string","nullable":true},"referer":{"type":"string","nullable":true},"timestamp":{"type":"string"}}},"RefererStats":{"type":"object","required":["referer","count","percentage"],"properties":{"count":{"type":"integer","format":"int64"},"percentage":{"type":"number","format":"double"},"referer":{"type":"string"}}},"RegisterRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string"}}},"RemoveTagsFromLinkRequest":{"type":"object","required":["tag_ids"],"properties":{"tag_ids":{"type":"array","items":{"type":"integer","format":"int32"}}}},"SuccessResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"TagInfo":{"type":"object","required":["id","name"],"properties":{"color":{"type":"string","nullable":true},"id":{"type":"integer","format":"int32"},"name":{"type":"string"}}},"TagQuery":{"type":"object","properties":{"org_id":{"type":"integer","format":"int32","nullable":true}}},"TagResponse":{"type":"object","required":["id","name","created_at","link_count"],"properties":{"color":{"type":"string","nullable":true},"created_at":{"type":"string"},"id":{"type":"integer","format":"int32"},"link_count":{"type":"integer","format":"int64"},"name":{"type":"string"},"org_id":{"type":"integer","format":"int32","nullable":true},"user_id":{"type":"integer","format":"int32","nullable":true}}},"TopLink":{"type":"object","required":["id","code","original_url","click_count"],"properties":{"click_count":{"type":"integer","format":"int32"},"code":{"type":"string"},"id":{"type":"integer","format":"int32"},"original_url":{"type":"string"}}},"UpdateFolderRequest":{"type":"object","properties":{"color":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}}},"UpdateLinkRequest":{"type":"object","properties":{"bio_visible":{"type":"boolean","nullable":true},"burn_after_reading":{"type":"boolean","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"folder_id":{"type":"integer","format":"int32","nullable":true},"max_clicks":{"type":"integer","format":"int32","nullable":true},"notes":{"type":"string","nullable":true},"original_url":{"type":"string","nullable":true},"password":{"type":"string","nullable":true},"remove_expiration":{"type":"boolean","nullable":true},"remove_max_clicks":{"type":"boolean","nullable":true},"remove_password":{"type":"boolean","nullable":true},"remove_starts_at":{"type":"boolean","nullable":true},"safe_link_interstitial":{"type":"boolean","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"title":{"type":"string","nullable":true}}},"UpdateMemberRoleRequest":{"type":"object","required":["role"],"properties":{"role":{"type":"string"}}},"UpdateOrgRequest":{"type":"object","properties":{"name":{"type":"string","nullable":true},"slug":{"type":"string","nullable":true}}},"UpdateTagRequest":{"type":"object","properties":{"color":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}}},"VerifyPasswordRequest":{"type":"object","required":["password"],"properties":{"password":{"type":"string"}}}},"securitySchemes":{"bearer_auth":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"Authentication","description":"User registration, login, and passkey management"},{"name":"Links","description":"Create, manage, and redirect shortened URLs"},{"name":"Analytics","description":"View click statistics and analytics"},{"name":"Organizations","description":"Team and organization management"},{"name":"Folders","description":"Organize links into folders"},{"name":"Tags","description":"Tag and categorize links"}]}