{"openapi":"3.0.2","info":{"title":"EnvelopeBudget API","version":"0.1.0"},"paths":{"/token":{"post":{"tags":["Auth"],"summary":"Login For Access Token","description":"Handles the login process and returns an access token.\n\nParameters:\n    username (str): The username of the user.\n    password (str): The password of the user.\n    db: The database instance.\n\nReturns:\n    dict: A dictionary containing the access token and token type.","operationId":"login_for_access_token_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_for_access_token_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me":{"get":{"tags":["Auth"],"summary":"Read Users Me","description":"Returns the currently authenticated user.\n\nReturns:\n- The currently authenticated user.","operationId":"read_users_me_users_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/forgot-password":{"post":{"tags":["Auth"],"summary":"Forgot Password","description":"Endpoint to request a password reset.\n\n:param email: The email of the user requesting the reset.","operationId":"forgot_password_forgot_password_post","parameters":[{"required":true,"schema":{"title":"Email","type":"string"},"name":"email","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reset-token-test/{token}":{"post":{"tags":["Auth"],"summary":"Reset Password","description":"Test if the token is valid.\n\n:param token: The reset token.","operationId":"reset_password_reset_token_test__token__post","parameters":[{"required":true,"schema":{"title":"Token","type":"string"},"name":"token","in":"path"},{"required":true,"schema":{"title":"Email","type":"string"},"name":"email","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reset-password/{token}":{"post":{"tags":["Auth"],"summary":"Reset Password","description":"Reset the password using the token.\n\n:param token: The reset token.\n:param email: The email of the user requesting the reset.\n:param new_password: The new password.","operationId":"reset_password_reset_password__token__post","parameters":[{"required":true,"schema":{"title":"Token","type":"string"},"name":"token","in":"path"},{"required":true,"schema":{"title":"Email","type":"string"},"name":"email","in":"query"},{"required":true,"schema":{"title":"New Password","type":"string"},"name":"new_password","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/":{"get":{"tags":["Accounts"],"summary":"Get Accounts","description":"Returns all accounts associated with the currently authenticated user.\n\nReturns:\n- A list of accounts associated with the currently authenticated user.","operationId":"get_accounts_accounts__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/accounts/import/ynab/":{"post":{"tags":["Accounts"],"summary":"Import Ynab","operationId":"import_ynab_accounts_import_ynab__post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_ynab_accounts_import_ynab__post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/category/envelopes/":{"get":{"tags":["Envelopes"],"summary":"Get Category Envelopes","description":"Returns all category envelopes associated with the currently authenticated user.\n\nReturns:\n- A list of category envelopes associated with the currently authenticated user.","operationId":"get_category_envelopes_category_envelopes__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/transactions/":{"get":{"tags":["Transactions"],"summary":"Get Transactions","description":"Returns all transactions associated with the currently authenticated user.\n\nArgs:\n- offset (int, optional): The starting index of transactions to return.\n- limit (int, optional): Max number of transactions to return.\n- pending (bool, optional): If True, only transactions with a null `envelope_id` will be returned.\n\nReturns:\n- A list of transactions associated with the currently authenticated user.","operationId":"get_transactions_transactions__get","parameters":[{"required":false,"schema":{"title":"Offset","type":"integer","default":0},"name":"offset","in":"query"},{"description":"Max number of transactions to return. Max limit is 100.","required":false,"schema":{"title":"Limit","type":"integer","description":"Max number of transactions to return. Max limit is 100.","default":30},"name":"limit","in":"query"},{"required":false,"schema":{"title":"Pending","type":"boolean"},"name":"pending","in":"query"},{"required":false,"schema":{"title":"Cleared","type":"boolean"},"name":"cleared","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["Transactions"],"summary":"Create Transactions","description":"Creates new transactions for the currently authenticated user.\n\nReturns:\n- The newly created transaction.","operationId":"create_transactions_transactions__post","requestBody":{"content":{"application/json":{"schema":{"title":"Transactions","type":"array","items":{"$ref":"#/components/schemas/TransactionImport"}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/transactions/stream/":{"get":{"tags":["Transactions"],"summary":"Stream Transactions","description":"Returns a streaming response of transaction events for the authenticated user.\n\nParameters:\n- current_user (AuthUser): The authenticated user.\n- db (Database): The database connection.\n\nReturns:\nA StreamingResponse object containing the transaction events in text/event-stream format.","operationId":"stream_transactions_transactions_stream__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/transaction/":{"post":{"tags":["Transactions"],"summary":"Create Transaction","description":"Creates a new transaction for the currently authenticated user.\n\nReturns:\n- The newly created transaction.","operationId":"create_transaction_transaction__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionImport"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/transaction/{transaction_id}":{"delete":{"tags":["Transactions"],"summary":"Delete Transaction","description":"Deletes a transaction for the currently authenticated user.\n\nReturns:\n- The deleted transaction.","operationId":"delete_transaction_transaction__transaction_id__delete","parameters":[{"required":true,"schema":{"title":"Transaction Id","type":"integer"},"name":"transaction_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}}},"components":{"schemas":{"Body_import_ynab_accounts_import_ynab__post":{"title":"Body_import_ynab_accounts_import_ynab__post","required":["file"],"type":"object","properties":{"file":{"title":"File","type":"string","format":"binary"}}},"Body_login_for_access_token_token_post":{"title":"Body_login_for_access_token_token_post","required":["username","password"],"type":"object","properties":{"username":{"title":"Username","type":"string"},"password":{"title":"Password","type":"string","format":"password","writeOnly":true}}},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"Transaction":{"title":"Transaction","required":["id","account","account_name","date","amount","payee","cleared"],"type":"object","properties":{"id":{"title":"Id","type":"integer"},"created_at":{"title":"Created At","type":"string","format":"date-time"},"updated_at":{"title":"Updated At","type":"string","format":"date-time"},"account":{"title":"Account","type":"integer"},"account_name":{"title":"Account Name","type":"string"},"date":{"title":"Date","type":"string","format":"date"},"amount":{"title":"Amount","type":"number"},"payee":{"title":"Payee","type":"string"},"number":{"title":"Number","type":"string"},"memo":{"title":"Memo","type":"string","default":""},"cleared":{"title":"Cleared","type":"boolean"},"uid":{"title":"Uid","type":"string"},"envelope":{"title":"Envelope","type":"integer"}}},"TransactionImport":{"title":"TransactionImport","required":["account_id","date","number","payee","memo","amount","cleared"],"type":"object","properties":{"account_id":{"title":"Account Id","type":"integer"},"envelope_id":{"title":"Envelope Id","type":"integer"},"date":{"title":"Date","type":"string","format":"date"},"number":{"title":"Number","type":"string"},"payee":{"title":"Payee","type":"string"},"memo":{"title":"Memo","type":"string"},"amount":{"title":"Amount","type":"number"},"cleared":{"title":"Cleared","type":"boolean"},"uid":{"title":"Uid","type":"string"}}},"TransactionResponse":{"title":"TransactionResponse","required":["transactions","total","pages"],"type":"object","properties":{"transactions":{"title":"Transactions","type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"total":{"title":"Total","type":"integer"},"pages":{"title":"Pages","type":"integer"}},"example":{"transactions":[{"id":1,"created_at":"2023-01-01T00:00:00Z","updated_at":"2023-01-01T00:00:00Z","account":1,"account_name":"Account 1","date":"2023-01-01","amount":100.0,"payee":"John","number":"123","memo":"Sample","cleared":true,"uid":"abc","envelope":1}],"total":100,"pages":4}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}}}}