{ "swagger": "2.0", "info": { "contact": {} }, "paths": { "/accesskeys": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get all access keys for the authenticated user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "access_key" ], "summary": "Get access keys", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/model.AccessKey" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a new access key for the authenticated user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "access_key" ], "summary": "Create access key", "parameters": [ { "description": "Access Key Request", "name": "access_key", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.AccessKeyReq" } } ], "responses": { "200": { "description": "token", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/accesskeys/{id}": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete access key by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "access_key" ], "summary": "Delete access key", "parameters": [ { "type": "string", "description": "Access Key ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/alias": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create alias", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Create alias", "parameters": [ { "description": "Alias request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.AliasReq" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/alias/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get alias by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Get alias", "parameters": [ { "type": "string", "description": "Alias ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Alias" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update alias", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Update alias", "parameters": [ { "type": "string", "description": "Alias ID", "name": "id", "in": "path", "required": true }, { "description": "Alias request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.AliasReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete alias", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Delete alias", "parameters": [ { "type": "string", "description": "Alias ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/aliases": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get all aliases", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Get aliases", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.AliasList" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/aliases/export": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Export all aliases as CSV", "consumes": [ "application/json" ], "produces": [ "text/csv" ], "tags": [ "alias" ], "summary": "Export aliases", "responses": { "200": { "description": "CSV data", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/api/alias": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create alias", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Create alias", "parameters": [ { "description": "Alias request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.AliasReq" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/api/alias/{id}": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update alias", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Update alias", "parameters": [ { "type": "string", "description": "Alias ID", "name": "id", "in": "path", "required": true }, { "description": "Alias request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.AliasReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete alias", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Delete alias", "parameters": [ { "type": "string", "description": "Alias ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/api/aliases": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get all aliases", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "alias" ], "summary": "Get aliases", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.AliasList" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/api/authenticate": { "post": { "description": "Authenticate using an access key to obtain a session token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "access_key" ], "summary": "Authenticate with access key", "parameters": [ { "description": "Authentication Request", "name": "auth_req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.AuthReq" } } ], "responses": { "200": { "description": "token", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/api/defaults": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get default settings and recipients for the authenticated user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "access_key" ], "summary": "Get default settings", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/api/logout": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Logout the authenticated API user by invalidating their session token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "access_key" ], "summary": "Logout API user", "responses": { "200": { "description": "message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/email": { "post": { "description": "Handle incoming email", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "email" ], "summary": "Email handler", "parameters": [ { "description": "Email body", "name": "email", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/initiatepasswordreset": { "post": { "description": "Initiate password reset", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Initiate password reset", "parameters": [ { "description": "Initiate password reset request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.EmailReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/log/file/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get log file by ID for the authenticated user", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "tags": [ "log" ], "summary": "Get log file", "parameters": [ { "type": "string", "description": "Log ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Log file content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/login": { "post": { "description": "Login user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Login user", "parameters": [ { "description": "User request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.UserReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/login/begin": { "post": { "description": "Begin login process", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "webauthn" ], "summary": "Begin login", "parameters": [ { "description": "Email", "name": "email", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.EmailReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/login/finish": { "post": { "description": "Finish login process", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "webauthn" ], "summary": "Finish login", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/logs": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get all logs for the authenticated user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Get logs", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/model.Log" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete all logs for the authenticated user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Delete logs", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/recipient": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update recipient", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipient" ], "summary": "Update recipient", "parameters": [ { "description": "Recipient request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.RecipientReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create recipient", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipient" ], "summary": "Create recipient", "parameters": [ { "description": "Recipient request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.EmailReq" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/recipient/activate/{id}": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Activate recipient", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipient" ], "summary": "Activate recipient", "parameters": [ { "type": "string", "description": "Recipient ID", "name": "id", "in": "path", "required": true }, { "description": "Activate request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.ActivateReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/recipient/sendotp/{id}": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Send recipient OTP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipient" ], "summary": "Send recipient OTP", "parameters": [ { "type": "string", "description": "Recipient ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/recipient/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get recipient by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipient" ], "summary": "Get recipient", "parameters": [ { "type": "string", "description": "Recipient ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Recipient" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete recipient", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipient" ], "summary": "Delete recipient", "parameters": [ { "type": "string", "description": "Recipient ID", "name": "id", "in": "path", "required": true }, { "description": "Delete recipient request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.DeleteRecipientReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/recipients": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get all recipients", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipient" ], "summary": "Get recipients", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/model.Recipient" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/register": { "post": { "description": "Register user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Register user", "parameters": [ { "description": "User request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.SignupUserReq" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/register/add": { "post": { "description": "Begin Add Passkey process", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "webauthn" ], "summary": "Add Passkey", "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/register/add/finish": { "post": { "description": "Finish add Passkey process", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "webauthn" ], "summary": "Finish add Passkey", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/register/begin": { "post": { "description": "Begin registration process", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "webauthn" ], "summary": "Begin registration", "parameters": [ { "description": "Email", "name": "email", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.SignupEmailReq" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/register/finish": { "post": { "description": "Finish registration process", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "webauthn" ], "summary": "Finish registration", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/resetpassword": { "put": { "description": "Reset password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Reset password", "parameters": [ { "description": "Password reset request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.ResetPasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/settings": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get settings", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "settings" ], "summary": "Get settings", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Settings" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update settings", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "settings" ], "summary": "Update settings", "parameters": [ { "description": "Settings", "name": "settings", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.SettingsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/sub": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get subscription", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscription" ], "summary": "Get subscription", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Subscription" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/subscription/add": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Add subscription", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscription" ], "summary": "Add subscription", "parameters": [ { "description": "Subscription request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.SubscriptionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/subscription/update": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update subscription", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscription" ], "summary": "Update subscription", "parameters": [ { "description": "Subscription request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.SubscriptionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get user", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.User" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/activate": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Activate user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Activate user", "parameters": [ { "description": "Activate request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.ActivateReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/changeemail": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Change email", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Change email", "parameters": [ { "description": "Change email request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.EmailReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/changepassword": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Change password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Change password", "parameters": [ { "description": "Change password request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.ChangePasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/credential/{id}": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete credential by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "webauthn" ], "summary": "Delete credential", "parameters": [ { "type": "string", "description": "Credential ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/credentials": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get user credentials", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "webauthn" ], "summary": "Get credentials", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/model.Credential" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Delete user", "parameters": [ { "description": "Delete user request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.DeleteUserReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/delete/request": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete user request", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Delete user request", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/logout": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Logout user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Logout user", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/sendotp": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Send user OTP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Send user OTP", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/stats": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get user stats", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get user stats", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.UserStats" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/totp/disable": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Disable TOTP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Disable TOTP", "parameters": [ { "description": "TOTP confirm request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.TotpReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.SuccessRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/totp/enable": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Enable TOTP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Enable TOTP", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.TOTPNew" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } }, "/user/totp/enable/confirm": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Enable TOTP confirm", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Enable TOTP confirm", "parameters": [ { "description": "TOTP confirm request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.TotpReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.TOTPBackup" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrorRes" } } } } } }, "definitions": { "api.AccessKeyReq": { "type": "object", "required": [ "name" ], "properties": { "expires_at": { "type": "string" }, "name": { "type": "string" } } }, "api.ActivateReq": { "type": "object", "required": [ "otp" ], "properties": { "otp": { "type": "string" } } }, "api.AliasReq": { "type": "object", "required": [ "domain", "recipients" ], "properties": { "catch_all_suffix": { "type": "string", "maxLength": 12, "minLength": 6 }, "description": { "type": "string" }, "domain": { "type": "string" }, "enabled": { "type": "boolean" }, "format": { "type": "string" }, "from_name": { "type": "string" }, "recipients": { "type": "string" } } }, "api.AuthReq": { "type": "object", "required": [ "access_key" ], "properties": { "access_key": { "type": "string", "maxLength": 85, "minLength": 85 } } }, "api.ChangePasswordReq": { "type": "object", "properties": { "password": { "type": "string" } } }, "api.DeleteRecipientReq": { "type": "object", "properties": { "recipients": { "type": "string" } } }, "api.DeleteUserReq": { "type": "object", "required": [ "otp" ], "properties": { "otp": { "type": "string" } } }, "api.EmailReq": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string" } } }, "api.ErrorRes": { "type": "object", "properties": { "error": { "type": "string" } } }, "api.RecipientReq": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" }, "pgp_enabled": { "type": "boolean" }, "pgp_inline": { "type": "boolean" }, "pgp_key": { "type": "string" } } }, "api.ResetPasswordReq": { "type": "object", "required": [ "otp" ], "properties": { "otp": { "type": "string" }, "password": { "type": "string" } } }, "api.SettingsReq": { "type": "object", "required": [ "id" ], "properties": { "alias_format": { "type": "string" }, "domain": { "type": "string" }, "from_name": { "type": "string" }, "id": { "type": "string" }, "log_issues": { "type": "boolean" }, "recipient": { "type": "string" }, "remove_header": { "type": "boolean" } } }, "api.SignupEmailReq": { "type": "object", "required": [ "email", "subid" ], "properties": { "email": { "type": "string" }, "subid": { "type": "string" } } }, "api.SignupUserReq": { "type": "object", "required": [ "email", "subid" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" }, "subid": { "type": "string" } } }, "api.SubscriptionReq": { "type": "object", "required": [ "active_until", "id" ], "properties": { "active_until": { "type": "string" }, "id": { "type": "string" } } }, "api.SuccessRes": { "type": "object", "properties": { "message": { "type": "string" } } }, "api.TotpReq": { "type": "object", "required": [ "otp" ], "properties": { "otp": { "type": "string", "maxLength": 8, "minLength": 6 } } }, "api.UserReq": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string" }, "otp": { "type": "string", "maxLength": 8, "minLength": 0 }, "password": { "type": "string" } } }, "model.AccessKey": { "type": "object", "properties": { "created_at": { "type": "string" }, "expires_at": { "description": "nullable", "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "user_id": { "type": "string" } } }, "model.Alias": { "type": "object", "properties": { "catch_all": { "type": "boolean" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "from_name": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "recipients": { "type": "string" }, "stats": { "$ref": "#/definitions/model.AliasStats" } } }, "model.AliasList": { "type": "object", "properties": { "aliases": { "type": "array", "items": { "$ref": "#/definitions/model.Alias" } }, "total": { "type": "integer" } } }, "model.AliasStats": { "type": "object", "properties": { "blocks": { "type": "integer" }, "forwards": { "type": "integer" }, "replies": { "type": "integer" }, "sends": { "type": "integer" } } }, "model.Credential": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "user_id": { "type": "string" } } }, "model.Log": { "type": "object", "properties": { "attempted_at": { "type": "string" }, "created_at": { "type": "string" }, "destination": { "type": "string" }, "from": { "type": "string" }, "id": { "type": "string" }, "log_type": { "$ref": "#/definitions/model.LogType" }, "message": { "type": "string" }, "remote_mta": { "type": "string" }, "status": { "type": "string" } } }, "model.LogType": { "type": "string", "enum": [ "bounce", "disabled_alias", "unauthorised_send" ], "x-enum-varnames": [ "BounceMessage", "DisabledAlias", "UnauthorisedSend" ] }, "model.Recipient": { "type": "object", "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "is_active": { "type": "boolean" }, "pgp_enabled": { "type": "boolean" }, "pgp_inline": { "type": "boolean" }, "pgp_key": { "type": "string" } } }, "model.Settings": { "type": "object", "properties": { "alias_format": { "type": "string" }, "created_at": { "type": "string" }, "domain": { "type": "string" }, "from_name": { "type": "string" }, "id": { "type": "string" }, "log_issues": { "type": "boolean" }, "recipient": { "type": "string" }, "remove_header": { "type": "boolean" } } }, "model.Subscription": { "type": "object", "properties": { "active_until": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "type": { "$ref": "#/definitions/model.SubscriptionType" } } }, "model.SubscriptionType": { "type": "string", "enum": [ "Free", "Managed" ], "x-enum-varnames": [ "Free", "Managed" ] }, "model.TOTPBackup": { "type": "object", "properties": { "backup": { "type": "string" } } }, "model.TOTPNew": { "type": "object", "properties": { "account": { "type": "string" }, "secret": { "type": "string" }, "uri": { "type": "string" } } }, "model.User": { "type": "object", "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "is_active": { "type": "boolean" }, "totp_enabled": { "type": "boolean" } } }, "model.UserStats": { "type": "object", "properties": { "aliases": { "type": "integer" }, "blocks": { "type": "integer" }, "forwards": { "type": "integer" }, "messages": { "type": "array", "items": {} }, "replies": { "type": "integer" }, "sends": { "type": "integer" } } } } }