### Get all system configuration values Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves all system configuration values. ```APIDOC ## GET /api/v1/configuration — Get all system configuration values ### Description Retrieves all system configuration values. ### Method GET ### Endpoint /api/v1/configuration ### Request Example ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ "https://firefly.example.com/api/v1/configuration" ``` ``` -------------------------------- ### Get All System Configuration Values Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieve all current system configuration settings. This endpoint is read-only and requires standard authentication. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ "https://firefly.example.com/api/v1/configuration" ``` -------------------------------- ### YAML Template Placeholder Example Source: https://github.com/firefly-iii/api-docs/blob/main/README.md This is an example of a placeholder found in YAML files, used for templates during the build process. It indicates the template name and indentation level. ```yaml _tpl_correlationParameter,3: ``` -------------------------------- ### List all budgets with spending data Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieve a list of all budgets. By providing `start` and `end` dates, the `spent` array will be populated with the amount spent within that period for each budget. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ "https://firefly.example.com/api/v1/budgets?start=2024-06-01&end=2024-06-30" # Each budget in "data" includes: # "attributes": { # "name": "Food", # "active": true, # "spent": [{ "currency_code": "EUR", "sum": "-230.45" }] # } ``` -------------------------------- ### Get Available Preselected Accounts Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.3.0-v6.4.0.html Retrieves the available options for pre-selecting accounts. This can be used to understand the possible values for the `preselected_accounts` parameter. ```APIDOC ## GET /api/v1/configuration/firefly.preselected_accounts ### Description This endpoint returns the available options for pre-selecting accounts. These options determine which accounts are included by default in certain views or reports. ### Method GET ### Endpoint /api/v1/configuration/firefly.preselected_accounts ### Parameters None ### Response #### Success Response (200) - **data** (object) - An object containing the available preselection options. - **type** (string) - The type of the preselection option. - **enum** (array) - A list of available enum values for preselection. - empty: Do not do a pre-selection. - all: Select all asset and all liability accounts. - assets: Select all asset accounts. - liabilities: Select all liability accounts. #### Response Example ```json { "data": { "type": "string", "enum": [ "empty", "all", "assets", "liabilities" ] } } ``` ``` -------------------------------- ### Get Total Income in Date Range Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves the total income within a specified date range. Requires authentication and the start and end dates for the period. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ "https://firefly.example.com/api/v1/insight/income/total?start=2024-06-01&end=2024-06-30" ``` -------------------------------- ### Create Piggy Bank Source: https://context7.com/firefly-iii/api-docs/llms.txt Create a new piggy bank with target and current amounts, start and end dates, and an associated account. ```bash curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ https://firefly.example.com/api/v1/piggy-banks \ -d '{ "name": "New Laptop", "account_id": "3", "target_amount": "1200.00", "current_amount": "100.00", "start_date": "2024-06-01", "target_date": "2024-12-31", "notes": "Saving for a MacBook Pro" }' ``` -------------------------------- ### Get Total Expenses in Date Range Source: https://context7.com/firefly-iii/api-docs/llms.txt Calculates the total expenses within a specified date range. The response includes the currency code, symbol, and the sum of expenses. Requires authentication. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ "https://firefly.example.com/api/v1/insight/expense/total?start=2024-06-01&end=2024-06-30" # Response: # [ # { "currency_code": "EUR", "currency_symbol": "€", "sum": "-1243.67" } # ] ``` -------------------------------- ### Get Expenses Grouped by Budget Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieve expenses aggregated by budget for a specified date range and list of budgets. Requires authentication and specifies the desired output format. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ "https://firefly.example.com/api/v1/insight/expense/budget?start=2024-06-01&end=2024-06-30&budgets[]=1&budgets[]=2" ``` -------------------------------- ### Get Dashboard Summary Figures Source: https://context7.com/firefly-iii/api-docs/llms.txt Fetch key financial summary figures like net worth, income, and spending for a given period. Supports filtering by currency. The response is structured with keyed summary entries. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ "https://firefly.example.com/api/v1/summary/basic?start=2024-06-01&end=2024-06-30¤cy_code=EUR" ``` -------------------------------- ### Create a new budget Source: https://context7.com/firefly-iii/api-docs/llms.txt Define and create a new budget. This includes setting its name, activity status, auto-budgeting rules, and currency. ```bash curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ https://firefly.example.com/api/v1/budgets \ -d '{ "name": "Groceries", "active": true, "auto_budget_type": "reset", "auto_budget_amount": "300.00", "auto_budget_period": "monthly", "currency_code": "EUR" }' ``` -------------------------------- ### Get Node Name Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html Returns the lowercase tag name of a given DOM node. ```javascript function i(e){return e.nodeName.toLowerCase()} ``` -------------------------------- ### Create Attachment Metadata and Upload File Source: https://context7.com/firefly-iii/api-docs/llms.txt This is a two-step process. First, register attachment metadata, then upload the binary content. The first step requires JSON payload with filename, attachable details, and title. The second step uses `--data-binary` to upload the file content and requires the attachment ID obtained from the first step. ```bash # Step 1: Create attachment object linked to a transaction journal curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ https://firefly.example.com/api/v1/attachments \ -d '{ "filename": "receipt.pdf", "attachable_type": "TransactionJournal", "attachable_id": "42", "title": "Grocery receipt June 10", "notes": "Scanned paper receipt" }' # Step 2: Upload the actual file (returns 204 on success) ATTACHMENT_ID=77 curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ --data-binary @/path/to/receipt.pdf \ "https://firefly.example.com/api/v1/attachments/${ATTACHMENT_ID}/upload" ``` -------------------------------- ### Get Authenticated User Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves full details of the user associated with the provided Bearer token. ```APIDOC ## GET /api/v1/about/user — Get the currently authenticated user ### Description Returns full details of the user whose Bearer token is being used. ### Method GET ### Endpoint /api/v1/about/user ### Request Example ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ https://firefly.example.com/api/v1/about/user ``` ### Response #### Success Response (200) - **data** (object) - Contains user details. - **type** (string) - Resource type, always "users". - **id** (string) - User ID. - **attributes** (object) - User attributes. - **email** (string) - User's email address. - **blocked** (boolean) - Indicates if the user is blocked. - **blocked_code** (null) - Blocked code, if applicable. - **role** (string) - User's role. #### Response Example ```json { "data": { "type": "users", "id": "1", "attributes": { "email": "james@firefly-iii.org", "blocked": false, "blocked_code": null, "role": "owner" } } } ``` ``` -------------------------------- ### Initialize Diff2HtmlUI with Configuration Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html The Diff2HtmlUI class constructor initializes the UI with provided HTML content, configuration options, and an optional highlight.js instance. It merges default configurations with user-provided settings. ```javascript constructor(e,t,i={},r){this.hljs=null;this.currentSelectionColumnId=-1;this.config=Object.assign(Object.assign({},n.defaultDiff2HtmlUIConfig),i);this.diffHtml=void 0!==t?(0,a.html)(t,this.config):e.innerHTML;this.targetElement=e;void 0!==r&&(this.hljs=r)} ``` -------------------------------- ### Get current primary currency Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves the currently set primary currency for the user's account. ```APIDOC ## GET /api/v1/currencies/primary — Get current primary currency ### Description Retrieves the currently set primary currency for the user's account. ### Method GET ### Endpoint /api/v1/currencies/primary ``` -------------------------------- ### Create a Webhook Source: https://context7.com/firefly-iii/api-docs/llms.txt Set up a webhook to receive notifications for transaction events (creation, update, deletion). The API generates a secret for payload verification. Requires specifying the trigger, response type, delivery format, and URL. ```bash curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ https://firefly.example.com/api/v1/webhooks \ -d '{ "title": "Notify budget app on new transaction", "active": true, "trigger": "STORE_TRANSACTION", "response": "TRANSACTIONS", "delivery": "JSON", "url": "https://myapp.example.com/webhooks/firefly" }' ``` -------------------------------- ### Get a single tag (by name or ID) Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves a single tag by providing its name or unique ID. ```APIDOC ## GET /api/v1/tags/{tag} — Get a single tag (by name or ID) ### Method GET ### Endpoint /api/v1/tags/{tag} #### Path Parameters - **tag** (string) - Required - The name or ID of the tag to retrieve. ### Request Example ```bash # By tag string curl -s -H "Authorization: Bearer $TOKEN" \ "https://firefly.example.com/api/v1/tags/business-trip" # By numeric ID curl -s -H "Authorization: Bearer $TOKEN" \ "https://firefly.example.com/api/v1/tags/17" ``` ``` -------------------------------- ### Enable a Currency Source: https://context7.com/firefly-iii/api-docs/llms.txt Enables a specific currency by its code. This action returns a 204 No Content status on success and requires authentication. ```bash curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ "https://firefly.example.com/api/v1/currencies/USD/enable" # 204 No Content on success ``` -------------------------------- ### Create a budget Source: https://context7.com/firefly-iii/api-docs/llms.txt Creates a new budget with specified details, including name, active status, auto-budget settings, and currency. ```APIDOC ## POST /api/v1/budgets ### Description Creates a budget. ### Method POST ### Endpoint /api/v1/budgets ### Parameters #### Request Body - **name** (string) - Required - The name of the budget. - **active** (boolean) - Optional - Whether the budget is active. - **auto_budget_type** (string) - Optional - The type of auto-budget (e.g., "reset"). - **auto_budget_amount** (string) - Optional - The amount for the auto-budget. - **auto_budget_period** (string) - Optional - The period for the auto-budget (e.g., "monthly"). - **currency_code** (string) - Optional - The currency code for the budget. ### Request Example ```json { "name": "Groceries", "active": true, "auto_budget_type": "reset", "auto_budget_amount": "300.00", "auto_budget_period": "monthly", "currency_code": "EUR" } ``` ``` -------------------------------- ### Get Single Tag Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieve a single tag by its name or ID. This is useful for checking the details of a specific tag. ```bash # By tag string curl -s -H "Authorization: Bearer $TOKEN" \ "https://firefly.example.com/api/v1/tags/business-trip" ``` ```bash # By numeric ID curl -s -H "Authorization: Bearer $TOKEN" \ "https://firefly.example.com/api/v1/tags/17" ``` -------------------------------- ### Retrieve System Information Source: https://context7.com/firefly-iii/api-docs/llms.txt Use this endpoint as a health-check to confirm API availability and retrieve system version details. Requires an Authorization header. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ https://firefly.example.com/api/v1/about ``` -------------------------------- ### Get Current Primary Currency Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves the currently set primary currency for the user's account. Requires authentication. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ "https://firefly.example.com/api/v1/currencies/primary" ``` -------------------------------- ### Create Tag Source: https://context7.com/firefly-iii/api-docs/llms.txt Create a new tag with an optional date and description. Tags help in organizing and filtering data. ```bash curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ https://firefly.example.com/api/v1/tags \ -d '{ "tag": "business-trip", "date": "2024-06-10", "description": "Expenses from Berlin trip" }' ``` -------------------------------- ### Get Hash Tag from URL Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html Retrieves the hashtag fragment from the current document's URL. Returns null if no hashtag is present. ```javascript getHashTag(){const e=document.URL,n=e.indexOf("#");let t=null;return-1!==n&&(t=e.substr(n+1)),t} ``` -------------------------------- ### List All User Preferences Source: https://context7.com/firefly-iii/api-docs/llms.txt Fetch all user-specific preferences. This endpoint provides access to settings that customize the user's experience within Firefly III. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ "https://firefly.example.com/api/v1/preferences" ``` -------------------------------- ### Create Rule Group Source: https://context7.com/firefly-iii/api-docs/llms.txt Create a new rule group to organize automated rules. Includes title, description, and active status. ```bash curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ https://firefly.example.com/api/v1/rule-groups \ -d '{ "title": "Auto-categorization", "description": "Rules that automatically sort transactions", "active": true }' ``` -------------------------------- ### Get Language from Highlight.js Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html Retrieves the language definition from the highlight.js library based on a given language name. Defaults to 'plaintext' if the language is not found. ```javascript n.getLanguage=function(e){var n;return null!==(n=a\[e\])&&void 0!==n?n:"plaintext"};const a={"1c":"1c",abnf:"abnf",accesslog:"accesslog",as:"actionscript",adb:"ada",ada:"ada",ads:"ada",angelscript:"angelscript",apache:"apache",applescript:"applescript",scpt:"applescript",arcade:"arcade",cpp:"cpp",hpp:"cpp",arduino:"arduino",ino:"arduino",armasm:"armasm",arm:"armasm",xml:"xml",html:"xml",xhtml:"xml",rss:"xml",atom:"xml",xjb:"xml",xsd:"xml",xsl:"xml",plist:"xml",svg:"xml",asciidoc:"asciidoc",adoc:"asciidoc",asc:"asciidoc",aspectj:"aspectj",ahk:"autohotkey",ahkl:"autohotkey",au3:"autoit",avrasm:"avrasm",awk:"awk",axapta:"axapta","x++":"axapta",bash:"bash",sh:"bash",zsh:"bash",b:"basic",bnf:"bnf",bf:"brainfuck",c:"c",h:"c",cats:"c",idc:"c",cal:"cal",capnproto:"capnproto",capnp:"capnproto",ceylon:"ceylon",clean:"clean",clj:"clojure",boot:"clojure",cl2:"clojure",cljc:"clojure",cljs:"clojure","cljs.hl":"clojure",cljscm:"clojure",cljx:"clojure",hic:"clojure","clojure-repl":"clojure-repl",cmake:"cmake","cmake.in":"cmake",coffee:"coffeescript",_coffee:"coffeescript",cake:"coffeescript",cjsx:"coffeescript",iced:"coffeescript",cson:"coffeescript",coq:"coq",cos:"cos",cls:"cos",crmsh:"crmsh",crm:"crmsh",pcmk:"crmsh",cr:"crystal",cs:"csharp",csx:"csharp",csp:"csp",css:"css",d:"d",di:"d",md:"markdown",markdown:"markdown",mdown:"markdown",mdwn:"markdown",mkd:"markd"} ``` -------------------------------- ### Highlight Code with highlight.js Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.3.0-v6.4.0.html Applies syntax highlighting to code blocks using highlight.js. Ensure highlight.js is provided during instantiation. Handles language detection and fallback to 'plaintext'. ```javascript highlightCode(){const e=this.hljs;if(null===e)throw new Error("Missing a \`highlight.js\` implementation. Please provide one when instantiating Diff2HtmlUI.");this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((n=>{const t=n.getAttribute("data-lang");this.config.highlightLanguages instanceof Map||(this.config.highlightLanguages=new Map(Object.entries(this.config.highlightLanguages)));let a=t&&this.config.highlightLanguages.has(t)?this.config.highlightLanguages.get(t):t?(0,i.getLanguage)(t):"plaintext";void 0===e.getLanguage(a)&&(a="plaintext"),n.querySelectorAll(".d2h-code-line-ctn").forEach((n=>{const t=n.textContent,r=n.parentNode;if(null===t||null===r||!this.isElement(r))return;const s=(0,i.closeTags)(e.highlight(t,{language:a,ignoreIllegals:!0})),o=(0,i.nodeStream)(n);if(o.length){const e=document.createElementNS("http://www.w3.org/1999/xhtml","div");e.innerHTML=s.value,s.value=(0,i.mergeStreams)(o,(0,i.nodeStream)(e),t)}n.classList.add("hljs"),s.language&&n.classList.add(s.language),n.innerHTML=s.value}))}))} ``` -------------------------------- ### Autocomplete Transactions API Request Source: https://context7.com/firefly-iii/api-docs/llms.txt Use this endpoint to get suggestions for transactions based on a query. Ensure you have a valid Bearer token for authorization. ```curl curl -s \ -H "Authorization: Bearer $TOKEN" \ "https://firefly.example.com/api/v1/autocomplete/transactions?query=grocery&limit=5" ``` -------------------------------- ### List all user preferences Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves a list of all user preferences. ```APIDOC ## GET /api/v1/preferences — List all user preferences ### Description Retrieves a list of all user preferences. ### Method GET ### Endpoint /api/v1/preferences ### Request Example ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ "https://firefly.example.com/api/v1/preferences" ``` ``` -------------------------------- ### List all bills Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves a list of all bills. You can filter by start and end dates to see upcoming payments and paid status within that period. ```APIDOC ## GET /api/v1/bills — List all bills With `start`/`end` dates, Firefly III calculates upcoming payment dates and whether each bill has been paid in that window. ### Method GET ### Endpoint /api/v1/bills #### Query Parameters - **start** (string) - Optional - The start date for filtering bills. - **end** (string) - Optional - The end date for filtering bills. ### Request Example ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ "https://firefly.example.com/api/v1/bills?start=2024-06-01&end=2024-06-30" ``` ### Response #### Success Response (200) - **attributes** (object) - Contains bill details like name, amount, date, repeat frequency, paid dates, and pay dates. #### Response Example ```json { "attributes": { "name": "Rent", "amount_min": "900.00", "amount_max": "900.00", "date": "2024-06-01", "repeat_freq": "monthly", "paid_dates": [{ "date": "2024-06-03", "transaction_group_id": "88" }], "pay_dates": [] } } ``` ``` -------------------------------- ### Get Authenticated User Details Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves full details of the user associated with the provided Bearer token. Ensure the Accept header is set to application/vnd.api+json. ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ https://firefly.example.com/api/v1/about/user ``` -------------------------------- ### List Accounts with Balance Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves a list of all accounts owned by the user, with an option to filter by type and include the balance on a specific date. Supports pagination. ```bash # List all asset accounts with balance on a specific date curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ "https://firefly.example.com/api/v1/accounts?type=asset&date=2024-06-01&limit=50&page=1" ``` -------------------------------- ### Apply Multiple Patches Sequentially Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html Applies a sequence of patches to content. It loads each patch, applies it, and proceeds to the next upon successful application. Errors during loading or patching will halt the process and complete with an error. ```javascript n.applyPatches = function(e, n) { "string" == typeof e && (e = (0, s.parsePatch)(e)); var t = 0; !(function i() { var a = e[t++]; if (!a) return n.complete(); n.loadFile(a, function(e, t) { if (e) return n.complete(e); var r = l(t, a, n); n.patched(a, r, function(e) { if (e) return n.complete(e); i(); }); }); })(); }; ``` -------------------------------- ### Code Highlighting Implementation Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html Implements code highlighting using highlight.js. It dynamically determines the language, applies highlighting, and merges the highlighted code back into the DOM. Requires highlight.js to be provided. ```javascript highlightCode(){const e=this.hljs;if(null===e)throw new Error("Missing a \`highlight.js\` implementation. Please provide one when instantiating Diff2HtmlUI.");this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((n=>{const t=n.getAttribute("data-lang");this.config.highlightLanguages instanceof Map||(this.config.highlightLanguages=new Map(Object.entries(this.config.highlightLanguages)));let a=t&&this.config.highlightLanguages.has(t)?this.config.highlightLanguages.get(t):t?(0,i.getLanguage)(t):"plaintext";void 0===e.getLanguage(a)&&(a="plaintext"),n.querySelectorAll(".d2h-code-line-ctn").forEach((n=>{const t=n.textContent,r=n.parentNode;if(null===t||null===r||!this.isElement(r))return;const s=(0,i.closeTags)(e.highlight(t,{language:a,ignoreIllegals:!0})),(0,i.nodeStream)(n);if(o.length){const e=document.createElementNS("http://www.w3.org/1999/xhtml","div");e.innerHTML=s.value,s.value=(0,i.mergeStreams)(o,(0,i.nodeStream)(e),t)}n.classList.add("hljs"),s.language&&n.classList.add(s.language),n.innerHTML=s.value}))}))} ``` -------------------------------- ### List all tags Source: https://context7.com/firefly-iii/api-docs/llms.txt Retrieves a list of all tags used in the system. ```APIDOC ## GET /api/v1/tags — List all tags ### Method GET ### Endpoint /api/v1/tags ### Request Example ```bash curl -s \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json" \ "https://firefly.example.com/api/v1/tags" ``` ``` -------------------------------- ### Create a tag Source: https://context7.com/firefly-iii/api-docs/llms.txt Creates a new tag with an optional date and description. ```APIDOC ## POST /api/v1/tags — Create a tag ### Method POST ### Endpoint /api/v1/tags #### Request Body - **tag** (string) - Required - The name of the tag. - **date** (string) - Optional - The date associated with the tag. - **description** (string) - Optional - A description for the tag. ### Request Example ```bash curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ https://firefly.example.com/api/v1/tags \ -d { "tag": "business-trip", "date": "2024-06-10", "description": "Expenses from Berlin trip" } ``` ``` -------------------------------- ### Ruby Syntax Highlighting Configuration Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html Configuration for Ruby syntax highlighting, including keywords, scope definitions, and special token handling. ```javascript const p=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^(\[>?\]>|\[\\w#\]+\\(\\w+\\):\\d+:\\d+[ >\*]| (\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[ ^\\d] [ ^>] +>)(?= [ ])",starts:{end:"$",keywords:r,contains:f}}]];return l.unshift(o),{name:"Ruby",aliases:[ "rb","gemspec","podspec","thor","irb" ],keywords:r,illegal:"/\*",contains:[e.SHEBANG({binary:"ruby"})].concat(p).concat(l).concat(f)}}},5409:e=>{e.exports=function(e){const n=e.regex,t={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e.IDENT_RE,n.lookahead(/\s*\(/))},i="( [ui](8|16|32|64|128|size)|f(32|64))?",a=[ "drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!" ],r=[ "i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec" ];return{name:"Rust",aliases:["rs"],keywords:{ $pattern:e.IDENT_RE+"!?",type:r,keyword:[ "abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield" ],literal:["true","false","Some","None","Ok","Err"],built_in:a},illegal:""},t]}}},3449:e=>{e.exports=function(e){const n=e.regex,t={className:"subst",variants:[{begin:"\\$[[A-Za-z0-9_]+"},{begin:/\$\{/,end:/\}/}]},i={className:"string",variants:[{begin:'"""',end:'"""'},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:'[a-z]+""',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t]},{className:"string",begin:'[a-z]+"""',end:'"""',contains:[t],relevance:10}]},a={className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},r={className:"title",begin:/[^0-9\n\t "'(),. `{} \[\]:;][^\n\t "'(),. `{} \[\]:;]| [^0-9\n\t "'(),. `{} \[\]:;= ]/,relevance:0},s={className:"class",beginKeywords:"class object trait type",end:/[:={ ``` -------------------------------- ### Line-by-Line Diff Renderer Configuration Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html Defines the default configuration for the line-by-line diff renderer, including settings for empty diffs and comparison limits. This configuration can be overridden during instantiation. ```javascript n.defaultLineByLineRendererConfig=Object.assign(Object.assign({},l.defaultRenderConfig),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200});const u="generic",g="line-by-line";n.default=class{ constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},n.defaultLineByLineRendererConfig),t)} render(e){const n=e.map((e=>{ let n; return n=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,n) })).join("\n");return this.hoganUtils.render(u,"wrapper",{colorScheme:l.colorSchemeToCss(this.config.colorScheme),content:n})} makeFileDiffHtml(e,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const t=this.hoganUtils.template(g,"file-diff"),i=this.hoganUtils.template(u,"file-path"),a=this.hoganUtils.template("icon","file"),r=this.hoganUtils.template("tag",l.getFileIcon(e));return t.render({file:e,fileHtmlId:l.getHtmlId(e),diffs:n,filePath:i.render({fileDiffName:l.filenameDiff(e)},{fileIcon:a,fileTag:r})})} generateEmptyDiff(){return this.hoganUtils.render(u,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:l.CSSLineClass})} generateFileHtml(e){const n=o.newMatcherFn(o.newDistanceFn((n=>l.deconstructLine(n.content,e.isCombined).content)));return e.blocks.map((t=>{ let i=this.hoganUtils.render(u,"block-header",{CSSLineClass:l.CSSLineClass,blockHeader:e.isTooBig?t.header:l.escapeForHtml(t.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"}); return this.applyLineGroupping(t).forEach((([t,a,r])=>{if(a.length&&r.length&&!t.length)this.applyRematchMatching(a,r,n).map((([n,t])=>{const{left:a,right:r}=this.processChangedLines(e,e.isCombined,n,t);i+=a,i+=r}));else if(t.length)t.forEach((n=>{const{prefix:t,content:a}=l.deconstructLine(n.content,e.isCombined);i+=this.generateSingleLineHtml(e,{type:l.CSSLineClass.CONTEXT,prefix:t,content:a,oldNumber:n.oldNumber,newNumber:n.newNumber})}));else if(a.length||r.length){const{left:n,right:t}=this.processChangedLines(e,e.isCombined,a,r);i+=n,i+=t}else console.error("Unknown state reached while processing groups of lines",t,a,r)})),i})).join("\n")} applyLineGroupping(e){const n=[];let t=[],i=[];for(let a=0;a0)&&(n.push([[ ],t,i]),t=[],i=[]),r.type===c.LineType.CONTEXT?n.push([[ r ],[ ],[ ]]):r.type===c.LineType.INSERT&&0===t.length?n.push([[ ],[ ],[r]]):r.type===c.LineType.INSERT&&t.length>0?i.push(r):r.type===c.LineType.DELETE&&t.push(r)}return(t.length||i.length)&&(n.push([[ ],t,i]),t=[],i=[]),n} applyRematchMatching(e,n,t){const i=e.length*n.length,a=(0,d.max)(e.concat(n).map((e=>e.content.length)));return i'),i.b("\n"+t),i.b('
'),i.b("\n"+t),i.b(' Files changed ('),i.b(i.v(i.f("filesNumber",e,n,0))),i.b(")"),i.b("\n"+t),i.b(' hide'),i.b("\n"+t),i.b(' show'),i.b("\n"+t),i.b("
"),i.b("\n"+t),i.b('
    '),i.b("\n"+t),i.b(' '),(i.b(i.t(i.f("files",e,n,0)))),i.b("\n"+t),i.b("
"),i.b("\n"+t),i.b(""),i.fl()},partials:{},subs:{}}) ``` -------------------------------- ### Create New Account Source: https://context7.com/firefly-iii/api-docs/llms.txt Creates a new account for the authenticated user. Requires account details in the request body. ```APIDOC ## POST /api/v1/accounts — Create a new account ### Description Creates a new account for the authenticated user. Requires account details in the request body. ### Method POST ### Endpoint /api/v1/accounts ### Parameters #### Request Body - **name** (string) - Required - The name of the account. - **type** (string) - Required - The type of the account (e.g., `asset`, `expense`). - **account_role** (string) - Optional - The role of the account (e.g., `savingAsset`). - **currency_code** (string) - Required - The currency code for the account (e.g., `EUR`). - **opening_balance** (string) - Optional - The initial balance of the account. - **opening_balance_date** (string) - Optional - The date of the opening balance (YYYY-MM-DD). - **include_net_worth** (boolean) - Optional - Whether to include this account in net worth calculations. ### Request Example ```bash curl -s -X POST \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/vnd.api+json" \ https://firefly.example.com/api/v1/accounts \ -d { "name": "Savings Account", "type": "asset", "account_role": "savingAsset", "currency_code": "EUR", "opening_balance": "5000.00", "opening_balance_date": "2024-01-01", "include_net_worth": true } ``` ### Response #### Success Response (200) - Returns the newly created AccountSingle object. #### Error Response (422) - Returns validation errors, e.g. missing required "name". ``` -------------------------------- ### Register Languages for Highlight.js Source: https://github.com/firefly-iii/api-docs/blob/main/dist/differences/v6.4.0-v6.4.1.html Registers various programming languages with the Highlight.js library. This is typically done once at application startup. ```javascript a.default.registerLanguage("cpp",r.default),a.default.registerLanguage("xml",s.default),a.default.registerLanguage("awk",o.default),a.default.registerLanguage("bash",l.default),a.default.registerLanguage("c",c.default),a.default.registerLanguage("clojure",d.default),a.default.registerLanguage("crystal",u.default),a.default.registerLanguage("csharp",g.default),a.default.registerLanguage("csp",b.default),a.default.registerLanguage("css",f.default),a.default.registerLanguage("markdown",p.default),a.default.registerLanguage("dart",m.default),a.default.registerLanguage("diff",h.default),a.default.registerLanguage("dockerfile",E.default),a.default.registerLanguage("elixir",ʇ.default),a.default.registerLanguage("elm",N.default),a.default.registerLanguage("ruby",T.default),a.default.registerLanguage("erlang",O.default),a.default.registerLanguage("fsharp",v.default),a.default.registerLanguage("go",y.default),a.default.registerLanguage("gradle",A.default),a.default.registerLanguage("groovy",S.default),a.default.registerLanguage("handlebars",w.default),a.default.registerLanguage("haskell",R.default),a.default.registerLanguage("ini",I.default),a.default.registerLanguage("java",C.default),a.default.registerLanguage("javascript",L.default),a.default.registerLanguage("json",M.default),a.default.registerLanguage("kotlin",D.default),a.default.registerLanguage("less",x.default),a.default.registerLanguage("lisp",k.default),a.default.registerLanguage("lua",P.default),a.default.registerLanguage("makefile",U.default),a.default.registerLanguage("perl",B.default),a.default.registerLanguage("nginx",j.default),a.default.registerLanguage("objectivec",F.default),a.default.registerLanguage("pgsql",H.default),a.default.registerLanguage("php",G.default),a.default.registerLanguage("plaintext",$.default),a.default.registerLanguage("powershell",z.default),a.default.registerLanguage("properties",W.default),a.default.registerLanguage("protobuf",V.default),a.default.registerLanguage("python",K.default),a.default.registerLanguage("rust",q.default),a.default.registerLanguage("scala",X.default),a.default.registerLanguage("scss",Y.default),a.default.registerLanguage("shell",Z.default),a.default.registerLanguage("sql",Q.default),a.default.registerLanguage("swift",J.default),a.default.registerLanguage("yaml",ee.default),a.default.registerLanguage("typescript",ne.default),n.hljs=a.default ```