{"openapi":"3.0.0","info":{"title":"2FAuth API","version":"1.0","license":{"name":"AGPL-3.0","url":"https://www.gnu.org/licenses/agpl-3.0.html"},"contact":{"name":"Bubka"},"description":"Official 2FAuth API"},"servers":[{"url":"http://2fauth/api","description":"dev"}],"paths":{"/twofaccounts":{"get":{"summary":"Get all Twofaccounts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwofaccountArray"},"examples":{"example-1":{"value":[{"id":10,"group_id":5,"service":"MySite","account":"john.doe","icon":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","isConsistent":true,"otpType":"totp"}]}}}}}},"operationId":"get-twofaccounts","description":"List all twofaccounts resources with basic attributes only","tags":["twofaccounts"]},"post":{"summary":"Create a Twofaccount","operationId":"post-twofaccounts","responses":{"201":{"description":"Created"}},"description":"Create a Twofaccount resource","tags":["twofaccounts"],"requestBody":{"content":{"application/json":{"schema":{"description":"","type":"object","properties":{"service":{"type":"string","example":"Mysite"},"account":{"type":"string","minLength":1,"example":"john.doe","pattern":"^[^:]+$"},"otpType":{"type":"string","enum":["totp","hotp"],"example":"totp"},"uri":{"type":"string","example":"otpauth://totp/MySite:john.doe?secret=A3HIETVV5BGY9UIW&issuer=MySite&period=30&algorithm=sha1&digits=6&image=https://www.example.com/icon.png","pattern":"^otpauth:\\/\\/[h,t]otp\\/","format":"uri"},"icon":{"type":"string","minLength":1,"example":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","description":"An image resource already in storage"},"secret":{"type":"string","minLength":1,"example":"A3HIETVV5BGY9UIW"},"secretIsBase32Encoded":{"type":"integer","enum":[0,1],"description":"Wether or not the provided secret is already base32 encoded"},"algorithm":{"type":"string","enum":["sha1","sha256","sha512","md5"],"example":"sha1"},"digits":{"type":"integer","minimum":6,"maximum":10,"example":6},"hotpCounter":{"type":"integer","example":15,"minimum":0},"totpPeriod":{"type":"number","example":30,"minimum":1},"imageLink":{"type":"string","example":"https://www.example.com/icon.png","format":"uri"}},"required":["service","account","otpType","secret"]},"examples":{"example-1":{"value":{"service":"Mysite","account":"john.doe","otpType":"totp","uri":"otpauth://totp/MySite:john.doe?secret=A3HIETVV5BGY9UIW&issuer=MySite&period=30&algorithm=sha1&digits=6&image=https://www.example.com/icon.png","icon":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","secret":"A3HIETVV5BGY9UIW","secretIsBase32Encoded":0,"algorithm":"sha1","digits":6,"hotpCounter":15,"totpPeriod":30,"imageLink":"https://www.example.com/icon.png"}}}}},"description":"Request body with all OTP attributes"}},"delete":{"summary":"Batch delete Twofaccounts","operationId":"delete-twofaccounts","responses":{"204":{"description":"No Content"}},"description":"Delete Twofaccount resources matching provided IDs","tags":["twofaccounts"],"requestBody":{"content":{"application/json":{"schema":{"type":"array","description":"A list of Twofaccount IDs to delete","minItems":1,"uniqueItems":true,"items":{"type":"integer","example":2}},"examples":{"example-1":{"value":[2,8,9]}}}}}}},"/twofaccounts/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"summary":"Get light Twofaccount","tags":["twofaccounts"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Twofaccount"},"examples":{"example-1":{"value":{"id":10,"group_id":5,"service":"MySite","account":"john.doe","icon":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","order_column":2,"isConsistent":true,"otpType":"totp","digits":6,"totpPeriod":30,"hotpCounter":5,"imageLink":"https://www.example.com/image.png","uri":"otpauth://totp/MySite:john.doe?secret=A3HIETVV5BGY9UIW&issuer=MySite&period=30&algorithm=sha1&digits=6","secret":"A3HIETVV5BGY9UIW","algorithm":"sha1"}}}}}},"404":{"description":"Resource not found"}},"operationId":"get-twofaccounts-id","description":"Get a single Twofaccount resource.\n\nBy default only safe attributes are returned. Use the `withSensitive` query parameter to get OTP sensitive attributes (`uri`, `secret` and `algorithm`)","parameters":[{"schema":{"type":"boolean"},"in":"query","name":"withSensitive","allowEmptyValue":true,"description":"Add sensitives attributes (`uri`, `secret` and `algorithm`) to the response body object"}]},"put":{"summary":"Update Twofaccount","operationId":"put-twofaccounts-id","responses":{"200":{"description":"Twofaccount updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Twofaccount"}}}},"404":{"description":"Not found"}},"description":"Update a twofaccount resource","tags":["twofaccounts"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"string","minLength":1,"example":"Mysite"},"account":{"type":"string","minLength":1,"example":"john.doe","pattern":"^[^:]+$"},"otpType":{"type":"string","enum":["totp","hotp"],"example":"totp"},"icon":{"type":"string","minLength":1,"example":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png"},"secret":{"type":"string","minLength":1,"example":"A3HIETVV5BGY9UIW"},"secretIsBase32Encoded":{"type":"integer","enum":[0,1],"description":"Wether or not the provided secret is already base32 encoded","example":0},"algorithm":{"type":"string","enum":["sha1","sha256","sha512","md5"],"example":"sha1"},"digits":{"type":"integer","minimum":6,"maximum":10,"example":6},"hotpCounter":{"type":"integer","example":15,"minimum":0},"totpPeriod":{"type":"number","example":30,"minimum":1},"imageLink":{"type":"string","example":"https://www.example.com/icon.png","format":"uri"}}},"examples":{"example-1":{"value":{"service":"Mysite","account":"john.doe","otpType":"totp","icon":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","secret":"A3HIETVV5BGY9UIW","secretIsBase32Encoded":1,"algorithm":"sha1","digits":6,"hotpCounter":15,"totpPeriod":30,"imageLink":"https://www.example.com/icon.png"}}}}}}},"delete":{"summary":"Delete Twofaccount","operationId":"delete-twofaccounts-id","responses":{"204":{"description":"No Content"}},"description":"Delete a twofaccount resource","tags":["twofaccounts"]}},"/twofaccounts/{id}/qrcode":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"summary":"Get a QR code","tags":["twofaccounts"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"qrcode":{"type":"string","format":"byte","description":"A base64 encoded image resource"}}},"examples":{}}}}},"operationId":"get-twofaccounts-id-qrcode","description":"Get a QR code that represente the Twofaccount (its encoded URI)"}},"/twofaccounts/{id}/token":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"summary":"Get a token","tags":["token","twofaccounts"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}}},"operationId":"get-twofaccounts-id-token","description":"Get a token for the Twofaccount"}},"/twofaccounts/order":{"patch":{"summary":"Reorder Twofaccounts","operationId":"patch-twofaccounts-order","responses":{"200":{"description":"Order saved","headers":{}}},"description":"Save Twofaccounts order","requestBody":{"content":{"application/json":{"schema":{"description":"","type":"object","properties":{"orderedIds":{"type":"array","uniqueItems":true,"description":"Twofaccount IDs listed in the wanted order","items":{"type":"integer"}}},"required":["orderedIds"]},"examples":{"example-1":{"value":{"orderedIds":[3,1,4,7,2,5,6]}}}}}},"tags":["twofaccounts"]}},"/twofaccounts/preview":{"post":{"summary":"Preview a Twofaccount","operationId":"post-twofaccounts-preview","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Twofaccount"},"examples":{"example-1":{"value":{"id":10,"group_id":5,"service":"MySite","account":"john.doe","icon":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","order_column":2,"isConsistent":true,"otpType":"totp","digits":6,"totpPeriod":30,"hotpCounter":5,"imageLink":"https://www.example.com/image.png","uri":"otpauth://totp/MySite:john.doe?secret=A3HIETVV5BGY9UIW&issuer=MySite&period=30&algorithm=sha1&digits=6","secret":"A3HIETVV5BGY9UIW","algorithm":"sha1"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}},"description":"Get the Twofaccount resource described by the provided otpauth URI","tags":["twofaccounts"],"requestBody":{"content":{"application/json":{"schema":{"description":"","type":"object","properties":{"uri":{"type":"string","example":"otpauth://totp/MySite:john.doe?secret=A3HIETVV5BGY9UIW&issuer=MySite&period=30&algorithm=sha1&digits=6&image=https://www.example.com/icon.png"}},"required":["uri"]},"examples":{"example-1":{"value":{"uri":"otpauth://totp/MySite:john.doe?secret=A3HIETVV5BGY9UIW&issuer=MySite&period=30&algorithm=sha1&digits=6&image=https://www.example.com/icon.png"}}}}},"description":""}}},"/twofaccounts/token":{"post":{"summary":"Get a token","operationId":"post-twofaccounts-token","responses":{"200":{"description":"OK"}},"description":"Get a token for the provided Twofaccount","tags":["token","twofaccounts"]}},"/icon":{"post":{"summary":"","operationId":"post-icon","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","example":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","description":"The filename of the icon in storage"}}},"examples":{"example-1":{"value":{"filename":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}},"tags":["icon"],"description":"Add an image file in storage.\n\nThe image stored are used as Twofaccount icons. Store the image first, then use the returned filename to set the `icon` parameter of a Twofaccount.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"string","format":"binary","description":"An image file (jpeg, png, bmp, gif, svg, or webp)"}}},"description":""}},"parameters":[]},"/icon/{filename}":{"parameters":[{"schema":{"type":"string","example":"ZMlzmrPsrWSWVt4fZouFVrt2w38D0PnXiyZQvDcY.png"},"name":"filename","in":"path","required":true,"description":"The filename of the file to delete"}],"delete":{"summary":"","operationId":"delete-icon-filename","responses":{"204":{"description":"No Content"}},"tags":["icon"],"description":"Delete an image file from storage."}},"/groups":{"get":{"summary":"Get all Groups","tags":["groups"],"responses":{"200":{"description":"All Groups","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupArray"},"examples":{"example-1":{"value":[{"name":"All","id":1,"twofaccounts_count":5,"isActive":false},{"name":"MyGroup","id":2,"twofaccounts_count":3,"isActive":true}]}}}}}},"operationId":"get-groups","description":"List all Group resources.\n\nThe first group is always a pseudo-group named `All` which fetch all existing Twofaccounts."},"post":{"summary":"Create a Group","operationId":"post-groups","responses":{"201":{"description":"Group created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"},"examples":{"example-1":{"value":{"name":"MyGroup","id":2,"isActive":false}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}},"description":"Create a Group","requestBody":{"content":{"application/json":{"schema":{"description":"","type":"object","properties":{"name":{"type":"string","example":"MyGroup","description":"The name of the group, must be unique","maxLength":32}},"required":["name"]}}}},"tags":["groups"]}},"/groups/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"summary":"Get a group","tags":["groups"],"responses":{"200":{"description":"The requested Group","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"404":{"description":"Not Found"}},"operationId":"get-groups-id","description":"Get a single Group resource"},"put":{"summary":"Update a group","operationId":"put-groups-id","responses":{"200":{"description":"Group updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"},"examples":{"example-1":{"value":{"name":"MyGroup-new-name","id":2,"isActive":true}}}}}},"404":{"description":"Not found"},"422":{"$ref":"#/components/responses/ValidationError"}},"description":"Update a Group resource","tags":["groups"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"MyGroup","description":"The new name of the group, must be unique","maxLength":32}},"required":["name"]},"examples":{"example-1":{"value":{"name":"MyGroup-new-name"}}}}},"description":"New Group definition"}},"delete":{"summary":"Delete a Group","operationId":"delete-groups-id","responses":{"204":{"description":"Group deleted"},"404":{"description":"Not Found"}},"tags":["groups"],"description":"Delete a Group resource"}},"/groups/{id}/accounts":{"parameters":[{"$ref":"#/components/parameters/id"}],"patch":{"summary":"Update group Twofaccounts","operationId":"patch-groups-id-accounts","responses":{"200":{"description":"Associated Twofaccounts updated"}},"tags":["groups"],"description":"Update Twofaccounts associated to a Group"},"get":{"summary":"Get the group Twofaccounts","operationId":"get-groups-id-accounts","responses":{"200":{"description":"The list of associated Twofaccounts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwofaccountArray"}}}}},"description":"Get Twofaccounts associated to a Group","tags":["twofaccounts","groups"]}},"/options":{"get":{"summary":"Get all Options","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Options"},"examples":{"example-1":{"value":{"isDemoApp":true,"showTokenAsDot":true,"closeTokenOnCopy":true,"useBasicQrcodeReader":true,"displayMode":"string","showAccountsIcons":true,"kickUserAfter":"string","activeGroup":0,"rememberActiveGroup":true,"defaultGroup":"string","useEncryption":true,"defaultCaptureMode":"string","useDirectCapture":true,"lang":"string"}}}}}}},"operationId":"get-options","description":"List all Options","tags":["options"]},"post":{"summary":"Save Settings","operationId":"post-options","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Options"},"examples":{"example-1":{"value":{"isDemoApp":true,"showTokenAsDot":true,"closeTokenOnCopy":true,"useBasicQrcodeReader":true,"displayMode":"string","showAccountsIcons":true,"kickUserAfter":"string","activeGroup":0,"rememberActiveGroup":true,"defaultGroup":"string","useEncryption":true,"defaultCaptureMode":"string","useDirectCapture":true,"lang":"string"}}}}}}},"description":"Save Options","requestBody":{"content":{"application/json":{"schema":{"description":"","type":"object","properties":{"lang":{"type":"string","minLength":1},"showTokenAsDot":{"type":"boolean"},"closeTokenOnCopy":{"type":"boolean"},"useBasicQrcodeReader":{"type":"boolean"},"showAccountsIcons":{"type":"boolean"},"displayMode":{"type":"string","minLength":1},"kickUserAfter":{"type":"string","minLength":1},"useEncryption":{"type":"boolean"},"defaultGroup":{"type":"string","minLength":1},"useDirectCapture":{"type":"boolean"},"defaultCaptureMode":{"type":"string","minLength":1},"rememberActiveGroup":{"type":"boolean"}},"required":["lang","showTokenAsDot","closeTokenOnCopy","useBasicQrcodeReader","showAccountsIcons","displayMode","kickUserAfter","useEncryption","defaultGroup","useDirectCapture","defaultCaptureMode","rememberActiveGroup"]}}}},"tags":["options"]},"parameters":[]},"/user":{"get":{"summary":"Get User","tags":["user"],"responses":{"200":{"description":"The registered user","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"John DOE","description":"Name of the user"},"email":{"type":"string","format":"email","example":"john.doe@example.com","description":"Email address of the user"}},"required":["name","email"]},"examples":{"example-1":{"value":{"name":"John DOE","email":"john.doe@example.com"}}}}}},"404":{"description":"Resource not found"}},"operationId":"get-user-infos","description":"Get user infos.\n\nThere is only one possible registered user, so the endpoint is singular."},"put":{"summary":"","operationId":"put-user-infos","responses":{"200":{"description":"User updated","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Jane DOE","description":"New name of the user"},"email":{"type":"string","format":"email","example":"jane.doe@example.com","description":"New email address of the user"}},"required":["name","email"]},"examples":{"example-1":{"value":{"name":"Jane DOE","email":"jane.doe@example.com"}}}}}},"404":{"description":"Resource not found"}},"description":"Update user infos.\n\nThere is only one possible registered user, so the endpoint is singular.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New name of the user","example":"Jane DOE"},"email":{"type":"string","format":"email","description":"New email address of the user","example":"jane.doe@example.com"},"password":{"type":"string","description":"Current password of the user (for security check)","example":"X4#fj6&vjs-cv)#5dd_T","format":"password"}},"required":["name","email","password"]},"examples":{"example-1":{"value":{"name":"Jane DOE","email":"jane.doe@example.com","password":"X4#fj6&vjs-cv)#5dd_T"}}}}},"description":"New user infos"},"tags":["user"]},"parameters":[]},"/user/password":{"patch":{"summary":"Update password","operationId":"patch-user-password","responses":{"200":{"description":"Password updated"},"422":{"$ref":"#/components/responses/ValidationError"}},"tags":["user"],"description":"Update the user password.\n\nThere is only one possible registered user, so the endpoint is singular.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"currentPassword":{"type":"string","description":"The current user password","format":"password","example":"curr3ntPa$$word"},"password":{"type":"string","description":"The new password","minLength":8,"format":"password","example":"n3wPa$$word"}},"required":["currentPassword","password"]},"examples":{"example-1":{"value":{"currentPassword":"curr3ntPa$$word","password":"n3wPa$$word"}}}}},"description":"The current password (for security check) and the new one"}}}},"components":{"schemas":{"Twofaccount":{"description":"A single 2-Factor-Auth account","type":"object","x-examples":{"example-1":{"id":10,"group_id":5,"service":"MySite","account":"john.doe","icon":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","order_column":2,"isConsistent":true,"otpType":"totp","digits":6,"totpPeriod":30,"hotpCounter":5,"imageLink":"https://www.example.com/image.png","uri":"otpauth://totp/MySite:john.doe?secret=A3HIETVV5BGY9UIW&issuer=MySite&period=30&algorithm=sha1&digits=6","secret":"A3HIETVV5BGY9UIW","algorithm":"sha1"}},"title":"Twofaccount","x-tags":["twofaccounts"],"properties":{"id":{"type":"integer","example":10,"description":"Id of the twofaccount"},"group_id":{"type":"integer","nullable":true,"example":5,"description":"The group ID the twofaccount belongs to"},"service":{"type":"string","description":"The Issuer of the OTP","example":"MySite"},"account":{"type":"string","example":"john.doe","description":"The Label of the OTP"},"icon":{"type":"string","nullable":true,"example":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","description":"The icon of the twofaccount"},"order_column":{"type":"integer","example":2,"minimum":1,"description":"Position of the twofaccount in the whole twofaccounts list"},"isConsistent":{"type":"boolean","description":"Whether or not the twofaccount has been successfully deciphered"},"otpType":{"type":"string","enum":["totp","hotp"],"example":"totp","description":"The type of OTP"},"digits":{"type":"integer","example":6,"minimum":6,"maximum":10,"description":"the number of digits of the generated tokens"},"totpPeriod":{"type":"integer","nullable":true,"default":30,"example":30,"minimum":1,"description":"The validity duration of generated tokens"},"hotpCounter":{"type":"integer","nullable":true,"minimum":0,"example":5,"description":"The value of the counter used to synchronize with HOTP verification servers"},"imageLink":{"type":"string","format":"uri","nullable":true,"example":"https://www.example.com/image.png","description":"an external image resource"},"uri":{"type":"string","format":"uri","pattern":"^otpauth:\\/\\/(totp|hotp)\\/.+","example":"otpauth://totp/MySite:john.doe?secret=A3HIETVV5BGY9UIW&issuer=MySite&period=30&algorithm=sha1&digits=6","description":"The uri which describe the 2FA account, usually encoded as a QR code"},"secret":{"type":"string","example":"A3HIETVV5BGY9UIW","description":"a base32 encoded string"},"algorithm":{"type":"string","enum":["sha1","sha256","sha512","md5"],"example":"sha1","description":"The algorithm used to generate the tokens","default":"sha1"}},"required":["id","group_id","service","account","icon","order_column","isConsistent","otpType","digits","totpPeriod","hotpCounter","imageLink"]},"TwofaccountArray":{"title":"TwofaccountArray","type":"array","x-examples":{"example-1":[{"id":10,"group_id":5,"service":"MySite","account":"john.doe","icon":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","isConsistent":true,"otpType":"totp"}]},"description":"An ordered list of 2-Factor-Auth accounts with basic attributes only","x-tags":["twofaccounts"],"items":{"type":"object","properties":{"id":{"type":"integer","example":10,"description":"Id of the twofaccount"},"group_id":{"type":"integer","nullable":true,"example":5,"description":"The group ID the twofaccount belongs to"},"service":{"type":"string","example":"MySite","description":"The Issuer of the OTP"},"account":{"type":"string","example":"john.doe","description":"The Label of the OTP"},"icon":{"type":"string","example":"XdPPECCaW6y6ZBLtjxq1NpNb0vUKtuoJcTXMaYmD.png","description":"A filename without path"},"isConsistent":{"type":"boolean","description":"Whether or not the twofaccount has been successfully deciphered"},"otpType":{"type":"string","enum":["totp","hotp"],"example":"totp","description":"The type of OTP"}},"required":["id","group_id","service","account","icon","isConsistent","otpType"]}},"Token":{"description":"A 2FA token","type":"object","x-examples":{"example-1":{"token":"536489","totpPeriod":30,"totpTimestamp":1607705370}},"x-tags":["token"],"properties":{"token":{"type":"string","minLength":6,"pattern":"^[0-9]","example":"536489","maxLength":10,"description":"A generated OTP code"},"totpPeriod":{"type":"integer","example":30,"minimum":1,"description":"Validity duration of a TOTP token, in second"},"totpTimestamp":{"type":"integer","example":1607705370,"description":"The timestamp at TOTP token generation"}},"required":["token"],"title":"Token"},"Group":{"description":"A single Group","type":"object","x-examples":{"example-1":{"name":"MyGroup","id":1,"twofaccounts_count":5,"isActive":true}},"title":"Group","properties":{"name":{"type":"string","example":"MyGroup","description":"the name of the Group"},"id":{"type":"integer","example":1,"description":"the Id of the Group"},"twofaccounts_count":{"type":"integer","example":5,"description":"Number of Twofaccounts associated to the Group"},"isActive":{"type":"boolean","description":"Whether or not the group is the active one"}},"required":["name","id","isActive"]},"GroupArray":{"type":"array","title":"GroupArray","description":"A list of Groups completed with a pseudo-group named 'All' which gather all Twofaccounts","x-examples":{"example-1":[{"name":"All","id":1,"twofaccounts_count":5,"isActive":false},{"name":"MyGroup","id":2,"twofaccounts_count":3,"isActive":true}]},"minItems":1,"items":{"$ref":"#/components/schemas/Group"}},"Options":{"description":"A list of options","type":"object","properties":{"isDemoApp":{"type":"boolean"},"showTokenAsDot":{"type":"boolean"},"closeTokenOnCopy":{"type":"boolean"},"useBasicQrcodeReader":{"type":"boolean"},"displayMode":{"type":"string","minLength":1},"showAccountsIcons":{"type":"boolean"},"kickUserAfter":{"type":"string","minLength":1},"activeGroup":{"type":"number"},"rememberActiveGroup":{"type":"boolean"},"defaultGroup":{"type":"string","minLength":1},"useEncryption":{"type":"boolean"},"defaultCaptureMode":{"type":"string","minLength":1},"useDirectCapture":{"type":"boolean"},"lang":{"type":"string","minLength":1}},"required":["isDemoApp","showTokenAsDot","closeTokenOnCopy","useBasicQrcodeReader","displayMode","showAccountsIcons","kickUserAfter","activeGroup","rememberActiveGroup","defaultGroup","useEncryption","defaultCaptureMode","useDirectCapture","lang"],"title":"Options"}},"securitySchemes":{"2FAuth_auth":{"name":"API Key","type":"apiKey","in":"query"}},"responses":{"ValidationError":{"description":"Validation errors\n\nSee `errors` object in body for details.","content":{"application/json":{"schema":{"description":"","type":"object","properties":{"message":{"type":"string","minLength":1,"example":"The given data was invalid."},"errors":{"type":"object","description":"An object of fields with their respective errors","minProperties":1,"properties":{"fieldName_A":{"type":"array","description":"All validation errors for fieldName A","items":{"type":"string","example":"The fieldName_A field is required"}},"fieldName_B":{"type":"array","description":"All validation errors for fieldName B","items":{"type":"string","example":"The fieldName_B must not contain number"}}}}},"required":["message"]},"examples":{"example-1":{"value":{"message":"The given data was invalid.","errors":{"fieldName_A":["The fieldName_A field is required"],"fieldName_B":["The fieldName_B must not contain number"]}}}}}}}},"parameters":{"id":{"name":"id","in":"path","schema":{"type":"integer","example":2},"description":"The ID of the resource","required":true}}},"tags":[{"name":"twofaccounts"},{"name":"token"},{"name":"icon"},{"name":"groups"},{"name":"options"},{"name":"user"}]}