{"api_version":"v1","release_version":"1.0.27","source_digest":"53623738bb531705d034047127ee1407241198ae132b53b675c9cc767cc3d906","operation_count":38,"document":{"openapi":"3.0.0","info":{"title":"Tetri Public API","description":"User-scoped programmatic access to Tetri","version":"v1","contact":{}},"tags":[],"servers":[{"url":"https://api.tetri.app"}],"components":{"schemas":{"ImportJobAttributesDto":{"type":"object","properties":{"bank_key":{"type":"string","example":"revolut"},"bank_name":{"type":"string","example":"Revolut"},"file_name":{"type":"string","example":"statement.csv"},"file_type":{"type":"string","example":"csv"},"reported_period":{"nullable":true,"description":"Immutable file evidence, independent of expiring previews. Null for unknown or ambiguous source scopes.","type":"object","allOf":[{"$ref":"#/components/schemas/ImportReportedPeriodDto"}]},"destination_draft":{"nullable":true,"description":"Retained destination and defaults while this statement remains an available preview. Not a created wallet.","type":"object","allOf":[{"$ref":"#/components/schemas/ImportDestinationDraftDto"}]},"statement_columns":{"nullable":true,"description":"Actual bounded source columns, examples and declared field roles. No raw row collection or editing capability is implied.","type":"object","allOf":[{"$ref":"#/components/schemas/ImportStatementColumnsDto"}]},"total_rows":{"type":"number","example":150},"imported_count":{"type":"number","example":148},"skipped_count":{"type":"number","example":1},"skipped_existing_count":{"type":"number","description":"Rows skipped because a matching transaction already exists.","example":1},"error_count":{"type":"number","example":1},"status":{"enum":["preview","queued","processing","completed","failed","reverted","discarded","cancelled"],"type":"string","example":"completed"},"preview_version":{"type":"number","example":3,"description":"Revision of the statement preview represented by this job."},"parse_options":{"type":"object","example":{"amount_semantics":"signed_debit_negative","amount_semantics_required":false}},"error_message":{"type":"string","nullable":true},"account_id":{"type":"string","nullable":true,"format":"uuid"},"preview":{"type":"array","description":"Source preview or persisted imported rows. transaction_id is null until persisted.","items":{"type":"object","required":["transaction_id"],"properties":{"transaction_id":{"type":"string","format":"uuid","nullable":true}},"additionalProperties":true}},"opening_balance_adjusted":{"type":"array","items":{"$ref":"#/components/schemas/ImportJobOpeningBalanceAdjustmentDto"}},"reverted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["bank_key","bank_name","file_name","file_type","total_rows","imported_count","skipped_count","skipped_existing_count","error_count","status","preview_version","parse_options","error_message","account_id","reverted_at","created_at","updated_at"]},"CountedCursorPaginationMetaDto":{"type":"object","properties":{"limit":{"type":"number","example":25,"minimum":1,"maximum":100,"description":"Requested page size."},"has_more":{"type":"boolean","example":true,"description":"Whether another page exists."},"next_cursor":{"type":"object","nullable":true,"example":"<opaque-cursor>","description":"Pass this value as `after` to request the next page."},"total":{"type":"number","example":120,"description":"Total matching resources."},"count":{"type":"number","example":25,"description":"Resources in this page."}},"required":["limit","has_more","next_cursor","total","count"]},"ApiProgrammaticErrorDto":{"type":"object","properties":{"statusCode":{"type":"number","example":400,"description":"HTTP status code of the response."},"code":{"type":"string","example":"PROGRAMMATIC_PAGINATION_MODE_CONFLICT","description":"Stable machine-readable Tetri error code (SCREAMING_SNAKE). Branch on this field; `VALIDATION_FAILED` for request validation, status-level codes such as `NOT_FOUND` or `TOO_MANY_REQUESTS` when no domain code applies."},"message":{"type":"string","example":"after and page are mutually exclusive","description":"English debugging text. It may change at any time; never branch on it or show it to end users."},"details":{"type":"object","additionalProperties":true,"example":{"errors":{"limit":["max"]}},"description":"Structured context for the code. For `VALIDATION_FAILED`, `errors` maps each invalid field path to the failed constraint keys."},"request_id":{"type":"string","example":"8cf64dcc-0f73-4f8d-a845-3d80c1040475","description":"Request tracing identifier also returned in `x-request-id`."}},"required":["statusCode","code","message"]},"ProgrammaticImportMutationResponseDto":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProgrammaticImportJobResourceDto"},"side_effects":{"description":"Additional client cache updates. Import mutations currently return an empty array.","type":"array","items":{"$ref":"#/components/schemas/ProgrammaticSideEffectDto"}}},"required":["data","side_effects"]},"ProgrammaticImportConfirmDto":{"type":"object","properties":{"skip_duplicates":{"type":"boolean","default":true,"description":"Skip rows that match existing transactions instead of importing duplicates."},"default_category_id":{"type":"string","format":"uuid","description":"Fallback category applied to otherwise uncategorized imported transactions."}}},"PublicV1InsightResponse":{"type":"object","properties":{"insights":{"type":"array","items":{"$ref":"#/components/schemas/InsightDto"}},"generated_at":{"type":"string","format":"date-time","description":"Absolute UTC instant when this response was formed. Changes independently of insight occurrence times."},"next_refresh_at":{"type":"string","format":"date-time"}},"required":["insights","generated_at","next_refresh_at"]},"PublicV1InsightEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InsightDto"}},"required":["data"]},"PublicV1BudgetAttributes":{"type":"object","properties":{"adjustment":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/BudgetAdjustmentDto"}]},"name":{"type":"string","example":"Groceries"},"raw_name":{"type":"string","example":"Groceries"},"is_system_seed":{"type":"boolean","description":"Whether Tetri seeded this budget."},"system_seed_key":{"type":"string","nullable":true,"description":"Stable system seed key."},"system_seed_source":{"nullable":true,"enum":["category_seed","rail_template","rail_catalog","system"],"type":"string","description":"Origin of the system seed."},"name_customized":{"type":"boolean","description":"Whether a user replaced the seeded name."},"active":{"type":"boolean","example":true},"period":{"enum":["custom","weekly","monthly","yearly","interval"],"type":"string","example":"monthly"},"rollover_strategy":{"enum":["none","accumulate","deficit_only"],"type":"string","example":"carry"},"pacing_strategy":{"enum":["linear","fixed_bill"],"type":"string","example":"linear","description":"How budget progress should be evaluated. linear uses daily expected spend; fixed_bill tracks paid vs remaining without daily pace alerts."},"include_recurring_transactions":{"type":"boolean","example":false,"description":"Whether recurring expenses in linked categories are covered by this budget in planning."},"notes":{"type":"string","nullable":true,"maxLength":2000},"warning_threshold":{"type":"number","nullable":true,"minimum":1,"maximum":100,"description":"Percentage for a warning. Null disables warnings; omitted is legacy producer data."},"accent_color":{"enum":["rose","orange","amber","emerald","teal","sky","indigo","violet","pink","slate","clay","apricot","olive","moss","jade","mist","denim","lavender","mauve","taupe"],"type":"string","example":"sky"},"icon":{"type":"string","nullable":true,"example":"lucide:shopping-cart"},"icon_url":{"type":"string","nullable":true,"example":"https://cdn.tetri.app/icons/abc.webp","description":"Resolved CDN URL for asset:* icons. Null for lucide/brand namespaces."},"currency_id":{"type":"string","format":"uuid"},"version":{"type":"number","example":0},"currency":{"$ref":"#/components/schemas/BudgetCurrencyRefDto"},"amount":{"type":"string","example":"500.00"},"base_amount":{"type":"string","example":"500.00"},"order":{"type":"number","example":0},"created_at":{"type":"string","format":"date-time"},"created_by":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/BudgetCreatorDto"}]},"category_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/BudgetCategoryRefDto"}},"current_period":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/BudgetPeriodAttributesDto"}]}},"required":["name","raw_name","is_system_seed","system_seed_key","system_seed_source","name_customized","active","period","rollover_strategy","pacing_strategy","include_recurring_transactions","accent_color","icon","icon_url","currency_id","version","currency","amount","base_amount","order","created_at","created_by","category_ids","categories","current_period"]},"PaginationWrapperMetaDto":{"type":"object","properties":{"pagination":{"description":"Offset pagination state.","allOf":[{"$ref":"#/components/schemas/PaginationMetaDto"}]}},"required":["pagination"]},"PublicV1RecurringRuleListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RecurringRuleDto"}},"meta":{"$ref":"#/components/schemas/RecurringRuleListMetaDto"}},"required":["data","meta"]},"PublicV1RecurringRuleResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecurringRuleDto"}},"required":["data"]},"PublicV1GoalAttributes":{"type":"object","properties":{"created_by_user_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","description":"Localized or user-customized goal name."},"raw_name":{"type":"string","description":"Stored source name before localization."},"is_system_seed":{"type":"boolean","description":"Whether Tetri seeded this goal."},"system_seed_key":{"type":"string","nullable":true,"description":"Stable system seed key."},"system_seed_source":{"nullable":true,"enum":["category_seed","rail_template","rail_catalog","system"],"type":"string","description":"Origin of the system seed."},"name_customized":{"type":"boolean","description":"Whether a user replaced the seeded name."},"icon":{"type":"string","nullable":true,"description":"Icon identifier."},"icon_url":{"type":"string","nullable":true,"format":"uri"},"cover_image":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/CoverImageAttributesDto"}]},"accent_color":{"enum":["rose","orange","amber","emerald","teal","sky","indigo","violet","pink","slate","clay","apricot","olive","moss","jade","mist","denim","lavender","mauve","taupe"],"type":"string","example":"sky","description":"Tetri accent color token."},"currency_id":{"type":"string","format":"uuid"},"currency_code":{"type":"string","description":"Currency code used to display this goal."},"currency_symbol":{"type":"string","description":"Currency symbol used to display this goal."},"target_amount":{"type":"string","example":"10000.00","description":"Goal target amount."},"monthly_contribution":{"type":"string","nullable":true,"example":"250.00"},"current_saved":{"type":"string","nullable":true,"example":"3200.00","description":"Complete saved balance in the goal currency. Null means unavailable, never zero."},"current_saved_unavailable_reason":{"nullable":true,"enum":["missing_rate","wallet_unavailable","snapshot_unavailable"],"type":"string","description":"Null for a known saved balance. snapshot_unavailable applies only to an old retained response whose money completeness cannot be proved."},"target_date":{"type":"string","nullable":true,"format":"date"},"linked_wallet_id":{"type":"string","nullable":true,"format":"uuid"},"order":{"type":"number","minimum":0},"status":{"enum":["active","achieved","abandoned"],"type":"string"},"achieved_at":{"type":"string","nullable":true,"format":"date-time","description":"When the goal became achieved. Null while it is not achieved and for goals achieved before this was recorded."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"monthly_pace":{"type":"string","nullable":true,"example":"230.00","description":"Three-month rolling average of net contributions."},"expected_completion_date":{"type":"string","nullable":true,"format":"date","description":"Projected completion date at the current pace."},"on_track":{"type":"boolean","nullable":true,"description":"Whether the projected completion meets the target date."},"pace":{"nullable":true,"enum":["on_track","behind","critical"],"type":"string"},"pace_detail":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/GoalPaceDetailAttributesDto"}]},"auto_contribution":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/GoalAutoContributionAttributesDto"}]},"suggested_auto_contribution":{"nullable":true,"description":"Suggested automatic contribution while the goal has a deadline pace and none is set.","type":"object","allOf":[{"$ref":"#/components/schemas/GoalSuggestedAutoContributionAttributesDto"}]},"eta_month":{"type":"string","nullable":true,"example":"2027-03","pattern":"^\\d{4}-(?:0[1-9]|1[0-2])$"},"overdue":{"type":"boolean","description":"Whether the unfinished goal is past its target date."},"version":{"type":"number","minimum":0,"description":"Optimistic concurrency version."},"created_by":{"type":"object","nullable":true}},"required":["created_by_user_id","name","raw_name","is_system_seed","system_seed_key","system_seed_source","name_customized","icon","icon_url","cover_image","accent_color","currency_id","currency_code","currency_symbol","target_amount","monthly_contribution","current_saved","current_saved_unavailable_reason","target_date","linked_wallet_id","order","status","achieved_at","created_at","updated_at","monthly_pace","expected_completion_date","on_track","pace","pace_detail","auto_contribution","suggested_auto_contribution","eta_month","overdue","version","created_by"]},"PublicV1AccountAttributes":{"type":"object","properties":{"name":{"type":"string","example":"Checking (USD)"},"type":{"type":"string","example":"asset"},"account_role":{"type":"string","nullable":true,"example":"defaultAsset"},"currency_id":{"type":"string","nullable":true,"format":"uuid"},"currency_code":{"type":"string","nullable":true,"example":"USD"},"currency_symbol":{"type":"string","nullable":true,"example":"$"},"currency_decimal_places":{"type":"number","nullable":true,"example":2},"current_balance":{"type":"string","example":"1250.00"},"native_current_balance":{"type":"string","nullable":true,"example":"1250.00"},"active":{"type":"boolean","example":true},"notes":{"type":"string","nullable":true},"liability_type":{"type":"string","nullable":true},"iban":{"type":"string","nullable":true},"account_number":{"type":"string","nullable":true},"bic":{"type":"string","nullable":true},"opening_balance":{"type":"string","nullable":true,"example":"0.00"},"opening_balance_missing":{"type":"boolean","example":false,"description":"True when an asset or liability has no known opening balance. Null is not zero."},"opening_balance_date":{"type":"string","nullable":true,"example":"2025-01-01"},"virtual_balance":{"type":"string","example":"0.00"},"include_net_worth":{"type":"boolean","example":true},"credit_card_type":{"type":"string","nullable":true},"first_payment_date":{"type":"string","nullable":true,"example":"2026-05-15"},"payment_day_of_month":{"type":"number","nullable":true,"example":15,"minimum":1,"maximum":31},"interest":{"type":"string","example":"0.00"},"interest_period":{"nullable":true,"enum":["monthly","quarterly","yearly","weekly","daily"],"type":"string","example":"monthly"},"scheduled_payment_amount":{"type":"string","nullable":true,"example":"1066.20"},"liability_direction":{"type":"string","nullable":true},"expected_settle_date":{"type":"string","nullable":true,"format":"date","example":"2026-09-15","description":"Iou-only optional settle date. Null on every other subtype."},"order":{"type":"number","example":0},"icon":{"type":"string","nullable":true},"icon_color":{"type":"string","nullable":true,"example":"#3366ff"},"group_id":{"type":"string","nullable":true,"format":"uuid"},"group_name":{"type":"string","nullable":true},"wallet_id":{"type":"string","nullable":true,"format":"uuid"}},"required":["name","type","account_role","currency_id","currency_code","currency_symbol","currency_decimal_places","current_balance","native_current_balance","active","notes","liability_type","iban","account_number","bic","opening_balance","opening_balance_missing","opening_balance_date","virtual_balance","include_net_worth","credit_card_type","first_payment_date","payment_day_of_month","interest","interest_period","scheduled_payment_amount","liability_direction","expected_settle_date","order","icon","icon_color","group_id","group_name","wallet_id"]},"PublicV1CategoryAttributes":{"type":"object","properties":{"version":{"type":"number","example":0},"created_by_user_id":{"type":"string","nullable":true,"format":"uuid"},"group_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","example":"Groceries"},"icon_name":{"type":"string","nullable":true,"example":"shopping-cart"},"icon_url":{"type":"string","nullable":true,"example":"https://cdn.tetri.app/icons/abc.webp","description":"Resolved CDN URL for asset:* icons. Null for lucide/brand namespaces."},"accent_color":{"enum":["rose","orange","amber","emerald","teal","sky","indigo","violet","pink","slate","clay","apricot","olive","moss","jade","mist","denim","lavender","mauve","taupe"],"type":"string","example":"emerald"},"is_archived":{"type":"boolean","example":false},"is_system":{"type":"boolean","example":false},"aliases":{"example":["coffee","latte","starbucks"],"description":"Lowercased fuzzy-match tokens that auto-assign this category when they appear in a transaction description.","type":"array","items":{"type":"string"}},"order":{"type":"number","example":0},"tx_count":{"type":"number","example":42},"recent_tx_count":{"type":"number","example":12,"description":"Transactions inside the requested start/end window; equals tx_count when no window is requested."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"spent_agg":{"description":"Outflows (withdrawals) as an honest multi-currency aggregate: `per_currency` keeps each native currency separate and `home_converted` re-expresses the total in the workspace home currency using each leg's own-date FX rate. `home_converted` is null when the workspace has no home display currency.","allOf":[{"$ref":"#/components/schemas/AggregateDto"}]},"earned_agg":{"description":"Same as `spent_agg` but for the deposit/income side.","allOf":[{"$ref":"#/components/schemas/AggregateDto"}]},"created_by":{"type":"object","nullable":true}},"required":["version","created_by_user_id","group_id","name","icon_name","icon_url","accent_color","is_archived","is_system","aliases","order","tx_count","recent_tx_count","created_at","updated_at","spent_agg","earned_agg","created_by"]},"PublicV1CurrencyAttributes":{"type":"object","properties":{"code":{"type":"string","example":"USD"},"name":{"type":"string","example":"US Dollar"},"symbol":{"type":"string","example":"$"},"enabled":{"type":"boolean","description":"Whether this currency is enabled in the workspace."},"default":{"type":"boolean","description":"Whether this is the workspace primary currency."},"decimal_places":{"type":"number","example":2},"kind":{"enum":["fiat","crypto"],"type":"string","example":"fiat","description":"Currency class used by clients for formatting and rate lookup."},"coingecko_id":{"type":"string","nullable":true,"example":"bitcoin","description":"CoinGecko asset id for automatically priced crypto assets."},"icon_url":{"type":"string","nullable":true,"example":"/api/v1/public/currency-icons/BTC.webp?v=8e8f5ec9a89b8d78","description":"Tetri-hosted proxied icon URL for system catalog currencies."},"is_custom":{"type":"boolean","description":"Whether this currency was created by a user."},"auto_rate":{"type":"boolean","description":"Whether exchange rates are synced automatically for this currency."}},"required":["code","name","symbol","enabled","default","decimal_places","kind","coingecko_id","icon_url","is_custom","auto_rate"]},"ProgrammaticCreateTransactionTemplateDto":{"type":"object","properties":{"direction":{"enum":["income","expense","transfer"],"type":"string","description":"Template transaction direction."},"name":{"type":"string","maxLength":120,"description":"Template display name. Tetri derives one when omitted."},"source_wallet_id":{"type":"string","format":"uuid","description":"Default source wallet for expenses and transfers."},"target_wallet_id":{"type":"string","format":"uuid","description":"Default destination wallet for income and transfers."},"category_id":{"type":"string","format":"uuid","description":"Default transaction category."},"amount_minor":{"type":"string","maxLength":19,"example":"1250","pattern":"^(?:0|[1-9]\\d*)$","description":"Non-negative amount in minor currency units, serialized as a base-10 integer string. Maximum 9223372036854775807."},"currency_code":{"type":"string","pattern":"^[A-Z]{3}$","example":"USD","description":"Three-letter ISO currency code for `amount_minor`."},"description":{"type":"string","maxLength":500,"description":"Default transaction description copied from the template."},"notes":{"type":"string","maxLength":5000,"description":"Private notes copied to transactions created from the template."},"note":{"type":"string","maxLength":5000,"deprecated":true,"description":"Legacy alias for `notes`. Use `notes` in new integrations."},"tags":{"maxItems":10,"description":"Default tag names copied to created transactions.","type":"array","items":{"type":"string","maxLength":30}},"recurrence_preset":{"enum":["daily","weekly","biweekly","monthly","quarterly","annual","custom"],"type":"string","description":"Optional recurrence shortcut stored with the template."}},"required":["direction"]},"ProgrammaticTransactionTemplateCreateResponseDto":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TransactionTemplateResponseDto"},"side_effects":{"description":"Additional client cache updates. Template creation currently returns an empty array.","type":"array","items":{"$ref":"#/components/schemas/ProgrammaticSideEffectDto"}}},"required":["data","side_effects"]},"PublicV1TransactionAttributes":{"type":"object","properties":{"revision":{"type":"string","format":"date-time"},"group_title":{"type":"string","nullable":true},"execution_status":{"enum":["scheduled","posted"],"type":"string"},"executed_at":{"type":"string","nullable":true,"format":"date-time"},"archived_at":{"type":"string","nullable":true,"format":"date-time"},"is_archived":{"type":"boolean"},"created_by":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/TransactionCreatorDto"}]},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/TransactionLegDto"}}},"required":["revision","group_title","execution_status","executed_at","archived_at","is_archived","created_by","transactions"]},"CursorPaginationMetaDto":{"type":"object","properties":{"limit":{"type":"number","example":25,"minimum":1,"maximum":100,"description":"Requested page size."},"has_more":{"type":"boolean","example":true,"description":"Whether another page exists."},"next_cursor":{"type":"object","nullable":true,"example":"<opaque-cursor>","description":"Pass this value as `after` to request the next page."}},"required":["limit","has_more","next_cursor"]},"ProgrammaticCreateTransactionDto":{"type":"object","properties":{"type":{"enum":["withdrawal","deposit","transfer"],"type":"string","description":"Journal direction to create."},"date":{"type":"string","format":"date-time","example":"2026-07-12T12:00:00.000Z","description":"Transaction instant with an explicit UTC offset. Tetri derives the financial date in the workspace timezone."},"amount":{"type":"string","example":"12.50","description":"Strictly positive decimal amount serialized as a string in the source account currency. Maximum 12 integer and 12 fractional digits.","pattern":"^(?=.*[1-9])\\d+(?:\\.\\d+)?$"},"description":{"type":"string","maxLength":500,"example":"Lunch","description":"Human-readable transaction description."},"source_account_id":{"type":"string","format":"uuid","description":"Required for withdrawals and transfers; forbidden for deposits."},"destination_account_id":{"type":"string","format":"uuid","description":"Required for deposits and transfers; forbidden for withdrawals."},"currency_id":{"type":"string","format":"uuid","description":"Currency of `amount`. When omitted, Tetri uses the source or destination account currency."},"foreign_amount":{"type":"string","example":"120.00","description":"Strictly positive original purchase amount in foreign_currency_id. Maximum 12 integer and 12 fractional digits.","pattern":"^(?=.*[1-9])\\d+(?:\\.\\d+)?$"},"foreign_currency_id":{"type":"string","format":"uuid","description":"Currency of foreign_amount for a foreign card charge or FX transfer."},"category_id":{"type":"string","format":"uuid","description":"Category assigned to the created transaction."},"tags":{"maxItems":10,"description":"Tag names attached to the transaction.","example":["food","workday"],"type":"array","items":{"type":"string","maxLength":30}},"notes":{"type":"string","maxLength":5000,"description":"Private free-form notes stored with the transaction."}},"required":["type","date","amount","description"]},"ProgrammaticCreateTransactionResponseDto":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProgrammaticTransactionResourceDto"},"meta":{"$ref":"#/components/schemas/ProgrammaticTransactionMutationMetaDto"},"side_effects":{"type":"array","items":{"$ref":"#/components/schemas/ProgrammaticSideEffectDto"}}},"required":["data","meta","side_effects"]},"ProgrammaticUpdateTransactionDto":{"type":"object","properties":{"expected_revision":{"type":"string","format":"date-time","description":"The `revision` returned by the latest read of this transaction. A stale value is rejected with 409."},"category_id":{"type":"string","nullable":true,"format":"uuid","description":"New category, or null to remove the category."},"description":{"type":"string","minLength":1,"maxLength":500,"example":"Lunch","description":"New human-readable description."},"date":{"type":"string","format":"date-time","example":"2026-07-12T12:00:00.000Z","description":"New transaction instant with an explicit UTC offset."},"account_id":{"type":"string","format":"uuid","description":"New source account of a withdrawal or destination account of a deposit. Its currency must equal the transaction currency. Not supported for transfers."}},"required":["expected_revision"]},"ProgrammaticDeleteTransactionResponseDto":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProgrammaticDeletedTransactionDto"}},"required":["data"]},"PublicV1ParseNlTransaction":{"type":"object","properties":{"text":{"type":"string","example":"wolt 42 gel yesterday","description":"Raw user input. The parser truncates to 512 chars and returns `input_truncated` instead of rejecting the request."},"locale":{"enum":["en","ru","de","es","ka","tr"],"type":"string","description":"Parser locale. Defaults to the authenticated user locale, or to the language of the text when it has no letters of that locale's script."},"timezone":{"type":"string","maxLength":50,"example":"Asia/Tbilisi","description":"IANA timezone for relative dates and explicit clock values. Defaults to the workspace timezone."},"reference_date":{"type":"string","format":"date","description":"Deterministic date anchor for relative date aliases."},"mode":{"enum":["create","edit"],"type":"string","default":"create","description":"`create` builds a new draft; `edit` preserves compatible client context."},"input_mode":{"enum":["text","voice"],"type":"string","default":"text","description":"Input origin. Voice mode enables parser behavior for speech recognition artifacts."},"client_context":{"description":"Optional current form selections used for deterministic disambiguation.","allOf":[{"$ref":"#/components/schemas/NlTransactionClientContextDto"}]}},"required":["text"]},"PublicV1NlTransactionParseResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NlTransactionParseDataDto"}},"required":["data"]},"PublicV1WalletAttributes":{"type":"object","properties":{"version":{"type":"number","example":0},"created_by_user_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","example":"Main checking"},"type":{"enum":["asset","expense","liability","revenue"],"type":"string","example":"bank"},"money_place_kind":{"nullable":true,"enum":["bank_account","cash","credit_card","loan"],"type":"string"},"icon":{"type":"string","nullable":true,"example":"wallet"},"icon_url":{"type":"string","nullable":true,"example":"https://cdn.tetri.app/icons/abc.webp","description":"Resolved CDN URL for asset:* icons. Null for lucide/brand namespaces."},"accent_color":{"enum":["rose","orange","amber","emerald","teal","sky","indigo","violet","pink","slate","clay","apricot","olive","moss","jade","mist","denim","lavender","mauve","taupe"],"type":"string","example":"sky"},"group_id":{"type":"string","nullable":true,"format":"uuid"},"include_net_worth":{"type":"boolean"},"notes":{"type":"string","nullable":true},"order":{"type":"number","example":0},"liability_type":{"nullable":true,"enum":["loan","credit_card","mortgage","iou"],"type":"string","example":"credit_card"},"liability_direction":{"type":"string","nullable":true,"example":"outgoing"},"interest":{"type":"string","nullable":true,"example":"5.25","pattern":"^-?\\d+(\\.\\d+)?$"},"interest_period":{"type":"string","nullable":true,"example":"yearly"},"term_periods":{"type":"number","nullable":true,"example":360},"repayment_type":{"nullable":true,"enum":["french","german","bullet","interest_only"],"type":"string","example":"french"},"scheduled_payment_amount":{"type":"string","nullable":true,"example":"1066.20"},"first_payment_date":{"type":"string","nullable":true,"example":"2026-06-15"},"payment_day_of_month":{"type":"number","nullable":true,"example":15},"expected_settle_date":{"type":"string","nullable":true,"format":"date","example":"2026-12-31"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/WalletAccountDto"}},"total_balance":{"type":"string","nullable":true,"example":"1234.56","pattern":"^-?\\d+(\\.\\d+)?$"},"total_balance_currency":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/WalletAccountCurrencyDto"}]},"balance_aggregate":{"$ref":"#/components/schemas/WalletBalanceAggregateDto"},"per_currency":{"type":"array","items":{"$ref":"#/components/schemas/WalletPerCurrencyBalanceDto","format":"date-time"}},"balance_sparkline_30d":{"description":"Trailing 30-day home-converted wallet balance series, oldest to newest.","type":"array","items":{"type":"number"}},"balance_trend_30d_percentage":{"type":"string","nullable":true,"example":"-3.2","description":"Signed percent change between the first and last 30-day sparkline points."},"last_transaction_at":{"type":"string","nullable":true,"format":"date-time"},"usage_score":{"type":"number","minimum":0,"example":3.25,"description":"Recency-weighted count of posted transactions (halves every 30 days over the last 365). A ranking scalar, not money; wallet list only."},"needs_opening_balance_setup":{"type":"boolean","description":"True if any asset/liability account in this wallet is missing its opening balance.","example":false},"last_reconciled_at":{"type":"string","nullable":true,"format":"date"},"reconciliation_status":{"nullable":true,"enum":["draft","clean","broken"],"type":"string"},"credit_card":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/CreditCardDetailsDto"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"archived_at":{"type":"string","nullable":true,"format":"date-time"},"is_archived":{"type":"boolean","example":false},"created_by":{"type":"object","nullable":true}},"required":["version","created_by_user_id","name","type","money_place_kind","icon","icon_url","accent_color","group_id","include_net_worth","notes","order","liability_type","liability_direction","interest","interest_period","term_periods","repayment_type","scheduled_payment_amount","first_payment_date","payment_day_of_month","expected_settle_date","accounts","total_balance","total_balance_currency","balance_aggregate","per_currency","balance_sparkline_30d","balance_trend_30d_percentage","last_transaction_at","needs_opening_balance_setup","last_reconciled_at","reconciliation_status","credit_card","created_at","updated_at","archived_at","is_archived","created_by"]},"ImportReportedPeriodDto":{"type":"object","properties":{"source":{"type":"string","enum":["ofx_banktranlist"]},"currency_code":{"type":"string","example":"USD"},"start_inclusive":{"type":"string","description":"File-declared inclusive start; retains source date or datetime and offset.","example":"2026-09-01"},"end_exclusive":{"type":"string","description":"File-declared exclusive end. This does not assert completed account coverage.","example":"2026-10-01"}},"required":["source","currency_code","start_inclusive","end_exclusive"]},"ImportDestinationDraftDto":{"type":"object","properties":{"wallet_id":{"type":"string","nullable":true,"format":"uuid"},"wallet_name":{"type":"string","nullable":true},"currency_code":{"type":"string","nullable":true}},"required":["wallet_id","wallet_name","currency_code"]},"ImportStatementColumnsDto":{"type":"object","properties":{"mode":{"enum":["mapped","format"],"type":"string"},"editable_fields":{"type":"array","items":{"type":"string","enum":["date","time","description","amount","debit","credit","currency","bank_reference","category"]}},"columns":{"type":"array","items":{"$ref":"#/components/schemas/ImportStatementColumnDto"}}},"required":["mode","columns"]},"ImportJobOpeningBalanceAdjustmentDto":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"account_name":{"type":"string","example":"Main checking"},"currency_code":{"type":"string","nullable":true,"example":"USD"},"reason":{"enum":["pre_opening_import_rows","bank_balance_match"],"type":"string"},"target_balance":{"type":"string","example":"1000.00","pattern":"^-?\\d+(\\.\\d+)?$"},"balance_as_of_date":{"type":"string","format":"date"},"tetri_balance_before":{"type":"string","example":"950.00","pattern":"^-?\\d+(\\.\\d+)?$"},"tetri_balance_after":{"type":"string","example":"1000.00","pattern":"^-?\\d+(\\.\\d+)?$"},"delta":{"type":"string","example":"50.00","pattern":"^-?\\d+(\\.\\d+)?$"},"old_opening_balance":{"type":"string","example":"100.00","pattern":"^-?\\d+(\\.\\d+)?$"},"new_opening_balance":{"type":"string","example":"150.00","pattern":"^-?\\d+(\\.\\d+)?$"},"old_opening_balance_date":{"type":"string","nullable":true,"format":"date"},"new_opening_balance_date":{"type":"string","nullable":true,"format":"date"}},"required":["account_id","account_name","currency_code","old_opening_balance","new_opening_balance","old_opening_balance_date","new_opening_balance_date"]},"ProgrammaticImportJobResourceDto":{"type":"object","properties":{"type":{"type":"string","example":"import_jobs"},"id":{"type":"string","format":"uuid"},"attributes":{"$ref":"#/components/schemas/ImportJobAttributesDto"}},"required":["type","id","attributes"]},"ProgrammaticSideEffectDto":{"type":"object","properties":{"domain":{"type":"string","example":"wallets","description":"Affected resource domain."},"id":{"type":"string","description":"Affected resource identifier."},"action":{"enum":["upsert","remove"],"type":"string"},"data":{"type":"object","nullable":true,"additionalProperties":true,"description":"Updated resource payload when supplied."}},"required":["domain","id","action"]},"InsightDto":{"type":"object","properties":{"id":{"type":"string","example":"anomaly_018f8e30-66fd-7e50-a1ef-9c52d11c2baf","description":"Stable logical insight key; not a UUID."},"type":{"enum":["balance_low","bill_reminder","budget_exceeded","overspending_alert","budget_progress","subscription_reminder","spending_trend","pending_rate","onboarding_first_account","onboarding_no_categories","onboarding_try_budget","onboarding_add_subscription","onboarding_welcome_back","recurring_detection","uncategorized_cluster","import_health","anomaly","savings_runway"],"type":"string","example":"anomaly"},"priority":{"enum":["low","medium","high"],"type":"string","example":"high"},"triggered_at":{"type":"string","format":"date-time","example":"2026-07-15T06:03:00.000Z","description":"Absolute UTC instant when this occurrence became active. Stable across repeated evaluation, cache refresh, and cache invalidation."},"entity_id":{"type":"string","nullable":true,"format":"uuid"},"associated_transaction_id":{"type":"string","nullable":true,"format":"uuid","description":"Journal whose transaction caused this insight. Null for non-transaction-owned insights."},"payload":{"type":"object","additionalProperties":true,"description":"Rule-specific payload; shape varies by `type`."}},"required":["id","type","priority","triggered_at","entity_id","associated_transaction_id","payload"]},"BudgetAdjustmentDto":{"type":"object","properties":{"amount_delta":{"type":"string","example":"100.00"},"from_month":{"type":"string","example":"2026-09"},"to_month":{"type":"string","nullable":true,"example":"2026-11"}},"required":["amount_delta","from_month","to_month"]},"BudgetCurrencyRefDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"USD"},"symbol":{"type":"string","example":"$"},"decimal_places":{"type":"number","example":2}},"required":["id","code","symbol","decimal_places"]},"BudgetCreatorDto":{"type":"object","properties":{"user_id":{"type":"string","format":"uuid"},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["user_id","display_name","avatar_url"]},"BudgetCategoryRefDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Groceries"},"raw_name":{"type":"string","example":"Groceries"},"is_system_seed":{"type":"boolean","description":"Whether Tetri seeded this category."},"system_seed_key":{"type":"string","nullable":true,"description":"Stable system seed key."},"system_seed_source":{"nullable":true,"enum":["category_seed","rail_template","rail_catalog","system"],"type":"string","description":"Origin of the system seed."},"name_customized":{"type":"boolean","description":"Whether a user replaced the seeded name."},"icon":{"type":"string","nullable":true,"example":"shopping-cart"},"accent_color":{"enum":["rose","orange","amber","emerald","teal","sky","indigo","violet","pink","slate","clay","apricot","olive","moss","jade","mist","denim","lavender","mauve","taupe"],"type":"string","example":"emerald"}},"required":["id","name","raw_name","is_system_seed","system_seed_key","system_seed_source","name_customized","icon","accent_color"]},"BudgetPeriodAttributesDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"budget_id":{"type":"string","format":"uuid"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"base_amount":{"type":"string","example":"500.00"},"rollover_amount":{"type":"string","nullable":true,"example":"0.00"},"effective_limit":{"type":"string","nullable":true,"example":"500.00"},"spent":{"type":"string","nullable":true,"example":"123.45"},"spent_fx_partial":{"type":"boolean","example":false,"description":"True when one or more historical amounts could not be converted."},"spent_missing_fx_count":{"type":"number","example":0},"rollover_fx_partial":{"type":"boolean","example":false,"description":"True when this period inherits an uncertain rollover from an earlier period."},"fx_partial":{"type":"boolean","example":false,"description":"True when spend or inherited rollover makes period financials incomplete."},"remaining":{"type":"string","nullable":true,"example":"376.55"},"percent_used":{"type":"number","nullable":true,"example":24.69},"created_at":{"type":"string","format":"date-time"},"days_total":{"type":"number","example":30},"days_elapsed":{"type":"number","example":12},"days_elapsed_before_today":{"type":"number","example":11},"days_remaining":{"type":"number","example":18},"days_left_including_today":{"type":"number","example":19},"daily_pace":{"type":"string","nullable":true,"example":"10.29"},"planned_daily_average":{"type":"string","nullable":true,"example":"16.67"},"available_today":{"type":"string","nullable":true,"example":"19.82"},"daily_budget_remaining":{"type":"string","nullable":true,"example":"20.91"},"pace_status":{"nullable":true,"enum":["ahead","on-track","warn","over"],"type":"string","description":"Compares actual spend rate to ideal pace. null on the first day of the period."},"share_of_total":{"type":"string","nullable":true,"example":"0.35"},"spend_overview":{"type":"object","description":"Exact bounded overview when requested."},"daily_window":{"type":"object","description":"Explicit bounded daily inspection when requested."},"forecast_total_spent":{"type":"string","nullable":true,"example":"1069.00","description":"Projected total spend at end of period (spent + daily_pace × days_remaining). Null when days_elapsed < 1."}},"required":["id","budget_id","start_date","end_date","base_amount","rollover_amount","effective_limit","spent","spent_fx_partial","spent_missing_fx_count","rollover_fx_partial","fx_partial","remaining","percent_used","created_at","days_total","days_elapsed","days_elapsed_before_today","days_remaining","days_left_including_today","daily_pace","planned_daily_average","available_today","daily_budget_remaining","pace_status","share_of_total","forecast_total_spent"]},"PaginationMetaDto":{"type":"object","properties":{"total":{"type":"number","example":120,"description":"Total matching resources."},"count":{"type":"number","example":25,"description":"Resources in this page."},"per_page":{"type":"number","example":25,"description":"Requested page size."},"current_page":{"type":"number","example":1,"description":"One-based current page."},"total_pages":{"type":"number","example":5,"description":"Total number of pages."}},"required":["total","count","per_page","current_page","total_pages"]},"RecurringRuleDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Recurring rule identifier."},"created_by_user_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","description":"Localized or user-customized display name."},"raw_name":{"type":"string","description":"Stored source name before localization."},"is_system_seed":{"type":"boolean","description":"Whether Tetri seeded this rule."},"system_seed_key":{"type":"string","nullable":true,"description":"Stable system seed key."},"system_seed_source":{"nullable":true,"enum":["category_seed","rail_template","rail_catalog","system"],"type":"string","description":"Origin of the system seed."},"name_customized":{"type":"boolean","description":"Whether a user replaced the seeded name."},"type":{"enum":["expense","income","transfer"],"type":"string"},"kind":{"enum":["rule","subscription"],"type":"string","description":"`rule` can auto-create occurrences; `subscription` is tracked and linked manually."},"amount":{"type":"string","example":"49.99","description":"Decimal amount as a string."},"currency_id":{"type":"string","format":"uuid","description":"Rule currency identifier."},"currency_code":{"type":"string","example":"USD","description":"ISO currency code."},"currency_symbol":{"type":"string","example":"$","description":"Currency display symbol."},"account_id":{"type":"string","format":"uuid","description":"Source account identifier."},"account_name":{"type":"string","description":"Source account display name."},"destination_account_id":{"type":"string","nullable":true,"format":"uuid","description":"Destination account for transfers."},"destination_account_name":{"type":"string","nullable":true,"description":"Destination account display name for transfers."},"category_id":{"type":"string","nullable":true,"format":"uuid"},"category_name":{"type":"string","nullable":true,"description":"Category display name."},"frequency":{"enum":["custom","daily","weekly","biweekly","monthly","quarterly","annual"],"type":"string","example":"monthly","description":"Recurrence frequency configured for the rule."},"custom_interval_days":{"type":"number","nullable":true,"minimum":1,"description":"Day interval when the frequency is custom."},"start_date":{"type":"string","format":"date","description":"First active date."},"end_date":{"type":"string","nullable":true,"format":"date","description":"Last active date."},"next_occurrence_date":{"type":"string","format":"date","description":"Next scheduled occurrence."},"schedule_anchor_day":{"type":"number","nullable":true,"minimum":1,"maximum":31,"description":"Persisted calendar day anchor."},"status":{"enum":["active","paused","ended"],"type":"string"},"paused_at":{"type":"string","nullable":true,"format":"date-time"},"pause_until":{"type":"string","nullable":true,"format":"date","description":"First day the rule runs again after a pause; null for a pause without end."},"auto_create":{"type":"boolean","description":"Whether Tetri automatically creates due transactions."},"catalog_item_id":{"type":"string","nullable":true,"format":"uuid"},"billing_url":{"type":"string","nullable":true,"format":"uri"},"plan_name":{"type":"string","nullable":true},"trial_end_date":{"type":"string","nullable":true,"format":"date"},"reminder_days":{"type":"number","nullable":true,"minimum":0},"icon":{"type":"string","nullable":true,"description":"Icon identifier."},"icon_url":{"type":"string","nullable":true,"format":"uri"},"accent_color":{"enum":["rose","orange","amber","emerald","teal","sky","indigo","violet","pink","slate","clay","apricot","olive","moss","jade","mist","denim","lavender","mauve","taupe"],"type":"string","example":"sky","description":"Tetri accent color token."},"external_id":{"type":"string","nullable":true,"description":"External provider identifier."},"notes":{"type":"string","nullable":true},"version":{"type":"number","minimum":0,"description":"Optimistic concurrency version."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"type":"object","nullable":true}},"required":["id","created_by_user_id","name","raw_name","is_system_seed","system_seed_key","system_seed_source","name_customized","type","kind","amount","currency_id","currency_code","currency_symbol","account_id","account_name","destination_account_id","destination_account_name","category_id","category_name","frequency","custom_interval_days","start_date","end_date","next_occurrence_date","schedule_anchor_day","status","paused_at","pause_until","auto_create","catalog_item_id","billing_url","plan_name","trial_end_date","reminder_days","icon","icon_url","accent_color","external_id","notes","version","created_at","updated_at","created_by"]},"RecurringRuleListMetaDto":{"type":"object","properties":{"total":{"type":"number","minimum":0,"description":"Total matching rules."},"page":{"type":"number","minimum":1,"description":"Current page number."},"limit":{"type":"number","minimum":1,"maximum":100,"description":"Page size."}},"required":["total","page","limit"]},"CoverImageAttributesDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"entity_type":{"type":"string","example":"goal","description":"Entity kind this cover was originally uploaded for."},"entity_id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"card_url":{"type":"string","format":"uri"},"hero_url":{"type":"string","format":"uri"}},"required":["id","entity_type","entity_id","url","card_url","hero_url"]},"GoalPaceDetailAttributesDto":{"type":"object","properties":{"current":{"type":"string","example":"250.00","description":"Current saved amount."},"expected":{"type":"string","example":"300.00","description":"Expected saved amount today."},"behind_by":{"type":"string","example":"50.00","description":"Amount below the expected pace."},"required_monthly":{"type":"string","example":"125.00","description":"Required monthly contribution to meet the target date."}},"required":["current","expected","behind_by","required_monthly"]},"GoalAutoContributionAttributesDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"goal_id":{"type":"string","format":"uuid"},"source_wallet_id":{"type":"string","format":"uuid"},"amount":{"type":"string","example":"100.00","description":"Decimal transfer amount."},"currency_id":{"type":"string","format":"uuid"},"currency_code":{"type":"string","description":"Currency code used to display this goal."},"currency_symbol":{"type":"string","description":"Currency symbol used to display this goal."},"day_of_month":{"type":"number","minimum":1,"maximum":31},"next_run_at":{"type":"string","format":"date-time"},"status":{"enum":["active","paused","stopped"],"type":"string"},"pause_until":{"type":"string","nullable":true,"format":"date-time"},"last_run_at":{"type":"string","nullable":true,"format":"date-time"},"last_run_status":{"nullable":true,"enum":["success","skipped_insufficient_funds","skipped_paused","error"],"type":"string"},"last_run_message":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","goal_id","source_wallet_id","amount","currency_id","currency_code","currency_symbol","day_of_month","next_run_at","status","pause_until","last_run_at","last_run_status","last_run_message","created_at","updated_at"]},"GoalSuggestedAutoContributionAttributesDto":{"type":"object","properties":{"amount":{"type":"string","example":"209","description":"Required monthly amount rounded up to a whole unit."},"day_of_month":{"type":"number","minimum":1,"maximum":31,"example":10,"description":"The day after the main income; 10 when unknown."},"source_wallet_id":{"type":"string","format":"uuid","description":"Main income wallet, else the largest asset wallet."}},"required":["amount","day_of_month","source_wallet_id"]},"AggregateDto":{"type":"object","properties":{"per_currency":{"description":"Raw per-currency breakdown. Amounts are summed within each currency, never converted across currencies. Always present; may be empty when nothing matched the query.","type":"array","items":{"$ref":"#/components/schemas/AggregatePerCurrencyDto"}},"home_converted":{"nullable":true,"description":"Sum re-expressed in the workspace home currency. Null when the workspace has no home display currency configured — the frontend should fall back to rendering `per_currency` directly with a CTA to set a display currency.","type":"object","allOf":[{"$ref":"#/components/schemas/AggregateHomeConvertedDto"}]}},"required":["per_currency","home_converted"]},"TransactionTemplateResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"source":{"enum":["user_saved","auto_suggested","system_default"],"type":"string"},"name":{"type":"string","nullable":true},"direction":{"enum":["income","expense","transfer"],"type":"string"},"fields":{"$ref":"#/components/schemas/TransactionTemplateFieldsDto"},"usageCount":{"type":"number","minimum":0},"lastUsedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","source","name","direction","fields","usageCount","lastUsedAt"]},"TransactionCreatorDto":{"type":"object","properties":{"user_id":{"type":"string","format":"uuid"},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["user_id","display_name","avatar_url"]},"TransactionLegDto":{"type":"object","properties":{"transaction_journal_id":{"type":"string","format":"uuid"},"type":{"enum":["withdrawal","deposit","transfer","loan_payment"],"type":"string"},"date":{"type":"string","format":"date-time"},"occurred_at":{"type":"string","format":"date-time","description":"Actual transaction instant in UTC. Use this for user-display timezone conversion."},"business_date":{"type":"string","format":"date","description":"Stable financial calendar day in the timezone used when the transaction was entered."},"timezone":{"type":"string","example":"Europe/Tbilisi","description":"IANA timezone used to interpret the entered transaction wall-clock time."},"description":{"type":"string","example":"Grocery shopping"},"amount":{"type":"string","example":"42.50"},"foreign_amount":{"type":"string","nullable":true,"example":"45.00"},"foreign_currency_code":{"type":"string","nullable":true,"example":"EUR"},"foreign_currency_symbol":{"type":"string","nullable":true,"example":"€"},"currency_code":{"type":"string","example":"USD"},"currency_symbol":{"type":"string","example":"$"},"currency_decimal_places":{"type":"number","example":2},"source_id":{"type":"string","format":"uuid"},"source_name":{"type":"string"},"source_type":{"type":"string","example":"asset"},"destination_id":{"type":"string","format":"uuid"},"destination_name":{"type":"string"},"destination_type":{"type":"string","example":"expense"},"category_id":{"type":"string","nullable":true,"format":"uuid"},"category_name":{"type":"string","nullable":true},"budget_id":{"type":"string","nullable":true,"format":"uuid"},"budget_name":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"notes":{"type":"string","nullable":true},"last_reconciled_at":{"type":"string","nullable":true,"format":"date"},"reconciled":{"type":"boolean"},"status":{"enum":["posted","pending_rate"],"type":"string"},"estimated_rate":{"type":"string","nullable":true,"example":"1.05","description":"Provisional FX rate captured at create-time for a `pending_rate` transaction. It is source→destination for transfers and foreign-ticket→wallet-native for foreign withdrawals/deposits. ⚠️ This is NOT a currency→home rate."},"pending_rate_quote":{"type":"object","nullable":true,"description":"Canonical base→quote orientation for pending-rate settlement. Null for posted transactions or malformed legacy FX state."},"final_rate":{"type":"string","nullable":true,"example":"1.058","description":"Authoritative FX rate from the executed deal (typically the bank statement value). Stamped by `PATCH /transactions/:id/settle`. When it differs from `estimated_rate`, settlement recomputes the affected native leg amounts and account balances. ⚠️ Same caveat as `estimated_rate`: not a currency→home rate."},"settled_at":{"type":"string","nullable":true,"format":"date-time"},"splits":{"type":"array","items":{"$ref":"#/components/schemas/TransactionSplitItemDto"}},"has_splits":{"type":"boolean"},"remainder":{"type":"string","nullable":true,"example":"0.00"}},"required":["transaction_journal_id","type","date","occurred_at","business_date","timezone","description","amount","foreign_amount","foreign_currency_code","foreign_currency_symbol","currency_code","currency_symbol","currency_decimal_places","source_id","source_name","source_type","destination_id","destination_name","destination_type","category_id","category_name","budget_id","budget_name","tags","notes","last_reconciled_at","reconciled","status","estimated_rate","pending_rate_quote","final_rate","settled_at","splits","has_splits","remainder"]},"ProgrammaticTransactionResourceDto":{"type":"object","properties":{"type":{"type":"string","example":"transactions"},"id":{"type":"string","format":"uuid"},"attributes":{"$ref":"#/components/schemas/TransactionAttributesDto"}},"required":["type","id","attributes"]},"ProgrammaticTransactionMutationMetaDto":{"type":"object","properties":{"accounts_created":{"description":"Accounts created as part of the mutation. Programmatic requests normally return an empty array because they use existing entities.","type":"array","items":{"$ref":"#/components/schemas/ProgrammaticCreatedAccountDto"}}},"required":["accounts_created"]},"ProgrammaticDeletedTransactionDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","example":true}},"required":["id","deleted"]},"NlTransactionClientContextDto":{"type":"object","properties":{"type":{"enum":["withdrawal","deposit","transfer"],"type":"string","description":"Current transaction type selected by the client."},"source_wallet_id":{"type":"string","format":"uuid","description":"Current source wallet selection used to rank candidates."},"source_account_id":{"type":"string","format":"uuid","description":"Current source account selection used to rank candidates."},"destination_wallet_id":{"type":"string","format":"uuid","description":"Current destination wallet selection used to rank candidates."},"destination_account_id":{"type":"string","format":"uuid","description":"Current destination account selection used to rank candidates."},"category_id":{"type":"string","format":"uuid","description":"Current category selection used to rank candidates."}}},"NlTransactionParseDataDto":{"type":"object","properties":{"type":{"type":"string","example":"nl_transaction_parse"},"id":{"type":"string","nullable":true,"example":null},"attributes":{"$ref":"#/components/schemas/NlTransactionParseAttributesDto"}},"required":["type","id","attributes"]},"WalletAccountDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"currency":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/WalletAccountCurrencyDto"}]},"current_balance":{"type":"string","example":"1234.56","pattern":"^-?\\d+(\\.\\d+)?$"},"opening_balance":{"type":"string","nullable":true,"example":"1234.56","pattern":"^-?\\d+(\\.\\d+)?$"},"opening_balance_date":{"type":"string","nullable":true,"format":"date","example":"2026-04-01"},"opening_balance_missing":{"type":"boolean","description":"True for asset/liability accounts created without an opening balance. UI should prompt the user to set it.","example":false},"active":{"type":"boolean"},"iban":{"type":"string","nullable":true},"bic":{"type":"string","nullable":true},"account_number":{"type":"string","nullable":true}},"required":["id","currency","current_balance","opening_balance","opening_balance_date","opening_balance_missing","active","iban","bic","account_number"]},"WalletAccountCurrencyDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"USD"},"symbol":{"type":"string","example":"$"},"kind":{"enum":["fiat","crypto"],"type":"string"},"decimal_places":{"type":"number","minimum":0},"icon_url":{"type":"string","nullable":true,"example":"/api/v1/public/currency-icons/USDT.webp?v=abc"}},"required":["id","code","symbol","kind","decimal_places"]},"WalletBalanceAggregateDto":{"type":"object","properties":{"contract_version":{"type":"string","enum":["wallet-setup-v1"]},"amount":{"type":"string","nullable":true,"example":"1234.56","pattern":"^-?\\d+(\\.\\d+)?$","description":"Current balance converted to the workspace home currency. Null only when currency identity or a required current FX rate is missing; opening-balance setup does not erase a known current amount."},"currency":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/WalletAccountCurrencyDto"}]},"status":{"enum":["complete","incomplete"],"type":"string"},"reasons":{"type":"array","items":{"type":"string","enum":["home_currency_missing","fx_rate_missing"]}},"missing_opening_balance_account_ids":{"description":"Informational account ids for the optional opening-balance recalculation flow. Does not affect current balance completeness.","type":"array","items":{"type":"string","format":"uuid"}},"missing_fx_currency_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["contract_version","amount","currency","status","reasons","missing_opening_balance_account_ids","missing_fx_currency_ids"]},"WalletPerCurrencyBalanceDto":{"type":"object","properties":{"currency_id":{"type":"string","format":"uuid"},"currency_code":{"type":"string","example":"USD"},"amount":{"type":"string","example":"1234.56","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["currency_id","currency_code","amount"]},"CreditCardDetailsDto":{"type":"object","properties":{"setup_status":{"enum":["complete","incomplete"],"type":"string"},"terms":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/CreditCardTermsDto"}]},"outstanding_balance":{"type":"string","example":"1200.00"},"available_credit":{"type":"string","nullable":true,"example":"3800.00"},"current_cycle":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/CreditCardCycleDto"}]},"last_statement_cycle":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/CreditCardCycleDto"}]}},"required":["setup_status","terms","outstanding_balance","available_credit","current_cycle","last_statement_cycle"]},"ImportStatementColumnDto":{"type":"object","properties":{"source_index":{"type":"number","minimum":0},"source_name":{"type":"string"},"example":{"type":"string","nullable":true},"example_truncated":{"type":"boolean"},"fields":{"type":"array","items":{"type":"string","enum":["date","time","description","amount","debit","credit","currency","bank_reference","category"]}},"usage":{"enum":["mapped","unused","format"],"type":"string"}},"required":["source_index","source_name","example","example_truncated","fields","usage"]},"AggregatePerCurrencyDto":{"type":"object","properties":{"currency_code":{"type":"string","example":"USD"},"currency_symbol":{"type":"string","example":"$"},"currency_decimal_places":{"type":"number","example":2},"currency_kind":{"enum":["fiat","crypto"],"type":"string"},"amount":{"type":"string","example":"1250.00","description":"Sum of this currency's entries as a Decimal string rounded to `currency_decimal_places`. Sign is preserved — for a signed aggregate (e.g. `net`) the value may be negative."},"count":{"type":"number","example":12,"description":"How many entries contributed to this bucket."}},"required":["currency_code","currency_symbol","currency_decimal_places","currency_kind","amount","count"]},"AggregateHomeConvertedDto":{"type":"object","properties":{"currency_code":{"type":"string","example":"USD"},"currency_symbol":{"type":"string","example":"$"},"currency_decimal_places":{"type":"number","example":2},"currency_kind":{"enum":["fiat","crypto"],"type":"string"},"amount":{"type":"string","nullable":true,"example":"1420.50","description":"Sum re-expressed in the workspace home currency. Every entry is converted at the FX rate that was in effect on its own date (with a five-day freshness window). Null when any entry is missing a rate; the API never presents a partial known subtotal as a complete aggregate. Rounded to `currency_decimal_places` at the API boundary."},"partial_amount":{"type":"string","nullable":true,"example":"1180.00","description":"The converted part of an incomplete aggregate, rounded the same way as `amount`. Set only when `fx_partial` is true. Clients present it as an explicitly incomplete answer next to the count of what is missing; it must never be shown as a complete total."},"missing_by_currency":{"description":"What `partial_amount` leaves out, grouped by the currency it is still denominated in. Empty when nothing is missing.","type":"array","items":{"$ref":"#/components/schemas/AggregateMissingCurrencyDto"}},"fx_partial":{"type":"boolean","example":false,"description":"True when at least one entry could not be converted (no FX rate in the five-day freshness window). In this state `amount` is null and `partial_amount` carries the converted part."},"missing_fx_count":{"type":"number","example":0,"description":"Number of entries skipped because no FX rate was found."},"rate_date":{"type":"string","nullable":true,"example":"2026-04-23","description":"The most recent actual rate observation date (ISO YYYY-MM-DD). Null when all entries were already in the home currency (no rate lookup needed) or when there were no entries."},"historical_rate_dates":{"description":"Actual historical rate dates used before the valuation date, sorted and unique.","type":"array","items":{"type":"string"}},"historical_rate_dates_complete":{"type":"boolean","description":"False when only a bounded preview of actual rate dates is listed."},"historical_rate_date_range":{"type":"object","properties":{"earliest_date":{"type":"string"},"latest_date":{"type":"string"}},"required":["earliest_date","latest_date"]}},"required":["currency_code","currency_symbol","currency_decimal_places","currency_kind","amount","partial_amount","missing_by_currency","fx_partial","missing_fx_count","rate_date","historical_rate_dates"]},"TransactionTemplateFieldsDto":{"type":"object","properties":{"sourceWallet":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ResolvedTemplateWalletDto"}]},"targetWallet":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ResolvedTemplateWalletDto"}]},"category":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ResolvedTemplateCategoryDto"}]},"amountMinor":{"type":"string","nullable":true,"example":"1250"},"currencyCode":{"type":"string","nullable":true,"example":"USD"},"description":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"note":{"type":"string","nullable":true,"deprecated":true},"tags":{"type":"array","items":{"type":"string"}},"recurrencePreset":{"nullable":true,"enum":["daily","weekly","biweekly","monthly","quarterly","annual","custom"],"type":"string"}},"required":["sourceWallet","targetWallet","category","amountMinor","currencyCode","description","notes","note","tags","recurrencePreset"]},"TransactionSplitItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"amount":{"type":"string","example":"42.50"},"category_id":{"type":"string","nullable":true,"format":"uuid"},"note":{"type":"string","nullable":true},"tag_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["id","amount","category_id","note","tag_ids"]},"TransactionAttributesDto":{"type":"object","properties":{"revision":{"type":"string","format":"date-time"},"group_title":{"type":"string","nullable":true},"execution_status":{"enum":["scheduled","posted"],"type":"string"},"executed_at":{"type":"string","nullable":true,"format":"date-time"},"archived_at":{"type":"string","nullable":true,"format":"date-time"},"is_archived":{"type":"boolean"},"created_by":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/TransactionCreatorDto"}]},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/TransactionLegDto"}}},"required":["revision","group_title","execution_status","executed_at","archived_at","is_archived","created_by","transactions"]},"ProgrammaticCreatedAccountDto":{"type":"object","properties":{"wallet_id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid"},"currency_id":{"type":"string","format":"uuid"}},"required":["wallet_id","account_id","currency_id"]},"NlTransactionParseAttributesDto":{"type":"object","properties":{"normalized_text":{"type":"string","example":"wolt 42 gel yesterday"},"tokens":{"type":"array","items":{"$ref":"#/components/schemas/NlTransactionTokenDto"}},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/NlTransactionCandidateDto"}},"selected":{"type":"array","items":{"$ref":"#/components/schemas/NlTransactionCandidateDto"}},"draft":{"$ref":"#/components/schemas/NlTransactionDraftDto"},"confidence":{"enum":["high","medium","low","invalid"],"type":"string"},"missing_fields":{"type":"array","items":{"$ref":"#/components/schemas/NlTransactionMissingFieldDto"}},"alternatives":{"type":"array","items":{"$ref":"#/components/schemas/NlTransactionAlternativeGroupDto"}},"warnings":{"example":["invalid_local_time"],"description":"Open warning-code list. Known codes: input_truncated, locale_fallback, invalid_local_time. Consumers must tolerate future codes.","type":"array","items":{"type":"string"}},"dictionary_version":{"type":"string","example":"nl-tx-v5-2026-07-17"}},"required":["normalized_text","tokens","candidates","selected","draft","confidence","missing_fields","alternatives","warnings","dictionary_version"]},"CreditCardTermsDto":{"type":"object","properties":{"credit_limit":{"type":"string","example":"5000.00"},"statement_day_of_month":{"type":"number","example":25},"statement_timezone":{"type":"string","example":"Asia/Tbilisi"},"grace_period_days":{"type":"number","example":20},"purchase_apr":{"type":"string","nullable":true,"example":"24.90"},"minimum_payment_percent":{"type":"string","example":"3.00"},"minimum_payment_fixed":{"type":"string","example":"25.00"},"grace_policy":{"enum":["full_statement_balance","none"],"type":"string"}},"required":["credit_limit","statement_day_of_month","statement_timezone","grace_period_days","purchase_apr","minimum_payment_percent","minimum_payment_fixed","grace_policy"]},"CreditCardCycleDto":{"type":"object","properties":{"period_start":{"type":"string","format":"date"},"period_end":{"type":"string","format":"date"},"statement_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"statement_balance":{"type":"string","example":"1200.00"},"due_amount":{"type":"string","example":"36.00"},"paid_amount":{"type":"string","example":"36.00"},"paid_at":{"type":"string","nullable":true,"format":"date-time"},"grace_eligible":{"type":"boolean"},"accrued_interest":{"type":"string","example":"0"},"status":{"enum":["open","closed","due","paid"],"type":"string"}},"required":["period_start","period_end","statement_date","due_date","statement_balance","due_amount","paid_amount","paid_at","grace_eligible","accrued_interest","status"]},"AggregateMissingCurrencyDto":{"type":"object","properties":{"currency_code":{"type":"string","example":"USDT"},"currency_symbol":{"type":"string","example":"₮"},"currency_decimal_places":{"type":"number","example":2},"currency_kind":{"enum":["fiat","crypto"],"type":"string"},"amount":{"type":"string","example":"800.00","description":"Sum that could not be converted, still in its own currency, rounded to `currency_decimal_places`."},"count":{"type":"number","example":1,"description":"How many entries are behind that sum."},"earliest_date":{"type":"string","example":"2026-03-12","description":"Journal date (ISO `YYYY-MM-DD`) of the oldest entry in this bucket — the earliest date whose exchange rate is missing."},"latest_date":{"type":"string","example":"2026-08-04","description":"Journal date (ISO `YYYY-MM-DD`) of the newest entry in this bucket."}},"required":["currency_code","currency_symbol","currency_decimal_places","currency_kind","amount","count","earliest_date","latest_date"]},"ResolvedTemplateWalletDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"Wallet display name."},"currencyCode":{"type":"string","nullable":true,"example":"USD"}},"required":["id","name","currencyCode"]},"ResolvedTemplateCategoryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"Category display name."},"color":{"type":"string","example":"emerald","description":"Tetri accent color token."}},"required":["id","name","color"]},"NlTransactionTokenDto":{"type":"object","properties":{"index":{"type":"number","example":0},"raw":{"type":"string","example":"wolt"},"normalized":{"type":"string","example":"wolt"},"start":{"type":"number","example":0},"end":{"type":"number","example":4},"kind":{"enum":["word","number","clock","symbol","punctuation","mixed"],"type":"string"}},"required":["index","raw","normalized","start","end","kind"]},"NlTransactionCandidateDto":{"type":"object","properties":{"id":{"type":"string","example":"amount:1:2:42"},"field":{"enum":["amount","currency","date","time","type","wallet","account","category","tag","description"],"type":"string"},"value":{"type":"string","example":"42"},"label":{"type":"string","example":"42"},"source":{"enum":["static","workspace","behavioral","system","derived"],"type":"string"},"match_kind":{"enum":["exact_alias","exact_name","prefix","contains","edit_distance","phonetic_alias","spoken_number","derived"],"type":"string"},"span_start":{"type":"number","example":1},"span_end":{"type":"number","example":2},"score":{"type":"number","example":1},"metadata":{"type":"object","additionalProperties":true}},"required":["id","field","value","label","source","match_kind","span_start","span_end","score"]},"NlTransactionDraftDto":{"type":"object","properties":{"type":{"enum":["withdrawal","deposit","transfer"],"type":"string"},"amount":{"type":"string","example":"42"},"currency_id":{"type":"string","format":"uuid"},"currency_code":{"type":"string","example":"GEL"},"date":{"type":"string","format":"date"},"occurred_at":{"type":"string","format":"date-time","description":"Exact transaction instant in UTC when one unambiguous explicit clock successfully resolves in the selected date and timezone."},"timezone":{"type":"string","example":"Asia/Tbilisi","description":"IANA timezone used to resolve occurred_at and preserve its financial day."},"source_wallet_id":{"type":"string","format":"uuid"},"source_account_id":{"type":"string","format":"uuid"},"destination_wallet_id":{"type":"string","format":"uuid"},"destination_account_id":{"type":"string","format":"uuid"},"category_id":{"type":"string","format":"uuid"},"tags":{"type":"array","items":{"type":"string"}},"description":{"type":"string","example":"wolt"}}},"NlTransactionMissingFieldDto":{"type":"object","properties":{"field":{"enum":["amount","currency","date","time","source_account","destination_account","category"],"type":"string"},"reason":{"enum":["missing","ambiguous","invalid","currency_conflict","unsupported"],"type":"string"},"can_use_default":{"type":"boolean","example":false}},"required":["field","reason","can_use_default"]},"NlTransactionAlternativeGroupDto":{"type":"object","properties":{"field":{"enum":["amount","currency","date","time","type","wallet","account","category","tag","description"],"type":"string"},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/NlTransactionCandidateDto"}}},"required":["field","candidates"]}},"securitySchemes":{"programmatic_access_token":{"scheme":"bearer","bearerFormat":"Tetri PAT","type":"http","description":"A Tetri personal access token for the API audience."}}},"x-tetri-release-version":"1.0.27","security":[{"programmatic_access_token":[]}],"paths":{"/api/v1/programmatic/imports":{"get":{"description":"Returns statement imports from the PAT workspace.","operationId":"ProgrammaticImportController_list_v1","parameters":[{"name":"after","required":false,"in":"query","description":"Opaque cursor returned as next_cursor by the previous page.","schema":{"maxLength":512,"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum import jobs returned per page.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}}],"responses":{"200":{"description":"Statement import jobs and pagination metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Resources in this page.","items":{"type":"object","properties":{"type":{"type":"string","example":"import_jobs","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/ImportJobAttributesDto"}},"required":["type","id","attributes"]}},"meta":{"$ref":"#/components/schemas/CountedCursorPaginationMetaDto"}},"required":["data","meta"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List statement imports","tags":["Programmatic imports"],"x-tetri-scope":"imports:read"},"post":{"description":"Uploads and parses a statement for an existing active asset account.","operationId":"ProgrammaticImportController_upload_v1","parameters":[{"name":"Idempotency-Key","in":"header","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical file and account.","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$","example":"import_20260722_01J2Y8M4R1"}}],"requestBody":{"required":true,"description":"Statement file and destination account. Supported files: CSV, Excel, OFX, QFX, and MT940, up to 10 MiB.","content":{"multipart/form-data":{"schema":{"type":"object","required":["account_id","file"],"properties":{"account_id":{"type":"string","format":"uuid","description":"Existing active asset account that receives the imported rows."},"file":{"type":"string","format":"binary","description":"Bank statement file, up to 10 MiB."}}},"examples":{"statement":{"summary":"Upload a statement","value":{"account_id":"<asset-account-id>","file":"<statement.csv>"}}}}}},"responses":{"201":{"description":"Statement uploaded and parsed into an import preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticImportMutationResponseDto"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"409":{"description":"The idempotency key was reused with a different request or the resource state conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"413":{"description":"The uploaded statement exceeds the 10 MiB limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Upload a statement import","tags":["Programmatic imports"],"x-tetri-scope":"imports:create"}},"/api/v1/programmatic/imports/{id}":{"get":{"description":"Returns one statement import and its available preview.","operationId":"ProgrammaticImportController_findById_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Statement import job identifier.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The requested import job and its available parsed preview.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested resource.","properties":{"type":{"type":"string","example":"import_jobs","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/ImportJobAttributesDto"}},"required":["type","id","attributes"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get a statement import","tags":["Programmatic imports"],"x-tetri-scope":"imports:read"}},"/api/v1/programmatic/imports/{id}/confirm":{"post":{"description":"Atomically queues a parsed statement preview for transaction creation.","operationId":"ProgrammaticImportController_confirm_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Parsed statement import job identifier.","schema":{"format":"uuid","type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical confirmation.","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$","example":"confirm_20260722_01J2Y8M4R1"}}],"requestBody":{"required":true,"description":"Confirmation options applied atomically when imported transactions are queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticImportConfirmDto"},"examples":{"default":{"summary":"Confirm with duplicate protection","value":{"skip_duplicates":true}},"fallbackCategory":{"summary":"Confirm with a fallback category","value":{"skip_duplicates":true,"default_category_id":"<category-id>"}}}}}},"responses":{"201":{"description":"Import confirmation accepted and transaction creation queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticImportMutationResponseDto"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"409":{"description":"The idempotency key was reused with a different request or the resource state conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Confirm a statement import","tags":["Programmatic imports"],"x-tetri-scope":"imports:create"}},"/api/v1/programmatic/reports/cash-flow-summary":{"get":{"description":"Returns income, expense, savings, and monthly trend aggregates. `monthly_trend` is deprecated and sunsets on 2027-04-01 (see the `Sunset` response header): read `trend_months` instead, which keeps months with a missing exchange rate and marks them `fx_partial`.","operationId":"ProgrammaticAnalyticsController_getCashFlowSummary_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Final report month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}},{"name":"range","required":false,"in":"query","description":"`full` is clamped to the history window allowed by the plan.","schema":{"default":"recent","type":"string","enum":["recent","full"]}},{"name":"period","required":false,"in":"query","deprecated":true,"description":"Deprecated compatibility alias. Use `range`.","schema":{"type":"string","enum":["6m","12m"]}}],"responses":{"200":{"description":"Complete cash flow summary report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["cash_flow_summary"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"month":{"type":"string"},"target_savings_rate":{"type":"string","description":"Decimal value serialized as a string."},"total_income_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"total_expenses_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"savings_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"savings_rate":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"income_sources":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"account_id":{"type":"string","nullable":true},"wallet_id":{"type":"string","nullable":true},"name":{"type":"string"},"amount":{"type":"string","description":"Decimal value serialized as a string."},"percentage":{"type":"string","description":"Decimal value serialized as a string."}},"required":["account_id","name","amount","percentage"]}},"expense_categories":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"category_id":{"type":"string","nullable":true},"name":{"type":"string"},"icon_name":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true},"accent_color":{"type":"string","nullable":true},"amount":{"type":"string","description":"Decimal value serialized as a string."},"percentage":{"type":"string","description":"Decimal value serialized as a string."}},"required":["category_id","name","icon_name","icon_url","accent_color","amount","percentage"]}},"monthly_trend":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"month":{"type":"string"},"income":{"type":"string","description":"Decimal value serialized as a string."},"expenses":{"type":"string","description":"Decimal value serialized as a string."},"savings":{"type":"string","description":"Decimal value serialized as a string."},"savings_rate":{"type":"string","description":"Decimal value serialized as a string."}},"required":["month","income","expenses","savings","savings_rate"]},"deprecated":true,"description":"Deprecated: omits every month that has a missing exchange rate or no savings rate. Use `trend_months`. Removed after 2027-04-01; the `Sunset` response header carries the date."},"trend_months":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"month":{"type":"string"},"income":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"expenses":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"savings":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"savings_rate":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["month","income","expenses","savings","savings_rate","fx_partial","missing_fx_count"]}},"fx_losses_home":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","month","target_savings_rate","total_income_agg","total_expenses_agg","savings_agg","savings_rate","income_sources","expense_categories","monthly_trend","trend_months","fx_losses_home","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get cash flow summary report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/expense-comparison":{"get":{"description":"Compares expense totals between two months.","operationId":"ProgrammaticAnalyticsController_getExpenseComparison_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Primary month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}},{"name":"compare_month","required":false,"in":"query","description":"Comparison month. Defaults to the month before `month`.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-06","type":"string"}}],"responses":{"200":{"description":"Complete expense comparison report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["expense_comparison"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"month":{"type":"string"},"compare_month":{"type":"string"},"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"categories":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"category_id":{"type":"string","nullable":true},"name":{"type":"string"},"icon_name":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true},"accent_color":{"type":"string","nullable":true},"current_amount":{"type":"string","description":"Decimal value serialized as a string."},"previous_amount":{"type":"string","description":"Decimal value serialized as a string."},"change_amount":{"type":"string","description":"Decimal value serialized as a string."},"change_percentage":{"type":"string","description":"Decimal value serialized as a string."},"direction":{"type":"string"},"trend":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"month":{"type":"string"},"amount":{"type":"string","description":"Decimal value serialized as a string."}},"required":["month","amount"]}},"budget":{"type":"object","additionalProperties":false,"properties":{"budget_id":{"type":"string"},"amount":{"type":"string","description":"Decimal value serialized as a string."}},"required":["budget_id","amount"],"nullable":true}},"required":["category_id","name","icon_name","icon_url","accent_color","current_amount","previous_amount","change_amount","change_percentage","direction","trend","budget"]}},"total_current_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"total_previous_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"total_change_amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"total_change_percentage":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"biggest_increases":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"category_id":{"type":"string","nullable":true},"name":{"type":"string"},"icon_name":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true},"change_amount":{"type":"string","description":"Decimal value serialized as a string."},"change_percentage":{"type":"string","description":"Decimal value serialized as a string."}},"required":["category_id","name","icon_name","icon_url","change_amount","change_percentage"]}},"biggest_decreases":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"category_id":{"type":"string","nullable":true},"name":{"type":"string"},"icon_name":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true},"change_amount":{"type":"string","description":"Decimal value serialized as a string."},"change_percentage":{"type":"string","description":"Decimal value serialized as a string."}},"required":["category_id","name","icon_name","icon_url","change_amount","change_percentage"]}},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","month","compare_month","currency_code","currency_symbol","categories","total_current_agg","total_previous_agg","total_change_amount","total_change_percentage","biggest_increases","biggest_decreases","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get expense comparison report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/budget-performance":{"get":{"description":"Returns budget utilization and pacing for a month.","operationId":"ProgrammaticAnalyticsController_getBudgetPerformance_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Budget month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}}],"responses":{"200":{"description":"Complete budget performance report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["budget_performance"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"month":{"type":"string"},"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"days_elapsed":{"type":"integer"},"days_in_month":{"type":"integer"},"budgets":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"budget_id":{"type":"string"},"name":{"type":"string"},"accent_color":{"type":"string","nullable":true},"budget_amount":{"type":"string","description":"Decimal value serialized as a string."},"actual_spent":{"type":"string","description":"Decimal value serialized as a string."},"forecast":{"type":"string","description":"Decimal value serialized as a string."},"status":{"type":"string","enum":["on_track","on_edge","over"]},"percent_used":{"type":"string","description":"Decimal value serialized as a string."},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"categories":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"icon_name":{"type":"string","nullable":true},"accent_color":{"type":"string","nullable":true},"actual_spent":{"type":"string","description":"Decimal value serialized as a string."},"percentage_of_budget":{"type":"string","description":"Decimal value serialized as a string."}},"required":["id","name","icon_name","accent_color","actual_spent","percentage_of_budget"]}}},"required":["budget_id","name","accent_color","budget_amount","actual_spent","forecast","status","percent_used","fx_partial","missing_fx_count","categories"]}},"summary":{"type":"object","additionalProperties":false,"properties":{"total_budgeted_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"total_spent_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"total_forecast_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"on_track_count":{"type":"integer","nullable":true},"on_edge_count":{"type":"integer","nullable":true},"over_count":{"type":"integer","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["total_budgeted_agg","total_spent_agg","total_forecast_agg","on_track_count","on_edge_count","over_count","fx_partial","missing_fx_count"]}},"required":["analysis_period_end","analysis_period_start","month","currency_code","currency_symbol","days_elapsed","days_in_month","budgets","summary"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get budget performance report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/category-heatmap":{"get":{"description":"Returns category spending intensity over the selected period.","operationId":"ProgrammaticAnalyticsController_getCategoryHeatmap_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Final report month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}},{"name":"range","required":false,"in":"query","description":"`full` is clamped to the history window allowed by the plan.","schema":{"default":"recent","type":"string","enum":["recent","full"]}},{"name":"period","required":false,"in":"query","deprecated":true,"description":"Deprecated compatibility alias. Use `range`.","schema":{"type":"string","enum":["6m","12m"]}}],"responses":{"200":{"description":"Complete category heatmap report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["category_heatmap"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"period":{"type":"string"},"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"months":{"type":"array","items":{"type":"string"}},"categories":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"category_id":{"type":"string","nullable":true},"name":{"type":"string"},"icon_name":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true},"accent_color":{"type":"string","nullable":true}},"required":["category_id","name","icon_name","icon_url","accent_color"]}},"cells":{"type":"array","items":{"type":"array","items":{"type":"string","description":"Decimal value serialized as a string."}}},"min_value":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"max_value":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"period_total_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","period","currency_code","currency_symbol","months","categories","cells","min_value","max_value","period_total_agg","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get category heatmap report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/spending-velocity":{"get":{"description":"Returns current-month spending pace and projection.","operationId":"ProgrammaticAnalyticsController_getSpendingVelocity_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Report month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}},{"name":"scope","required":false,"in":"query","description":"`all` (default) or `group:<category_group_id>`.","schema":{"pattern":"^(all|group:[0-9a-f-]{36})$","example":"group:3f1c…","type":"string"}}],"responses":{"200":{"description":"Complete spending velocity report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["spending_velocity"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"month":{"type":"string"},"daily_cumulative":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"day":{"type":"integer"},"date":{"type":"string","format":"date"},"cumulative_amount":{"type":"string","description":"Decimal value serialized as a string."}},"required":["day","date","cumulative_amount"]}},"total_spent_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"half_spent_day":{"type":"integer","nullable":true},"operation_count":{"type":"integer"},"half_spent_trend":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"month":{"type":"string"},"half_spent_day":{"type":"integer","nullable":true}},"required":["month","half_spent_day"]}},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","month","daily_cumulative","total_spent_agg","half_spent_day","operation_count","half_spent_trend","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get spending velocity report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/anomalies":{"get":{"description":"Returns transactions that differ materially from category history.","operationId":"ProgrammaticAnalyticsController_getAnomalies_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Report month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}}],"responses":{"200":{"description":"Complete anomaly detection report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["anomaly_detection"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"month":{"type":"string"},"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"anomalies":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"transaction_id":{"type":"string"},"journal_id":{"type":"string"},"journal_revision":{"type":"string"},"description":{"type":"string"},"date":{"type":"string","format":"date"},"amount":{"type":"string","description":"Decimal value serialized as a string."},"native_amount":{"type":"string","description":"Decimal value serialized as a string."},"native_currency_code":{"type":"string","nullable":true},"native_currency_symbol":{"type":"string","nullable":true},"category_id":{"type":"string"},"category_name":{"type":"string"},"category_color":{"type":"string","nullable":true},"category_avg":{"type":"string","description":"Decimal value serialized as a string."},"multiplier":{"type":"string","description":"Decimal value serialized as a string."},"monthly_history":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"month":{"type":"string"},"amount":{"type":"string","description":"Decimal value serialized as a string."}},"required":["month","amount"]}},"hints":{"type":"object","additionalProperties":false,"properties":{"recategorize":{"type":"object","additionalProperties":false,"properties":{"category_id":{"type":"string"},"category_name":{"type":"string"},"keyword":{"type":"string"},"category_avg":{"type":"string","description":"Decimal value serialized as a string."},"ratio_after":{"type":"string","description":"Decimal value serialized as a string."}},"required":["category_id","category_name","keyword","category_avg","ratio_after"],"nullable":true},"split":{"type":"object","additionalProperties":false,"properties":{"suggested_own_share":{"type":"string","description":"Decimal value serialized as a string."}},"required":["suggested_own_share"],"nullable":true}},"required":["recategorize","split"]}},"required":["transaction_id","journal_id","journal_revision","description","date","amount","native_amount","native_currency_code","native_currency_symbol","category_id","category_name","category_color","category_avg","multiplier","monthly_history","hints"]}},"operations":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"transaction_id":{"type":"string"},"date":{"type":"string","format":"date"},"category_id":{"type":"string"},"amount":{"type":"string","description":"Decimal value serialized as a string."},"ratio":{"type":"string","description":"Decimal value serialized as a string."}},"required":["transaction_id","date","category_id","amount","ratio"]}},"operations_truncated":{"type":"boolean"},"categories":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"category_id":{"type":"string"},"name":{"type":"string"},"accent_color":{"type":"string","nullable":true},"avg_amount":{"type":"string","description":"Decimal value serialized as a string."},"normal_count":{"type":"integer"}},"required":["category_id","name","accent_color","avg_amount","normal_count"]}},"threshold_multiplier":{"type":"number"},"extreme_multiplier":{"type":"number"},"total_amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"extreme_count":{"type":"integer","nullable":true},"transaction_count":{"type":"integer"},"baseline_start":{"type":"string","format":"date"},"baseline_end":{"type":"string","format":"date"},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","month","currency_code","currency_symbol","anomalies","operations","operations_truncated","categories","threshold_multiplier","extreme_multiplier","total_amount","extreme_count","transaction_count","baseline_start","baseline_end","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get anomalies report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/income-stability":{"get":{"description":"Returns income consistency metrics over the selected period.","operationId":"ProgrammaticAnalyticsController_getIncomeStability_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Final report month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}},{"name":"range","required":false,"in":"query","description":"`full` is clamped to the history window allowed by the plan.","schema":{"default":"recent","type":"string","enum":["recent","full"]}},{"name":"period","required":false,"in":"query","deprecated":true,"description":"Deprecated compatibility alias. Use `range`.","schema":{"type":"string","enum":["6m","12m"]}}],"responses":{"200":{"description":"Complete income stability report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["income_stability"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"period":{"type":"string"},"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"monthly_incomes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"month":{"type":"string"},"amount":{"type":"string","description":"Decimal value serialized as a string."}},"required":["month","amount"]}},"mean":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"stddev":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"cv":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"trend":{"type":"string","enum":["increasing","decreasing","stable"],"nullable":true},"forecast_next_month":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"total_income_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","period","currency_code","currency_symbol","monthly_incomes","mean","stddev","cv","trend","forecast_next_month","total_income_agg","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get income stability report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/category-drift":{"get":{"description":"Returns material category spending changes over time.","operationId":"ProgrammaticAnalyticsController_getCategoryDrift_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Final report month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}},{"name":"range","required":false,"in":"query","description":"`full` is clamped to the history window allowed by the plan.","schema":{"default":"recent","type":"string","enum":["recent","full"]}},{"name":"period","required":false,"in":"query","deprecated":true,"description":"Deprecated compatibility alias. Use `range`.","schema":{"type":"string","enum":["6m","12m"]}}],"responses":{"200":{"description":"Complete category drift report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["category_drift"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"period":{"type":"string"},"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"categories":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"category_id":{"type":"string"},"name":{"type":"string"},"icon_name":{"type":"string","nullable":true},"accent_color":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true},"monthly_shares":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"month":{"type":"string"},"share":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"amount":{"type":"string","description":"Decimal value serialized as a string."}},"required":["month","share","amount"]}},"change_pp":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"direction":{"type":"string","enum":["growing","shrinking","stable","unavailable"]}},"required":["category_id","name","icon_name","accent_color","icon_url","monthly_shares","change_pp","direction"]}},"month_totals":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"month":{"type":"string"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"status":{"type":"string","enum":["complete","in_progress","future","fx_missing","empty"]}},"required":["month","amount","status"]}},"drift_threshold_pp":{"type":"number"},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","period","currency_code","currency_symbol","categories","month_totals","drift_threshold_pp","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get category drift report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/transfer-flow":{"get":{"description":"Returns transfer volumes and directions for a month.","operationId":"ProgrammaticAnalyticsController_getTransferFlow_v1","parameters":[{"name":"month","required":false,"in":"query","description":"Report month. Defaults to the current month in the workspace timezone.","schema":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-07","type":"string"}}],"responses":{"200":{"description":"Complete transfer flow report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transfer_flow"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"month":{"type":"string"},"home_currency_code":{"type":"string"},"window_start":{"type":"string","format":"date"},"nodes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"account_id":{"type":"string"},"wallet_id":{"type":"string","nullable":true},"name":{"type":"string"},"type":{"type":"string"},"currency_code":{"type":"string","nullable":true},"wallet_name":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true},"accent_color":{"type":"string","nullable":true}},"required":["account_id","name","type"]}},"links":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"source_id":{"type":"string"},"target_id":{"type":"string"},"amount":{"type":"string","description":"Decimal value serialized as a string."}},"required":["source_id","target_id","amount"]}},"transfers":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"journal_id":{"type":"string"},"transaction_id":{"type":"string"},"journal_revision":{"type":"string"},"date":{"type":"string","format":"date"},"source_id":{"type":"string"},"target_id":{"type":"string"},"native_amount":{"type":"string","description":"Decimal value serialized as a string."},"native_currency":{"type":"string"},"dest_amount":{"type":"string","description":"Decimal value serialized as a string."},"dest_currency":{"type":"string"},"home_amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"status":{"type":"string","enum":["posted","pending_rate"]},"transfer_kind":{"type":"string","enum":["internal_fx","inter_wallet"]},"estimated_rate":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"recurring_rule_id":{"type":"string","nullable":true}},"required":["journal_id","transaction_id","journal_revision","date","source_id","target_id","native_amount","native_currency","dest_amount","dest_currency","home_amount","status","transfer_kind","estimated_rate","recurring_rule_id"]}},"recurring_routes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"source_id":{"type":"string"},"target_id":{"type":"string"},"rule_id":{"type":"string"},"frequency":{"type":"string"},"day":{"type":"integer"}},"required":["source_id","target_id","rule_id","frequency","day"]}},"total_transferred_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","month","home_currency_code","nodes","links","total_transferred_agg","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get transfer flow report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/recurring-detection":{"get":{"description":"Returns transaction patterns that may be recurring.","operationId":"ProgrammaticReportSnapshotsController_getRecurringDetection_v1","parameters":[],"responses":{"200":{"description":"Complete recurring detection report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["recurring_detection"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"analysis_period_months":{"type":"integer"},"detected":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"description_pattern":{"type":"string"},"suggested_name":{"type":"string"},"avg_amount":{"type":"string","description":"Decimal value serialized as a string."},"frequency":{"type":"string","enum":["weekly","biweekly","monthly","quarterly","irregular"]},"count":{"type":"integer"},"last_date":{"type":"string","format":"date"},"amount_variance":{"type":"string","description":"Decimal value serialized as a string."},"suggested_action":{"type":"string","enum":["create_subscription","create_recurring_rule"]}},"required":["description_pattern","suggested_name","avg_amount","frequency","count","last_date","amount_variance","suggested_action"]}},"total_estimated_monthly_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","analysis_period_months","detected","total_estimated_monthly_agg","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get recurring detection report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/uncategorized-clusters":{"get":{"description":"Groups uncategorized transactions by similar descriptions.","operationId":"ProgrammaticReportSnapshotsController_getUncategorizedClusters_v1","parameters":[],"responses":{"200":{"description":"Complete uncategorized clusters report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["uncategorized_clusters"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"analysis_period_months":{"type":"integer"},"transaction_count":{"type":"integer"},"total_uncategorized_count":{"type":"integer"},"clusters":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"description_pattern":{"type":"string"},"count":{"type":"integer"},"total_amount":{"type":"string","description":"Decimal value serialized as a string."},"avg_amount":{"type":"string","description":"Decimal value serialized as a string."},"last_date":{"type":"string","format":"date"},"sample_transaction_ids":{"type":"array","items":{"type":"string"}},"transactions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"date":{"type":"string","format":"date"},"amount":{"type":"string","description":"Decimal value serialized as a string."}},"required":["id","date","amount"]}},"every_days":{"type":"number","nullable":true},"last_days_ago":{"type":"integer"},"total_amount_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["description_pattern","count","total_amount","avg_amount","last_date","sample_transaction_ids","transactions","every_days","last_days_ago","total_amount_agg","fx_partial","missing_fx_count"]}},"one_off_count":{"type":"integer"},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"}},"required":["analysis_period_end","analysis_period_start","currency_code","currency_symbol","analysis_period_months","transaction_count","total_uncategorized_count","clusters","one_off_count","fx_partial","missing_fx_count"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get uncategorized clusters report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/import-health":{"get":{"description":"Returns statement import freshness and coverage by account.","operationId":"ProgrammaticReportSnapshotsController_getImportHealth_v1","parameters":[],"responses":{"200":{"description":"Complete import health report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["import_health"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"overall_score":{"type":"number"},"duplicate_rate":{"type":"string","description":"Decimal value serialized as a string."},"error_rate":{"type":"string","description":"Decimal value serialized as a string."},"categorization_rate":{"type":"string","description":"Decimal value serialized as a string."},"total_imports":{"type":"integer"},"accounts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"account_id":{"type":"string"},"wallet_id":{"type":"string","nullable":true},"account_name":{"type":"string"},"total_imports":{"type":"integer"},"last_import_date":{"type":"string","format":"date","nullable":true},"avg_error_rate":{"type":"string","description":"Decimal value serialized as a string."},"avg_duplicate_rate":{"type":"string","description":"Decimal value serialized as a string."}},"required":["account_id","account_name","total_imports","last_import_date","avg_error_rate","avg_duplicate_rate"]}}},"required":["overall_score","duplicate_rate","error_rate","categorization_rate","total_imports","accounts"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get import health report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/account-gaps":{"get":{"description":"Returns active accounts with stale or missing transaction activity.","operationId":"ProgrammaticReportSnapshotsController_getAccountGaps_v1","parameters":[],"responses":{"200":{"description":"Complete account gaps report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["account_gaps"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"threshold_days":{"type":"integer"},"flagged_accounts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"account_id":{"type":"string"},"wallet_id":{"type":"string","nullable":true},"name":{"type":"string"},"last_transaction_date":{"type":"string","format":"date","nullable":true},"days_since_last":{"type":"integer"},"has_import_history":{"type":"boolean"}},"required":["account_id","name","last_transaction_date","days_since_last","has_import_history"]}},"total_active_accounts":{"type":"integer"}},"required":["threshold_days","flagged_accounts","total_active_accounts"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get account gaps report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/reports/savings-runway":{"get":{"description":"Estimates how long current assets cover recent expenses.","operationId":"ProgrammaticReportSnapshotsController_getSavingsRunway_v1","parameters":[],"responses":{"200":{"description":"Complete savings runway report in a JSON:API resource envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["savings_runway"]},"id":{"type":"string"},"attributes":{"type":"object","additionalProperties":false,"properties":{"analysis_period_end":{"type":"string","format":"date"},"analysis_period_start":{"type":"string","format":"date"},"total_assets_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"avg_monthly_expenses_agg":{"type":"object","additionalProperties":false,"properties":{"per_currency":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"count":{"type":"integer"}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","count"]},"nullable":true},"home_converted":{"type":"object","additionalProperties":false,"properties":{"currency_code":{"type":"string"},"currency_symbol":{"type":"string"},"currency_decimal_places":{"type":"integer"},"amount":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"fx_partial":{"type":"boolean"},"missing_fx_count":{"type":"integer"},"rate_date":{"type":"string","format":"date","nullable":true}},"required":["currency_code","currency_symbol","currency_decimal_places","amount","fx_partial","missing_fx_count","rate_date"],"nullable":true}},"required":["per_currency","home_converted"]},"runway_months":{"type":"string","description":"Decimal value serialized as a string.","nullable":true},"runway_date":{"type":"string","format":"date","nullable":true}},"required":["analysis_period_end","analysis_period_start","total_assets_agg","avg_monthly_expenses_agg","runway_months","runway_date"]},"window":{"type":"object","additionalProperties":false,"properties":{"applied_months":{"type":"integer"},"earliest_visible_date":{"type":"string","format":"date","nullable":true},"plan":{"type":"string","enum":["free","plus","pro"]},"requested_range":{"type":"string","enum":["recent","full"]},"truncated_by_plan":{"type":"boolean"}},"required":["applied_months","earliest_visible_date","plan","requested_range","truncated_by_plan"]}},"required":["type","id","attributes","window"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get savings runway report","tags":["Programmatic API"],"x-tetri-scope":"reports:read"}},"/api/v1/programmatic/insights":{"get":{"description":"Returns generated insights for the required YYYY-MM period.","operationId":"ProgrammaticInsightsController_listInsights_v1","parameters":[{"name":"account_ids","required":false,"in":"query","description":"Restrict insights to these account identifiers. At most 100 values.","schema":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"period","required":true,"in":"query","description":"Required financial month in `YYYY-MM` format.","schema":{"pattern":"^\\d{4}-(?:0[1-9]|1[0-2])$","example":"2026-07","type":"string"}}],"responses":{"200":{"description":"Generated insights, response timestamp, and the next planned refresh time.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicV1InsightResponse"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List insights","tags":["Programmatic API"],"x-tetri-scope":"insights:read"}},"/api/v1/programmatic/insights/{id}":{"get":{"description":"Returns one generated insight from the PAT workspace.","operationId":"ProgrammaticInsightsController_getInsight_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Stable logical insight key returned by the insights collection. This is not necessarily a UUID.","schema":{"example":"anomaly_018f8e30-66fd-7e50-a1ef-9c52d11c2baf","type":"string"}}],"responses":{"200":{"description":"The requested generated insight.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicV1InsightEnvelope"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get an insight","tags":["Programmatic API"],"x-tetri-scope":"insights:read"}},"/api/v1/programmatic/budgets":{"get":{"description":"Returns budgets with status for the requested period date.","operationId":"ProgrammaticPlanningController_listBudgets_v1","parameters":[{"name":"period_date","required":false,"in":"query","description":"Date used to select each budget period. Defaults to today in the workspace timezone.","schema":{"format":"date","example":"2026-07-12","type":"string"}},{"name":"page","required":false,"in":"query","description":"One-based result page.","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Maximum budgets returned per page.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}}],"responses":{"200":{"description":"Budgets with status for the selected financial date and pagination metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Resources in this page.","items":{"type":"object","properties":{"type":{"type":"string","example":"budgets","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1BudgetAttributes"}},"required":["type","id","attributes"]}},"meta":{"$ref":"#/components/schemas/PaginationWrapperMetaDto"}},"required":["data","meta"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List budgets","tags":["Programmatic API"],"x-tetri-scope":"budgets:read"}},"/api/v1/programmatic/budgets/{id}":{"get":{"description":"Returns one budget with status for the requested period date.","operationId":"ProgrammaticPlanningController_getBudget_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Budget identifier.","schema":{"format":"uuid","type":"string"}},{"name":"period_date","required":false,"in":"query","description":"Date used to select the budget period. Defaults to today in the workspace timezone.","schema":{"format":"date","example":"2026-07-12","type":"string"}}],"responses":{"200":{"description":"The requested budget with status for the selected date.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested resource.","properties":{"type":{"type":"string","example":"budgets","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1BudgetAttributes"}},"required":["type","id","attributes"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get a budget","tags":["Programmatic API"],"x-tetri-scope":"budgets:read"}},"/api/v1/programmatic/recurring-rules":{"get":{"description":"Returns recurring rules with bounded filtering and pagination.","operationId":"ProgrammaticPlanningController_listRecurring_v1","parameters":[{"name":"status","required":false,"in":"query","description":"Return only recurring rules in this lifecycle state.","schema":{"type":"string","enum":["active","paused","ended"]}},{"name":"type","required":false,"in":"query","description":"Return only rules for this transaction direction.","schema":{"type":"string","enum":["expense","income","transfer"]}},{"name":"kind","required":false,"in":"query","description":"Filter automatic recurring rules separately from manually tracked subscriptions.","schema":{"type":"string","enum":["rule","subscription"]}},{"name":"account_id","required":false,"in":"query","description":"Return rules that use this source account.","schema":{"format":"uuid","type":"string"}},{"name":"page","required":false,"in":"query","description":"One-based result page.","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Maximum recurring rules returned per page.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}}],"responses":{"200":{"description":"Recurring rules and page metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicV1RecurringRuleListResponse"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List recurring rules","tags":["Programmatic API"],"x-tetri-scope":"recurring:read"}},"/api/v1/programmatic/recurring-rules/{id}":{"get":{"description":"Returns one recurring rule from the PAT workspace.","operationId":"ProgrammaticPlanningController_getRecurring_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Recurring rule identifier.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The requested recurring rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicV1RecurringRuleResponse"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get a recurring rule","tags":["Programmatic API"],"x-tetri-scope":"recurring:read"}},"/api/v1/programmatic/goals":{"get":{"description":"Returns goals with status filtering and pagination.","operationId":"ProgrammaticPlanningController_listGoals_v1","parameters":[{"name":"status","required":false,"in":"query","description":"Goal lifecycle filter. Use `all` to include closed goals.","schema":{"default":"active","type":"string","enum":["active","achieved","abandoned","all"]}},{"name":"page","required":false,"in":"query","description":"One-based result page.","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Maximum goals returned per page.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}}],"responses":{"200":{"description":"Goals with progress, pace, and pagination metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Resources in this page.","items":{"type":"object","properties":{"type":{"type":"string","example":"goals","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1GoalAttributes"}},"required":["type","id","attributes"]}},"meta":{"$ref":"#/components/schemas/PaginationWrapperMetaDto"}},"required":["data","meta"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List goals","tags":["Programmatic API"],"x-tetri-scope":"goals:read"}},"/api/v1/programmatic/goals/{id}":{"get":{"description":"Returns one goal from the PAT workspace.","operationId":"ProgrammaticPlanningController_getGoal_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Goal identifier.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The requested goal with progress and pace details.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested resource.","properties":{"type":{"type":"string","example":"goals","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1GoalAttributes"}},"required":["type","id","attributes"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get a goal","tags":["Programmatic API"],"x-tetri-scope":"goals:read"}},"/api/v1/programmatic/accounts":{"get":{"description":"Returns active asset accounts that can be used as transaction source or destination identifiers.","operationId":"ProgrammaticReferenceDataController_listAccounts_v1","parameters":[{"name":"page","required":false,"in":"query","description":"One-based result page.","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Maximum resources returned per page.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}}],"responses":{"200":{"description":"Active asset accounts and pagination metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Resources in this page.","items":{"type":"object","properties":{"type":{"type":"string","example":"accounts","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1AccountAttributes"}},"required":["type","id","attributes"]}},"meta":{"$ref":"#/components/schemas/PaginationWrapperMetaDto"}},"required":["data","meta"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List transaction accounts","tags":["Programmatic API"],"x-tetri-scope":"wallets:read"}},"/api/v1/programmatic/categories":{"get":{"description":"Returns active categories that can be assigned while parsing or creating transactions.","operationId":"ProgrammaticReferenceDataController_listCategories_v1","parameters":[{"name":"page","required":false,"in":"query","description":"One-based result page.","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Maximum resources returned per page.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}},{"name":"group_id","required":false,"in":"query","description":"Return active categories from this category group only.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Active transaction categories and pagination metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Resources in this page.","items":{"type":"object","properties":{"type":{"type":"string","example":"categories","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1CategoryAttributes"}},"required":["type","id","attributes"]}},"meta":{"$ref":"#/components/schemas/PaginationWrapperMetaDto"}},"required":["data","meta"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List transaction categories","tags":["Programmatic API"],"x-tetri-scope":"transactions:read"}},"/api/v1/programmatic/currencies":{"get":{"description":"Returns the currency catalog ordered for the PAT workspace, including enabled and primary flags.","operationId":"ProgrammaticReferenceDataController_listCurrencies_v1","parameters":[],"responses":{"200":{"description":"Currency catalog and workspace availability metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Resources in this page.","items":{"type":"object","properties":{"type":{"type":"string","example":"currencies","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1CurrencyAttributes"}},"required":["type","id","attributes"]}},"meta":{"$ref":"#/components/schemas/PaginationWrapperMetaDto"}},"required":["data","meta"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List transaction currencies","tags":["Programmatic API"],"x-tetri-scope":"wallets:read"}},"/api/v1/programmatic/transaction-templates":{"post":{"description":"Creates a user-saved transaction template in the PAT workspace. At least one transaction default besides direction and name is required.","operationId":"ProgrammaticTransactionTemplatesController_create_v1","parameters":[{"name":"Idempotency-Key","in":"header","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical template.","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$","example":"template_20260722_01J2Y8M4R1"}}],"requestBody":{"required":true,"description":"Reusable transaction defaults. Wallet references are optional; their role depends on the selected direction. Supply at least one wallet, category, amount, description, or notes value.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticCreateTransactionTemplateDto"},"examples":{"expense":{"summary":"Create an expense template","value":{"direction":"expense","name":"Lunch","source_wallet_id":"<asset-wallet-id>","amount_minor":"1250","currency_code":"USD","description":"Weekday lunch"}},"income":{"summary":"Create an income template","value":{"direction":"income","name":"Salary","target_wallet_id":"<asset-wallet-id>","amount_minor":"250000","currency_code":"USD"}},"transfer":{"summary":"Create a transfer template","value":{"direction":"transfer","name":"Monthly savings","source_wallet_id":"<checking-wallet-id>","target_wallet_id":"<savings-wallet-id>","amount_minor":"50000","currency_code":"USD","recurrence_preset":"monthly"}}}}}},"responses":{"201":{"description":"Transaction template created with resolved references.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticTransactionTemplateCreateResponseDto"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"409":{"description":"The idempotency key was reused with a different request or the resource state conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"422":{"description":"The payload is syntactically valid but violates a domain constraint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Create a transaction template","tags":["Programmatic API"],"x-tetri-scope":"transaction_templates:create"}},"/api/v1/programmatic/transactions":{"get":{"description":"Returns posted, non-archived transactions with offset or cursor pagination.","operationId":"ProgrammaticTransactionsController_list_v1","parameters":[{"name":"type","required":false,"in":"query","description":"Return only transactions with this journal type.","schema":{"type":"string","enum":["withdrawal","deposit","transfer","loan_payment"]}},{"name":"start","required":false,"in":"query","description":"Inclusive start of the financial date range.","schema":{"format":"date","example":"2026-07-01","type":"string"}},{"name":"end","required":false,"in":"query","description":"Inclusive end of the financial date range.","schema":{"format":"date","example":"2026-07-31","type":"string"}},{"name":"page","required":false,"in":"query","description":"One-based offset page. Mutually exclusive with `after`; omit it for cursor pagination.","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Maximum transactions returned per page.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}},{"name":"query","required":false,"in":"query","description":"Case-insensitive transaction description search.","schema":{"maxLength":255,"example":"coffee","type":"string"}},{"name":"account_id","required":false,"in":"query","description":"Return transactions that include this account.","schema":{"format":"uuid","type":"string"}},{"name":"category_id","required":false,"in":"query","description":"Return transactions assigned to this category.","schema":{"format":"uuid","type":"string"}},{"name":"after","required":false,"in":"query","description":"Opaque cursor returned as `meta.next_cursor`. Mutually exclusive with `page`.","schema":{"maxLength":255,"example":"<opaque-cursor>","type":"string"}}],"responses":{"200":{"description":"Posted transactions with offset pagination metadata, or cursor metadata when `after` is supplied.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Resources in this page.","items":{"type":"object","properties":{"type":{"type":"string","example":"transactions","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1TransactionAttributes"}},"required":["type","id","attributes"]}},"meta":{"oneOf":[{"$ref":"#/components/schemas/PaginationWrapperMetaDto"},{"$ref":"#/components/schemas/CursorPaginationMetaDto"}],"description":"Offset pagination metadata, or cursor metadata when `after` is used."}},"required":["data","meta"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List transactions","tags":["Programmatic API"],"x-tetri-scope":"transactions:read"},"post":{"description":"Creates one withdrawal, deposit, or transfer. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionsController_create_v1","parameters":[{"name":"Idempotency-Key","in":"header","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$","example":"tx_20260722_01J2Y8M4R1"}}],"requestBody":{"required":true,"description":"One posted withdrawal, deposit, or transfer. Account requirements depend on `type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ProgrammaticCreateTransactionDto"},{"oneOf":[{"type":"object","required":["type","source_account_id"]},{"type":"object","required":["type","destination_account_id"]},{"type":"object","required":["type","source_account_id","destination_account_id"]}]}]},"examples":{"withdrawal":{"summary":"Create a withdrawal from an asset account","value":{"type":"withdrawal","date":"2026-07-12T12:00:00.000Z","amount":"12.50","description":"Lunch","source_account_id":"<asset-account-id>"}},"foreignCardCharge":{"summary":"Record a USD purchase charged to a GEL card","value":{"type":"withdrawal","date":"2026-07-12T12:00:00.000Z","amount":"326.40","currency_id":"<gel-currency-id>","foreign_amount":"120.00","foreign_currency_id":"<usd-currency-id>","description":"Hotel","source_account_id":"<gel-card-account-id>"}},"deposit":{"summary":"Create a deposit","value":{"type":"deposit","date":"2026-07-12T12:00:00.000Z","amount":"2500.00","description":"Salary","destination_account_id":"<asset-account-id>","category_id":"<income-category-id>"}},"transfer":{"summary":"Create a transfer between accounts","value":{"type":"transfer","date":"2026-07-12T12:00:00.000Z","amount":"500.00","description":"Move to savings","source_account_id":"<source-account-id>","destination_account_id":"<destination-account-id>"}}}}}},"responses":{"201":{"description":"Transaction created. The response includes cache side effects and mutation metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticCreateTransactionResponseDto"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"409":{"description":"The idempotency key was reused with a different request or the resource state conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Create a transaction","tags":["Programmatic API"],"x-tetri-scope":"transactions:create"}},"/api/v1/programmatic/transactions/{id}":{"get":{"description":"Returns one posted transaction from the PAT workspace.","operationId":"ProgrammaticTransactionsController_get_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Transaction journal identifier.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The requested posted transaction.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested resource.","properties":{"type":{"type":"string","example":"transactions","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1TransactionAttributes"}},"required":["type","id","attributes"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get a transaction","tags":["Programmatic API"],"x-tetri-scope":"transactions:read"},"patch":{"description":"Changes the category, description, date or account of one posted transaction; every other field is kept. Read `revision` first and send it as `expected_revision`. Transactions with amount splits are rejected, and only a withdrawal or deposit can change its account. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionEditsController_update_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Transaction journal identifier.","schema":{"format":"uuid","type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$","example":"tx_20260722_01J2Y8M4R1"}}],"requestBody":{"required":true,"description":"The fields to change and the `revision` from the latest read. Omitted fields keep their value; `category_id: null` removes the category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticUpdateTransactionDto"},"examples":{"categorize":{"summary":"Set the category of a transaction","value":{"expected_revision":"2026-07-12T12:00:00.000Z","category_id":"<category-id>"}},"fix":{"summary":"Correct the description and date","value":{"expected_revision":"2026-07-12T12:00:00.000Z","description":"Lunch with team","date":"2026-07-11T12:00:00.000Z"}}}}}},"responses":{"200":{"description":"Transaction updated. The response includes cache side effects and mutation metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticCreateTransactionResponseDto"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"409":{"description":"The idempotency key was reused with a different request or the resource state conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Update a transaction","tags":["Programmatic API"],"x-tetri-scope":"transactions:update"},"delete":{"description":"Soft-deletes one posted transaction. Read `revision` first and send it as the `expected_revision` query parameter. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionEditsController_delete_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Transaction journal identifier.","schema":{"format":"uuid","type":"string"}},{"name":"expected_revision","required":true,"in":"query","description":"The `revision` returned by the latest read of this transaction. A stale value is rejected with 409.","schema":{"format":"date-time","type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$","example":"tx_20260722_01J2Y8M4R1"}}],"responses":{"200":{"description":"Transaction deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgrammaticDeleteTransactionResponseDto"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"409":{"description":"The idempotency key was reused with a different request or the resource state conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Delete a transaction","tags":["Programmatic API"],"x-tetri-scope":"transactions:delete"}},"/api/v1/programmatic/transactions/parse":{"post":{"description":"Parses natural-language text into a canonical transaction draft using the PAT workspace context.","operationId":"ProgrammaticTransactionsController_parse_v1","parameters":[],"requestBody":{"required":true,"description":"Natural-language input plus optional locale, timezone, date anchor, and current form context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicV1ParseNlTransaction"},"examples":{"shortExpense":{"summary":"Parse a short expense","value":{"text":"wolt 42 gel yesterday","locale":"en","timezone":"Asia/Tbilisi","reference_date":"2026-07-22"}},"transfer":{"summary":"Parse a transfer with known accounts","value":{"text":"transfer 500 usd from checking to savings today","locale":"en","client_context":{"type":"transfer","source_account_id":"<source-account-id>","destination_account_id":"<destination-account-id>"}}},"voice":{"summary":"Parse speech recognition text","value":{"text":"кофе триста рублей сегодня утром","locale":"ru","input_mode":"voice","timezone":"Europe/Moscow"}}}}}},"responses":{"200":{"description":"Canonical natural-language transaction draft parse.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicV1NlTransactionParseResponse"}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Parse transaction text","tags":["Programmatic API"],"x-tetri-scope":"transactions:read"}},"/api/v1/programmatic/wallets":{"get":{"description":"Returns active asset wallets and their account balances.","operationId":"ProgrammaticWalletsController_list_v1","parameters":[{"name":"group_id","required":false,"in":"query","description":"Return wallets from this wallet group only.","schema":{"format":"uuid","type":"string"}},{"name":"page","required":false,"in":"query","description":"One-based result page.","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Maximum wallets returned per page.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}}],"responses":{"200":{"description":"Active asset wallets with account balances and pagination metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Resources in this page.","items":{"type":"object","properties":{"type":{"type":"string","example":"wallets","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1WalletAttributes"}},"required":["type","id","attributes"]}},"meta":{"$ref":"#/components/schemas/PaginationWrapperMetaDto"}},"required":["data","meta"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"List asset wallets","tags":["Programmatic API"],"x-tetri-scope":"wallets:read"}},"/api/v1/programmatic/wallets/{id}":{"get":{"description":"Returns one active asset wallet from the PAT workspace.","operationId":"ProgrammaticWalletsController_get_v1","parameters":[{"name":"id","required":true,"in":"path","description":"Asset wallet identifier.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The requested active asset wallet and its account balances.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested resource.","properties":{"type":{"type":"string","example":"wallets","description":"Stable resource type."},"id":{"type":"string","format":"uuid","description":"Resource identifier."},"attributes":{"$ref":"#/components/schemas/PublicV1WalletAttributes"}},"required":["type","id","attributes"]}},"required":["data"]}}}},"400":{"description":"Request parameters or payload failed validation. Inspect `code` and `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"401":{"description":"The personal access token is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"403":{"description":"The token lacks the required scope or no longer has workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"404":{"description":"The resource does not exist in the token workspace or is not visible to this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}},"429":{"description":"The credential exceeded its request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProgrammaticErrorDto"}}}}},"summary":"Get an asset wallet","tags":["Programmatic API"],"x-tetri-scope":"wallets:read"}}}},"documentation":{"pageSeeds":[{"systemKey":"docs/api/v1","slug":"docs/api/v1","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Tetri Public API v1","description":"A stable, user-scoped interface for Tetri data and supported actions."},"blocks":[{"id":"0fcf4261-93e1-4132-bca7-7d4defcb4882","kind":"hero","anchorId":"overview","title":"Tetri Public API v1","text":"A stable, user-scoped interface for Tetri data and supported actions."},{"id":"af9639f4-a925-4c5a-a2bc-894bdffa2394","kind":"richText","anchorId":"content","html":"<h2>Base URL</h2><p>Every endpoint is served under <code>https://api.tetri.app/api/v1/programmatic</code>.</p><h2>Version policy</h2><p>This documentation follows the deployed contract within the v1 API major. Breaking contract changes are published under a new API version.</p><h2>Features</h2><ul><li><a href=\"/docs/api/v1/budgets\">Budgets</a> — Read budgets together with their status for a period date. 2 endpoints. Scopes: <code>budgets:read</code>.</li><li><a href=\"/docs/api/v1/goals\">Goals</a> — Read savings goals and their progress. 2 endpoints. Scopes: <code>goals:read</code>.</li><li><a href=\"/docs/api/v1/imports\">Imports</a> — Upload a bank statement, review the parsed preview and confirm it to create transactions. 4 endpoints. Scopes: <code>imports:read</code>, <code>imports:create</code>.</li><li><a href=\"/docs/api/v1/insights\">Insights</a> — Read the insights Tetri generates from the transactions of a financial month. 2 endpoints. Scopes: <code>insights:read</code>.</li><li><a href=\"/docs/api/v1/recurring\">Recurring rules</a> — Read recurring rules: automatic transactions and manually tracked subscriptions. 2 endpoints. Scopes: <code>recurring:read</code>.</li><li><a href=\"/docs/api/v1/reports\">Reports</a> — Read cash flow, spending, budget, income and data-quality reports for the token workspace. 14 endpoints. Scopes: <code>reports:read</code>.</li><li><a href=\"/docs/api/v1/transaction-templates\">Transaction templates</a> — Create reusable transaction templates. 1 endpoint. Scopes: <code>transaction_templates:create</code>.</li><li><a href=\"/docs/api/v1/transactions\">Transactions</a> — List and read posted transactions, parse free text into a draft, and create, correct or delete transactions. 7 endpoints. Scopes: <code>transactions:read</code>, <code>transactions:create</code>, <code>transactions:update</code>, <code>transactions:delete</code>.</li><li><a href=\"/docs/api/v1/wallets\">Wallets</a> — Read asset wallets, their accounts and balances, and the currency catalog. 4 endpoints. Scopes: <code>wallets:read</code>.</li></ul><h2>Start here</h2><ul><li><a href=\"/docs/api/v1/getting-started/authentication\">Authentication</a> — Use a user-scoped personal access token with the minimum required scopes.</li><li><a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> — Which scope each endpoint requires and what a scope allows a token to do.</li><li><a href=\"/docs/api/v1/getting-started/first-request\">Your first request</a> — Verify the credential with a read-only request and inspect the response.</li><li><a href=\"/docs/api/v1/getting-started/errors-and-conventions\">Errors and conventions</a> — Shared behavior for authentication, writes, pagination, and failures.</li></ul>"}]},{"systemKey":"docs/api/v1/getting-started","slug":"docs/api/v1/getting-started","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Getting started","description":"Make your first authenticated Tetri API v1 request."},"blocks":[{"id":"8a7850d8-9830-4864-9f3b-dee27af2d6b9","kind":"hero","anchorId":"overview","title":"Getting started","text":"Make your first authenticated Tetri API v1 request."},{"id":"b2862737-79d0-4be3-ba21-5f7afeb1e536","kind":"richText","anchorId":"content","html":"<h2>Before you start</h2><p>Create a personal access token with the minimum required scopes and keep it outside client-side code. This is a private user credential, not a public API key: anyone who obtains it can access your workspace data and perform every action allowed by its scopes.</p><h2>Guides</h2><ul><li><a href=\"/docs/api/v1/getting-started/authentication\">Authentication</a> — Use a user-scoped personal access token with the minimum required scopes.</li><li><a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> — Which scope each endpoint requires and what a scope allows a token to do.</li><li><a href=\"/docs/api/v1/getting-started/first-request\">Your first request</a> — Verify the credential with a read-only request and inspect the response.</li><li><a href=\"/docs/api/v1/getting-started/errors-and-conventions\">Errors and conventions</a> — Shared behavior for authentication, writes, pagination, and failures.</li></ul>"}]},{"systemKey":"docs/api/v1/getting-started/authentication","slug":"docs/api/v1/getting-started/authentication","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Authentication","description":"Use a user-scoped personal access token with the minimum required scopes."},"blocks":[{"id":"72b15ed5-59f9-4c30-929a-bafda569afea","kind":"hero","anchorId":"overview","title":"Authentication","text":"Use a user-scoped personal access token with the minimum required scopes."},{"id":"618ce36d-879b-434d-be7c-8d57ead37549","kind":"richText","anchorId":"content","html":"<h2>Treat tokens as passwords</h2><p>Personal access tokens are private user-scoped credentials, not public API keys. Anyone who obtains a token can access workspace data and perform every action allowed by its scopes. Never share a token, embed it in client-side code, commit it to source control, or include it in screenshots and logs.</p><h2>Bearer token</h2><p>Send the token with every request:</p><pre>Authorization: Bearer $TETRI_API_TOKEN</pre><p>A Tetri personal access token for the API audience. The OpenAPI security scheme is HTTP bearer with the Tetri PAT token format.</p><h2>Create a token</h2><pre>POST /api/v1/programmatic-access/credentials\nAuthorization: Bearer $TETRI_SESSION_TOKEN\nContent-Type: application/json\n\n{\n  &quot;name&quot;: &quot;My integration&quot;,\n  &quot;audience&quot;: &quot;programmatic_api&quot;,\n  &quot;scopes&quot;: [\n    &quot;wallets:read&quot;\n  ],\n  &quot;expires_in_days&quot;: 30\n}</pre><p>The plaintext token is returned once. Store it in a secrets manager or protected environment variable.</p><h2>Revocation</h2><p>Revoke a credential immediately if it may have been exposed. Changing or resetting your password, or changing your email address, revokes every Public API and MCP credential for your account. Create replacement credentials after the account change.</p>"}]},{"systemKey":"docs/api/v1/getting-started/scopes","slug":"docs/api/v1/getting-started/scopes","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Scopes","description":"Which scope each endpoint requires and what a scope allows a token to do."},"blocks":[{"id":"f2e5be8e-5f24-4519-9cf4-4d839097f6d2","kind":"hero","anchorId":"overview","title":"Scopes","text":"Which scope each endpoint requires and what a scope allows a token to do."},{"id":"e380d1e2-bbe9-4faf-bd28-4ac14a0889b4","kind":"richText","anchorId":"content","html":"<h2>How scopes work</h2><p>A personal access token carries the scopes selected when it was created. An endpoint rejects a token that lacks the scope it requires. Grant an integration only the scopes it needs.</p><h2>Scopes and endpoints</h2><ul><li><code>wallets:read</code> — Read wallets, accounts, balances and the currency catalog.<ul><li><a href=\"/docs/api/v1/wallets#get-accounts\"><code>GET</code> List transaction accounts</a></li><li><a href=\"/docs/api/v1/wallets#get-currencies\"><code>GET</code> List transaction currencies</a></li><li><a href=\"/docs/api/v1/wallets#get-wallets\"><code>GET</code> List asset wallets</a></li><li><a href=\"/docs/api/v1/wallets#get-wallets-by-id\"><code>GET</code> Get an asset wallet</a></li></ul></li><li><code>transactions:read</code> — Read posted transactions and categories, and parse transaction text into a draft.<ul><li><a href=\"/docs/api/v1/transactions#get-categories\"><code>GET</code> List transaction categories</a></li><li><a href=\"/docs/api/v1/transactions#get-transactions\"><code>GET</code> List transactions</a></li><li><a href=\"/docs/api/v1/transactions#get-transactions-by-id\"><code>GET</code> Get a transaction</a></li><li><a href=\"/docs/api/v1/transactions#post-transactions-parse\"><code>POST</code> Parse transaction text</a></li></ul></li><li><code>transactions:create</code> — Create transactions.<ul><li><a href=\"/docs/api/v1/transactions#post-transactions\"><code>POST</code> Create a transaction</a></li></ul></li><li><code>transactions:update</code> — Change the category, description, date or account of transactions.<ul><li><a href=\"/docs/api/v1/transactions#patch-transactions-by-id\"><code>PATCH</code> Update a transaction</a></li></ul></li><li><code>transactions:delete</code> — Delete transactions.<ul><li><a href=\"/docs/api/v1/transactions#delete-transactions-by-id\"><code>DELETE</code> Delete a transaction</a></li></ul></li><li><code>budgets:read</code> — Read budgets and their status.<ul><li><a href=\"/docs/api/v1/budgets#get-budgets\"><code>GET</code> List budgets</a></li><li><a href=\"/docs/api/v1/budgets#get-budgets-by-id\"><code>GET</code> Get a budget</a></li></ul></li><li><code>recurring:read</code> — Read recurring rules.<ul><li><a href=\"/docs/api/v1/recurring#get-recurring-rules\"><code>GET</code> List recurring rules</a></li><li><a href=\"/docs/api/v1/recurring#get-recurring-rules-by-id\"><code>GET</code> Get a recurring rule</a></li></ul></li><li><code>goals:read</code> — Read goals and their progress.<ul><li><a href=\"/docs/api/v1/goals#get-goals\"><code>GET</code> List goals</a></li><li><a href=\"/docs/api/v1/goals#get-goals-by-id\"><code>GET</code> Get a goal</a></li></ul></li><li><code>insights:read</code> — Read generated insights.<ul><li><a href=\"/docs/api/v1/insights#get-insights\"><code>GET</code> List insights</a></li><li><a href=\"/docs/api/v1/insights#get-insights-by-id\"><code>GET</code> Get an insight</a></li></ul></li><li><code>reports:read</code> — Read analytical and data-quality reports.<ul><li><a href=\"/docs/api/v1/reports#get-reports-account-gaps\"><code>GET</code> Get account gaps report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-anomalies\"><code>GET</code> Get anomalies report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-budget-performance\"><code>GET</code> Get budget performance report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-cash-flow-summary\"><code>GET</code> Get cash flow summary report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-category-drift\"><code>GET</code> Get category drift report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-category-heatmap\"><code>GET</code> Get category heatmap report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-expense-comparison\"><code>GET</code> Get expense comparison report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-import-health\"><code>GET</code> Get import health report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-income-stability\"><code>GET</code> Get income stability report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-recurring-detection\"><code>GET</code> Get recurring detection report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-savings-runway\"><code>GET</code> Get savings runway report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-spending-velocity\"><code>GET</code> Get spending velocity report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-transfer-flow\"><code>GET</code> Get transfer flow report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-uncategorized-clusters\"><code>GET</code> Get uncategorized clusters report</a></li></ul></li><li><code>transaction_templates:create</code> — Create transaction templates.<ul><li><a href=\"/docs/api/v1/transaction-templates#post-transaction-templates\"><code>POST</code> Create a transaction template</a></li></ul></li><li><code>imports:read</code> — Read statement imports and their previews.<ul><li><a href=\"/docs/api/v1/imports#get-imports\"><code>GET</code> List statement imports</a></li><li><a href=\"/docs/api/v1/imports#get-imports-by-id\"><code>GET</code> Get a statement import</a></li></ul></li><li><code>imports:create</code> — Upload statements and confirm parsed imports.<ul><li><a href=\"/docs/api/v1/imports#post-imports\"><code>POST</code> Upload a statement import</a></li><li><a href=\"/docs/api/v1/imports#post-imports-by-id-confirm\"><code>POST</code> Confirm a statement import</a></li></ul></li></ul>"}]},{"systemKey":"docs/api/v1/getting-started/first-request","slug":"docs/api/v1/getting-started/first-request","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Your first request","description":"Verify the credential with a read-only request and inspect the response."},"blocks":[{"id":"80984f49-a296-492a-95a6-238cd7943fd6","kind":"hero","anchorId":"overview","title":"Your first request","text":"Verify the credential with a read-only request and inspect the response."},{"id":"728fd85d-0142-47a4-98f0-170afa413a8b","kind":"richText","anchorId":"content","html":"<h2>Request</h2><p>List asset wallets. The token needs the <code>wallets:read</code> scope. Returns active asset wallets and their account balances.</p><pre>curl --request GET \\\n  --url &#39;https://api.tetri.app/api/v1/programmatic/wallets&#39; \\\n  --header &#39;Authorization: Bearer $TETRI_API_TOKEN&#39;</pre><h2>Response</h2><p>A successful request returns <code>200</code> with a body shaped like this:</p><pre>{\n  &quot;data&quot;: [\n    {\n      &quot;type&quot;: &quot;wallets&quot;,\n      &quot;id&quot;: &quot;&lt;uuid&gt;&quot;,\n      &quot;attributes&quot;: {\n        &quot;version&quot;: 0,\n        &quot;created_by_user_id&quot;: &quot;&lt;uuid&gt;&quot;,\n        &quot;name&quot;: &quot;Main checking&quot;,\n        &quot;type&quot;: &quot;bank&quot;,\n        &quot;money_place_kind&quot;: &quot;bank_account&quot;,\n        &quot;icon&quot;: &quot;wallet&quot;,\n        &quot;icon_url&quot;: &quot;https://cdn.tetri.app/icons/abc.webp&quot;,\n        &quot;accent_color&quot;: &quot;sky&quot;,\n        &quot;group_id&quot;: &quot;&lt;uuid&gt;&quot;,\n        &quot;include_net_worth&quot;: false,\n        &quot;notes&quot;: &quot;&lt;string&gt;&quot;,\n        &quot;order&quot;: 0,\n        &quot;liability_type&quot;: &quot;credit_card&quot;,\n        &quot;liability_direction&quot;: &quot;outgoing&quot;,\n        &quot;interest&quot;: &quot;5.25&quot;,\n        &quot;interest_period&quot;: &quot;yearly&quot;,\n        &quot;term_periods&quot;: 360,\n        &quot;repayment_type&quot;: &quot;french&quot;,\n        &quot;scheduled_payment_amount&quot;: &quot;1066.20&quot;,\n        &quot;first_payment_date&quot;: &quot;2026-06-15&quot;,\n        &quot;payment_day_of_month&quot;: 15,\n        &quot;expected_settle_date&quot;: &quot;2026-12-31&quot;,\n        &quot;accounts&quot;: [\n          {\n            &quot;id&quot;: &quot;&lt;uuid&gt;&quot;,\n            &quot;currency&quot;: {},\n            &quot;current_balance&quot;: &quot;1234.56&quot;,\n            &quot;opening_balance&quot;: &quot;1234.56&quot;,\n            &quot;opening_balance_date&quot;: &quot;2026-04-01&quot;,\n            &quot;opening_balance_missing&quot;: false,\n            &quot;active&quot;: false,\n            &quot;iban&quot;: &quot;&lt;string&gt;&quot;,\n            &quot;bic&quot;: &quot;&lt;string&gt;&quot;,\n            &quot;account_number&quot;: &quot;&lt;string&gt;&quot;\n          }\n        ],\n        &quot;total_balance&quot;: &quot;1234.56&quot;,\n        &quot;total_balance_currency&quot;: {},\n        &quot;balance_aggregate&quot;: {\n          &quot;contract_version&quot;: &quot;wallet-setup-v1&quot;,\n          &quot;amount&quot;: &quot;1234.56&quot;,\n          &quot;currency&quot;: {},\n          &quot;status&quot;: &quot;complete&quot;,\n          &quot;reasons&quot;: [\n            &quot;home_currency_missing&quot;\n          ],\n          &quot;missing_opening_balance_account_ids&quot;: [\n            &quot;&lt;uuid&gt;&quot;\n          ],\n          &quot;missing_fx_currency_ids&quot;: [\n            &quot;&lt;uuid&gt;&quot;\n          ]\n        },\n        &quot;per_currency&quot;: [\n          {\n            &quot;currency_id&quot;: &quot;&lt;uuid&gt;&quot;,\n            &quot;currency_code&quot;: &quot;USD&quot;,\n            &quot;amount&quot;: &quot;1234.56&quot;\n          }\n        ],\n        &quot;balance_sparkline_30d&quot;: [\n          0\n        ],\n        &quot;balance_trend_30d_percentage&quot;: &quot;-3.2&quot;,\n        &quot;last_transaction_at&quot;: &quot;2026-07-12T12:00:00Z&quot;,\n        &quot;usage_score&quot;: 3.25,\n        &quot;needs_opening_balance_setup&quot;: false,\n        &quot;last_reconciled_at&quot;: &quot;2026-07-12&quot;,\n        &quot;reconciliation_status&quot;: &quot;draft&quot;,\n        &quot;credit_card&quot;: {},\n        &quot;created_at&quot;: &quot;2026-07-12T12:00:00Z&quot;,\n        &quot;updated_at&quot;: &quot;2026-07-12T12:00:00Z&quot;,\n        &quot;archived_at&quot;: &quot;2026-07-12T12:00:00Z&quot;,\n        &quot;is_archived&quot;: false,\n        &quot;created_by&quot;: {}\n      }\n    }\n  ],\n  &quot;meta&quot;: {\n    &quot;pagination&quot;: &quot;&lt;string&gt;&quot;\n  }\n}</pre><h2>Next step</h2><p>Open a feature chapter from the <a href=\"/docs/api/v1\">API overview</a> to see scopes, parameters, complete payloads, and endpoint-specific responses.</p>"}]},{"systemKey":"docs/api/v1/getting-started/errors-and-conventions","slug":"docs/api/v1/getting-started/errors-and-conventions","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Errors and conventions","description":"Shared behavior for authentication, writes, pagination, and failures."},"blocks":[{"id":"209fa5d7-735c-4c55-af33-3c0dd50d2cdc","kind":"hero","anchorId":"overview","title":"Errors and conventions","text":"Shared behavior for authentication, writes, pagination, and failures."},{"id":"777daa79-0b02-4435-83b6-5c72d1eda4c7","kind":"richText","anchorId":"content","html":"<h2>Idempotency</h2><p>Send a unique <code>Idempotency-Key</code> header with the requests that accept it. Reusing a key with a different payload returns a conflict. These operations accept the header:</p><ul><li><a href=\"/docs/api/v1/imports#post-imports\"><code>POST</code> Upload a statement import</a></li><li><a href=\"/docs/api/v1/imports#post-imports-by-id-confirm\"><code>POST</code> Confirm a statement import</a></li><li><a href=\"/docs/api/v1/transaction-templates#post-transaction-templates\"><code>POST</code> Create a transaction template</a></li><li><a href=\"/docs/api/v1/transactions#post-transactions\"><code>POST</code> Create a transaction</a></li><li><a href=\"/docs/api/v1/transactions#patch-transactions-by-id\"><code>PATCH</code> Update a transaction</a></li><li><a href=\"/docs/api/v1/transactions#delete-transactions-by-id\"><code>DELETE</code> Delete a transaction</a></li></ul><h2>Common errors</h2><p>Every error response has the same JSON body: <code>statusCode</code>, a stable machine-readable <code>code</code> (for example <code>VALIDATION_FAILED</code> or <code>PROGRAMMATIC_SCOPE_REQUIRED</code>), an English <code>message</code> meant for logs, optional structured <code>details</code> (for <code>VALIDATION_FAILED</code>, <code>details.errors</code> maps each invalid field to the failed constraints) and <code>request_id</code>. Branch on <code>code</code>, never on <code>message</code>.</p><p>Example <code>400</code> body:</p><pre>{\n  &quot;statusCode&quot;: 400,\n  &quot;code&quot;: &quot;PROGRAMMATIC_PAGINATION_MODE_CONFLICT&quot;,\n  &quot;message&quot;: &quot;after and page are mutually exclusive&quot;,\n  &quot;details&quot;: {\n    &quot;errors&quot;: {\n      &quot;limit&quot;: [\n        &quot;max&quot;\n      ]\n    }\n  },\n  &quot;request_id&quot;: &quot;8cf64dcc-0f73-4f8d-a845-3d80c1040475&quot;\n}</pre><p><strong>Deprecated code spellings.</strong> Codes are SCREAMING_SNAKE. A few codes that <code>v1</code> returned before this convention keep their original lowercase or dotted spelling on <code>v1</code> (for example <code>budget.notFound</code> or <code>transaction.revisionConflict</code>) so existing integrations keep working; they are deprecated and switch to SCREAMING_SNAKE (<code>BUDGET_NOT_FOUND</code>, <code>ENTITY_VERSION_CONFLICT</code>) in the next API version.</p><h2>Status codes</h2><ul><li><code>400</code> Request parameters or payload failed validation. Inspect `code` and `details`.</li><li><code>401</code> The personal access token is missing, invalid, expired, or revoked.</li><li><code>403</code> The token lacks the required scope or no longer has workspace access.</li><li><code>404</code> The resource does not exist in the token workspace or is not visible to this API.</li><li><code>409</code> The idempotency key was reused with a different request or the resource state conflicts.</li><li><code>413</code> The uploaded statement exceeds the 10 MiB limit.</li><li><code>422</code> The payload is syntactically valid but violates a domain constraint.</li><li><code>429</code> The credential exceeded its request rate limit.</li></ul><h2>Pagination</h2><p>Collection endpoints return metadata alongside items. Each one documents the pagination parameters it accepts:</p><ul><li><code>page</code> (number) — accepted by Wallets, Budgets, Transactions, Goals, Recurring rules</li><li><code>limit</code> (number) — accepted by Wallets, Budgets, Transactions, Goals, Imports, Recurring rules</li><li><code>after</code> (string) — accepted by Imports, Transactions</li></ul>"}]},{"systemKey":"docs/api/v1/budgets","slug":"docs/api/v1/budgets","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Budgets API: endpoints and examples","description":"Read budgets together with their status for a period date. List budgets, Get a budget."},"blocks":[{"id":"f0ffea3e-6f6f-4e5e-9ebc-eb7014a1259b","kind":"hero","anchorId":"overview","title":"Budgets","text":"Read budgets together with their status for a period date."},{"id":"aa1c4f83-2b22-4638-b10a-6dee2e9c5988","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Budgets are returned with their status for one period. The period date selects the budget period of each budget and defaults to today in the workspace timezone.</p><p>Lists are paginated with page and limit parameters.</p><h2>Required scopes</h2><ul><li><code>budgets:read</code> — Read budgets and their status.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-budgets\">List budgets</a></li><li><a href=\"#get-budgets-by-id\">Get a budget</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-budgets\"><code>GET</code> List budgets</a> — <code>/api/v1/programmatic/budgets</code></li><li><a href=\"#get-budgets-by-id\"><code>GET</code> Get a budget</a> — <code>/api/v1/programmatic/budgets/{id}</code></li></ul>"},{"id":"cf78fa8f-643f-46b2-b7ab-90a90b6f09cd","kind":"apiReference","anchorId":"get-budgets","apiVersion":"v1","feature":"Budgets","method":"GET","path":"/api/v1/programmatic/budgets","summary":"List budgets","description":"Returns budgets with status for the requested period date.","operationId":"ProgrammaticPlanningController_listBudgets_v1","requiredScope":"budgets:read","parameters":[{"name":"period_date","location":"query","required":false,"schema":"string","description":"Date used to select each budget period. Defaults to today in the workspace timezone.","example":"2026-07-12"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum budgets returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/budgets?period_date=2026-07-12&page=<page>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/budgets?period_date=2026-07-12&page=<page>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/budgets?period_date=2026-07-12&page=<page>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Budgets with status for the selected financial date and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"budgets\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"adjustment\": {},\n        \"name\": \"Groceries\",\n        \"raw_name\": \"Groceries\",\n        \"is_system_seed\": false,\n        \"system_seed_key\": \"<string>\",\n        \"system_seed_source\": \"category_seed\",\n        \"name_customized\": false,\n        \"active\": true,\n        \"period\": \"monthly\",\n        \"rollover_strategy\": \"carry\",\n        \"pacing_strategy\": \"linear\",\n        \"include_recurring_transactions\": false,\n        \"notes\": \"<string>\",\n        \"warning_threshold\": 0,\n        \"accent_color\": \"sky\",\n        \"icon\": \"lucide:shopping-cart\",\n        \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n        \"currency_id\": \"<uuid>\",\n        \"version\": 0,\n        \"currency\": {\n          \"id\": \"<uuid>\",\n          \"code\": \"USD\",\n          \"symbol\": \"$\",\n          \"decimal_places\": 2\n        },\n        \"amount\": \"500.00\",\n        \"base_amount\": \"500.00\",\n        \"order\": 0,\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"created_by\": {},\n        \"category_ids\": [\n          \"<uuid>\"\n        ],\n        \"categories\": [\n          {\n            \"id\": \"<uuid>\",\n            \"name\": \"Groceries\",\n            \"raw_name\": \"Groceries\",\n            \"is_system_seed\": false,\n            \"system_seed_key\": \"<string>\",\n            \"system_seed_source\": \"category_seed\",\n            \"name_customized\": false,\n            \"icon\": \"shopping-cart\",\n            \"accent_color\": \"emerald\"\n          }\n        ],\n        \"current_period\": {}\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"68f30d29-3349-4e7a-b8ce-a990234842ef","kind":"apiReference","anchorId":"get-budgets-by-id","apiVersion":"v1","feature":"Budgets","method":"GET","path":"/api/v1/programmatic/budgets/{id}","summary":"Get a budget","description":"Returns one budget with status for the requested period date.","operationId":"ProgrammaticPlanningController_getBudget_v1","requiredScope":"budgets:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Budget identifier.","example":"<id>"},{"name":"period_date","location":"query","required":false,"schema":"string","description":"Date used to select the budget period. Defaults to today in the workspace timezone.","example":"2026-07-12"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/budgets/<id>?period_date=2026-07-12' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/budgets/<id>?period_date=2026-07-12', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/budgets/<id>?period_date=2026-07-12',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested budget with status for the selected date.","example":"{\n  \"data\": {\n    \"type\": \"budgets\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"adjustment\": {},\n      \"name\": \"Groceries\",\n      \"raw_name\": \"Groceries\",\n      \"is_system_seed\": false,\n      \"system_seed_key\": \"<string>\",\n      \"system_seed_source\": \"category_seed\",\n      \"name_customized\": false,\n      \"active\": true,\n      \"period\": \"monthly\",\n      \"rollover_strategy\": \"carry\",\n      \"pacing_strategy\": \"linear\",\n      \"include_recurring_transactions\": false,\n      \"notes\": \"<string>\",\n      \"warning_threshold\": 0,\n      \"accent_color\": \"sky\",\n      \"icon\": \"lucide:shopping-cart\",\n      \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n      \"currency_id\": \"<uuid>\",\n      \"version\": 0,\n      \"currency\": {\n        \"id\": \"<uuid>\",\n        \"code\": \"USD\",\n        \"symbol\": \"$\",\n        \"decimal_places\": 2\n      },\n      \"amount\": \"500.00\",\n      \"base_amount\": \"500.00\",\n      \"order\": 0,\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"created_by\": {},\n      \"category_ids\": [\n        \"<uuid>\"\n      ],\n      \"categories\": [\n        {\n          \"id\": \"<uuid>\",\n          \"name\": \"Groceries\",\n          \"raw_name\": \"Groceries\",\n          \"is_system_seed\": false,\n          \"system_seed_key\": \"<string>\",\n          \"system_seed_source\": \"category_seed\",\n          \"name_customized\": false,\n          \"icon\": \"shopping-cart\",\n          \"accent_color\": \"emerald\"\n        }\n      ],\n      \"current_period\": {}\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/goals","slug":"docs/api/v1/goals","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Goals API: endpoints and examples","description":"Read savings goals and their progress. List goals, Get a goal."},"blocks":[{"id":"35ee98bb-57b4-40cf-9a48-a872e89d3400","kind":"hero","anchorId":"overview","title":"Goals","text":"Read savings goals and their progress."},{"id":"d74d7cee-88a3-4b8f-a978-141bbc8f703d","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Goals are returned with their status. By default the list shows open goals; pass the all status to include closed goals.</p><p>Lists are paginated with page and limit parameters.</p><h2>Required scopes</h2><ul><li><code>goals:read</code> — Read goals and their progress.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-goals\">List goals</a></li><li><a href=\"#get-goals-by-id\">Get a goal</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-goals\"><code>GET</code> List goals</a> — <code>/api/v1/programmatic/goals</code></li><li><a href=\"#get-goals-by-id\"><code>GET</code> Get a goal</a> — <code>/api/v1/programmatic/goals/{id}</code></li></ul>"},{"id":"b51a3539-fb0d-410d-a008-bb0674cd6216","kind":"apiReference","anchorId":"get-goals","apiVersion":"v1","feature":"Goals","method":"GET","path":"/api/v1/programmatic/goals","summary":"List goals","description":"Returns goals with status filtering and pagination.","operationId":"ProgrammaticPlanningController_listGoals_v1","requiredScope":"goals:read","parameters":[{"name":"status","location":"query","required":false,"schema":"active | achieved | abandoned | all","description":"Goal lifecycle filter. Use `all` to include closed goals.","example":"active"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum goals returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/goals?status=active&page=<page>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/goals?status=active&page=<page>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/goals?status=active&page=<page>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Goals with progress, pace, and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"goals\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"created_by_user_id\": \"<uuid>\",\n        \"name\": \"<string>\",\n        \"raw_name\": \"<string>\",\n        \"is_system_seed\": false,\n        \"system_seed_key\": \"<string>\",\n        \"system_seed_source\": \"category_seed\",\n        \"name_customized\": false,\n        \"icon\": \"<string>\",\n        \"icon_url\": \"<string>\",\n        \"cover_image\": {},\n        \"accent_color\": \"sky\",\n        \"currency_id\": \"<uuid>\",\n        \"currency_code\": \"<string>\",\n        \"currency_symbol\": \"<string>\",\n        \"target_amount\": \"10000.00\",\n        \"monthly_contribution\": \"250.00\",\n        \"current_saved\": \"3200.00\",\n        \"current_saved_unavailable_reason\": \"missing_rate\",\n        \"target_date\": \"2026-07-12\",\n        \"linked_wallet_id\": \"<uuid>\",\n        \"order\": 0,\n        \"status\": \"active\",\n        \"achieved_at\": \"2026-07-12T12:00:00Z\",\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"updated_at\": \"2026-07-12T12:00:00Z\",\n        \"monthly_pace\": \"230.00\",\n        \"expected_completion_date\": \"2026-07-12\",\n        \"on_track\": false,\n        \"pace\": \"on_track\",\n        \"pace_detail\": {},\n        \"auto_contribution\": {},\n        \"suggested_auto_contribution\": {},\n        \"eta_month\": \"2027-03\",\n        \"overdue\": false,\n        \"version\": 0,\n        \"created_by\": {}\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"66cbe378-b6aa-4232-9bb5-d12478a65524","kind":"apiReference","anchorId":"get-goals-by-id","apiVersion":"v1","feature":"Goals","method":"GET","path":"/api/v1/programmatic/goals/{id}","summary":"Get a goal","description":"Returns one goal from the PAT workspace.","operationId":"ProgrammaticPlanningController_getGoal_v1","requiredScope":"goals:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Goal identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/goals/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/goals/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/goals/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested goal with progress and pace details.","example":"{\n  \"data\": {\n    \"type\": \"goals\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"created_by_user_id\": \"<uuid>\",\n      \"name\": \"<string>\",\n      \"raw_name\": \"<string>\",\n      \"is_system_seed\": false,\n      \"system_seed_key\": \"<string>\",\n      \"system_seed_source\": \"category_seed\",\n      \"name_customized\": false,\n      \"icon\": \"<string>\",\n      \"icon_url\": \"<string>\",\n      \"cover_image\": {},\n      \"accent_color\": \"sky\",\n      \"currency_id\": \"<uuid>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"target_amount\": \"10000.00\",\n      \"monthly_contribution\": \"250.00\",\n      \"current_saved\": \"3200.00\",\n      \"current_saved_unavailable_reason\": \"missing_rate\",\n      \"target_date\": \"2026-07-12\",\n      \"linked_wallet_id\": \"<uuid>\",\n      \"order\": 0,\n      \"status\": \"active\",\n      \"achieved_at\": \"2026-07-12T12:00:00Z\",\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\",\n      \"monthly_pace\": \"230.00\",\n      \"expected_completion_date\": \"2026-07-12\",\n      \"on_track\": false,\n      \"pace\": \"on_track\",\n      \"pace_detail\": {},\n      \"auto_contribution\": {},\n      \"suggested_auto_contribution\": {},\n      \"eta_month\": \"2027-03\",\n      \"overdue\": false,\n      \"version\": 0,\n      \"created_by\": {}\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/imports","slug":"docs/api/v1/imports","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Imports API: endpoints and examples","description":"Upload a bank statement, review the parsed preview and confirm it to create transactions. List statement imports, Upload a statement import, Get a…"},"blocks":[{"id":"5e8d46dc-19fa-4650-97cf-c20e5b297452","kind":"hero","anchorId":"overview","title":"Imports","text":"Upload a bank statement, review the parsed preview and confirm it to create transactions."},{"id":"ec6a6707-0e5b-4f5b-9ca9-465be1891b67","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>An import turns a statement file into transactions in two steps. Uploading parses the file for one existing active asset account and returns a preview; nothing is posted yet. Confirming the preview queues transaction creation.</p><p>Statements can be CSV, Excel, OFX, QFX or MT940 files up to 10 MiB. Uploading and confirming require an Idempotency-Key header, so a retried request does not create a second import or a second confirmation.</p><p>Import jobs are listed with cursor pagination: pass the returned cursor as the after parameter to read the next page.</p><h2>Required scopes</h2><ul><li><code>imports:read</code> — Read statement imports and their previews.</li><li><code>imports:create</code> — Upload statements and confirm parsed imports.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#post-imports\">Upload a statement import</a></li><li><a href=\"#get-imports-by-id\">Get a statement import</a></li><li><a href=\"#post-imports-by-id-confirm\">Confirm a statement import</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-imports\"><code>GET</code> List statement imports</a> — <code>/api/v1/programmatic/imports</code></li><li><a href=\"#post-imports\"><code>POST</code> Upload a statement import</a> — <code>/api/v1/programmatic/imports</code></li><li><a href=\"#get-imports-by-id\"><code>GET</code> Get a statement import</a> — <code>/api/v1/programmatic/imports/{id}</code></li><li><a href=\"#post-imports-by-id-confirm\"><code>POST</code> Confirm a statement import</a> — <code>/api/v1/programmatic/imports/{id}/confirm</code></li></ul>"},{"id":"a81a9039-175a-42ea-8077-16fde31ded6c","kind":"apiReference","anchorId":"get-imports","apiVersion":"v1","feature":"Imports","method":"GET","path":"/api/v1/programmatic/imports","summary":"List statement imports","description":"Returns statement imports from the PAT workspace.","operationId":"ProgrammaticImportController_list_v1","requiredScope":"imports:read","parameters":[{"name":"after","location":"query","required":false,"schema":"string","description":"Opaque cursor returned as next_cursor by the previous page.","example":"<after>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum import jobs returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/imports?after=<after>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/imports?after=<after>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/imports?after=<after>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Statement import jobs and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"import_jobs\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"bank_key\": \"revolut\",\n        \"bank_name\": \"Revolut\",\n        \"file_name\": \"statement.csv\",\n        \"file_type\": \"csv\",\n        \"reported_period\": {},\n        \"destination_draft\": {},\n        \"statement_columns\": {},\n        \"total_rows\": 150,\n        \"imported_count\": 148,\n        \"skipped_count\": 1,\n        \"skipped_existing_count\": 1,\n        \"error_count\": 1,\n        \"status\": \"completed\",\n        \"preview_version\": 3,\n        \"parse_options\": {\n          \"amount_semantics\": \"signed_debit_negative\",\n          \"amount_semantics_required\": false\n        },\n        \"error_message\": \"<string>\",\n        \"account_id\": \"<uuid>\",\n        \"preview\": [\n          {\n            \"transaction_id\": \"<uuid>\"\n          }\n        ],\n        \"opening_balance_adjusted\": [\n          {\n            \"account_id\": \"<uuid>\",\n            \"account_name\": \"Main checking\",\n            \"currency_code\": \"USD\",\n            \"reason\": \"pre_opening_import_rows\",\n            \"target_balance\": \"1000.00\",\n            \"balance_as_of_date\": \"2026-07-12\",\n            \"tetri_balance_before\": \"950.00\",\n            \"tetri_balance_after\": \"1000.00\",\n            \"delta\": \"50.00\",\n            \"old_opening_balance\": \"100.00\",\n            \"new_opening_balance\": \"150.00\",\n            \"old_opening_balance_date\": \"2026-07-12\",\n            \"new_opening_balance_date\": \"2026-07-12\"\n          }\n        ],\n        \"reverted_at\": \"2026-07-12T12:00:00Z\",\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"updated_at\": \"2026-07-12T12:00:00Z\"\n      }\n    }\n  ],\n  \"meta\": {\n    \"limit\": 25,\n    \"has_more\": true,\n    \"next_cursor\": \"<opaque-cursor>\",\n    \"total\": 120,\n    \"count\": 25\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"48850a4e-5cdc-4bfc-8502-bd68efe5a535","kind":"apiReference","anchorId":"post-imports","apiVersion":"v1","feature":"Imports","method":"POST","path":"/api/v1/programmatic/imports","summary":"Upload a statement import","description":"Uploads and parses a statement for an existing active asset account.","operationId":"ProgrammaticImportController_upload_v1","requiredScope":"imports:create","parameters":[{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical file and account.","example":"import_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"multipart/form-data","required":true,"description":"Statement file and destination account. Supported files: CSV, Excel, OFX, QFX, and MT940, up to 10 MiB.","example":"{\n  \"account_id\": \"<asset-account-id>\",\n  \"file\": \"<statement.csv>\"\n}","examples":[{"key":"statement","label":"Upload a statement","value":"{\n  \"account_id\": \"<asset-account-id>\",\n  \"file\": \"<statement.csv>\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/imports' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: import_20260722_01J2Y8M4R1' \\\n  --form 'account_id=<uuid>' \\\n  --form 'file=@statement.csv'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst fileInput = document.querySelector('input[type=\"file\"]');\nconst file = fileInput?.files?.[0];\nif (!file) throw new Error('Select a statement file first.');\nconst form = new FormData();\nform.append('account_id', '<uuid>');\nform.append('file', file);\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/imports', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"import_20260722_01J2Y8M4R1\",\n  },\n  body: form,\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/imports',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"import_20260722_01J2Y8M4R1\"},\n    data={\"account_id\": \"<uuid>\"},\n    files={\"file\": open('statement.csv', 'rb')}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"201","description":"Statement uploaded and parsed into an import preview.","example":"{\n  \"data\": {\n    \"type\": \"import_jobs\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"bank_key\": \"revolut\",\n      \"bank_name\": \"Revolut\",\n      \"file_name\": \"statement.csv\",\n      \"file_type\": \"csv\",\n      \"reported_period\": {},\n      \"destination_draft\": {},\n      \"statement_columns\": {},\n      \"total_rows\": 150,\n      \"imported_count\": 148,\n      \"skipped_count\": 1,\n      \"skipped_existing_count\": 1,\n      \"error_count\": 1,\n      \"status\": \"completed\",\n      \"preview_version\": 3,\n      \"parse_options\": {\n        \"amount_semantics\": \"signed_debit_negative\",\n        \"amount_semantics_required\": false\n      },\n      \"error_message\": \"<string>\",\n      \"account_id\": \"<uuid>\",\n      \"preview\": [\n        {\n          \"transaction_id\": \"<uuid>\"\n        }\n      ],\n      \"opening_balance_adjusted\": [\n        {\n          \"account_id\": \"<uuid>\",\n          \"account_name\": \"Main checking\",\n          \"currency_code\": \"USD\",\n          \"reason\": \"pre_opening_import_rows\",\n          \"target_balance\": \"1000.00\",\n          \"balance_as_of_date\": \"2026-07-12\",\n          \"tetri_balance_before\": \"950.00\",\n          \"tetri_balance_after\": \"1000.00\",\n          \"delta\": \"50.00\",\n          \"old_opening_balance\": \"100.00\",\n          \"new_opening_balance\": \"150.00\",\n          \"old_opening_balance_date\": \"2026-07-12\",\n          \"new_opening_balance_date\": \"2026-07-12\"\n        }\n      ],\n      \"reverted_at\": \"2026-07-12T12:00:00Z\",\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\"\n    }\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"413","description":"The uploaded statement exceeds the 10 MiB limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"30eb2715-aaa1-4558-9b28-95edcfe46613","kind":"apiReference","anchorId":"get-imports-by-id","apiVersion":"v1","feature":"Imports","method":"GET","path":"/api/v1/programmatic/imports/{id}","summary":"Get a statement import","description":"Returns one statement import and its available preview.","operationId":"ProgrammaticImportController_findById_v1","requiredScope":"imports:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Statement import job identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/imports/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/imports/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/imports/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested import job and its available parsed preview.","example":"{\n  \"data\": {\n    \"type\": \"import_jobs\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"bank_key\": \"revolut\",\n      \"bank_name\": \"Revolut\",\n      \"file_name\": \"statement.csv\",\n      \"file_type\": \"csv\",\n      \"reported_period\": {},\n      \"destination_draft\": {},\n      \"statement_columns\": {},\n      \"total_rows\": 150,\n      \"imported_count\": 148,\n      \"skipped_count\": 1,\n      \"skipped_existing_count\": 1,\n      \"error_count\": 1,\n      \"status\": \"completed\",\n      \"preview_version\": 3,\n      \"parse_options\": {\n        \"amount_semantics\": \"signed_debit_negative\",\n        \"amount_semantics_required\": false\n      },\n      \"error_message\": \"<string>\",\n      \"account_id\": \"<uuid>\",\n      \"preview\": [\n        {\n          \"transaction_id\": \"<uuid>\"\n        }\n      ],\n      \"opening_balance_adjusted\": [\n        {\n          \"account_id\": \"<uuid>\",\n          \"account_name\": \"Main checking\",\n          \"currency_code\": \"USD\",\n          \"reason\": \"pre_opening_import_rows\",\n          \"target_balance\": \"1000.00\",\n          \"balance_as_of_date\": \"2026-07-12\",\n          \"tetri_balance_before\": \"950.00\",\n          \"tetri_balance_after\": \"1000.00\",\n          \"delta\": \"50.00\",\n          \"old_opening_balance\": \"100.00\",\n          \"new_opening_balance\": \"150.00\",\n          \"old_opening_balance_date\": \"2026-07-12\",\n          \"new_opening_balance_date\": \"2026-07-12\"\n        }\n      ],\n      \"reverted_at\": \"2026-07-12T12:00:00Z\",\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\"\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"5e4c2ce8-ce1b-4b33-b849-6b731d877ef5","kind":"apiReference","anchorId":"post-imports-by-id-confirm","apiVersion":"v1","feature":"Imports","method":"POST","path":"/api/v1/programmatic/imports/{id}/confirm","summary":"Confirm a statement import","description":"Atomically queues a parsed statement preview for transaction creation.","operationId":"ProgrammaticImportController_confirm_v1","requiredScope":"imports:create","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Parsed statement import job identifier.","example":"<id>"},{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical confirmation.","example":"confirm_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"application/json","required":true,"description":"Confirmation options applied atomically when imported transactions are queued.","example":"{\n  \"skip_duplicates\": true\n}","examples":[{"key":"default","label":"Confirm with duplicate protection","value":"{\n  \"skip_duplicates\": true\n}"},{"key":"fallbackCategory","label":"Confirm with a fallback category","value":"{\n  \"skip_duplicates\": true,\n  \"default_category_id\": \"<category-id>\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/imports/<id>/confirm' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: confirm_20260722_01J2Y8M4R1' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"skip_duplicates\": true }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/imports/<id>/confirm', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"confirm_20260722_01J2Y8M4R1\",\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"skip_duplicates\": true\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"skip_duplicates\\\": true\\n}\")\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/imports/<id>/confirm',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"confirm_20260722_01J2Y8M4R1\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"201","description":"Import confirmation accepted and transaction creation queued.","example":"{\n  \"data\": {\n    \"type\": \"import_jobs\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"bank_key\": \"revolut\",\n      \"bank_name\": \"Revolut\",\n      \"file_name\": \"statement.csv\",\n      \"file_type\": \"csv\",\n      \"reported_period\": {},\n      \"destination_draft\": {},\n      \"statement_columns\": {},\n      \"total_rows\": 150,\n      \"imported_count\": 148,\n      \"skipped_count\": 1,\n      \"skipped_existing_count\": 1,\n      \"error_count\": 1,\n      \"status\": \"completed\",\n      \"preview_version\": 3,\n      \"parse_options\": {\n        \"amount_semantics\": \"signed_debit_negative\",\n        \"amount_semantics_required\": false\n      },\n      \"error_message\": \"<string>\",\n      \"account_id\": \"<uuid>\",\n      \"preview\": [\n        {\n          \"transaction_id\": \"<uuid>\"\n        }\n      ],\n      \"opening_balance_adjusted\": [\n        {\n          \"account_id\": \"<uuid>\",\n          \"account_name\": \"Main checking\",\n          \"currency_code\": \"USD\",\n          \"reason\": \"pre_opening_import_rows\",\n          \"target_balance\": \"1000.00\",\n          \"balance_as_of_date\": \"2026-07-12\",\n          \"tetri_balance_before\": \"950.00\",\n          \"tetri_balance_after\": \"1000.00\",\n          \"delta\": \"50.00\",\n          \"old_opening_balance\": \"100.00\",\n          \"new_opening_balance\": \"150.00\",\n          \"old_opening_balance_date\": \"2026-07-12\",\n          \"new_opening_balance_date\": \"2026-07-12\"\n        }\n      ],\n      \"reverted_at\": \"2026-07-12T12:00:00Z\",\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\"\n    }\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/insights","slug":"docs/api/v1/insights","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Insights API: endpoints and examples","description":"Read the insights Tetri generates from the transactions of a financial month. List insights, Get an insight."},"blocks":[{"id":"393dac2c-fb86-4b65-901a-95becfa090a4","kind":"hero","anchorId":"overview","title":"Insights","text":"Read the insights Tetri generates from the transactions of a financial month."},{"id":"aeba12e4-2d96-4ac1-af1f-966aef750af0","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>An insight is a generated observation about spending or income in one financial month. The month is required and uses the YYYY-MM format.</p><p>The list can be restricted to specific accounts. The response includes the time it was produced and the next planned refresh.</p><h2>Required scopes</h2><ul><li><code>insights:read</code> — Read generated insights.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-insights\">List insights</a></li><li><a href=\"#get-insights-by-id\">Get an insight</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-insights\"><code>GET</code> List insights</a> — <code>/api/v1/programmatic/insights</code></li><li><a href=\"#get-insights-by-id\"><code>GET</code> Get an insight</a> — <code>/api/v1/programmatic/insights/{id}</code></li></ul>"},{"id":"bb08594b-4c4c-4cbb-b46e-7de1d9376484","kind":"apiReference","anchorId":"get-insights","apiVersion":"v1","feature":"Insights","method":"GET","path":"/api/v1/programmatic/insights","summary":"List insights","description":"Returns generated insights for the required YYYY-MM period.","operationId":"ProgrammaticInsightsController_listInsights_v1","requiredScope":"insights:read","parameters":[{"name":"account_ids","location":"query","required":false,"schema":"array<string>","description":"Restrict insights to these account identifiers. At most 100 values.","example":"<account_ids>"},{"name":"period","location":"query","required":true,"schema":"string","description":"Required financial month in `YYYY-MM` format.","example":"2026-07"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/insights?account_ids=<account_ids>&period=2026-07' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/insights?account_ids=<account_ids>&period=2026-07', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/insights?account_ids=<account_ids>&period=2026-07',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Generated insights, response timestamp, and the next planned refresh time.","example":"{\n  \"insights\": [\n    {\n      \"id\": \"anomaly_018f8e30-66fd-7e50-a1ef-9c52d11c2baf\",\n      \"type\": \"anomaly\",\n      \"priority\": \"high\",\n      \"triggered_at\": \"2026-07-15T06:03:00.000Z\",\n      \"entity_id\": \"<uuid>\",\n      \"associated_transaction_id\": \"<uuid>\",\n      \"payload\": {}\n    }\n  ],\n  \"generated_at\": \"2026-07-12T12:00:00Z\",\n  \"next_refresh_at\": \"2026-07-12T12:00:00Z\"\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"0666dd22-fa1f-4f3e-abcb-2dcbc9c3496c","kind":"apiReference","anchorId":"get-insights-by-id","apiVersion":"v1","feature":"Insights","method":"GET","path":"/api/v1/programmatic/insights/{id}","summary":"Get an insight","description":"Returns one generated insight from the PAT workspace.","operationId":"ProgrammaticInsightsController_getInsight_v1","requiredScope":"insights:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Stable logical insight key returned by the insights collection. This is not necessarily a UUID.","example":"anomaly_018f8e30-66fd-7e50-a1ef-9c52d11c2baf"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/insights/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/insights/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/insights/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested generated insight.","example":"{\n  \"data\": {\n    \"id\": \"anomaly_018f8e30-66fd-7e50-a1ef-9c52d11c2baf\",\n    \"type\": \"anomaly\",\n    \"priority\": \"high\",\n    \"triggered_at\": \"2026-07-15T06:03:00.000Z\",\n    \"entity_id\": \"<uuid>\",\n    \"associated_transaction_id\": \"<uuid>\",\n    \"payload\": {}\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/recurring","slug":"docs/api/v1/recurring","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Recurring rules API: endpoints and examples","description":"Read recurring rules: automatic transactions and manually tracked subscriptions. List recurring rules, Get a recurring rule."},"blocks":[{"id":"2707802a-c17d-47e7-a042-8ceb935da71a","kind":"hero","anchorId":"overview","title":"Recurring rules","text":"Read recurring rules: automatic transactions and manually tracked subscriptions."},{"id":"2c6c564f-696a-4bb5-9b0b-30334675a791","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>A recurring rule describes a transaction that repeats. Automatic recurring rules and manually tracked subscriptions can be filtered separately with the kind parameter.</p><p>The list can also be filtered by lifecycle status, transaction direction and source account, and is paginated with page and limit parameters.</p><h2>Required scopes</h2><ul><li><code>recurring:read</code> — Read recurring rules.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-recurring-rules\">List recurring rules</a></li><li><a href=\"#get-recurring-rules-by-id\">Get a recurring rule</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-recurring-rules\"><code>GET</code> List recurring rules</a> — <code>/api/v1/programmatic/recurring-rules</code></li><li><a href=\"#get-recurring-rules-by-id\"><code>GET</code> Get a recurring rule</a> — <code>/api/v1/programmatic/recurring-rules/{id}</code></li></ul>"},{"id":"25545707-f705-4ac7-8caf-b9453e29452c","kind":"apiReference","anchorId":"get-recurring-rules","apiVersion":"v1","feature":"Recurring rules","method":"GET","path":"/api/v1/programmatic/recurring-rules","summary":"List recurring rules","description":"Returns recurring rules with bounded filtering and pagination.","operationId":"ProgrammaticPlanningController_listRecurring_v1","requiredScope":"recurring:read","parameters":[{"name":"status","location":"query","required":false,"schema":"active | paused | ended","description":"Return only recurring rules in this lifecycle state.","example":"active"},{"name":"type","location":"query","required":false,"schema":"expense | income | transfer","description":"Return only rules for this transaction direction.","example":"expense"},{"name":"kind","location":"query","required":false,"schema":"rule | subscription","description":"Filter automatic recurring rules separately from manually tracked subscriptions.","example":"rule"},{"name":"account_id","location":"query","required":false,"schema":"string","description":"Return rules that use this source account.","example":"<account_id>"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum recurring rules returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/recurring-rules?status=active&type=expense&kind=rule&account_id=<account_id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/recurring-rules?status=active&type=expense&kind=rule&account_id=<account_id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/recurring-rules?status=active&type=expense&kind=rule&account_id=<account_id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Recurring rules and page metadata.","example":"{\n  \"data\": [\n    {\n      \"id\": \"<uuid>\",\n      \"created_by_user_id\": \"<uuid>\",\n      \"name\": \"<string>\",\n      \"raw_name\": \"<string>\",\n      \"is_system_seed\": false,\n      \"system_seed_key\": \"<string>\",\n      \"system_seed_source\": \"category_seed\",\n      \"name_customized\": false,\n      \"type\": \"expense\",\n      \"kind\": \"rule\",\n      \"amount\": \"49.99\",\n      \"currency_id\": \"<uuid>\",\n      \"currency_code\": \"USD\",\n      \"currency_symbol\": \"$\",\n      \"account_id\": \"<uuid>\",\n      \"account_name\": \"<string>\",\n      \"destination_account_id\": \"<uuid>\",\n      \"destination_account_name\": \"<string>\",\n      \"category_id\": \"<uuid>\",\n      \"category_name\": \"<string>\",\n      \"frequency\": \"monthly\",\n      \"custom_interval_days\": 0,\n      \"start_date\": \"2026-07-12\",\n      \"end_date\": \"2026-07-12\",\n      \"next_occurrence_date\": \"2026-07-12\",\n      \"schedule_anchor_day\": 0,\n      \"status\": \"active\",\n      \"paused_at\": \"2026-07-12T12:00:00Z\",\n      \"pause_until\": \"2026-07-12\",\n      \"auto_create\": false,\n      \"catalog_item_id\": \"<uuid>\",\n      \"billing_url\": \"<string>\",\n      \"plan_name\": \"<string>\",\n      \"trial_end_date\": \"2026-07-12\",\n      \"reminder_days\": 0,\n      \"icon\": \"<string>\",\n      \"icon_url\": \"<string>\",\n      \"accent_color\": \"sky\",\n      \"external_id\": \"<string>\",\n      \"notes\": \"<string>\",\n      \"version\": 0,\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\",\n      \"created_by\": {}\n    }\n  ],\n  \"meta\": {\n    \"total\": 0,\n    \"page\": 0,\n    \"limit\": 0\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"0df15972-54b3-480c-896b-04b7dea6331c","kind":"apiReference","anchorId":"get-recurring-rules-by-id","apiVersion":"v1","feature":"Recurring rules","method":"GET","path":"/api/v1/programmatic/recurring-rules/{id}","summary":"Get a recurring rule","description":"Returns one recurring rule from the PAT workspace.","operationId":"ProgrammaticPlanningController_getRecurring_v1","requiredScope":"recurring:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Recurring rule identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/recurring-rules/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/recurring-rules/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/recurring-rules/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested recurring rule.","example":"{\n  \"data\": {\n    \"id\": \"<uuid>\",\n    \"created_by_user_id\": \"<uuid>\",\n    \"name\": \"<string>\",\n    \"raw_name\": \"<string>\",\n    \"is_system_seed\": false,\n    \"system_seed_key\": \"<string>\",\n    \"system_seed_source\": \"category_seed\",\n    \"name_customized\": false,\n    \"type\": \"expense\",\n    \"kind\": \"rule\",\n    \"amount\": \"49.99\",\n    \"currency_id\": \"<uuid>\",\n    \"currency_code\": \"USD\",\n    \"currency_symbol\": \"$\",\n    \"account_id\": \"<uuid>\",\n    \"account_name\": \"<string>\",\n    \"destination_account_id\": \"<uuid>\",\n    \"destination_account_name\": \"<string>\",\n    \"category_id\": \"<uuid>\",\n    \"category_name\": \"<string>\",\n    \"frequency\": \"monthly\",\n    \"custom_interval_days\": 0,\n    \"start_date\": \"2026-07-12\",\n    \"end_date\": \"2026-07-12\",\n    \"next_occurrence_date\": \"2026-07-12\",\n    \"schedule_anchor_day\": 0,\n    \"status\": \"active\",\n    \"paused_at\": \"2026-07-12T12:00:00Z\",\n    \"pause_until\": \"2026-07-12\",\n    \"auto_create\": false,\n    \"catalog_item_id\": \"<uuid>\",\n    \"billing_url\": \"<string>\",\n    \"plan_name\": \"<string>\",\n    \"trial_end_date\": \"2026-07-12\",\n    \"reminder_days\": 0,\n    \"icon\": \"<string>\",\n    \"icon_url\": \"<string>\",\n    \"accent_color\": \"sky\",\n    \"external_id\": \"<string>\",\n    \"notes\": \"<string>\",\n    \"version\": 0,\n    \"created_at\": \"2026-07-12T12:00:00Z\",\n    \"updated_at\": \"2026-07-12T12:00:00Z\",\n    \"created_by\": {}\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/reports","slug":"docs/api/v1/reports","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Reports API: endpoints and examples","description":"Read cash flow, spending, budget, income and data-quality reports for the token workspace. Get account gaps report, Get anomalies report, Get budget…"},"blocks":[{"id":"9bc0f0ac-2631-426a-8cb7-9120a347d90c","kind":"hero","anchorId":"overview","title":"Reports","text":"Read cash flow, spending, budget, income and data-quality reports for the token workspace."},{"id":"127073e7-30c3-4172-abc5-59fc26135546","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Each report is a read-only snapshot calculated for the workspace that owns the token. Reports that depend on a period take a month, a range or a period parameter; the others describe the current state of the workspace.</p><p>Monetary amounts are returned as decimal strings, so clients can format them without losing precision.</p><p>Data-quality reports such as import health and account gaps show where missing or stale data may affect the other reports.</p><h2>Required scopes</h2><ul><li><code>reports:read</code> — Read analytical and data-quality reports.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-reports-cash-flow-summary\">Get cash flow summary report</a></li><li><a href=\"#get-reports-expense-comparison\">Get expense comparison report</a></li><li><a href=\"#get-reports-budget-performance\">Get budget performance report</a></li><li><a href=\"#get-reports-anomalies\">Get anomalies report</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-reports-account-gaps\"><code>GET</code> Get account gaps report</a> — <code>/api/v1/programmatic/reports/account-gaps</code></li><li><a href=\"#get-reports-anomalies\"><code>GET</code> Get anomalies report</a> — <code>/api/v1/programmatic/reports/anomalies</code></li><li><a href=\"#get-reports-budget-performance\"><code>GET</code> Get budget performance report</a> — <code>/api/v1/programmatic/reports/budget-performance</code></li><li><a href=\"#get-reports-cash-flow-summary\"><code>GET</code> Get cash flow summary report</a> — <code>/api/v1/programmatic/reports/cash-flow-summary</code></li><li><a href=\"#get-reports-category-drift\"><code>GET</code> Get category drift report</a> — <code>/api/v1/programmatic/reports/category-drift</code></li><li><a href=\"#get-reports-category-heatmap\"><code>GET</code> Get category heatmap report</a> — <code>/api/v1/programmatic/reports/category-heatmap</code></li><li><a href=\"#get-reports-expense-comparison\"><code>GET</code> Get expense comparison report</a> — <code>/api/v1/programmatic/reports/expense-comparison</code></li><li><a href=\"#get-reports-import-health\"><code>GET</code> Get import health report</a> — <code>/api/v1/programmatic/reports/import-health</code></li><li><a href=\"#get-reports-income-stability\"><code>GET</code> Get income stability report</a> — <code>/api/v1/programmatic/reports/income-stability</code></li><li><a href=\"#get-reports-recurring-detection\"><code>GET</code> Get recurring detection report</a> — <code>/api/v1/programmatic/reports/recurring-detection</code></li><li><a href=\"#get-reports-savings-runway\"><code>GET</code> Get savings runway report</a> — <code>/api/v1/programmatic/reports/savings-runway</code></li><li><a href=\"#get-reports-spending-velocity\"><code>GET</code> Get spending velocity report</a> — <code>/api/v1/programmatic/reports/spending-velocity</code></li><li><a href=\"#get-reports-transfer-flow\"><code>GET</code> Get transfer flow report</a> — <code>/api/v1/programmatic/reports/transfer-flow</code></li><li><a href=\"#get-reports-uncategorized-clusters\"><code>GET</code> Get uncategorized clusters report</a> — <code>/api/v1/programmatic/reports/uncategorized-clusters</code></li></ul>"},{"id":"081d5998-72d7-4dfb-9734-4c2ba98db18c","kind":"apiReference","anchorId":"get-reports-account-gaps","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/account-gaps","summary":"Get account gaps report","description":"Returns active accounts with stale or missing transaction activity.","operationId":"ProgrammaticReportSnapshotsController_getAccountGaps_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/account-gaps' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/account-gaps', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/account-gaps',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete account gaps report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"account_gaps\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"threshold_days\": 0,\n      \"flagged_accounts\": [\n        {\n          \"account_id\": \"<string>\",\n          \"wallet_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"last_transaction_date\": \"2026-07-12\",\n          \"days_since_last\": 0,\n          \"has_import_history\": false\n        }\n      ],\n      \"total_active_accounts\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"deaf2e75-b60e-4da3-b206-03b8f029dcb8","kind":"apiReference","anchorId":"get-reports-anomalies","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/anomalies","summary":"Get anomalies report","description":"Returns transactions that differ materially from category history.","operationId":"ProgrammaticAnalyticsController_getAnomalies_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Report month. Defaults to the current month in the workspace timezone.","example":"2026-07"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/anomalies?month=2026-07' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/anomalies?month=2026-07', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/anomalies?month=2026-07',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete anomaly detection report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"anomaly_detection\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"anomalies\": [\n        {\n          \"transaction_id\": \"<string>\",\n          \"journal_id\": \"<string>\",\n          \"journal_revision\": \"<string>\",\n          \"description\": \"<string>\",\n          \"date\": \"2026-07-12\",\n          \"amount\": \"<string>\",\n          \"native_amount\": \"<string>\",\n          \"native_currency_code\": \"<string>\",\n          \"native_currency_symbol\": \"<string>\",\n          \"category_id\": \"<string>\",\n          \"category_name\": \"<string>\",\n          \"category_color\": \"<string>\",\n          \"category_avg\": \"<string>\",\n          \"multiplier\": \"<string>\",\n          \"monthly_history\": [\n            {\n              \"month\": \"<string>\",\n              \"amount\": \"<string>\"\n            }\n          ],\n          \"hints\": {\n            \"recategorize\": {\n              \"category_id\": \"<string>\",\n              \"category_name\": \"<string>\",\n              \"keyword\": \"<string>\",\n              \"category_avg\": \"<string>\",\n              \"ratio_after\": \"<string>\"\n            },\n            \"split\": {\n              \"suggested_own_share\": \"<string>\"\n            }\n          }\n        }\n      ],\n      \"operations\": [\n        {\n          \"transaction_id\": \"<string>\",\n          \"date\": \"2026-07-12\",\n          \"category_id\": \"<string>\",\n          \"amount\": \"<string>\",\n          \"ratio\": \"<string>\"\n        }\n      ],\n      \"operations_truncated\": false,\n      \"categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"avg_amount\": \"<string>\",\n          \"normal_count\": 0\n        }\n      ],\n      \"threshold_multiplier\": 0,\n      \"extreme_multiplier\": 0,\n      \"total_amount\": \"<string>\",\n      \"extreme_count\": 0,\n      \"transaction_count\": 0,\n      \"baseline_start\": \"2026-07-12\",\n      \"baseline_end\": \"2026-07-12\",\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"e095af22-848e-4646-b35e-574d19866eba","kind":"apiReference","anchorId":"get-reports-budget-performance","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/budget-performance","summary":"Get budget performance report","description":"Returns budget utilization and pacing for a month.","operationId":"ProgrammaticAnalyticsController_getBudgetPerformance_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Budget month. Defaults to the current month in the workspace timezone.","example":"2026-07"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/budget-performance?month=2026-07' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/budget-performance?month=2026-07', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/budget-performance?month=2026-07',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete budget performance report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"budget_performance\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"days_elapsed\": 0,\n      \"days_in_month\": 0,\n      \"budgets\": [\n        {\n          \"budget_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"budget_amount\": \"<string>\",\n          \"actual_spent\": \"<string>\",\n          \"forecast\": \"<string>\",\n          \"status\": \"on_track\",\n          \"percent_used\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"categories\": [\n            {\n              \"id\": \"<string>\",\n              \"name\": \"<string>\",\n              \"icon_name\": \"<string>\",\n              \"accent_color\": \"<string>\",\n              \"actual_spent\": \"<string>\",\n              \"percentage_of_budget\": \"<string>\"\n            }\n          ]\n        }\n      ],\n      \"summary\": {\n        \"total_budgeted_agg\": {\n          \"per_currency\": [\n            {\n              \"currency_code\": \"<string>\",\n              \"currency_symbol\": \"<string>\",\n              \"currency_decimal_places\": 0,\n              \"amount\": \"<string>\",\n              \"count\": 0\n            }\n          ],\n          \"home_converted\": {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"fx_partial\": false,\n            \"missing_fx_count\": 0,\n            \"rate_date\": \"2026-07-12\"\n          }\n        },\n        \"total_spent_agg\": {\n          \"per_currency\": [\n            {\n              \"currency_code\": \"<string>\",\n              \"currency_symbol\": \"<string>\",\n              \"currency_decimal_places\": 0,\n              \"amount\": \"<string>\",\n              \"count\": 0\n            }\n          ],\n          \"home_converted\": {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"fx_partial\": false,\n            \"missing_fx_count\": 0,\n            \"rate_date\": \"2026-07-12\"\n          }\n        },\n        \"total_forecast_agg\": {\n          \"per_currency\": [\n            {\n              \"currency_code\": \"<string>\",\n              \"currency_symbol\": \"<string>\",\n              \"currency_decimal_places\": 0,\n              \"amount\": \"<string>\",\n              \"count\": 0\n            }\n          ],\n          \"home_converted\": {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"fx_partial\": false,\n            \"missing_fx_count\": 0,\n            \"rate_date\": \"2026-07-12\"\n          }\n        },\n        \"on_track_count\": 0,\n        \"on_edge_count\": 0,\n        \"over_count\": 0,\n        \"fx_partial\": false,\n        \"missing_fx_count\": 0\n      }\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"30d0fe4b-6467-45e9-add6-0ba8a88a62c7","kind":"apiReference","anchorId":"get-reports-cash-flow-summary","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/cash-flow-summary","summary":"Get cash flow summary report","description":"Returns income, expense, savings, and monthly trend aggregates. `monthly_trend` is deprecated and sunsets on 2027-04-01 (see the `Sunset` response header): read `trend_months` instead, which keeps months with a missing exchange rate and marks them `fx_partial`.","operationId":"ProgrammaticAnalyticsController_getCashFlowSummary_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Final report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"range","location":"query","required":false,"schema":"recent | full","description":"`full` is clamped to the history window allowed by the plan.","example":"recent"},{"name":"period","location":"query","required":false,"schema":"6m | 12m","description":"Deprecated compatibility alias. Use `range`.","example":"6m"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/cash-flow-summary?month=2026-07&range=recent&period=6m' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/cash-flow-summary?month=2026-07&range=recent&period=6m', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/cash-flow-summary?month=2026-07&range=recent&period=6m',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete cash flow summary report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"cash_flow_summary\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"target_savings_rate\": \"<string>\",\n      \"total_income_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"total_expenses_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"savings_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"savings_rate\": \"<string>\",\n      \"income_sources\": [\n        {\n          \"account_id\": \"<string>\",\n          \"wallet_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"amount\": \"<string>\",\n          \"percentage\": \"<string>\"\n        }\n      ],\n      \"expense_categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"amount\": \"<string>\",\n          \"percentage\": \"<string>\"\n        }\n      ],\n      \"monthly_trend\": [\n        {\n          \"month\": \"<string>\",\n          \"income\": \"<string>\",\n          \"expenses\": \"<string>\",\n          \"savings\": \"<string>\",\n          \"savings_rate\": \"<string>\"\n        }\n      ],\n      \"trend_months\": [\n        {\n          \"month\": \"<string>\",\n          \"income\": \"<string>\",\n          \"expenses\": \"<string>\",\n          \"savings\": \"<string>\",\n          \"savings_rate\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0\n        }\n      ],\n      \"fx_losses_home\": \"<string>\",\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"35a5874a-a342-4338-990e-0429cff1ead2","kind":"apiReference","anchorId":"get-reports-category-drift","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/category-drift","summary":"Get category drift report","description":"Returns material category spending changes over time.","operationId":"ProgrammaticAnalyticsController_getCategoryDrift_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Final report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"range","location":"query","required":false,"schema":"recent | full","description":"`full` is clamped to the history window allowed by the plan.","example":"recent"},{"name":"period","location":"query","required":false,"schema":"6m | 12m","description":"Deprecated compatibility alias. Use `range`.","example":"6m"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/category-drift?month=2026-07&range=recent&period=6m' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/category-drift?month=2026-07&range=recent&period=6m', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/category-drift?month=2026-07&range=recent&period=6m',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete category drift report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"category_drift\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"period\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"monthly_shares\": [\n            {\n              \"month\": \"<string>\",\n              \"share\": \"<string>\",\n              \"amount\": \"<string>\"\n            }\n          ],\n          \"change_pp\": \"<string>\",\n          \"direction\": \"growing\"\n        }\n      ],\n      \"month_totals\": [\n        {\n          \"month\": \"<string>\",\n          \"amount\": \"<string>\",\n          \"status\": \"complete\"\n        }\n      ],\n      \"drift_threshold_pp\": 0,\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"e9f4fb64-876f-439a-b69f-49bdd0a950ea","kind":"apiReference","anchorId":"get-reports-category-heatmap","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/category-heatmap","summary":"Get category heatmap report","description":"Returns category spending intensity over the selected period.","operationId":"ProgrammaticAnalyticsController_getCategoryHeatmap_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Final report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"range","location":"query","required":false,"schema":"recent | full","description":"`full` is clamped to the history window allowed by the plan.","example":"recent"},{"name":"period","location":"query","required":false,"schema":"6m | 12m","description":"Deprecated compatibility alias. Use `range`.","example":"6m"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/category-heatmap?month=2026-07&range=recent&period=6m' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/category-heatmap?month=2026-07&range=recent&period=6m', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/category-heatmap?month=2026-07&range=recent&period=6m',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete category heatmap report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"category_heatmap\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"period\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"months\": [\n        \"<string>\"\n      ],\n      \"categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"accent_color\": \"<string>\"\n        }\n      ],\n      \"cells\": [\n        [\n          \"<string>\"\n        ]\n      ],\n      \"min_value\": \"<string>\",\n      \"max_value\": \"<string>\",\n      \"period_total_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"4edcfdf6-7696-4890-886e-11d9542c0375","kind":"apiReference","anchorId":"get-reports-expense-comparison","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/expense-comparison","summary":"Get expense comparison report","description":"Compares expense totals between two months.","operationId":"ProgrammaticAnalyticsController_getExpenseComparison_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Primary month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"compare_month","location":"query","required":false,"schema":"string","description":"Comparison month. Defaults to the month before `month`.","example":"2026-06"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/expense-comparison?month=2026-07&compare_month=2026-06' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/expense-comparison?month=2026-07&compare_month=2026-06', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/expense-comparison?month=2026-07&compare_month=2026-06',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete expense comparison report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"expense_comparison\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"compare_month\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"current_amount\": \"<string>\",\n          \"previous_amount\": \"<string>\",\n          \"change_amount\": \"<string>\",\n          \"change_percentage\": \"<string>\",\n          \"direction\": \"<string>\",\n          \"trend\": [\n            {\n              \"month\": \"<string>\",\n              \"amount\": \"<string>\"\n            }\n          ],\n          \"budget\": {\n            \"budget_id\": \"<string>\",\n            \"amount\": \"<string>\"\n          }\n        }\n      ],\n      \"total_current_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"total_previous_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"total_change_amount\": \"<string>\",\n      \"total_change_percentage\": \"<string>\",\n      \"biggest_increases\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"change_amount\": \"<string>\",\n          \"change_percentage\": \"<string>\"\n        }\n      ],\n      \"biggest_decreases\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"change_amount\": \"<string>\",\n          \"change_percentage\": \"<string>\"\n        }\n      ],\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"08170ccc-9fc4-4d68-bbc7-7d1e5feced0c","kind":"apiReference","anchorId":"get-reports-import-health","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/import-health","summary":"Get import health report","description":"Returns statement import freshness and coverage by account.","operationId":"ProgrammaticReportSnapshotsController_getImportHealth_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/import-health' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/import-health', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/import-health',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete import health report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"import_health\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"overall_score\": 0,\n      \"duplicate_rate\": \"<string>\",\n      \"error_rate\": \"<string>\",\n      \"categorization_rate\": \"<string>\",\n      \"total_imports\": 0,\n      \"accounts\": [\n        {\n          \"account_id\": \"<string>\",\n          \"wallet_id\": \"<string>\",\n          \"account_name\": \"<string>\",\n          \"total_imports\": 0,\n          \"last_import_date\": \"2026-07-12\",\n          \"avg_error_rate\": \"<string>\",\n          \"avg_duplicate_rate\": \"<string>\"\n        }\n      ]\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"3a113013-238a-4935-b7a6-80710f4874f5","kind":"apiReference","anchorId":"get-reports-income-stability","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/income-stability","summary":"Get income stability report","description":"Returns income consistency metrics over the selected period.","operationId":"ProgrammaticAnalyticsController_getIncomeStability_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Final report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"range","location":"query","required":false,"schema":"recent | full","description":"`full` is clamped to the history window allowed by the plan.","example":"recent"},{"name":"period","location":"query","required":false,"schema":"6m | 12m","description":"Deprecated compatibility alias. Use `range`.","example":"6m"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/income-stability?month=2026-07&range=recent&period=6m' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/income-stability?month=2026-07&range=recent&period=6m', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/income-stability?month=2026-07&range=recent&period=6m',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete income stability report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"income_stability\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"period\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"monthly_incomes\": [\n        {\n          \"month\": \"<string>\",\n          \"amount\": \"<string>\"\n        }\n      ],\n      \"mean\": \"<string>\",\n      \"stddev\": \"<string>\",\n      \"cv\": \"<string>\",\n      \"trend\": \"increasing\",\n      \"forecast_next_month\": \"<string>\",\n      \"total_income_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"e3c44233-1f39-43d1-8dc3-692c066088ac","kind":"apiReference","anchorId":"get-reports-recurring-detection","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/recurring-detection","summary":"Get recurring detection report","description":"Returns transaction patterns that may be recurring.","operationId":"ProgrammaticReportSnapshotsController_getRecurringDetection_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/recurring-detection' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/recurring-detection', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/recurring-detection',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete recurring detection report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"recurring_detection\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"analysis_period_months\": 0,\n      \"detected\": [\n        {\n          \"description_pattern\": \"<string>\",\n          \"suggested_name\": \"<string>\",\n          \"avg_amount\": \"<string>\",\n          \"frequency\": \"weekly\",\n          \"count\": 0,\n          \"last_date\": \"2026-07-12\",\n          \"amount_variance\": \"<string>\",\n          \"suggested_action\": \"create_subscription\"\n        }\n      ],\n      \"total_estimated_monthly_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"cf26f9cc-819a-472c-b5f4-cc0153605791","kind":"apiReference","anchorId":"get-reports-savings-runway","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/savings-runway","summary":"Get savings runway report","description":"Estimates how long current assets cover recent expenses.","operationId":"ProgrammaticReportSnapshotsController_getSavingsRunway_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/savings-runway' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/savings-runway', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/savings-runway',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete savings runway report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"savings_runway\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"total_assets_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"avg_monthly_expenses_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"runway_months\": \"<string>\",\n      \"runway_date\": \"2026-07-12\"\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"779daa91-4a4b-4623-8195-d78f9805a83e","kind":"apiReference","anchorId":"get-reports-spending-velocity","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/spending-velocity","summary":"Get spending velocity report","description":"Returns current-month spending pace and projection.","operationId":"ProgrammaticAnalyticsController_getSpendingVelocity_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"scope","location":"query","required":false,"schema":"string","description":"`all` (default) or `group:<category_group_id>`.","example":"group:3f1c…"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/spending-velocity?month=2026-07&scope=group:3f1c…' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/spending-velocity?month=2026-07&scope=group:3f1c…', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/spending-velocity?month=2026-07&scope=group:3f1c…',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete spending velocity report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"spending_velocity\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"daily_cumulative\": [\n        {\n          \"day\": 0,\n          \"date\": \"2026-07-12\",\n          \"cumulative_amount\": \"<string>\"\n        }\n      ],\n      \"total_spent_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"half_spent_day\": 0,\n      \"operation_count\": 0,\n      \"half_spent_trend\": [\n        {\n          \"month\": \"<string>\",\n          \"half_spent_day\": 0\n        }\n      ],\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"21ecf6f9-17ca-42d1-9a96-91156718ead4","kind":"apiReference","anchorId":"get-reports-transfer-flow","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/transfer-flow","summary":"Get transfer flow report","description":"Returns transfer volumes and directions for a month.","operationId":"ProgrammaticAnalyticsController_getTransferFlow_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Report month. Defaults to the current month in the workspace timezone.","example":"2026-07"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/transfer-flow?month=2026-07' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/transfer-flow?month=2026-07', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/transfer-flow?month=2026-07',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete transfer flow report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"transfer_flow\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"home_currency_code\": \"<string>\",\n      \"window_start\": \"2026-07-12\",\n      \"nodes\": [\n        {\n          \"account_id\": \"<string>\",\n          \"wallet_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"type\": \"<string>\",\n          \"currency_code\": \"<string>\",\n          \"wallet_name\": \"<string>\",\n          \"icon\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"accent_color\": \"<string>\"\n        }\n      ],\n      \"links\": [\n        {\n          \"source_id\": \"<string>\",\n          \"target_id\": \"<string>\",\n          \"amount\": \"<string>\"\n        }\n      ],\n      \"transfers\": [\n        {\n          \"journal_id\": \"<string>\",\n          \"transaction_id\": \"<string>\",\n          \"journal_revision\": \"<string>\",\n          \"date\": \"2026-07-12\",\n          \"source_id\": \"<string>\",\n          \"target_id\": \"<string>\",\n          \"native_amount\": \"<string>\",\n          \"native_currency\": \"<string>\",\n          \"dest_amount\": \"<string>\",\n          \"dest_currency\": \"<string>\",\n          \"home_amount\": \"<string>\",\n          \"status\": \"posted\",\n          \"transfer_kind\": \"internal_fx\",\n          \"estimated_rate\": \"<string>\",\n          \"recurring_rule_id\": \"<string>\"\n        }\n      ],\n      \"recurring_routes\": [\n        {\n          \"source_id\": \"<string>\",\n          \"target_id\": \"<string>\",\n          \"rule_id\": \"<string>\",\n          \"frequency\": \"<string>\",\n          \"day\": 0\n        }\n      ],\n      \"total_transferred_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"55952b77-a458-49a6-a304-24e455fe7343","kind":"apiReference","anchorId":"get-reports-uncategorized-clusters","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/uncategorized-clusters","summary":"Get uncategorized clusters report","description":"Groups uncategorized transactions by similar descriptions.","operationId":"ProgrammaticReportSnapshotsController_getUncategorizedClusters_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/uncategorized-clusters' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/uncategorized-clusters', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/uncategorized-clusters',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete uncategorized clusters report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"uncategorized_clusters\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"analysis_period_months\": 0,\n      \"transaction_count\": 0,\n      \"total_uncategorized_count\": 0,\n      \"clusters\": [\n        {\n          \"description_pattern\": \"<string>\",\n          \"count\": 0,\n          \"total_amount\": \"<string>\",\n          \"avg_amount\": \"<string>\",\n          \"last_date\": \"2026-07-12\",\n          \"sample_transaction_ids\": [\n            \"<string>\"\n          ],\n          \"transactions\": [\n            {\n              \"id\": \"<string>\",\n              \"date\": \"2026-07-12\",\n              \"amount\": \"<string>\"\n            }\n          ],\n          \"every_days\": 0,\n          \"last_days_ago\": 0,\n          \"total_amount_agg\": {\n            \"per_currency\": [\n              {\n                \"currency_code\": \"<string>\",\n                \"currency_symbol\": \"<string>\",\n                \"currency_decimal_places\": 0,\n                \"amount\": \"<string>\",\n                \"count\": 0\n              }\n            ],\n            \"home_converted\": {\n              \"currency_code\": \"<string>\",\n              \"currency_symbol\": \"<string>\",\n              \"currency_decimal_places\": 0,\n              \"amount\": \"<string>\",\n              \"fx_partial\": false,\n              \"missing_fx_count\": 0,\n              \"rate_date\": \"2026-07-12\"\n            }\n          },\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0\n        }\n      ],\n      \"one_off_count\": 0,\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/transaction-templates","slug":"docs/api/v1/transaction-templates","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Transaction templates API: endpoints and examples","description":"Create reusable transaction templates. Create a transaction template."},"blocks":[{"id":"11e1d314-139d-42f9-858c-2158735479a4","kind":"hero","anchorId":"overview","title":"Transaction templates","text":"Create reusable transaction templates."},{"id":"a8d6ed31-ff36-4d18-a2c2-7ef612c248a2","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>A template stores defaults for a transaction: direction, wallets, category, amount, description and notes. At least one default besides the direction and the name is required.</p><p>Creating a template requires an Idempotency-Key header, so a retried request does not save the template twice.</p><h2>Required scopes</h2><ul><li><code>transaction_templates:create</code> — Create transaction templates.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#post-transaction-templates\">Create a transaction template</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#post-transaction-templates\"><code>POST</code> Create a transaction template</a> — <code>/api/v1/programmatic/transaction-templates</code></li></ul>"},{"id":"5f5e5db4-97b7-46c7-b8fd-4a51d15167aa","kind":"apiReference","anchorId":"post-transaction-templates","apiVersion":"v1","feature":"Transaction templates","method":"POST","path":"/api/v1/programmatic/transaction-templates","summary":"Create a transaction template","description":"Creates a user-saved transaction template in the PAT workspace. At least one transaction default besides direction and name is required.","operationId":"ProgrammaticTransactionTemplatesController_create_v1","requiredScope":"transaction_templates:create","parameters":[{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical template.","example":"template_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"application/json","required":true,"description":"Reusable transaction defaults. Wallet references are optional; their role depends on the selected direction. Supply at least one wallet, category, amount, description, or notes value.","example":"{\n  \"direction\": \"expense\",\n  \"name\": \"Lunch\",\n  \"source_wallet_id\": \"<asset-wallet-id>\",\n  \"amount_minor\": \"1250\",\n  \"currency_code\": \"USD\",\n  \"description\": \"Weekday lunch\"\n}","examples":[{"key":"expense","label":"Create an expense template","value":"{\n  \"direction\": \"expense\",\n  \"name\": \"Lunch\",\n  \"source_wallet_id\": \"<asset-wallet-id>\",\n  \"amount_minor\": \"1250\",\n  \"currency_code\": \"USD\",\n  \"description\": \"Weekday lunch\"\n}"},{"key":"income","label":"Create an income template","value":"{\n  \"direction\": \"income\",\n  \"name\": \"Salary\",\n  \"target_wallet_id\": \"<asset-wallet-id>\",\n  \"amount_minor\": \"250000\",\n  \"currency_code\": \"USD\"\n}"},{"key":"transfer","label":"Create a transfer template","value":"{\n  \"direction\": \"transfer\",\n  \"name\": \"Monthly savings\",\n  \"source_wallet_id\": \"<checking-wallet-id>\",\n  \"target_wallet_id\": \"<savings-wallet-id>\",\n  \"amount_minor\": \"50000\",\n  \"currency_code\": \"USD\",\n  \"recurrence_preset\": \"monthly\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transaction-templates' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: template_20260722_01J2Y8M4R1' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"direction\": \"expense\", \"name\": \"Lunch\", \"source_wallet_id\": \"<asset-wallet-id>\", \"amount_minor\": \"1250\", \"currency_code\": \"USD\", \"description\": \"Weekday lunch\" }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transaction-templates', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"template_20260722_01J2Y8M4R1\",\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"direction\": \"expense\",\n  \"name\": \"Lunch\",\n  \"source_wallet_id\": \"<asset-wallet-id>\",\n  \"amount_minor\": \"1250\",\n  \"currency_code\": \"USD\",\n  \"description\": \"Weekday lunch\"\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"direction\\\": \\\"expense\\\",\\n  \\\"name\\\": \\\"Lunch\\\",\\n  \\\"source_wallet_id\\\": \\\"<asset-wallet-id>\\\",\\n  \\\"amount_minor\\\": \\\"1250\\\",\\n  \\\"currency_code\\\": \\\"USD\\\",\\n  \\\"description\\\": \\\"Weekday lunch\\\"\\n}\")\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/transaction-templates',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"template_20260722_01J2Y8M4R1\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"201","description":"Transaction template created with resolved references.","example":"{\n  \"data\": {\n    \"id\": \"<uuid>\",\n    \"source\": \"user_saved\",\n    \"name\": \"<string>\",\n    \"direction\": \"income\",\n    \"fields\": {\n      \"sourceWallet\": {},\n      \"targetWallet\": {},\n      \"category\": {},\n      \"amountMinor\": \"1250\",\n      \"currencyCode\": \"USD\",\n      \"description\": \"<string>\",\n      \"notes\": \"<string>\",\n      \"note\": \"<string>\",\n      \"tags\": [\n        \"<string>\"\n      ],\n      \"recurrencePreset\": \"daily\"\n    },\n    \"usageCount\": 0,\n    \"lastUsedAt\": \"2026-07-12T12:00:00Z\"\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"422","description":"The payload is syntactically valid but violates a domain constraint.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/transactions","slug":"docs/api/v1/transactions","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Transactions API: endpoints and examples","description":"List and read posted transactions, parse free text into a draft, and create, correct or delete transactions. List transaction categories, List…"},"blocks":[{"id":"0ea6f588-63bf-4768-8cfb-ccc030450ab1","kind":"hero","anchorId":"overview","title":"Transactions","text":"List and read posted transactions, parse free text into a draft, and create, correct or delete transactions."},{"id":"6f3e7622-bbe2-4ed2-bf25-2ef9690be416","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Listing returns posted, non-archived transactions. Use page for offset pagination or after for cursor pagination; the two are mutually exclusive.</p><p>Parsing turns natural-language text into a canonical transaction draft using the workspace context. It does not create anything, so review the draft before posting it.</p><p>Creating posts one withdrawal, deposit or transfer. The account requirements depend on the type, and an Idempotency-Key header makes the request safe to retry. The categories endpoint lists the categories that can be assigned.</p><p>Updating changes the category, description, date or account of a posted transaction and keeps every other field. Deleting removes it. Both need the revision from the latest read as expected_revision and an Idempotency-Key header.</p><h2>Required scopes</h2><ul><li><code>transactions:read</code> — Read posted transactions and categories, and parse transaction text into a draft.</li><li><code>transactions:create</code> — Create transactions.</li><li><code>transactions:update</code> — Change the category, description, date or account of transactions.</li><li><code>transactions:delete</code> — Delete transactions.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-categories\">List transaction categories</a></li><li><a href=\"#post-transactions-parse\">Parse transaction text</a></li><li><a href=\"#post-transactions\">Create a transaction</a></li><li><a href=\"#get-transactions-by-id\">Get a transaction</a></li><li><a href=\"#patch-transactions-by-id\">Update a transaction</a></li><li><a href=\"#delete-transactions-by-id\">Delete a transaction</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-categories\"><code>GET</code> List transaction categories</a> — <code>/api/v1/programmatic/categories</code></li><li><a href=\"#get-transactions\"><code>GET</code> List transactions</a> — <code>/api/v1/programmatic/transactions</code></li><li><a href=\"#post-transactions\"><code>POST</code> Create a transaction</a> — <code>/api/v1/programmatic/transactions</code></li><li><a href=\"#get-transactions-by-id\"><code>GET</code> Get a transaction</a> — <code>/api/v1/programmatic/transactions/{id}</code></li><li><a href=\"#patch-transactions-by-id\"><code>PATCH</code> Update a transaction</a> — <code>/api/v1/programmatic/transactions/{id}</code></li><li><a href=\"#delete-transactions-by-id\"><code>DELETE</code> Delete a transaction</a> — <code>/api/v1/programmatic/transactions/{id}</code></li><li><a href=\"#post-transactions-parse\"><code>POST</code> Parse transaction text</a> — <code>/api/v1/programmatic/transactions/parse</code></li></ul>"},{"id":"bf3c639b-9a2b-42fb-a6c9-a4575388b736","kind":"apiReference","anchorId":"get-categories","apiVersion":"v1","feature":"Transactions","method":"GET","path":"/api/v1/programmatic/categories","summary":"List transaction categories","description":"Returns active categories that can be assigned while parsing or creating transactions.","operationId":"ProgrammaticReferenceDataController_listCategories_v1","requiredScope":"transactions:read","parameters":[{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum resources returned per page.","example":"<limit>"},{"name":"group_id","location":"query","required":false,"schema":"string","description":"Return active categories from this category group only.","example":"<group_id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/categories?page=<page>&limit=<limit>&group_id=<group_id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/categories?page=<page>&limit=<limit>&group_id=<group_id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/categories?page=<page>&limit=<limit>&group_id=<group_id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Active transaction categories and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"categories\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"version\": 0,\n        \"created_by_user_id\": \"<uuid>\",\n        \"group_id\": \"<uuid>\",\n        \"name\": \"Groceries\",\n        \"icon_name\": \"shopping-cart\",\n        \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n        \"accent_color\": \"emerald\",\n        \"is_archived\": false,\n        \"is_system\": false,\n        \"aliases\": [\n          \"coffee\",\n          \"latte\",\n          \"starbucks\"\n        ],\n        \"order\": 0,\n        \"tx_count\": 42,\n        \"recent_tx_count\": 12,\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"updated_at\": \"2026-07-12T12:00:00Z\",\n        \"spent_agg\": \"<string>\",\n        \"earned_agg\": \"<string>\",\n        \"created_by\": {}\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"74d21a3b-f743-44c7-8664-22ea2570d7fe","kind":"apiReference","anchorId":"get-transactions","apiVersion":"v1","feature":"Transactions","method":"GET","path":"/api/v1/programmatic/transactions","summary":"List transactions","description":"Returns posted, non-archived transactions with offset or cursor pagination.","operationId":"ProgrammaticTransactionsController_list_v1","requiredScope":"transactions:read","parameters":[{"name":"type","location":"query","required":false,"schema":"withdrawal | deposit | transfer | loan_payment","description":"Return only transactions with this journal type.","example":"withdrawal"},{"name":"start","location":"query","required":false,"schema":"string","description":"Inclusive start of the financial date range.","example":"2026-07-01"},{"name":"end","location":"query","required":false,"schema":"string","description":"Inclusive end of the financial date range.","example":"2026-07-31"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based offset page. Mutually exclusive with `after`; omit it for cursor pagination.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum transactions returned per page.","example":"<limit>"},{"name":"query","location":"query","required":false,"schema":"string","description":"Case-insensitive transaction description search.","example":"coffee"},{"name":"account_id","location":"query","required":false,"schema":"string","description":"Return transactions that include this account.","example":"<account_id>"},{"name":"category_id","location":"query","required":false,"schema":"string","description":"Return transactions assigned to this category.","example":"<category_id>"},{"name":"after","location":"query","required":false,"schema":"string","description":"Opaque cursor returned as `meta.next_cursor`. Mutually exclusive with `page`.","example":"<opaque-cursor>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions?type=withdrawal&start=2026-07-01&end=2026-07-31&page=<page>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions?type=withdrawal&start=2026-07-01&end=2026-07-31&page=<page>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/transactions?type=withdrawal&start=2026-07-01&end=2026-07-31&page=<page>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Posted transactions with offset pagination metadata, or cursor metadata when `after` is supplied.","example":"{\n  \"data\": [\n    {\n      \"type\": \"transactions\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"revision\": \"2026-07-12T12:00:00Z\",\n        \"group_title\": \"<string>\",\n        \"execution_status\": \"scheduled\",\n        \"executed_at\": \"2026-07-12T12:00:00Z\",\n        \"archived_at\": \"2026-07-12T12:00:00Z\",\n        \"is_archived\": false,\n        \"created_by\": {},\n        \"transactions\": [\n          {\n            \"transaction_journal_id\": \"<uuid>\",\n            \"type\": \"withdrawal\",\n            \"date\": \"2026-07-12T12:00:00Z\",\n            \"occurred_at\": \"2026-07-12T12:00:00Z\",\n            \"business_date\": \"2026-07-12\",\n            \"timezone\": \"Europe/Tbilisi\",\n            \"description\": \"Grocery shopping\",\n            \"amount\": \"42.50\",\n            \"foreign_amount\": \"45.00\",\n            \"foreign_currency_code\": \"EUR\",\n            \"foreign_currency_symbol\": \"€\",\n            \"currency_code\": \"USD\",\n            \"currency_symbol\": \"$\",\n            \"currency_decimal_places\": 2,\n            \"source_id\": \"<uuid>\",\n            \"source_name\": \"<string>\",\n            \"source_type\": \"asset\",\n            \"destination_id\": \"<uuid>\",\n            \"destination_name\": \"<string>\",\n            \"destination_type\": \"expense\",\n            \"category_id\": \"<uuid>\",\n            \"category_name\": \"<string>\",\n            \"budget_id\": \"<uuid>\",\n            \"budget_name\": \"<string>\",\n            \"tags\": [\n              \"<string>\"\n            ],\n            \"notes\": \"<string>\",\n            \"last_reconciled_at\": \"2026-07-12\",\n            \"reconciled\": false,\n            \"status\": \"posted\",\n            \"estimated_rate\": \"1.05\",\n            \"pending_rate_quote\": {},\n            \"final_rate\": \"1.058\",\n            \"settled_at\": \"2026-07-12T12:00:00Z\",\n            \"splits\": [\n              {\n                \"id\": \"<uuid>\",\n                \"amount\": \"42.50\",\n                \"category_id\": \"<uuid>\",\n                \"note\": \"<string>\",\n                \"tag_ids\": [\n                  \"<uuid>\"\n                ]\n              }\n            ],\n            \"has_splits\": false,\n            \"remainder\": \"0.00\"\n          }\n        ]\n      }\n    }\n  ],\n  \"meta\": \"<string>\"\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"7901f89a-d1ba-4982-b521-7249a4b4bf0a","kind":"apiReference","anchorId":"post-transactions","apiVersion":"v1","feature":"Transactions","method":"POST","path":"/api/v1/programmatic/transactions","summary":"Create a transaction","description":"Creates one withdrawal, deposit, or transfer. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionsController_create_v1","requiredScope":"transactions:create","parameters":[{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","example":"tx_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"application/json","required":true,"description":"One posted withdrawal, deposit, or transfer. Account requirements depend on `type`.","example":"{\n  \"type\": \"withdrawal\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"12.50\",\n  \"description\": \"Lunch\",\n  \"source_account_id\": \"<asset-account-id>\"\n}","examples":[{"key":"withdrawal","label":"Create a withdrawal from an asset account","value":"{\n  \"type\": \"withdrawal\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"12.50\",\n  \"description\": \"Lunch\",\n  \"source_account_id\": \"<asset-account-id>\"\n}"},{"key":"foreignCardCharge","label":"Record a USD purchase charged to a GEL card","value":"{\n  \"type\": \"withdrawal\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"326.40\",\n  \"currency_id\": \"<gel-currency-id>\",\n  \"foreign_amount\": \"120.00\",\n  \"foreign_currency_id\": \"<usd-currency-id>\",\n  \"description\": \"Hotel\",\n  \"source_account_id\": \"<gel-card-account-id>\"\n}"},{"key":"deposit","label":"Create a deposit","value":"{\n  \"type\": \"deposit\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"2500.00\",\n  \"description\": \"Salary\",\n  \"destination_account_id\": \"<asset-account-id>\",\n  \"category_id\": \"<income-category-id>\"\n}"},{"key":"transfer","label":"Create a transfer between accounts","value":"{\n  \"type\": \"transfer\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"500.00\",\n  \"description\": \"Move to savings\",\n  \"source_account_id\": \"<source-account-id>\",\n  \"destination_account_id\": \"<destination-account-id>\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: tx_20260722_01J2Y8M4R1' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"type\": \"withdrawal\", \"date\": \"2026-07-12T12:00:00.000Z\", \"amount\": \"12.50\", \"description\": \"Lunch\", \"source_account_id\": \"<asset-account-id>\" }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"tx_20260722_01J2Y8M4R1\",\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"type\": \"withdrawal\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"12.50\",\n  \"description\": \"Lunch\",\n  \"source_account_id\": \"<asset-account-id>\"\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"type\\\": \\\"withdrawal\\\",\\n  \\\"date\\\": \\\"2026-07-12T12:00:00.000Z\\\",\\n  \\\"amount\\\": \\\"12.50\\\",\\n  \\\"description\\\": \\\"Lunch\\\",\\n  \\\"source_account_id\\\": \\\"<asset-account-id>\\\"\\n}\")\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/transactions',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"tx_20260722_01J2Y8M4R1\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"201","description":"Transaction created. The response includes cache side effects and mutation metadata.","example":"{\n  \"data\": {\n    \"type\": \"transactions\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"revision\": \"2026-07-12T12:00:00Z\",\n      \"group_title\": \"<string>\",\n      \"execution_status\": \"scheduled\",\n      \"executed_at\": \"2026-07-12T12:00:00Z\",\n      \"archived_at\": \"2026-07-12T12:00:00Z\",\n      \"is_archived\": false,\n      \"created_by\": {},\n      \"transactions\": [\n        {\n          \"transaction_journal_id\": \"<uuid>\",\n          \"type\": \"withdrawal\",\n          \"date\": \"2026-07-12T12:00:00Z\",\n          \"occurred_at\": \"2026-07-12T12:00:00Z\",\n          \"business_date\": \"2026-07-12\",\n          \"timezone\": \"Europe/Tbilisi\",\n          \"description\": \"Grocery shopping\",\n          \"amount\": \"42.50\",\n          \"foreign_amount\": \"45.00\",\n          \"foreign_currency_code\": \"EUR\",\n          \"foreign_currency_symbol\": \"€\",\n          \"currency_code\": \"USD\",\n          \"currency_symbol\": \"$\",\n          \"currency_decimal_places\": 2,\n          \"source_id\": \"<uuid>\",\n          \"source_name\": \"<string>\",\n          \"source_type\": \"asset\",\n          \"destination_id\": \"<uuid>\",\n          \"destination_name\": \"<string>\",\n          \"destination_type\": \"expense\",\n          \"category_id\": \"<uuid>\",\n          \"category_name\": \"<string>\",\n          \"budget_id\": \"<uuid>\",\n          \"budget_name\": \"<string>\",\n          \"tags\": [\n            \"<string>\"\n          ],\n          \"notes\": \"<string>\",\n          \"last_reconciled_at\": \"2026-07-12\",\n          \"reconciled\": false,\n          \"status\": \"posted\",\n          \"estimated_rate\": \"1.05\",\n          \"pending_rate_quote\": {},\n          \"final_rate\": \"1.058\",\n          \"settled_at\": \"2026-07-12T12:00:00Z\",\n          \"splits\": [\n            {\n              \"id\": \"<uuid>\",\n              \"amount\": \"42.50\",\n              \"category_id\": \"<uuid>\",\n              \"note\": \"<string>\",\n              \"tag_ids\": [\n                \"<uuid>\"\n              ]\n            }\n          ],\n          \"has_splits\": false,\n          \"remainder\": \"0.00\"\n        }\n      ]\n    }\n  },\n  \"meta\": {\n    \"accounts_created\": [\n      {\n        \"wallet_id\": \"<uuid>\",\n        \"account_id\": \"<uuid>\",\n        \"currency_id\": \"<uuid>\"\n      }\n    ]\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"77ffa1af-d66d-4fe2-8736-377c37b78399","kind":"apiReference","anchorId":"get-transactions-by-id","apiVersion":"v1","feature":"Transactions","method":"GET","path":"/api/v1/programmatic/transactions/{id}","summary":"Get a transaction","description":"Returns one posted transaction from the PAT workspace.","operationId":"ProgrammaticTransactionsController_get_v1","requiredScope":"transactions:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Transaction journal identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/transactions/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested posted transaction.","example":"{\n  \"data\": {\n    \"type\": \"transactions\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"revision\": \"2026-07-12T12:00:00Z\",\n      \"group_title\": \"<string>\",\n      \"execution_status\": \"scheduled\",\n      \"executed_at\": \"2026-07-12T12:00:00Z\",\n      \"archived_at\": \"2026-07-12T12:00:00Z\",\n      \"is_archived\": false,\n      \"created_by\": {},\n      \"transactions\": [\n        {\n          \"transaction_journal_id\": \"<uuid>\",\n          \"type\": \"withdrawal\",\n          \"date\": \"2026-07-12T12:00:00Z\",\n          \"occurred_at\": \"2026-07-12T12:00:00Z\",\n          \"business_date\": \"2026-07-12\",\n          \"timezone\": \"Europe/Tbilisi\",\n          \"description\": \"Grocery shopping\",\n          \"amount\": \"42.50\",\n          \"foreign_amount\": \"45.00\",\n          \"foreign_currency_code\": \"EUR\",\n          \"foreign_currency_symbol\": \"€\",\n          \"currency_code\": \"USD\",\n          \"currency_symbol\": \"$\",\n          \"currency_decimal_places\": 2,\n          \"source_id\": \"<uuid>\",\n          \"source_name\": \"<string>\",\n          \"source_type\": \"asset\",\n          \"destination_id\": \"<uuid>\",\n          \"destination_name\": \"<string>\",\n          \"destination_type\": \"expense\",\n          \"category_id\": \"<uuid>\",\n          \"category_name\": \"<string>\",\n          \"budget_id\": \"<uuid>\",\n          \"budget_name\": \"<string>\",\n          \"tags\": [\n            \"<string>\"\n          ],\n          \"notes\": \"<string>\",\n          \"last_reconciled_at\": \"2026-07-12\",\n          \"reconciled\": false,\n          \"status\": \"posted\",\n          \"estimated_rate\": \"1.05\",\n          \"pending_rate_quote\": {},\n          \"final_rate\": \"1.058\",\n          \"settled_at\": \"2026-07-12T12:00:00Z\",\n          \"splits\": [\n            {\n              \"id\": \"<uuid>\",\n              \"amount\": \"42.50\",\n              \"category_id\": \"<uuid>\",\n              \"note\": \"<string>\",\n              \"tag_ids\": [\n                \"<uuid>\"\n              ]\n            }\n          ],\n          \"has_splits\": false,\n          \"remainder\": \"0.00\"\n        }\n      ]\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"39d0ca64-7a06-4712-b018-7ec10363037d","kind":"apiReference","anchorId":"patch-transactions-by-id","apiVersion":"v1","feature":"Transactions","method":"PATCH","path":"/api/v1/programmatic/transactions/{id}","summary":"Update a transaction","description":"Changes the category, description, date or account of one posted transaction; every other field is kept. Read `revision` first and send it as `expected_revision`. Transactions with amount splits are rejected, and only a withdrawal or deposit can change its account. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionEditsController_update_v1","requiredScope":"transactions:update","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Transaction journal identifier.","example":"<id>"},{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","example":"tx_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"application/json","required":true,"description":"The fields to change and the `revision` from the latest read. Omitted fields keep their value; `category_id: null` removes the category.","example":"{\n  \"expected_revision\": \"2026-07-12T12:00:00.000Z\",\n  \"category_id\": \"<category-id>\"\n}","examples":[{"key":"categorize","label":"Set the category of a transaction","value":"{\n  \"expected_revision\": \"2026-07-12T12:00:00.000Z\",\n  \"category_id\": \"<category-id>\"\n}"},{"key":"fix","label":"Correct the description and date","value":"{\n  \"expected_revision\": \"2026-07-12T12:00:00.000Z\",\n  \"description\": \"Lunch with team\",\n  \"date\": \"2026-07-11T12:00:00.000Z\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request PATCH \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: tx_20260722_01J2Y8M4R1' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"expected_revision\": \"2026-07-12T12:00:00.000Z\", \"category_id\": \"<category-id>\" }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions/<id>', {\n  method: 'PATCH',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"tx_20260722_01J2Y8M4R1\",\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"expected_revision\": \"2026-07-12T12:00:00.000Z\",\n  \"category_id\": \"<category-id>\"\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"expected_revision\\\": \\\"2026-07-12T12:00:00.000Z\\\",\\n  \\\"category_id\\\": \\\"<category-id>\\\"\\n}\")\n\nresponse = requests.patch('https://api.tetri.app/api/v1/programmatic/transactions/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"tx_20260722_01J2Y8M4R1\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Transaction updated. The response includes cache side effects and mutation metadata.","example":"{\n  \"data\": {\n    \"type\": \"transactions\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"revision\": \"2026-07-12T12:00:00Z\",\n      \"group_title\": \"<string>\",\n      \"execution_status\": \"scheduled\",\n      \"executed_at\": \"2026-07-12T12:00:00Z\",\n      \"archived_at\": \"2026-07-12T12:00:00Z\",\n      \"is_archived\": false,\n      \"created_by\": {},\n      \"transactions\": [\n        {\n          \"transaction_journal_id\": \"<uuid>\",\n          \"type\": \"withdrawal\",\n          \"date\": \"2026-07-12T12:00:00Z\",\n          \"occurred_at\": \"2026-07-12T12:00:00Z\",\n          \"business_date\": \"2026-07-12\",\n          \"timezone\": \"Europe/Tbilisi\",\n          \"description\": \"Grocery shopping\",\n          \"amount\": \"42.50\",\n          \"foreign_amount\": \"45.00\",\n          \"foreign_currency_code\": \"EUR\",\n          \"foreign_currency_symbol\": \"€\",\n          \"currency_code\": \"USD\",\n          \"currency_symbol\": \"$\",\n          \"currency_decimal_places\": 2,\n          \"source_id\": \"<uuid>\",\n          \"source_name\": \"<string>\",\n          \"source_type\": \"asset\",\n          \"destination_id\": \"<uuid>\",\n          \"destination_name\": \"<string>\",\n          \"destination_type\": \"expense\",\n          \"category_id\": \"<uuid>\",\n          \"category_name\": \"<string>\",\n          \"budget_id\": \"<uuid>\",\n          \"budget_name\": \"<string>\",\n          \"tags\": [\n            \"<string>\"\n          ],\n          \"notes\": \"<string>\",\n          \"last_reconciled_at\": \"2026-07-12\",\n          \"reconciled\": false,\n          \"status\": \"posted\",\n          \"estimated_rate\": \"1.05\",\n          \"pending_rate_quote\": {},\n          \"final_rate\": \"1.058\",\n          \"settled_at\": \"2026-07-12T12:00:00Z\",\n          \"splits\": [\n            {\n              \"id\": \"<uuid>\",\n              \"amount\": \"42.50\",\n              \"category_id\": \"<uuid>\",\n              \"note\": \"<string>\",\n              \"tag_ids\": [\n                \"<uuid>\"\n              ]\n            }\n          ],\n          \"has_splits\": false,\n          \"remainder\": \"0.00\"\n        }\n      ]\n    }\n  },\n  \"meta\": {\n    \"accounts_created\": [\n      {\n        \"wallet_id\": \"<uuid>\",\n        \"account_id\": \"<uuid>\",\n        \"currency_id\": \"<uuid>\"\n      }\n    ]\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"33ed2df3-ae80-4aeb-9594-e23e8443d407","kind":"apiReference","anchorId":"delete-transactions-by-id","apiVersion":"v1","feature":"Transactions","method":"DELETE","path":"/api/v1/programmatic/transactions/{id}","summary":"Delete a transaction","description":"Soft-deletes one posted transaction. Read `revision` first and send it as the `expected_revision` query parameter. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionEditsController_delete_v1","requiredScope":"transactions:delete","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Transaction journal identifier.","example":"<id>"},{"name":"expected_revision","location":"query","required":true,"schema":"string","description":"The `revision` returned by the latest read of this transaction. A stale value is rejected with 409.","example":"<expected_revision>"},{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","example":"tx_20260722_01J2Y8M4R1"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request DELETE \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions/<id>?expected_revision=<expected_revision>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: tx_20260722_01J2Y8M4R1'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions/<id>?expected_revision=<expected_revision>', {\n  method: 'DELETE',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"tx_20260722_01J2Y8M4R1\",\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.delete('https://api.tetri.app/api/v1/programmatic/transactions/<id>?expected_revision=<expected_revision>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"tx_20260722_01J2Y8M4R1\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Transaction deleted.","example":"{\n  \"data\": {\n    \"id\": \"<uuid>\",\n    \"deleted\": true\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"6185f9e7-b6e3-40ad-a350-9142cd21e49a","kind":"apiReference","anchorId":"post-transactions-parse","apiVersion":"v1","feature":"Transactions","method":"POST","path":"/api/v1/programmatic/transactions/parse","summary":"Parse transaction text","description":"Parses natural-language text into a canonical transaction draft using the PAT workspace context.","operationId":"ProgrammaticTransactionsController_parse_v1","requiredScope":"transactions:read","parameters":[],"requestBody":{"contentType":"application/json","required":true,"description":"Natural-language input plus optional locale, timezone, date anchor, and current form context.","example":"{\n  \"text\": \"wolt 42 gel yesterday\",\n  \"locale\": \"en\",\n  \"timezone\": \"Asia/Tbilisi\",\n  \"reference_date\": \"2026-07-22\"\n}","examples":[{"key":"shortExpense","label":"Parse a short expense","value":"{\n  \"text\": \"wolt 42 gel yesterday\",\n  \"locale\": \"en\",\n  \"timezone\": \"Asia/Tbilisi\",\n  \"reference_date\": \"2026-07-22\"\n}"},{"key":"transfer","label":"Parse a transfer with known accounts","value":"{\n  \"text\": \"transfer 500 usd from checking to savings today\",\n  \"locale\": \"en\",\n  \"client_context\": {\n    \"type\": \"transfer\",\n    \"source_account_id\": \"<source-account-id>\",\n    \"destination_account_id\": \"<destination-account-id>\"\n  }\n}"},{"key":"voice","label":"Parse speech recognition text","value":"{\n  \"text\": \"кофе триста рублей сегодня утром\",\n  \"locale\": \"ru\",\n  \"input_mode\": \"voice\",\n  \"timezone\": \"Europe/Moscow\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions/parse' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"text\": \"wolt 42 gel yesterday\", \"locale\": \"en\", \"timezone\": \"Asia/Tbilisi\", \"reference_date\": \"2026-07-22\" }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions/parse', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"text\": \"wolt 42 gel yesterday\",\n  \"locale\": \"en\",\n  \"timezone\": \"Asia/Tbilisi\",\n  \"reference_date\": \"2026-07-22\"\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"text\\\": \\\"wolt 42 gel yesterday\\\",\\n  \\\"locale\\\": \\\"en\\\",\\n  \\\"timezone\\\": \\\"Asia/Tbilisi\\\",\\n  \\\"reference_date\\\": \\\"2026-07-22\\\"\\n}\")\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/transactions/parse',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Canonical natural-language transaction draft parse.","example":"{\n  \"data\": {\n    \"type\": \"nl_transaction_parse\",\n    \"id\": null,\n    \"attributes\": {\n      \"normalized_text\": \"wolt 42 gel yesterday\",\n      \"tokens\": [\n        {\n          \"index\": 0,\n          \"raw\": \"wolt\",\n          \"normalized\": \"wolt\",\n          \"start\": 0,\n          \"end\": 4,\n          \"kind\": \"word\"\n        }\n      ],\n      \"candidates\": [\n        {\n          \"id\": \"amount:1:2:42\",\n          \"field\": \"amount\",\n          \"value\": \"42\",\n          \"label\": \"42\",\n          \"source\": \"static\",\n          \"match_kind\": \"exact_alias\",\n          \"span_start\": 1,\n          \"span_end\": 2,\n          \"score\": 1,\n          \"metadata\": {}\n        }\n      ],\n      \"selected\": [\n        {\n          \"id\": \"amount:1:2:42\",\n          \"field\": \"amount\",\n          \"value\": \"42\",\n          \"label\": \"42\",\n          \"source\": \"static\",\n          \"match_kind\": \"exact_alias\",\n          \"span_start\": 1,\n          \"span_end\": 2,\n          \"score\": 1,\n          \"metadata\": {}\n        }\n      ],\n      \"draft\": {\n        \"type\": \"withdrawal\",\n        \"amount\": \"42\",\n        \"currency_id\": \"<uuid>\",\n        \"currency_code\": \"GEL\",\n        \"date\": \"2026-07-12\",\n        \"occurred_at\": \"2026-07-12T12:00:00Z\",\n        \"timezone\": \"Asia/Tbilisi\",\n        \"source_wallet_id\": \"<uuid>\",\n        \"source_account_id\": \"<uuid>\",\n        \"destination_wallet_id\": \"<uuid>\",\n        \"destination_account_id\": \"<uuid>\",\n        \"category_id\": \"<uuid>\",\n        \"tags\": [\n          \"<string>\"\n        ],\n        \"description\": \"wolt\"\n      },\n      \"confidence\": \"high\",\n      \"missing_fields\": [\n        {\n          \"field\": \"amount\",\n          \"reason\": \"missing\",\n          \"can_use_default\": false\n        }\n      ],\n      \"alternatives\": [\n        {\n          \"field\": \"amount\",\n          \"candidates\": [\n            {\n              \"id\": \"amount:1:2:42\",\n              \"field\": \"amount\",\n              \"value\": \"42\",\n              \"label\": \"42\",\n              \"source\": \"static\",\n              \"match_kind\": \"exact_alias\",\n              \"span_start\": 1,\n              \"span_end\": 2,\n              \"score\": 1,\n              \"metadata\": {}\n            }\n          ]\n        }\n      ],\n      \"warnings\": [\n        \"invalid_local_time\"\n      ],\n      \"dictionary_version\": \"nl-tx-v5-2026-07-17\"\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/wallets","slug":"docs/api/v1/wallets","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Wallets API: endpoints and examples","description":"Read asset wallets, their accounts and balances, and the currency catalog. List transaction accounts, List transaction currencies, List asset wallets."},"blocks":[{"id":"c417e5ac-f21c-47ff-a340-fc383ea2b265","kind":"hero","anchorId":"overview","title":"Wallets","text":"Read asset wallets, their accounts and balances, and the currency catalog."},{"id":"834939f4-b62d-48c0-8c14-21218b1797a5","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Wallet responses include the accounts of each active asset wallet and their balances.</p><p>The accounts endpoint lists the active asset accounts you can use as the source or destination of a transaction or as the target of an import. The currencies endpoint lists the currency catalog for the workspace, including the enabled and primary flags.</p><h2>Required scopes</h2><ul><li><code>wallets:read</code> — Read wallets, accounts, balances and the currency catalog.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-wallets\">List asset wallets</a></li><li><a href=\"#get-wallets-by-id\">Get an asset wallet</a></li><li><a href=\"#get-accounts\">List transaction accounts</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-accounts\"><code>GET</code> List transaction accounts</a> — <code>/api/v1/programmatic/accounts</code></li><li><a href=\"#get-currencies\"><code>GET</code> List transaction currencies</a> — <code>/api/v1/programmatic/currencies</code></li><li><a href=\"#get-wallets\"><code>GET</code> List asset wallets</a> — <code>/api/v1/programmatic/wallets</code></li><li><a href=\"#get-wallets-by-id\"><code>GET</code> Get an asset wallet</a> — <code>/api/v1/programmatic/wallets/{id}</code></li></ul>"},{"id":"bc88eb82-f631-46e6-840a-416556ec226e","kind":"apiReference","anchorId":"get-accounts","apiVersion":"v1","feature":"Wallets","method":"GET","path":"/api/v1/programmatic/accounts","summary":"List transaction accounts","description":"Returns active asset accounts that can be used as transaction source or destination identifiers.","operationId":"ProgrammaticReferenceDataController_listAccounts_v1","requiredScope":"wallets:read","parameters":[{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum resources returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/accounts?page=<page>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/accounts?page=<page>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/accounts?page=<page>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Active asset accounts and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"accounts\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"name\": \"Checking (USD)\",\n        \"type\": \"asset\",\n        \"account_role\": \"defaultAsset\",\n        \"currency_id\": \"<uuid>\",\n        \"currency_code\": \"USD\",\n        \"currency_symbol\": \"$\",\n        \"currency_decimal_places\": 2,\n        \"current_balance\": \"1250.00\",\n        \"native_current_balance\": \"1250.00\",\n        \"active\": true,\n        \"notes\": \"<string>\",\n        \"liability_type\": \"<string>\",\n        \"iban\": \"<string>\",\n        \"account_number\": \"<string>\",\n        \"bic\": \"<string>\",\n        \"opening_balance\": \"0.00\",\n        \"opening_balance_missing\": false,\n        \"opening_balance_date\": \"2025-01-01\",\n        \"virtual_balance\": \"0.00\",\n        \"include_net_worth\": true,\n        \"credit_card_type\": \"<string>\",\n        \"first_payment_date\": \"2026-05-15\",\n        \"payment_day_of_month\": 15,\n        \"interest\": \"0.00\",\n        \"interest_period\": \"monthly\",\n        \"scheduled_payment_amount\": \"1066.20\",\n        \"liability_direction\": \"<string>\",\n        \"expected_settle_date\": \"2026-09-15\",\n        \"order\": 0,\n        \"icon\": \"<string>\",\n        \"icon_color\": \"#3366ff\",\n        \"group_id\": \"<uuid>\",\n        \"group_name\": \"<string>\",\n        \"wallet_id\": \"<uuid>\"\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"5ddf6dc3-4df7-414b-baba-9806be14a438","kind":"apiReference","anchorId":"get-currencies","apiVersion":"v1","feature":"Wallets","method":"GET","path":"/api/v1/programmatic/currencies","summary":"List transaction currencies","description":"Returns the currency catalog ordered for the PAT workspace, including enabled and primary flags.","operationId":"ProgrammaticReferenceDataController_listCurrencies_v1","requiredScope":"wallets:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/currencies' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/currencies', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/currencies',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Currency catalog and workspace availability metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"currencies\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"code\": \"USD\",\n        \"name\": \"US Dollar\",\n        \"symbol\": \"$\",\n        \"enabled\": false,\n        \"default\": false,\n        \"decimal_places\": 2,\n        \"kind\": \"fiat\",\n        \"coingecko_id\": \"bitcoin\",\n        \"icon_url\": \"/api/v1/public/currency-icons/BTC.webp?v=8e8f5ec9a89b8d78\",\n        \"is_custom\": false,\n        \"auto_rate\": false\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"823e3c00-2493-440b-9829-6d1deb18aea8","kind":"apiReference","anchorId":"get-wallets","apiVersion":"v1","feature":"Wallets","method":"GET","path":"/api/v1/programmatic/wallets","summary":"List asset wallets","description":"Returns active asset wallets and their account balances.","operationId":"ProgrammaticWalletsController_list_v1","requiredScope":"wallets:read","parameters":[{"name":"group_id","location":"query","required":false,"schema":"string","description":"Return wallets from this wallet group only.","example":"<group_id>"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum wallets returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/wallets?group_id=<group_id>&page=<page>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/wallets?group_id=<group_id>&page=<page>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/wallets?group_id=<group_id>&page=<page>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Active asset wallets with account balances and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"wallets\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"version\": 0,\n        \"created_by_user_id\": \"<uuid>\",\n        \"name\": \"Main checking\",\n        \"type\": \"bank\",\n        \"money_place_kind\": \"bank_account\",\n        \"icon\": \"wallet\",\n        \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n        \"accent_color\": \"sky\",\n        \"group_id\": \"<uuid>\",\n        \"include_net_worth\": false,\n        \"notes\": \"<string>\",\n        \"order\": 0,\n        \"liability_type\": \"credit_card\",\n        \"liability_direction\": \"outgoing\",\n        \"interest\": \"5.25\",\n        \"interest_period\": \"yearly\",\n        \"term_periods\": 360,\n        \"repayment_type\": \"french\",\n        \"scheduled_payment_amount\": \"1066.20\",\n        \"first_payment_date\": \"2026-06-15\",\n        \"payment_day_of_month\": 15,\n        \"expected_settle_date\": \"2026-12-31\",\n        \"accounts\": [\n          {\n            \"id\": \"<uuid>\",\n            \"currency\": {},\n            \"current_balance\": \"1234.56\",\n            \"opening_balance\": \"1234.56\",\n            \"opening_balance_date\": \"2026-04-01\",\n            \"opening_balance_missing\": false,\n            \"active\": false,\n            \"iban\": \"<string>\",\n            \"bic\": \"<string>\",\n            \"account_number\": \"<string>\"\n          }\n        ],\n        \"total_balance\": \"1234.56\",\n        \"total_balance_currency\": {},\n        \"balance_aggregate\": {\n          \"contract_version\": \"wallet-setup-v1\",\n          \"amount\": \"1234.56\",\n          \"currency\": {},\n          \"status\": \"complete\",\n          \"reasons\": [\n            \"home_currency_missing\"\n          ],\n          \"missing_opening_balance_account_ids\": [\n            \"<uuid>\"\n          ],\n          \"missing_fx_currency_ids\": [\n            \"<uuid>\"\n          ]\n        },\n        \"per_currency\": [\n          {\n            \"currency_id\": \"<uuid>\",\n            \"currency_code\": \"USD\",\n            \"amount\": \"1234.56\"\n          }\n        ],\n        \"balance_sparkline_30d\": [\n          0\n        ],\n        \"balance_trend_30d_percentage\": \"-3.2\",\n        \"last_transaction_at\": \"2026-07-12T12:00:00Z\",\n        \"usage_score\": 3.25,\n        \"needs_opening_balance_setup\": false,\n        \"last_reconciled_at\": \"2026-07-12\",\n        \"reconciliation_status\": \"draft\",\n        \"credit_card\": {},\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"updated_at\": \"2026-07-12T12:00:00Z\",\n        \"archived_at\": \"2026-07-12T12:00:00Z\",\n        \"is_archived\": false,\n        \"created_by\": {}\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"0ca80e52-a395-44b5-a190-9e9463142f35","kind":"apiReference","anchorId":"get-wallets-by-id","apiVersion":"v1","feature":"Wallets","method":"GET","path":"/api/v1/programmatic/wallets/{id}","summary":"Get an asset wallet","description":"Returns one active asset wallet from the PAT workspace.","operationId":"ProgrammaticWalletsController_get_v1","requiredScope":"wallets:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Asset wallet identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/wallets/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/wallets/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/wallets/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested active asset wallet and its account balances.","example":"{\n  \"data\": {\n    \"type\": \"wallets\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"version\": 0,\n      \"created_by_user_id\": \"<uuid>\",\n      \"name\": \"Main checking\",\n      \"type\": \"bank\",\n      \"money_place_kind\": \"bank_account\",\n      \"icon\": \"wallet\",\n      \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n      \"accent_color\": \"sky\",\n      \"group_id\": \"<uuid>\",\n      \"include_net_worth\": false,\n      \"notes\": \"<string>\",\n      \"order\": 0,\n      \"liability_type\": \"credit_card\",\n      \"liability_direction\": \"outgoing\",\n      \"interest\": \"5.25\",\n      \"interest_period\": \"yearly\",\n      \"term_periods\": 360,\n      \"repayment_type\": \"french\",\n      \"scheduled_payment_amount\": \"1066.20\",\n      \"first_payment_date\": \"2026-06-15\",\n      \"payment_day_of_month\": 15,\n      \"expected_settle_date\": \"2026-12-31\",\n      \"accounts\": [\n        {\n          \"id\": \"<uuid>\",\n          \"currency\": {},\n          \"current_balance\": \"1234.56\",\n          \"opening_balance\": \"1234.56\",\n          \"opening_balance_date\": \"2026-04-01\",\n          \"opening_balance_missing\": false,\n          \"active\": false,\n          \"iban\": \"<string>\",\n          \"bic\": \"<string>\",\n          \"account_number\": \"<string>\"\n        }\n      ],\n      \"total_balance\": \"1234.56\",\n      \"total_balance_currency\": {},\n      \"balance_aggregate\": {\n        \"contract_version\": \"wallet-setup-v1\",\n        \"amount\": \"1234.56\",\n        \"currency\": {},\n        \"status\": \"complete\",\n        \"reasons\": [\n          \"home_currency_missing\"\n        ],\n        \"missing_opening_balance_account_ids\": [\n          \"<uuid>\"\n        ],\n        \"missing_fx_currency_ids\": [\n          \"<uuid>\"\n        ]\n      },\n      \"per_currency\": [\n        {\n          \"currency_id\": \"<uuid>\",\n          \"currency_code\": \"USD\",\n          \"amount\": \"1234.56\"\n        }\n      ],\n      \"balance_sparkline_30d\": [\n        0\n      ],\n      \"balance_trend_30d_percentage\": \"-3.2\",\n      \"last_transaction_at\": \"2026-07-12T12:00:00Z\",\n      \"usage_score\": 3.25,\n      \"needs_opening_balance_setup\": false,\n      \"last_reconciled_at\": \"2026-07-12\",\n      \"reconciliation_status\": \"draft\",\n      \"credit_card\": {},\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\",\n      \"archived_at\": \"2026-07-12T12:00:00Z\",\n      \"is_archived\": false,\n      \"created_by\": {}\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]}],"documentationNodeSeeds":[{"systemKey":"docs/api/v1","kind":"section","parentSystemKey":"docs/api","position":10,"icon":"braces"},{"systemKey":"docs/api/v1/getting-started","kind":"section","parentSystemKey":"docs/api/v1","position":10,"icon":"rocket"},{"systemKey":"docs/api/v1/getting-started/authentication","kind":"chapter","parentSystemKey":"docs/api/v1/getting-started","position":10,"icon":"book-open"},{"systemKey":"docs/api/v1/getting-started/scopes","kind":"chapter","parentSystemKey":"docs/api/v1/getting-started","position":20,"icon":"book-open"},{"systemKey":"docs/api/v1/getting-started/first-request","kind":"chapter","parentSystemKey":"docs/api/v1/getting-started","position":30,"icon":"book-open"},{"systemKey":"docs/api/v1/getting-started/errors-and-conventions","kind":"chapter","parentSystemKey":"docs/api/v1/getting-started","position":40,"icon":"book-open"},{"systemKey":"docs/api/v1/budgets","kind":"chapter","parentSystemKey":"docs/api/v1","position":20,"icon":"folder-tree"},{"systemKey":"docs/api/v1/goals","kind":"chapter","parentSystemKey":"docs/api/v1","position":30,"icon":"folder-tree"},{"systemKey":"docs/api/v1/imports","kind":"chapter","parentSystemKey":"docs/api/v1","position":40,"icon":"folder-tree"},{"systemKey":"docs/api/v1/insights","kind":"chapter","parentSystemKey":"docs/api/v1","position":50,"icon":"folder-tree"},{"systemKey":"docs/api/v1/recurring","kind":"chapter","parentSystemKey":"docs/api/v1","position":60,"icon":"folder-tree"},{"systemKey":"docs/api/v1/reports","kind":"chapter","parentSystemKey":"docs/api/v1","position":70,"icon":"folder-tree"},{"systemKey":"docs/api/v1/transaction-templates","kind":"chapter","parentSystemKey":"docs/api/v1","position":80,"icon":"folder-tree"},{"systemKey":"docs/api/v1/transactions","kind":"chapter","parentSystemKey":"docs/api/v1","position":90,"icon":"folder-tree"},{"systemKey":"docs/api/v1/wallets","kind":"chapter","parentSystemKey":"docs/api/v1","position":100,"icon":"folder-tree"}],"pages":[{"systemKey":"docs/api/v1","slug":"docs/api/v1","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Tetri Public API v1","description":"A stable, user-scoped interface for Tetri data and supported actions."},"blocks":[{"id":"0fcf4261-93e1-4132-bca7-7d4defcb4882","kind":"hero","anchorId":"overview","title":"Tetri Public API v1","text":"A stable, user-scoped interface for Tetri data and supported actions."},{"id":"af9639f4-a925-4c5a-a2bc-894bdffa2394","kind":"richText","anchorId":"content","html":"<h2>Base URL</h2><p>Every endpoint is served under <code>https://api.tetri.app/api/v1/programmatic</code>.</p><h2>Version policy</h2><p>This documentation follows the deployed contract within the v1 API major. Breaking contract changes are published under a new API version.</p><h2>Features</h2><ul><li><a href=\"/docs/api/v1/budgets\">Budgets</a> — Read budgets together with their status for a period date. 2 endpoints. Scopes: <code>budgets:read</code>.</li><li><a href=\"/docs/api/v1/goals\">Goals</a> — Read savings goals and their progress. 2 endpoints. Scopes: <code>goals:read</code>.</li><li><a href=\"/docs/api/v1/imports\">Imports</a> — Upload a bank statement, review the parsed preview and confirm it to create transactions. 4 endpoints. Scopes: <code>imports:read</code>, <code>imports:create</code>.</li><li><a href=\"/docs/api/v1/insights\">Insights</a> — Read the insights Tetri generates from the transactions of a financial month. 2 endpoints. Scopes: <code>insights:read</code>.</li><li><a href=\"/docs/api/v1/recurring\">Recurring rules</a> — Read recurring rules: automatic transactions and manually tracked subscriptions. 2 endpoints. Scopes: <code>recurring:read</code>.</li><li><a href=\"/docs/api/v1/reports\">Reports</a> — Read cash flow, spending, budget, income and data-quality reports for the token workspace. 14 endpoints. Scopes: <code>reports:read</code>.</li><li><a href=\"/docs/api/v1/transaction-templates\">Transaction templates</a> — Create reusable transaction templates. 1 endpoint. Scopes: <code>transaction_templates:create</code>.</li><li><a href=\"/docs/api/v1/transactions\">Transactions</a> — List and read posted transactions, parse free text into a draft, and create, correct or delete transactions. 7 endpoints. Scopes: <code>transactions:read</code>, <code>transactions:create</code>, <code>transactions:update</code>, <code>transactions:delete</code>.</li><li><a href=\"/docs/api/v1/wallets\">Wallets</a> — Read asset wallets, their accounts and balances, and the currency catalog. 4 endpoints. Scopes: <code>wallets:read</code>.</li></ul><h2>Start here</h2><ul><li><a href=\"/docs/api/v1/getting-started/authentication\">Authentication</a> — Use a user-scoped personal access token with the minimum required scopes.</li><li><a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> — Which scope each endpoint requires and what a scope allows a token to do.</li><li><a href=\"/docs/api/v1/getting-started/first-request\">Your first request</a> — Verify the credential with a read-only request and inspect the response.</li><li><a href=\"/docs/api/v1/getting-started/errors-and-conventions\">Errors and conventions</a> — Shared behavior for authentication, writes, pagination, and failures.</li></ul>"}]},{"systemKey":"docs/api/v1/getting-started","slug":"docs/api/v1/getting-started","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Getting started","description":"Make your first authenticated Tetri API v1 request."},"blocks":[{"id":"8a7850d8-9830-4864-9f3b-dee27af2d6b9","kind":"hero","anchorId":"overview","title":"Getting started","text":"Make your first authenticated Tetri API v1 request."},{"id":"b2862737-79d0-4be3-ba21-5f7afeb1e536","kind":"richText","anchorId":"content","html":"<h2>Before you start</h2><p>Create a personal access token with the minimum required scopes and keep it outside client-side code. This is a private user credential, not a public API key: anyone who obtains it can access your workspace data and perform every action allowed by its scopes.</p><h2>Guides</h2><ul><li><a href=\"/docs/api/v1/getting-started/authentication\">Authentication</a> — Use a user-scoped personal access token with the minimum required scopes.</li><li><a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> — Which scope each endpoint requires and what a scope allows a token to do.</li><li><a href=\"/docs/api/v1/getting-started/first-request\">Your first request</a> — Verify the credential with a read-only request and inspect the response.</li><li><a href=\"/docs/api/v1/getting-started/errors-and-conventions\">Errors and conventions</a> — Shared behavior for authentication, writes, pagination, and failures.</li></ul>"}]},{"systemKey":"docs/api/v1/getting-started/authentication","slug":"docs/api/v1/getting-started/authentication","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Authentication","description":"Use a user-scoped personal access token with the minimum required scopes."},"blocks":[{"id":"72b15ed5-59f9-4c30-929a-bafda569afea","kind":"hero","anchorId":"overview","title":"Authentication","text":"Use a user-scoped personal access token with the minimum required scopes."},{"id":"618ce36d-879b-434d-be7c-8d57ead37549","kind":"richText","anchorId":"content","html":"<h2>Treat tokens as passwords</h2><p>Personal access tokens are private user-scoped credentials, not public API keys. Anyone who obtains a token can access workspace data and perform every action allowed by its scopes. Never share a token, embed it in client-side code, commit it to source control, or include it in screenshots and logs.</p><h2>Bearer token</h2><p>Send the token with every request:</p><pre>Authorization: Bearer $TETRI_API_TOKEN</pre><p>A Tetri personal access token for the API audience. The OpenAPI security scheme is HTTP bearer with the Tetri PAT token format.</p><h2>Create a token</h2><pre>POST /api/v1/programmatic-access/credentials\nAuthorization: Bearer $TETRI_SESSION_TOKEN\nContent-Type: application/json\n\n{\n  &quot;name&quot;: &quot;My integration&quot;,\n  &quot;audience&quot;: &quot;programmatic_api&quot;,\n  &quot;scopes&quot;: [\n    &quot;wallets:read&quot;\n  ],\n  &quot;expires_in_days&quot;: 30\n}</pre><p>The plaintext token is returned once. Store it in a secrets manager or protected environment variable.</p><h2>Revocation</h2><p>Revoke a credential immediately if it may have been exposed. Changing or resetting your password, or changing your email address, revokes every Public API and MCP credential for your account. Create replacement credentials after the account change.</p>"}]},{"systemKey":"docs/api/v1/getting-started/scopes","slug":"docs/api/v1/getting-started/scopes","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Scopes","description":"Which scope each endpoint requires and what a scope allows a token to do."},"blocks":[{"id":"f2e5be8e-5f24-4519-9cf4-4d839097f6d2","kind":"hero","anchorId":"overview","title":"Scopes","text":"Which scope each endpoint requires and what a scope allows a token to do."},{"id":"e380d1e2-bbe9-4faf-bd28-4ac14a0889b4","kind":"richText","anchorId":"content","html":"<h2>How scopes work</h2><p>A personal access token carries the scopes selected when it was created. An endpoint rejects a token that lacks the scope it requires. Grant an integration only the scopes it needs.</p><h2>Scopes and endpoints</h2><ul><li><code>wallets:read</code> — Read wallets, accounts, balances and the currency catalog.<ul><li><a href=\"/docs/api/v1/wallets#get-accounts\"><code>GET</code> List transaction accounts</a></li><li><a href=\"/docs/api/v1/wallets#get-currencies\"><code>GET</code> List transaction currencies</a></li><li><a href=\"/docs/api/v1/wallets#get-wallets\"><code>GET</code> List asset wallets</a></li><li><a href=\"/docs/api/v1/wallets#get-wallets-by-id\"><code>GET</code> Get an asset wallet</a></li></ul></li><li><code>transactions:read</code> — Read posted transactions and categories, and parse transaction text into a draft.<ul><li><a href=\"/docs/api/v1/transactions#get-categories\"><code>GET</code> List transaction categories</a></li><li><a href=\"/docs/api/v1/transactions#get-transactions\"><code>GET</code> List transactions</a></li><li><a href=\"/docs/api/v1/transactions#get-transactions-by-id\"><code>GET</code> Get a transaction</a></li><li><a href=\"/docs/api/v1/transactions#post-transactions-parse\"><code>POST</code> Parse transaction text</a></li></ul></li><li><code>transactions:create</code> — Create transactions.<ul><li><a href=\"/docs/api/v1/transactions#post-transactions\"><code>POST</code> Create a transaction</a></li></ul></li><li><code>transactions:update</code> — Change the category, description, date or account of transactions.<ul><li><a href=\"/docs/api/v1/transactions#patch-transactions-by-id\"><code>PATCH</code> Update a transaction</a></li></ul></li><li><code>transactions:delete</code> — Delete transactions.<ul><li><a href=\"/docs/api/v1/transactions#delete-transactions-by-id\"><code>DELETE</code> Delete a transaction</a></li></ul></li><li><code>budgets:read</code> — Read budgets and their status.<ul><li><a href=\"/docs/api/v1/budgets#get-budgets\"><code>GET</code> List budgets</a></li><li><a href=\"/docs/api/v1/budgets#get-budgets-by-id\"><code>GET</code> Get a budget</a></li></ul></li><li><code>recurring:read</code> — Read recurring rules.<ul><li><a href=\"/docs/api/v1/recurring#get-recurring-rules\"><code>GET</code> List recurring rules</a></li><li><a href=\"/docs/api/v1/recurring#get-recurring-rules-by-id\"><code>GET</code> Get a recurring rule</a></li></ul></li><li><code>goals:read</code> — Read goals and their progress.<ul><li><a href=\"/docs/api/v1/goals#get-goals\"><code>GET</code> List goals</a></li><li><a href=\"/docs/api/v1/goals#get-goals-by-id\"><code>GET</code> Get a goal</a></li></ul></li><li><code>insights:read</code> — Read generated insights.<ul><li><a href=\"/docs/api/v1/insights#get-insights\"><code>GET</code> List insights</a></li><li><a href=\"/docs/api/v1/insights#get-insights-by-id\"><code>GET</code> Get an insight</a></li></ul></li><li><code>reports:read</code> — Read analytical and data-quality reports.<ul><li><a href=\"/docs/api/v1/reports#get-reports-account-gaps\"><code>GET</code> Get account gaps report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-anomalies\"><code>GET</code> Get anomalies report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-budget-performance\"><code>GET</code> Get budget performance report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-cash-flow-summary\"><code>GET</code> Get cash flow summary report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-category-drift\"><code>GET</code> Get category drift report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-category-heatmap\"><code>GET</code> Get category heatmap report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-expense-comparison\"><code>GET</code> Get expense comparison report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-import-health\"><code>GET</code> Get import health report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-income-stability\"><code>GET</code> Get income stability report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-recurring-detection\"><code>GET</code> Get recurring detection report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-savings-runway\"><code>GET</code> Get savings runway report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-spending-velocity\"><code>GET</code> Get spending velocity report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-transfer-flow\"><code>GET</code> Get transfer flow report</a></li><li><a href=\"/docs/api/v1/reports#get-reports-uncategorized-clusters\"><code>GET</code> Get uncategorized clusters report</a></li></ul></li><li><code>transaction_templates:create</code> — Create transaction templates.<ul><li><a href=\"/docs/api/v1/transaction-templates#post-transaction-templates\"><code>POST</code> Create a transaction template</a></li></ul></li><li><code>imports:read</code> — Read statement imports and their previews.<ul><li><a href=\"/docs/api/v1/imports#get-imports\"><code>GET</code> List statement imports</a></li><li><a href=\"/docs/api/v1/imports#get-imports-by-id\"><code>GET</code> Get a statement import</a></li></ul></li><li><code>imports:create</code> — Upload statements and confirm parsed imports.<ul><li><a href=\"/docs/api/v1/imports#post-imports\"><code>POST</code> Upload a statement import</a></li><li><a href=\"/docs/api/v1/imports#post-imports-by-id-confirm\"><code>POST</code> Confirm a statement import</a></li></ul></li></ul>"}]},{"systemKey":"docs/api/v1/getting-started/first-request","slug":"docs/api/v1/getting-started/first-request","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Your first request","description":"Verify the credential with a read-only request and inspect the response."},"blocks":[{"id":"80984f49-a296-492a-95a6-238cd7943fd6","kind":"hero","anchorId":"overview","title":"Your first request","text":"Verify the credential with a read-only request and inspect the response."},{"id":"728fd85d-0142-47a4-98f0-170afa413a8b","kind":"richText","anchorId":"content","html":"<h2>Request</h2><p>List asset wallets. The token needs the <code>wallets:read</code> scope. Returns active asset wallets and their account balances.</p><pre>curl --request GET \\\n  --url &#39;https://api.tetri.app/api/v1/programmatic/wallets&#39; \\\n  --header &#39;Authorization: Bearer $TETRI_API_TOKEN&#39;</pre><h2>Response</h2><p>A successful request returns <code>200</code> with a body shaped like this:</p><pre>{\n  &quot;data&quot;: [\n    {\n      &quot;type&quot;: &quot;wallets&quot;,\n      &quot;id&quot;: &quot;&lt;uuid&gt;&quot;,\n      &quot;attributes&quot;: {\n        &quot;version&quot;: 0,\n        &quot;created_by_user_id&quot;: &quot;&lt;uuid&gt;&quot;,\n        &quot;name&quot;: &quot;Main checking&quot;,\n        &quot;type&quot;: &quot;bank&quot;,\n        &quot;money_place_kind&quot;: &quot;bank_account&quot;,\n        &quot;icon&quot;: &quot;wallet&quot;,\n        &quot;icon_url&quot;: &quot;https://cdn.tetri.app/icons/abc.webp&quot;,\n        &quot;accent_color&quot;: &quot;sky&quot;,\n        &quot;group_id&quot;: &quot;&lt;uuid&gt;&quot;,\n        &quot;include_net_worth&quot;: false,\n        &quot;notes&quot;: &quot;&lt;string&gt;&quot;,\n        &quot;order&quot;: 0,\n        &quot;liability_type&quot;: &quot;credit_card&quot;,\n        &quot;liability_direction&quot;: &quot;outgoing&quot;,\n        &quot;interest&quot;: &quot;5.25&quot;,\n        &quot;interest_period&quot;: &quot;yearly&quot;,\n        &quot;term_periods&quot;: 360,\n        &quot;repayment_type&quot;: &quot;french&quot;,\n        &quot;scheduled_payment_amount&quot;: &quot;1066.20&quot;,\n        &quot;first_payment_date&quot;: &quot;2026-06-15&quot;,\n        &quot;payment_day_of_month&quot;: 15,\n        &quot;expected_settle_date&quot;: &quot;2026-12-31&quot;,\n        &quot;accounts&quot;: [\n          {\n            &quot;id&quot;: &quot;&lt;uuid&gt;&quot;,\n            &quot;currency&quot;: {},\n            &quot;current_balance&quot;: &quot;1234.56&quot;,\n            &quot;opening_balance&quot;: &quot;1234.56&quot;,\n            &quot;opening_balance_date&quot;: &quot;2026-04-01&quot;,\n            &quot;opening_balance_missing&quot;: false,\n            &quot;active&quot;: false,\n            &quot;iban&quot;: &quot;&lt;string&gt;&quot;,\n            &quot;bic&quot;: &quot;&lt;string&gt;&quot;,\n            &quot;account_number&quot;: &quot;&lt;string&gt;&quot;\n          }\n        ],\n        &quot;total_balance&quot;: &quot;1234.56&quot;,\n        &quot;total_balance_currency&quot;: {},\n        &quot;balance_aggregate&quot;: {\n          &quot;contract_version&quot;: &quot;wallet-setup-v1&quot;,\n          &quot;amount&quot;: &quot;1234.56&quot;,\n          &quot;currency&quot;: {},\n          &quot;status&quot;: &quot;complete&quot;,\n          &quot;reasons&quot;: [\n            &quot;home_currency_missing&quot;\n          ],\n          &quot;missing_opening_balance_account_ids&quot;: [\n            &quot;&lt;uuid&gt;&quot;\n          ],\n          &quot;missing_fx_currency_ids&quot;: [\n            &quot;&lt;uuid&gt;&quot;\n          ]\n        },\n        &quot;per_currency&quot;: [\n          {\n            &quot;currency_id&quot;: &quot;&lt;uuid&gt;&quot;,\n            &quot;currency_code&quot;: &quot;USD&quot;,\n            &quot;amount&quot;: &quot;1234.56&quot;\n          }\n        ],\n        &quot;balance_sparkline_30d&quot;: [\n          0\n        ],\n        &quot;balance_trend_30d_percentage&quot;: &quot;-3.2&quot;,\n        &quot;last_transaction_at&quot;: &quot;2026-07-12T12:00:00Z&quot;,\n        &quot;usage_score&quot;: 3.25,\n        &quot;needs_opening_balance_setup&quot;: false,\n        &quot;last_reconciled_at&quot;: &quot;2026-07-12&quot;,\n        &quot;reconciliation_status&quot;: &quot;draft&quot;,\n        &quot;credit_card&quot;: {},\n        &quot;created_at&quot;: &quot;2026-07-12T12:00:00Z&quot;,\n        &quot;updated_at&quot;: &quot;2026-07-12T12:00:00Z&quot;,\n        &quot;archived_at&quot;: &quot;2026-07-12T12:00:00Z&quot;,\n        &quot;is_archived&quot;: false,\n        &quot;created_by&quot;: {}\n      }\n    }\n  ],\n  &quot;meta&quot;: {\n    &quot;pagination&quot;: &quot;&lt;string&gt;&quot;\n  }\n}</pre><h2>Next step</h2><p>Open a feature chapter from the <a href=\"/docs/api/v1\">API overview</a> to see scopes, parameters, complete payloads, and endpoint-specific responses.</p>"}]},{"systemKey":"docs/api/v1/getting-started/errors-and-conventions","slug":"docs/api/v1/getting-started/errors-and-conventions","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Errors and conventions","description":"Shared behavior for authentication, writes, pagination, and failures."},"blocks":[{"id":"209fa5d7-735c-4c55-af33-3c0dd50d2cdc","kind":"hero","anchorId":"overview","title":"Errors and conventions","text":"Shared behavior for authentication, writes, pagination, and failures."},{"id":"777daa79-0b02-4435-83b6-5c72d1eda4c7","kind":"richText","anchorId":"content","html":"<h2>Idempotency</h2><p>Send a unique <code>Idempotency-Key</code> header with the requests that accept it. Reusing a key with a different payload returns a conflict. These operations accept the header:</p><ul><li><a href=\"/docs/api/v1/imports#post-imports\"><code>POST</code> Upload a statement import</a></li><li><a href=\"/docs/api/v1/imports#post-imports-by-id-confirm\"><code>POST</code> Confirm a statement import</a></li><li><a href=\"/docs/api/v1/transaction-templates#post-transaction-templates\"><code>POST</code> Create a transaction template</a></li><li><a href=\"/docs/api/v1/transactions#post-transactions\"><code>POST</code> Create a transaction</a></li><li><a href=\"/docs/api/v1/transactions#patch-transactions-by-id\"><code>PATCH</code> Update a transaction</a></li><li><a href=\"/docs/api/v1/transactions#delete-transactions-by-id\"><code>DELETE</code> Delete a transaction</a></li></ul><h2>Common errors</h2><p>Every error response has the same JSON body: <code>statusCode</code>, a stable machine-readable <code>code</code> (for example <code>VALIDATION_FAILED</code> or <code>PROGRAMMATIC_SCOPE_REQUIRED</code>), an English <code>message</code> meant for logs, optional structured <code>details</code> (for <code>VALIDATION_FAILED</code>, <code>details.errors</code> maps each invalid field to the failed constraints) and <code>request_id</code>. Branch on <code>code</code>, never on <code>message</code>.</p><p>Example <code>400</code> body:</p><pre>{\n  &quot;statusCode&quot;: 400,\n  &quot;code&quot;: &quot;PROGRAMMATIC_PAGINATION_MODE_CONFLICT&quot;,\n  &quot;message&quot;: &quot;after and page are mutually exclusive&quot;,\n  &quot;details&quot;: {\n    &quot;errors&quot;: {\n      &quot;limit&quot;: [\n        &quot;max&quot;\n      ]\n    }\n  },\n  &quot;request_id&quot;: &quot;8cf64dcc-0f73-4f8d-a845-3d80c1040475&quot;\n}</pre><p><strong>Deprecated code spellings.</strong> Codes are SCREAMING_SNAKE. A few codes that <code>v1</code> returned before this convention keep their original lowercase or dotted spelling on <code>v1</code> (for example <code>budget.notFound</code> or <code>transaction.revisionConflict</code>) so existing integrations keep working; they are deprecated and switch to SCREAMING_SNAKE (<code>BUDGET_NOT_FOUND</code>, <code>ENTITY_VERSION_CONFLICT</code>) in the next API version.</p><h2>Status codes</h2><ul><li><code>400</code> Request parameters or payload failed validation. Inspect `code` and `details`.</li><li><code>401</code> The personal access token is missing, invalid, expired, or revoked.</li><li><code>403</code> The token lacks the required scope or no longer has workspace access.</li><li><code>404</code> The resource does not exist in the token workspace or is not visible to this API.</li><li><code>409</code> The idempotency key was reused with a different request or the resource state conflicts.</li><li><code>413</code> The uploaded statement exceeds the 10 MiB limit.</li><li><code>422</code> The payload is syntactically valid but violates a domain constraint.</li><li><code>429</code> The credential exceeded its request rate limit.</li></ul><h2>Pagination</h2><p>Collection endpoints return metadata alongside items. Each one documents the pagination parameters it accepts:</p><ul><li><code>page</code> (number) — accepted by Wallets, Budgets, Transactions, Goals, Recurring rules</li><li><code>limit</code> (number) — accepted by Wallets, Budgets, Transactions, Goals, Imports, Recurring rules</li><li><code>after</code> (string) — accepted by Imports, Transactions</li></ul>"}]},{"systemKey":"docs/api/v1/budgets","slug":"docs/api/v1/budgets","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Budgets API: endpoints and examples","description":"Read budgets together with their status for a period date. List budgets, Get a budget."},"blocks":[{"id":"f0ffea3e-6f6f-4e5e-9ebc-eb7014a1259b","kind":"hero","anchorId":"overview","title":"Budgets","text":"Read budgets together with their status for a period date."},{"id":"aa1c4f83-2b22-4638-b10a-6dee2e9c5988","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Budgets are returned with their status for one period. The period date selects the budget period of each budget and defaults to today in the workspace timezone.</p><p>Lists are paginated with page and limit parameters.</p><h2>Required scopes</h2><ul><li><code>budgets:read</code> — Read budgets and their status.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-budgets\">List budgets</a></li><li><a href=\"#get-budgets-by-id\">Get a budget</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-budgets\"><code>GET</code> List budgets</a> — <code>/api/v1/programmatic/budgets</code></li><li><a href=\"#get-budgets-by-id\"><code>GET</code> Get a budget</a> — <code>/api/v1/programmatic/budgets/{id}</code></li></ul>"},{"id":"cf78fa8f-643f-46b2-b7ab-90a90b6f09cd","kind":"apiReference","anchorId":"get-budgets","apiVersion":"v1","feature":"Budgets","method":"GET","path":"/api/v1/programmatic/budgets","summary":"List budgets","description":"Returns budgets with status for the requested period date.","operationId":"ProgrammaticPlanningController_listBudgets_v1","requiredScope":"budgets:read","parameters":[{"name":"period_date","location":"query","required":false,"schema":"string","description":"Date used to select each budget period. Defaults to today in the workspace timezone.","example":"2026-07-12"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum budgets returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/budgets?period_date=2026-07-12&page=<page>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/budgets?period_date=2026-07-12&page=<page>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/budgets?period_date=2026-07-12&page=<page>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Budgets with status for the selected financial date and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"budgets\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"adjustment\": {},\n        \"name\": \"Groceries\",\n        \"raw_name\": \"Groceries\",\n        \"is_system_seed\": false,\n        \"system_seed_key\": \"<string>\",\n        \"system_seed_source\": \"category_seed\",\n        \"name_customized\": false,\n        \"active\": true,\n        \"period\": \"monthly\",\n        \"rollover_strategy\": \"carry\",\n        \"pacing_strategy\": \"linear\",\n        \"include_recurring_transactions\": false,\n        \"notes\": \"<string>\",\n        \"warning_threshold\": 0,\n        \"accent_color\": \"sky\",\n        \"icon\": \"lucide:shopping-cart\",\n        \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n        \"currency_id\": \"<uuid>\",\n        \"version\": 0,\n        \"currency\": {\n          \"id\": \"<uuid>\",\n          \"code\": \"USD\",\n          \"symbol\": \"$\",\n          \"decimal_places\": 2\n        },\n        \"amount\": \"500.00\",\n        \"base_amount\": \"500.00\",\n        \"order\": 0,\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"created_by\": {},\n        \"category_ids\": [\n          \"<uuid>\"\n        ],\n        \"categories\": [\n          {\n            \"id\": \"<uuid>\",\n            \"name\": \"Groceries\",\n            \"raw_name\": \"Groceries\",\n            \"is_system_seed\": false,\n            \"system_seed_key\": \"<string>\",\n            \"system_seed_source\": \"category_seed\",\n            \"name_customized\": false,\n            \"icon\": \"shopping-cart\",\n            \"accent_color\": \"emerald\"\n          }\n        ],\n        \"current_period\": {}\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"68f30d29-3349-4e7a-b8ce-a990234842ef","kind":"apiReference","anchorId":"get-budgets-by-id","apiVersion":"v1","feature":"Budgets","method":"GET","path":"/api/v1/programmatic/budgets/{id}","summary":"Get a budget","description":"Returns one budget with status for the requested period date.","operationId":"ProgrammaticPlanningController_getBudget_v1","requiredScope":"budgets:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Budget identifier.","example":"<id>"},{"name":"period_date","location":"query","required":false,"schema":"string","description":"Date used to select the budget period. Defaults to today in the workspace timezone.","example":"2026-07-12"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/budgets/<id>?period_date=2026-07-12' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/budgets/<id>?period_date=2026-07-12', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/budgets/<id>?period_date=2026-07-12',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested budget with status for the selected date.","example":"{\n  \"data\": {\n    \"type\": \"budgets\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"adjustment\": {},\n      \"name\": \"Groceries\",\n      \"raw_name\": \"Groceries\",\n      \"is_system_seed\": false,\n      \"system_seed_key\": \"<string>\",\n      \"system_seed_source\": \"category_seed\",\n      \"name_customized\": false,\n      \"active\": true,\n      \"period\": \"monthly\",\n      \"rollover_strategy\": \"carry\",\n      \"pacing_strategy\": \"linear\",\n      \"include_recurring_transactions\": false,\n      \"notes\": \"<string>\",\n      \"warning_threshold\": 0,\n      \"accent_color\": \"sky\",\n      \"icon\": \"lucide:shopping-cart\",\n      \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n      \"currency_id\": \"<uuid>\",\n      \"version\": 0,\n      \"currency\": {\n        \"id\": \"<uuid>\",\n        \"code\": \"USD\",\n        \"symbol\": \"$\",\n        \"decimal_places\": 2\n      },\n      \"amount\": \"500.00\",\n      \"base_amount\": \"500.00\",\n      \"order\": 0,\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"created_by\": {},\n      \"category_ids\": [\n        \"<uuid>\"\n      ],\n      \"categories\": [\n        {\n          \"id\": \"<uuid>\",\n          \"name\": \"Groceries\",\n          \"raw_name\": \"Groceries\",\n          \"is_system_seed\": false,\n          \"system_seed_key\": \"<string>\",\n          \"system_seed_source\": \"category_seed\",\n          \"name_customized\": false,\n          \"icon\": \"shopping-cart\",\n          \"accent_color\": \"emerald\"\n        }\n      ],\n      \"current_period\": {}\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/goals","slug":"docs/api/v1/goals","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Goals API: endpoints and examples","description":"Read savings goals and their progress. List goals, Get a goal."},"blocks":[{"id":"35ee98bb-57b4-40cf-9a48-a872e89d3400","kind":"hero","anchorId":"overview","title":"Goals","text":"Read savings goals and their progress."},{"id":"d74d7cee-88a3-4b8f-a978-141bbc8f703d","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Goals are returned with their status. By default the list shows open goals; pass the all status to include closed goals.</p><p>Lists are paginated with page and limit parameters.</p><h2>Required scopes</h2><ul><li><code>goals:read</code> — Read goals and their progress.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-goals\">List goals</a></li><li><a href=\"#get-goals-by-id\">Get a goal</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-goals\"><code>GET</code> List goals</a> — <code>/api/v1/programmatic/goals</code></li><li><a href=\"#get-goals-by-id\"><code>GET</code> Get a goal</a> — <code>/api/v1/programmatic/goals/{id}</code></li></ul>"},{"id":"b51a3539-fb0d-410d-a008-bb0674cd6216","kind":"apiReference","anchorId":"get-goals","apiVersion":"v1","feature":"Goals","method":"GET","path":"/api/v1/programmatic/goals","summary":"List goals","description":"Returns goals with status filtering and pagination.","operationId":"ProgrammaticPlanningController_listGoals_v1","requiredScope":"goals:read","parameters":[{"name":"status","location":"query","required":false,"schema":"active | achieved | abandoned | all","description":"Goal lifecycle filter. Use `all` to include closed goals.","example":"active"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum goals returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/goals?status=active&page=<page>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/goals?status=active&page=<page>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/goals?status=active&page=<page>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Goals with progress, pace, and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"goals\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"created_by_user_id\": \"<uuid>\",\n        \"name\": \"<string>\",\n        \"raw_name\": \"<string>\",\n        \"is_system_seed\": false,\n        \"system_seed_key\": \"<string>\",\n        \"system_seed_source\": \"category_seed\",\n        \"name_customized\": false,\n        \"icon\": \"<string>\",\n        \"icon_url\": \"<string>\",\n        \"cover_image\": {},\n        \"accent_color\": \"sky\",\n        \"currency_id\": \"<uuid>\",\n        \"currency_code\": \"<string>\",\n        \"currency_symbol\": \"<string>\",\n        \"target_amount\": \"10000.00\",\n        \"monthly_contribution\": \"250.00\",\n        \"current_saved\": \"3200.00\",\n        \"current_saved_unavailable_reason\": \"missing_rate\",\n        \"target_date\": \"2026-07-12\",\n        \"linked_wallet_id\": \"<uuid>\",\n        \"order\": 0,\n        \"status\": \"active\",\n        \"achieved_at\": \"2026-07-12T12:00:00Z\",\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"updated_at\": \"2026-07-12T12:00:00Z\",\n        \"monthly_pace\": \"230.00\",\n        \"expected_completion_date\": \"2026-07-12\",\n        \"on_track\": false,\n        \"pace\": \"on_track\",\n        \"pace_detail\": {},\n        \"auto_contribution\": {},\n        \"suggested_auto_contribution\": {},\n        \"eta_month\": \"2027-03\",\n        \"overdue\": false,\n        \"version\": 0,\n        \"created_by\": {}\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"66cbe378-b6aa-4232-9bb5-d12478a65524","kind":"apiReference","anchorId":"get-goals-by-id","apiVersion":"v1","feature":"Goals","method":"GET","path":"/api/v1/programmatic/goals/{id}","summary":"Get a goal","description":"Returns one goal from the PAT workspace.","operationId":"ProgrammaticPlanningController_getGoal_v1","requiredScope":"goals:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Goal identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/goals/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/goals/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/goals/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested goal with progress and pace details.","example":"{\n  \"data\": {\n    \"type\": \"goals\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"created_by_user_id\": \"<uuid>\",\n      \"name\": \"<string>\",\n      \"raw_name\": \"<string>\",\n      \"is_system_seed\": false,\n      \"system_seed_key\": \"<string>\",\n      \"system_seed_source\": \"category_seed\",\n      \"name_customized\": false,\n      \"icon\": \"<string>\",\n      \"icon_url\": \"<string>\",\n      \"cover_image\": {},\n      \"accent_color\": \"sky\",\n      \"currency_id\": \"<uuid>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"target_amount\": \"10000.00\",\n      \"monthly_contribution\": \"250.00\",\n      \"current_saved\": \"3200.00\",\n      \"current_saved_unavailable_reason\": \"missing_rate\",\n      \"target_date\": \"2026-07-12\",\n      \"linked_wallet_id\": \"<uuid>\",\n      \"order\": 0,\n      \"status\": \"active\",\n      \"achieved_at\": \"2026-07-12T12:00:00Z\",\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\",\n      \"monthly_pace\": \"230.00\",\n      \"expected_completion_date\": \"2026-07-12\",\n      \"on_track\": false,\n      \"pace\": \"on_track\",\n      \"pace_detail\": {},\n      \"auto_contribution\": {},\n      \"suggested_auto_contribution\": {},\n      \"eta_month\": \"2027-03\",\n      \"overdue\": false,\n      \"version\": 0,\n      \"created_by\": {}\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/imports","slug":"docs/api/v1/imports","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Imports API: endpoints and examples","description":"Upload a bank statement, review the parsed preview and confirm it to create transactions. List statement imports, Upload a statement import, Get a…"},"blocks":[{"id":"5e8d46dc-19fa-4650-97cf-c20e5b297452","kind":"hero","anchorId":"overview","title":"Imports","text":"Upload a bank statement, review the parsed preview and confirm it to create transactions."},{"id":"ec6a6707-0e5b-4f5b-9ca9-465be1891b67","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>An import turns a statement file into transactions in two steps. Uploading parses the file for one existing active asset account and returns a preview; nothing is posted yet. Confirming the preview queues transaction creation.</p><p>Statements can be CSV, Excel, OFX, QFX or MT940 files up to 10 MiB. Uploading and confirming require an Idempotency-Key header, so a retried request does not create a second import or a second confirmation.</p><p>Import jobs are listed with cursor pagination: pass the returned cursor as the after parameter to read the next page.</p><h2>Required scopes</h2><ul><li><code>imports:read</code> — Read statement imports and their previews.</li><li><code>imports:create</code> — Upload statements and confirm parsed imports.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#post-imports\">Upload a statement import</a></li><li><a href=\"#get-imports-by-id\">Get a statement import</a></li><li><a href=\"#post-imports-by-id-confirm\">Confirm a statement import</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-imports\"><code>GET</code> List statement imports</a> — <code>/api/v1/programmatic/imports</code></li><li><a href=\"#post-imports\"><code>POST</code> Upload a statement import</a> — <code>/api/v1/programmatic/imports</code></li><li><a href=\"#get-imports-by-id\"><code>GET</code> Get a statement import</a> — <code>/api/v1/programmatic/imports/{id}</code></li><li><a href=\"#post-imports-by-id-confirm\"><code>POST</code> Confirm a statement import</a> — <code>/api/v1/programmatic/imports/{id}/confirm</code></li></ul>"},{"id":"a81a9039-175a-42ea-8077-16fde31ded6c","kind":"apiReference","anchorId":"get-imports","apiVersion":"v1","feature":"Imports","method":"GET","path":"/api/v1/programmatic/imports","summary":"List statement imports","description":"Returns statement imports from the PAT workspace.","operationId":"ProgrammaticImportController_list_v1","requiredScope":"imports:read","parameters":[{"name":"after","location":"query","required":false,"schema":"string","description":"Opaque cursor returned as next_cursor by the previous page.","example":"<after>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum import jobs returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/imports?after=<after>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/imports?after=<after>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/imports?after=<after>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Statement import jobs and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"import_jobs\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"bank_key\": \"revolut\",\n        \"bank_name\": \"Revolut\",\n        \"file_name\": \"statement.csv\",\n        \"file_type\": \"csv\",\n        \"reported_period\": {},\n        \"destination_draft\": {},\n        \"statement_columns\": {},\n        \"total_rows\": 150,\n        \"imported_count\": 148,\n        \"skipped_count\": 1,\n        \"skipped_existing_count\": 1,\n        \"error_count\": 1,\n        \"status\": \"completed\",\n        \"preview_version\": 3,\n        \"parse_options\": {\n          \"amount_semantics\": \"signed_debit_negative\",\n          \"amount_semantics_required\": false\n        },\n        \"error_message\": \"<string>\",\n        \"account_id\": \"<uuid>\",\n        \"preview\": [\n          {\n            \"transaction_id\": \"<uuid>\"\n          }\n        ],\n        \"opening_balance_adjusted\": [\n          {\n            \"account_id\": \"<uuid>\",\n            \"account_name\": \"Main checking\",\n            \"currency_code\": \"USD\",\n            \"reason\": \"pre_opening_import_rows\",\n            \"target_balance\": \"1000.00\",\n            \"balance_as_of_date\": \"2026-07-12\",\n            \"tetri_balance_before\": \"950.00\",\n            \"tetri_balance_after\": \"1000.00\",\n            \"delta\": \"50.00\",\n            \"old_opening_balance\": \"100.00\",\n            \"new_opening_balance\": \"150.00\",\n            \"old_opening_balance_date\": \"2026-07-12\",\n            \"new_opening_balance_date\": \"2026-07-12\"\n          }\n        ],\n        \"reverted_at\": \"2026-07-12T12:00:00Z\",\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"updated_at\": \"2026-07-12T12:00:00Z\"\n      }\n    }\n  ],\n  \"meta\": {\n    \"limit\": 25,\n    \"has_more\": true,\n    \"next_cursor\": \"<opaque-cursor>\",\n    \"total\": 120,\n    \"count\": 25\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"48850a4e-5cdc-4bfc-8502-bd68efe5a535","kind":"apiReference","anchorId":"post-imports","apiVersion":"v1","feature":"Imports","method":"POST","path":"/api/v1/programmatic/imports","summary":"Upload a statement import","description":"Uploads and parses a statement for an existing active asset account.","operationId":"ProgrammaticImportController_upload_v1","requiredScope":"imports:create","parameters":[{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical file and account.","example":"import_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"multipart/form-data","required":true,"description":"Statement file and destination account. Supported files: CSV, Excel, OFX, QFX, and MT940, up to 10 MiB.","example":"{\n  \"account_id\": \"<asset-account-id>\",\n  \"file\": \"<statement.csv>\"\n}","examples":[{"key":"statement","label":"Upload a statement","value":"{\n  \"account_id\": \"<asset-account-id>\",\n  \"file\": \"<statement.csv>\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/imports' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: import_20260722_01J2Y8M4R1' \\\n  --form 'account_id=<uuid>' \\\n  --form 'file=@statement.csv'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst fileInput = document.querySelector('input[type=\"file\"]');\nconst file = fileInput?.files?.[0];\nif (!file) throw new Error('Select a statement file first.');\nconst form = new FormData();\nform.append('account_id', '<uuid>');\nform.append('file', file);\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/imports', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"import_20260722_01J2Y8M4R1\",\n  },\n  body: form,\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/imports',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"import_20260722_01J2Y8M4R1\"},\n    data={\"account_id\": \"<uuid>\"},\n    files={\"file\": open('statement.csv', 'rb')}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"201","description":"Statement uploaded and parsed into an import preview.","example":"{\n  \"data\": {\n    \"type\": \"import_jobs\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"bank_key\": \"revolut\",\n      \"bank_name\": \"Revolut\",\n      \"file_name\": \"statement.csv\",\n      \"file_type\": \"csv\",\n      \"reported_period\": {},\n      \"destination_draft\": {},\n      \"statement_columns\": {},\n      \"total_rows\": 150,\n      \"imported_count\": 148,\n      \"skipped_count\": 1,\n      \"skipped_existing_count\": 1,\n      \"error_count\": 1,\n      \"status\": \"completed\",\n      \"preview_version\": 3,\n      \"parse_options\": {\n        \"amount_semantics\": \"signed_debit_negative\",\n        \"amount_semantics_required\": false\n      },\n      \"error_message\": \"<string>\",\n      \"account_id\": \"<uuid>\",\n      \"preview\": [\n        {\n          \"transaction_id\": \"<uuid>\"\n        }\n      ],\n      \"opening_balance_adjusted\": [\n        {\n          \"account_id\": \"<uuid>\",\n          \"account_name\": \"Main checking\",\n          \"currency_code\": \"USD\",\n          \"reason\": \"pre_opening_import_rows\",\n          \"target_balance\": \"1000.00\",\n          \"balance_as_of_date\": \"2026-07-12\",\n          \"tetri_balance_before\": \"950.00\",\n          \"tetri_balance_after\": \"1000.00\",\n          \"delta\": \"50.00\",\n          \"old_opening_balance\": \"100.00\",\n          \"new_opening_balance\": \"150.00\",\n          \"old_opening_balance_date\": \"2026-07-12\",\n          \"new_opening_balance_date\": \"2026-07-12\"\n        }\n      ],\n      \"reverted_at\": \"2026-07-12T12:00:00Z\",\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\"\n    }\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"413","description":"The uploaded statement exceeds the 10 MiB limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"30eb2715-aaa1-4558-9b28-95edcfe46613","kind":"apiReference","anchorId":"get-imports-by-id","apiVersion":"v1","feature":"Imports","method":"GET","path":"/api/v1/programmatic/imports/{id}","summary":"Get a statement import","description":"Returns one statement import and its available preview.","operationId":"ProgrammaticImportController_findById_v1","requiredScope":"imports:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Statement import job identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/imports/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/imports/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/imports/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested import job and its available parsed preview.","example":"{\n  \"data\": {\n    \"type\": \"import_jobs\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"bank_key\": \"revolut\",\n      \"bank_name\": \"Revolut\",\n      \"file_name\": \"statement.csv\",\n      \"file_type\": \"csv\",\n      \"reported_period\": {},\n      \"destination_draft\": {},\n      \"statement_columns\": {},\n      \"total_rows\": 150,\n      \"imported_count\": 148,\n      \"skipped_count\": 1,\n      \"skipped_existing_count\": 1,\n      \"error_count\": 1,\n      \"status\": \"completed\",\n      \"preview_version\": 3,\n      \"parse_options\": {\n        \"amount_semantics\": \"signed_debit_negative\",\n        \"amount_semantics_required\": false\n      },\n      \"error_message\": \"<string>\",\n      \"account_id\": \"<uuid>\",\n      \"preview\": [\n        {\n          \"transaction_id\": \"<uuid>\"\n        }\n      ],\n      \"opening_balance_adjusted\": [\n        {\n          \"account_id\": \"<uuid>\",\n          \"account_name\": \"Main checking\",\n          \"currency_code\": \"USD\",\n          \"reason\": \"pre_opening_import_rows\",\n          \"target_balance\": \"1000.00\",\n          \"balance_as_of_date\": \"2026-07-12\",\n          \"tetri_balance_before\": \"950.00\",\n          \"tetri_balance_after\": \"1000.00\",\n          \"delta\": \"50.00\",\n          \"old_opening_balance\": \"100.00\",\n          \"new_opening_balance\": \"150.00\",\n          \"old_opening_balance_date\": \"2026-07-12\",\n          \"new_opening_balance_date\": \"2026-07-12\"\n        }\n      ],\n      \"reverted_at\": \"2026-07-12T12:00:00Z\",\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\"\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"5e4c2ce8-ce1b-4b33-b849-6b731d877ef5","kind":"apiReference","anchorId":"post-imports-by-id-confirm","apiVersion":"v1","feature":"Imports","method":"POST","path":"/api/v1/programmatic/imports/{id}/confirm","summary":"Confirm a statement import","description":"Atomically queues a parsed statement preview for transaction creation.","operationId":"ProgrammaticImportController_confirm_v1","requiredScope":"imports:create","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Parsed statement import job identifier.","example":"<id>"},{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical confirmation.","example":"confirm_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"application/json","required":true,"description":"Confirmation options applied atomically when imported transactions are queued.","example":"{\n  \"skip_duplicates\": true\n}","examples":[{"key":"default","label":"Confirm with duplicate protection","value":"{\n  \"skip_duplicates\": true\n}"},{"key":"fallbackCategory","label":"Confirm with a fallback category","value":"{\n  \"skip_duplicates\": true,\n  \"default_category_id\": \"<category-id>\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/imports/<id>/confirm' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: confirm_20260722_01J2Y8M4R1' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"skip_duplicates\": true }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/imports/<id>/confirm', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"confirm_20260722_01J2Y8M4R1\",\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"skip_duplicates\": true\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"skip_duplicates\\\": true\\n}\")\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/imports/<id>/confirm',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"confirm_20260722_01J2Y8M4R1\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"201","description":"Import confirmation accepted and transaction creation queued.","example":"{\n  \"data\": {\n    \"type\": \"import_jobs\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"bank_key\": \"revolut\",\n      \"bank_name\": \"Revolut\",\n      \"file_name\": \"statement.csv\",\n      \"file_type\": \"csv\",\n      \"reported_period\": {},\n      \"destination_draft\": {},\n      \"statement_columns\": {},\n      \"total_rows\": 150,\n      \"imported_count\": 148,\n      \"skipped_count\": 1,\n      \"skipped_existing_count\": 1,\n      \"error_count\": 1,\n      \"status\": \"completed\",\n      \"preview_version\": 3,\n      \"parse_options\": {\n        \"amount_semantics\": \"signed_debit_negative\",\n        \"amount_semantics_required\": false\n      },\n      \"error_message\": \"<string>\",\n      \"account_id\": \"<uuid>\",\n      \"preview\": [\n        {\n          \"transaction_id\": \"<uuid>\"\n        }\n      ],\n      \"opening_balance_adjusted\": [\n        {\n          \"account_id\": \"<uuid>\",\n          \"account_name\": \"Main checking\",\n          \"currency_code\": \"USD\",\n          \"reason\": \"pre_opening_import_rows\",\n          \"target_balance\": \"1000.00\",\n          \"balance_as_of_date\": \"2026-07-12\",\n          \"tetri_balance_before\": \"950.00\",\n          \"tetri_balance_after\": \"1000.00\",\n          \"delta\": \"50.00\",\n          \"old_opening_balance\": \"100.00\",\n          \"new_opening_balance\": \"150.00\",\n          \"old_opening_balance_date\": \"2026-07-12\",\n          \"new_opening_balance_date\": \"2026-07-12\"\n        }\n      ],\n      \"reverted_at\": \"2026-07-12T12:00:00Z\",\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\"\n    }\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/insights","slug":"docs/api/v1/insights","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Insights API: endpoints and examples","description":"Read the insights Tetri generates from the transactions of a financial month. List insights, Get an insight."},"blocks":[{"id":"393dac2c-fb86-4b65-901a-95becfa090a4","kind":"hero","anchorId":"overview","title":"Insights","text":"Read the insights Tetri generates from the transactions of a financial month."},{"id":"aeba12e4-2d96-4ac1-af1f-966aef750af0","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>An insight is a generated observation about spending or income in one financial month. The month is required and uses the YYYY-MM format.</p><p>The list can be restricted to specific accounts. The response includes the time it was produced and the next planned refresh.</p><h2>Required scopes</h2><ul><li><code>insights:read</code> — Read generated insights.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-insights\">List insights</a></li><li><a href=\"#get-insights-by-id\">Get an insight</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-insights\"><code>GET</code> List insights</a> — <code>/api/v1/programmatic/insights</code></li><li><a href=\"#get-insights-by-id\"><code>GET</code> Get an insight</a> — <code>/api/v1/programmatic/insights/{id}</code></li></ul>"},{"id":"bb08594b-4c4c-4cbb-b46e-7de1d9376484","kind":"apiReference","anchorId":"get-insights","apiVersion":"v1","feature":"Insights","method":"GET","path":"/api/v1/programmatic/insights","summary":"List insights","description":"Returns generated insights for the required YYYY-MM period.","operationId":"ProgrammaticInsightsController_listInsights_v1","requiredScope":"insights:read","parameters":[{"name":"account_ids","location":"query","required":false,"schema":"array<string>","description":"Restrict insights to these account identifiers. At most 100 values.","example":"<account_ids>"},{"name":"period","location":"query","required":true,"schema":"string","description":"Required financial month in `YYYY-MM` format.","example":"2026-07"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/insights?account_ids=<account_ids>&period=2026-07' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/insights?account_ids=<account_ids>&period=2026-07', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/insights?account_ids=<account_ids>&period=2026-07',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Generated insights, response timestamp, and the next planned refresh time.","example":"{\n  \"insights\": [\n    {\n      \"id\": \"anomaly_018f8e30-66fd-7e50-a1ef-9c52d11c2baf\",\n      \"type\": \"anomaly\",\n      \"priority\": \"high\",\n      \"triggered_at\": \"2026-07-15T06:03:00.000Z\",\n      \"entity_id\": \"<uuid>\",\n      \"associated_transaction_id\": \"<uuid>\",\n      \"payload\": {}\n    }\n  ],\n  \"generated_at\": \"2026-07-12T12:00:00Z\",\n  \"next_refresh_at\": \"2026-07-12T12:00:00Z\"\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"0666dd22-fa1f-4f3e-abcb-2dcbc9c3496c","kind":"apiReference","anchorId":"get-insights-by-id","apiVersion":"v1","feature":"Insights","method":"GET","path":"/api/v1/programmatic/insights/{id}","summary":"Get an insight","description":"Returns one generated insight from the PAT workspace.","operationId":"ProgrammaticInsightsController_getInsight_v1","requiredScope":"insights:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Stable logical insight key returned by the insights collection. This is not necessarily a UUID.","example":"anomaly_018f8e30-66fd-7e50-a1ef-9c52d11c2baf"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/insights/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/insights/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/insights/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested generated insight.","example":"{\n  \"data\": {\n    \"id\": \"anomaly_018f8e30-66fd-7e50-a1ef-9c52d11c2baf\",\n    \"type\": \"anomaly\",\n    \"priority\": \"high\",\n    \"triggered_at\": \"2026-07-15T06:03:00.000Z\",\n    \"entity_id\": \"<uuid>\",\n    \"associated_transaction_id\": \"<uuid>\",\n    \"payload\": {}\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/recurring","slug":"docs/api/v1/recurring","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Recurring rules API: endpoints and examples","description":"Read recurring rules: automatic transactions and manually tracked subscriptions. List recurring rules, Get a recurring rule."},"blocks":[{"id":"2707802a-c17d-47e7-a042-8ceb935da71a","kind":"hero","anchorId":"overview","title":"Recurring rules","text":"Read recurring rules: automatic transactions and manually tracked subscriptions."},{"id":"2c6c564f-696a-4bb5-9b0b-30334675a791","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>A recurring rule describes a transaction that repeats. Automatic recurring rules and manually tracked subscriptions can be filtered separately with the kind parameter.</p><p>The list can also be filtered by lifecycle status, transaction direction and source account, and is paginated with page and limit parameters.</p><h2>Required scopes</h2><ul><li><code>recurring:read</code> — Read recurring rules.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-recurring-rules\">List recurring rules</a></li><li><a href=\"#get-recurring-rules-by-id\">Get a recurring rule</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-recurring-rules\"><code>GET</code> List recurring rules</a> — <code>/api/v1/programmatic/recurring-rules</code></li><li><a href=\"#get-recurring-rules-by-id\"><code>GET</code> Get a recurring rule</a> — <code>/api/v1/programmatic/recurring-rules/{id}</code></li></ul>"},{"id":"25545707-f705-4ac7-8caf-b9453e29452c","kind":"apiReference","anchorId":"get-recurring-rules","apiVersion":"v1","feature":"Recurring rules","method":"GET","path":"/api/v1/programmatic/recurring-rules","summary":"List recurring rules","description":"Returns recurring rules with bounded filtering and pagination.","operationId":"ProgrammaticPlanningController_listRecurring_v1","requiredScope":"recurring:read","parameters":[{"name":"status","location":"query","required":false,"schema":"active | paused | ended","description":"Return only recurring rules in this lifecycle state.","example":"active"},{"name":"type","location":"query","required":false,"schema":"expense | income | transfer","description":"Return only rules for this transaction direction.","example":"expense"},{"name":"kind","location":"query","required":false,"schema":"rule | subscription","description":"Filter automatic recurring rules separately from manually tracked subscriptions.","example":"rule"},{"name":"account_id","location":"query","required":false,"schema":"string","description":"Return rules that use this source account.","example":"<account_id>"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum recurring rules returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/recurring-rules?status=active&type=expense&kind=rule&account_id=<account_id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/recurring-rules?status=active&type=expense&kind=rule&account_id=<account_id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/recurring-rules?status=active&type=expense&kind=rule&account_id=<account_id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Recurring rules and page metadata.","example":"{\n  \"data\": [\n    {\n      \"id\": \"<uuid>\",\n      \"created_by_user_id\": \"<uuid>\",\n      \"name\": \"<string>\",\n      \"raw_name\": \"<string>\",\n      \"is_system_seed\": false,\n      \"system_seed_key\": \"<string>\",\n      \"system_seed_source\": \"category_seed\",\n      \"name_customized\": false,\n      \"type\": \"expense\",\n      \"kind\": \"rule\",\n      \"amount\": \"49.99\",\n      \"currency_id\": \"<uuid>\",\n      \"currency_code\": \"USD\",\n      \"currency_symbol\": \"$\",\n      \"account_id\": \"<uuid>\",\n      \"account_name\": \"<string>\",\n      \"destination_account_id\": \"<uuid>\",\n      \"destination_account_name\": \"<string>\",\n      \"category_id\": \"<uuid>\",\n      \"category_name\": \"<string>\",\n      \"frequency\": \"monthly\",\n      \"custom_interval_days\": 0,\n      \"start_date\": \"2026-07-12\",\n      \"end_date\": \"2026-07-12\",\n      \"next_occurrence_date\": \"2026-07-12\",\n      \"schedule_anchor_day\": 0,\n      \"status\": \"active\",\n      \"paused_at\": \"2026-07-12T12:00:00Z\",\n      \"pause_until\": \"2026-07-12\",\n      \"auto_create\": false,\n      \"catalog_item_id\": \"<uuid>\",\n      \"billing_url\": \"<string>\",\n      \"plan_name\": \"<string>\",\n      \"trial_end_date\": \"2026-07-12\",\n      \"reminder_days\": 0,\n      \"icon\": \"<string>\",\n      \"icon_url\": \"<string>\",\n      \"accent_color\": \"sky\",\n      \"external_id\": \"<string>\",\n      \"notes\": \"<string>\",\n      \"version\": 0,\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\",\n      \"created_by\": {}\n    }\n  ],\n  \"meta\": {\n    \"total\": 0,\n    \"page\": 0,\n    \"limit\": 0\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"0df15972-54b3-480c-896b-04b7dea6331c","kind":"apiReference","anchorId":"get-recurring-rules-by-id","apiVersion":"v1","feature":"Recurring rules","method":"GET","path":"/api/v1/programmatic/recurring-rules/{id}","summary":"Get a recurring rule","description":"Returns one recurring rule from the PAT workspace.","operationId":"ProgrammaticPlanningController_getRecurring_v1","requiredScope":"recurring:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Recurring rule identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/recurring-rules/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/recurring-rules/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/recurring-rules/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested recurring rule.","example":"{\n  \"data\": {\n    \"id\": \"<uuid>\",\n    \"created_by_user_id\": \"<uuid>\",\n    \"name\": \"<string>\",\n    \"raw_name\": \"<string>\",\n    \"is_system_seed\": false,\n    \"system_seed_key\": \"<string>\",\n    \"system_seed_source\": \"category_seed\",\n    \"name_customized\": false,\n    \"type\": \"expense\",\n    \"kind\": \"rule\",\n    \"amount\": \"49.99\",\n    \"currency_id\": \"<uuid>\",\n    \"currency_code\": \"USD\",\n    \"currency_symbol\": \"$\",\n    \"account_id\": \"<uuid>\",\n    \"account_name\": \"<string>\",\n    \"destination_account_id\": \"<uuid>\",\n    \"destination_account_name\": \"<string>\",\n    \"category_id\": \"<uuid>\",\n    \"category_name\": \"<string>\",\n    \"frequency\": \"monthly\",\n    \"custom_interval_days\": 0,\n    \"start_date\": \"2026-07-12\",\n    \"end_date\": \"2026-07-12\",\n    \"next_occurrence_date\": \"2026-07-12\",\n    \"schedule_anchor_day\": 0,\n    \"status\": \"active\",\n    \"paused_at\": \"2026-07-12T12:00:00Z\",\n    \"pause_until\": \"2026-07-12\",\n    \"auto_create\": false,\n    \"catalog_item_id\": \"<uuid>\",\n    \"billing_url\": \"<string>\",\n    \"plan_name\": \"<string>\",\n    \"trial_end_date\": \"2026-07-12\",\n    \"reminder_days\": 0,\n    \"icon\": \"<string>\",\n    \"icon_url\": \"<string>\",\n    \"accent_color\": \"sky\",\n    \"external_id\": \"<string>\",\n    \"notes\": \"<string>\",\n    \"version\": 0,\n    \"created_at\": \"2026-07-12T12:00:00Z\",\n    \"updated_at\": \"2026-07-12T12:00:00Z\",\n    \"created_by\": {}\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/reports","slug":"docs/api/v1/reports","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Reports API: endpoints and examples","description":"Read cash flow, spending, budget, income and data-quality reports for the token workspace. Get account gaps report, Get anomalies report, Get budget…"},"blocks":[{"id":"9bc0f0ac-2631-426a-8cb7-9120a347d90c","kind":"hero","anchorId":"overview","title":"Reports","text":"Read cash flow, spending, budget, income and data-quality reports for the token workspace."},{"id":"127073e7-30c3-4172-abc5-59fc26135546","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Each report is a read-only snapshot calculated for the workspace that owns the token. Reports that depend on a period take a month, a range or a period parameter; the others describe the current state of the workspace.</p><p>Monetary amounts are returned as decimal strings, so clients can format them without losing precision.</p><p>Data-quality reports such as import health and account gaps show where missing or stale data may affect the other reports.</p><h2>Required scopes</h2><ul><li><code>reports:read</code> — Read analytical and data-quality reports.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-reports-cash-flow-summary\">Get cash flow summary report</a></li><li><a href=\"#get-reports-expense-comparison\">Get expense comparison report</a></li><li><a href=\"#get-reports-budget-performance\">Get budget performance report</a></li><li><a href=\"#get-reports-anomalies\">Get anomalies report</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-reports-account-gaps\"><code>GET</code> Get account gaps report</a> — <code>/api/v1/programmatic/reports/account-gaps</code></li><li><a href=\"#get-reports-anomalies\"><code>GET</code> Get anomalies report</a> — <code>/api/v1/programmatic/reports/anomalies</code></li><li><a href=\"#get-reports-budget-performance\"><code>GET</code> Get budget performance report</a> — <code>/api/v1/programmatic/reports/budget-performance</code></li><li><a href=\"#get-reports-cash-flow-summary\"><code>GET</code> Get cash flow summary report</a> — <code>/api/v1/programmatic/reports/cash-flow-summary</code></li><li><a href=\"#get-reports-category-drift\"><code>GET</code> Get category drift report</a> — <code>/api/v1/programmatic/reports/category-drift</code></li><li><a href=\"#get-reports-category-heatmap\"><code>GET</code> Get category heatmap report</a> — <code>/api/v1/programmatic/reports/category-heatmap</code></li><li><a href=\"#get-reports-expense-comparison\"><code>GET</code> Get expense comparison report</a> — <code>/api/v1/programmatic/reports/expense-comparison</code></li><li><a href=\"#get-reports-import-health\"><code>GET</code> Get import health report</a> — <code>/api/v1/programmatic/reports/import-health</code></li><li><a href=\"#get-reports-income-stability\"><code>GET</code> Get income stability report</a> — <code>/api/v1/programmatic/reports/income-stability</code></li><li><a href=\"#get-reports-recurring-detection\"><code>GET</code> Get recurring detection report</a> — <code>/api/v1/programmatic/reports/recurring-detection</code></li><li><a href=\"#get-reports-savings-runway\"><code>GET</code> Get savings runway report</a> — <code>/api/v1/programmatic/reports/savings-runway</code></li><li><a href=\"#get-reports-spending-velocity\"><code>GET</code> Get spending velocity report</a> — <code>/api/v1/programmatic/reports/spending-velocity</code></li><li><a href=\"#get-reports-transfer-flow\"><code>GET</code> Get transfer flow report</a> — <code>/api/v1/programmatic/reports/transfer-flow</code></li><li><a href=\"#get-reports-uncategorized-clusters\"><code>GET</code> Get uncategorized clusters report</a> — <code>/api/v1/programmatic/reports/uncategorized-clusters</code></li></ul>"},{"id":"081d5998-72d7-4dfb-9734-4c2ba98db18c","kind":"apiReference","anchorId":"get-reports-account-gaps","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/account-gaps","summary":"Get account gaps report","description":"Returns active accounts with stale or missing transaction activity.","operationId":"ProgrammaticReportSnapshotsController_getAccountGaps_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/account-gaps' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/account-gaps', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/account-gaps',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete account gaps report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"account_gaps\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"threshold_days\": 0,\n      \"flagged_accounts\": [\n        {\n          \"account_id\": \"<string>\",\n          \"wallet_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"last_transaction_date\": \"2026-07-12\",\n          \"days_since_last\": 0,\n          \"has_import_history\": false\n        }\n      ],\n      \"total_active_accounts\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"deaf2e75-b60e-4da3-b206-03b8f029dcb8","kind":"apiReference","anchorId":"get-reports-anomalies","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/anomalies","summary":"Get anomalies report","description":"Returns transactions that differ materially from category history.","operationId":"ProgrammaticAnalyticsController_getAnomalies_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Report month. Defaults to the current month in the workspace timezone.","example":"2026-07"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/anomalies?month=2026-07' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/anomalies?month=2026-07', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/anomalies?month=2026-07',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete anomaly detection report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"anomaly_detection\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"anomalies\": [\n        {\n          \"transaction_id\": \"<string>\",\n          \"journal_id\": \"<string>\",\n          \"journal_revision\": \"<string>\",\n          \"description\": \"<string>\",\n          \"date\": \"2026-07-12\",\n          \"amount\": \"<string>\",\n          \"native_amount\": \"<string>\",\n          \"native_currency_code\": \"<string>\",\n          \"native_currency_symbol\": \"<string>\",\n          \"category_id\": \"<string>\",\n          \"category_name\": \"<string>\",\n          \"category_color\": \"<string>\",\n          \"category_avg\": \"<string>\",\n          \"multiplier\": \"<string>\",\n          \"monthly_history\": [\n            {\n              \"month\": \"<string>\",\n              \"amount\": \"<string>\"\n            }\n          ],\n          \"hints\": {\n            \"recategorize\": {\n              \"category_id\": \"<string>\",\n              \"category_name\": \"<string>\",\n              \"keyword\": \"<string>\",\n              \"category_avg\": \"<string>\",\n              \"ratio_after\": \"<string>\"\n            },\n            \"split\": {\n              \"suggested_own_share\": \"<string>\"\n            }\n          }\n        }\n      ],\n      \"operations\": [\n        {\n          \"transaction_id\": \"<string>\",\n          \"date\": \"2026-07-12\",\n          \"category_id\": \"<string>\",\n          \"amount\": \"<string>\",\n          \"ratio\": \"<string>\"\n        }\n      ],\n      \"operations_truncated\": false,\n      \"categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"avg_amount\": \"<string>\",\n          \"normal_count\": 0\n        }\n      ],\n      \"threshold_multiplier\": 0,\n      \"extreme_multiplier\": 0,\n      \"total_amount\": \"<string>\",\n      \"extreme_count\": 0,\n      \"transaction_count\": 0,\n      \"baseline_start\": \"2026-07-12\",\n      \"baseline_end\": \"2026-07-12\",\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"e095af22-848e-4646-b35e-574d19866eba","kind":"apiReference","anchorId":"get-reports-budget-performance","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/budget-performance","summary":"Get budget performance report","description":"Returns budget utilization and pacing for a month.","operationId":"ProgrammaticAnalyticsController_getBudgetPerformance_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Budget month. Defaults to the current month in the workspace timezone.","example":"2026-07"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/budget-performance?month=2026-07' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/budget-performance?month=2026-07', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/budget-performance?month=2026-07',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete budget performance report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"budget_performance\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"days_elapsed\": 0,\n      \"days_in_month\": 0,\n      \"budgets\": [\n        {\n          \"budget_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"budget_amount\": \"<string>\",\n          \"actual_spent\": \"<string>\",\n          \"forecast\": \"<string>\",\n          \"status\": \"on_track\",\n          \"percent_used\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"categories\": [\n            {\n              \"id\": \"<string>\",\n              \"name\": \"<string>\",\n              \"icon_name\": \"<string>\",\n              \"accent_color\": \"<string>\",\n              \"actual_spent\": \"<string>\",\n              \"percentage_of_budget\": \"<string>\"\n            }\n          ]\n        }\n      ],\n      \"summary\": {\n        \"total_budgeted_agg\": {\n          \"per_currency\": [\n            {\n              \"currency_code\": \"<string>\",\n              \"currency_symbol\": \"<string>\",\n              \"currency_decimal_places\": 0,\n              \"amount\": \"<string>\",\n              \"count\": 0\n            }\n          ],\n          \"home_converted\": {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"fx_partial\": false,\n            \"missing_fx_count\": 0,\n            \"rate_date\": \"2026-07-12\"\n          }\n        },\n        \"total_spent_agg\": {\n          \"per_currency\": [\n            {\n              \"currency_code\": \"<string>\",\n              \"currency_symbol\": \"<string>\",\n              \"currency_decimal_places\": 0,\n              \"amount\": \"<string>\",\n              \"count\": 0\n            }\n          ],\n          \"home_converted\": {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"fx_partial\": false,\n            \"missing_fx_count\": 0,\n            \"rate_date\": \"2026-07-12\"\n          }\n        },\n        \"total_forecast_agg\": {\n          \"per_currency\": [\n            {\n              \"currency_code\": \"<string>\",\n              \"currency_symbol\": \"<string>\",\n              \"currency_decimal_places\": 0,\n              \"amount\": \"<string>\",\n              \"count\": 0\n            }\n          ],\n          \"home_converted\": {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"fx_partial\": false,\n            \"missing_fx_count\": 0,\n            \"rate_date\": \"2026-07-12\"\n          }\n        },\n        \"on_track_count\": 0,\n        \"on_edge_count\": 0,\n        \"over_count\": 0,\n        \"fx_partial\": false,\n        \"missing_fx_count\": 0\n      }\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"30d0fe4b-6467-45e9-add6-0ba8a88a62c7","kind":"apiReference","anchorId":"get-reports-cash-flow-summary","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/cash-flow-summary","summary":"Get cash flow summary report","description":"Returns income, expense, savings, and monthly trend aggregates. `monthly_trend` is deprecated and sunsets on 2027-04-01 (see the `Sunset` response header): read `trend_months` instead, which keeps months with a missing exchange rate and marks them `fx_partial`.","operationId":"ProgrammaticAnalyticsController_getCashFlowSummary_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Final report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"range","location":"query","required":false,"schema":"recent | full","description":"`full` is clamped to the history window allowed by the plan.","example":"recent"},{"name":"period","location":"query","required":false,"schema":"6m | 12m","description":"Deprecated compatibility alias. Use `range`.","example":"6m"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/cash-flow-summary?month=2026-07&range=recent&period=6m' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/cash-flow-summary?month=2026-07&range=recent&period=6m', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/cash-flow-summary?month=2026-07&range=recent&period=6m',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete cash flow summary report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"cash_flow_summary\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"target_savings_rate\": \"<string>\",\n      \"total_income_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"total_expenses_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"savings_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"savings_rate\": \"<string>\",\n      \"income_sources\": [\n        {\n          \"account_id\": \"<string>\",\n          \"wallet_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"amount\": \"<string>\",\n          \"percentage\": \"<string>\"\n        }\n      ],\n      \"expense_categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"amount\": \"<string>\",\n          \"percentage\": \"<string>\"\n        }\n      ],\n      \"monthly_trend\": [\n        {\n          \"month\": \"<string>\",\n          \"income\": \"<string>\",\n          \"expenses\": \"<string>\",\n          \"savings\": \"<string>\",\n          \"savings_rate\": \"<string>\"\n        }\n      ],\n      \"trend_months\": [\n        {\n          \"month\": \"<string>\",\n          \"income\": \"<string>\",\n          \"expenses\": \"<string>\",\n          \"savings\": \"<string>\",\n          \"savings_rate\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0\n        }\n      ],\n      \"fx_losses_home\": \"<string>\",\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"35a5874a-a342-4338-990e-0429cff1ead2","kind":"apiReference","anchorId":"get-reports-category-drift","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/category-drift","summary":"Get category drift report","description":"Returns material category spending changes over time.","operationId":"ProgrammaticAnalyticsController_getCategoryDrift_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Final report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"range","location":"query","required":false,"schema":"recent | full","description":"`full` is clamped to the history window allowed by the plan.","example":"recent"},{"name":"period","location":"query","required":false,"schema":"6m | 12m","description":"Deprecated compatibility alias. Use `range`.","example":"6m"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/category-drift?month=2026-07&range=recent&period=6m' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/category-drift?month=2026-07&range=recent&period=6m', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/category-drift?month=2026-07&range=recent&period=6m',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete category drift report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"category_drift\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"period\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"monthly_shares\": [\n            {\n              \"month\": \"<string>\",\n              \"share\": \"<string>\",\n              \"amount\": \"<string>\"\n            }\n          ],\n          \"change_pp\": \"<string>\",\n          \"direction\": \"growing\"\n        }\n      ],\n      \"month_totals\": [\n        {\n          \"month\": \"<string>\",\n          \"amount\": \"<string>\",\n          \"status\": \"complete\"\n        }\n      ],\n      \"drift_threshold_pp\": 0,\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"e9f4fb64-876f-439a-b69f-49bdd0a950ea","kind":"apiReference","anchorId":"get-reports-category-heatmap","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/category-heatmap","summary":"Get category heatmap report","description":"Returns category spending intensity over the selected period.","operationId":"ProgrammaticAnalyticsController_getCategoryHeatmap_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Final report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"range","location":"query","required":false,"schema":"recent | full","description":"`full` is clamped to the history window allowed by the plan.","example":"recent"},{"name":"period","location":"query","required":false,"schema":"6m | 12m","description":"Deprecated compatibility alias. Use `range`.","example":"6m"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/category-heatmap?month=2026-07&range=recent&period=6m' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/category-heatmap?month=2026-07&range=recent&period=6m', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/category-heatmap?month=2026-07&range=recent&period=6m',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete category heatmap report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"category_heatmap\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"period\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"months\": [\n        \"<string>\"\n      ],\n      \"categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"accent_color\": \"<string>\"\n        }\n      ],\n      \"cells\": [\n        [\n          \"<string>\"\n        ]\n      ],\n      \"min_value\": \"<string>\",\n      \"max_value\": \"<string>\",\n      \"period_total_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"4edcfdf6-7696-4890-886e-11d9542c0375","kind":"apiReference","anchorId":"get-reports-expense-comparison","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/expense-comparison","summary":"Get expense comparison report","description":"Compares expense totals between two months.","operationId":"ProgrammaticAnalyticsController_getExpenseComparison_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Primary month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"compare_month","location":"query","required":false,"schema":"string","description":"Comparison month. Defaults to the month before `month`.","example":"2026-06"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/expense-comparison?month=2026-07&compare_month=2026-06' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/expense-comparison?month=2026-07&compare_month=2026-06', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/expense-comparison?month=2026-07&compare_month=2026-06',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete expense comparison report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"expense_comparison\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"compare_month\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"categories\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"accent_color\": \"<string>\",\n          \"current_amount\": \"<string>\",\n          \"previous_amount\": \"<string>\",\n          \"change_amount\": \"<string>\",\n          \"change_percentage\": \"<string>\",\n          \"direction\": \"<string>\",\n          \"trend\": [\n            {\n              \"month\": \"<string>\",\n              \"amount\": \"<string>\"\n            }\n          ],\n          \"budget\": {\n            \"budget_id\": \"<string>\",\n            \"amount\": \"<string>\"\n          }\n        }\n      ],\n      \"total_current_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"total_previous_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"total_change_amount\": \"<string>\",\n      \"total_change_percentage\": \"<string>\",\n      \"biggest_increases\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"change_amount\": \"<string>\",\n          \"change_percentage\": \"<string>\"\n        }\n      ],\n      \"biggest_decreases\": [\n        {\n          \"category_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"icon_name\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"change_amount\": \"<string>\",\n          \"change_percentage\": \"<string>\"\n        }\n      ],\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"08170ccc-9fc4-4d68-bbc7-7d1e5feced0c","kind":"apiReference","anchorId":"get-reports-import-health","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/import-health","summary":"Get import health report","description":"Returns statement import freshness and coverage by account.","operationId":"ProgrammaticReportSnapshotsController_getImportHealth_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/import-health' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/import-health', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/import-health',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete import health report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"import_health\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"overall_score\": 0,\n      \"duplicate_rate\": \"<string>\",\n      \"error_rate\": \"<string>\",\n      \"categorization_rate\": \"<string>\",\n      \"total_imports\": 0,\n      \"accounts\": [\n        {\n          \"account_id\": \"<string>\",\n          \"wallet_id\": \"<string>\",\n          \"account_name\": \"<string>\",\n          \"total_imports\": 0,\n          \"last_import_date\": \"2026-07-12\",\n          \"avg_error_rate\": \"<string>\",\n          \"avg_duplicate_rate\": \"<string>\"\n        }\n      ]\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"3a113013-238a-4935-b7a6-80710f4874f5","kind":"apiReference","anchorId":"get-reports-income-stability","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/income-stability","summary":"Get income stability report","description":"Returns income consistency metrics over the selected period.","operationId":"ProgrammaticAnalyticsController_getIncomeStability_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Final report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"range","location":"query","required":false,"schema":"recent | full","description":"`full` is clamped to the history window allowed by the plan.","example":"recent"},{"name":"period","location":"query","required":false,"schema":"6m | 12m","description":"Deprecated compatibility alias. Use `range`.","example":"6m"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/income-stability?month=2026-07&range=recent&period=6m' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/income-stability?month=2026-07&range=recent&period=6m', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/income-stability?month=2026-07&range=recent&period=6m',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete income stability report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"income_stability\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"period\": \"<string>\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"monthly_incomes\": [\n        {\n          \"month\": \"<string>\",\n          \"amount\": \"<string>\"\n        }\n      ],\n      \"mean\": \"<string>\",\n      \"stddev\": \"<string>\",\n      \"cv\": \"<string>\",\n      \"trend\": \"increasing\",\n      \"forecast_next_month\": \"<string>\",\n      \"total_income_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"e3c44233-1f39-43d1-8dc3-692c066088ac","kind":"apiReference","anchorId":"get-reports-recurring-detection","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/recurring-detection","summary":"Get recurring detection report","description":"Returns transaction patterns that may be recurring.","operationId":"ProgrammaticReportSnapshotsController_getRecurringDetection_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/recurring-detection' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/recurring-detection', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/recurring-detection',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete recurring detection report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"recurring_detection\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"analysis_period_months\": 0,\n      \"detected\": [\n        {\n          \"description_pattern\": \"<string>\",\n          \"suggested_name\": \"<string>\",\n          \"avg_amount\": \"<string>\",\n          \"frequency\": \"weekly\",\n          \"count\": 0,\n          \"last_date\": \"2026-07-12\",\n          \"amount_variance\": \"<string>\",\n          \"suggested_action\": \"create_subscription\"\n        }\n      ],\n      \"total_estimated_monthly_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"cf26f9cc-819a-472c-b5f4-cc0153605791","kind":"apiReference","anchorId":"get-reports-savings-runway","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/savings-runway","summary":"Get savings runway report","description":"Estimates how long current assets cover recent expenses.","operationId":"ProgrammaticReportSnapshotsController_getSavingsRunway_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/savings-runway' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/savings-runway', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/savings-runway',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete savings runway report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"savings_runway\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"total_assets_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"avg_monthly_expenses_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"runway_months\": \"<string>\",\n      \"runway_date\": \"2026-07-12\"\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"779daa91-4a4b-4623-8195-d78f9805a83e","kind":"apiReference","anchorId":"get-reports-spending-velocity","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/spending-velocity","summary":"Get spending velocity report","description":"Returns current-month spending pace and projection.","operationId":"ProgrammaticAnalyticsController_getSpendingVelocity_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Report month. Defaults to the current month in the workspace timezone.","example":"2026-07"},{"name":"scope","location":"query","required":false,"schema":"string","description":"`all` (default) or `group:<category_group_id>`.","example":"group:3f1c…"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/spending-velocity?month=2026-07&scope=group:3f1c…' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/spending-velocity?month=2026-07&scope=group:3f1c…', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/spending-velocity?month=2026-07&scope=group:3f1c…',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete spending velocity report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"spending_velocity\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"daily_cumulative\": [\n        {\n          \"day\": 0,\n          \"date\": \"2026-07-12\",\n          \"cumulative_amount\": \"<string>\"\n        }\n      ],\n      \"total_spent_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"half_spent_day\": 0,\n      \"operation_count\": 0,\n      \"half_spent_trend\": [\n        {\n          \"month\": \"<string>\",\n          \"half_spent_day\": 0\n        }\n      ],\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"21ecf6f9-17ca-42d1-9a96-91156718ead4","kind":"apiReference","anchorId":"get-reports-transfer-flow","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/transfer-flow","summary":"Get transfer flow report","description":"Returns transfer volumes and directions for a month.","operationId":"ProgrammaticAnalyticsController_getTransferFlow_v1","requiredScope":"reports:read","parameters":[{"name":"month","location":"query","required":false,"schema":"string","description":"Report month. Defaults to the current month in the workspace timezone.","example":"2026-07"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/transfer-flow?month=2026-07' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/transfer-flow?month=2026-07', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/transfer-flow?month=2026-07',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete transfer flow report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"transfer_flow\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"month\": \"<string>\",\n      \"home_currency_code\": \"<string>\",\n      \"window_start\": \"2026-07-12\",\n      \"nodes\": [\n        {\n          \"account_id\": \"<string>\",\n          \"wallet_id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"type\": \"<string>\",\n          \"currency_code\": \"<string>\",\n          \"wallet_name\": \"<string>\",\n          \"icon\": \"<string>\",\n          \"icon_url\": \"<string>\",\n          \"accent_color\": \"<string>\"\n        }\n      ],\n      \"links\": [\n        {\n          \"source_id\": \"<string>\",\n          \"target_id\": \"<string>\",\n          \"amount\": \"<string>\"\n        }\n      ],\n      \"transfers\": [\n        {\n          \"journal_id\": \"<string>\",\n          \"transaction_id\": \"<string>\",\n          \"journal_revision\": \"<string>\",\n          \"date\": \"2026-07-12\",\n          \"source_id\": \"<string>\",\n          \"target_id\": \"<string>\",\n          \"native_amount\": \"<string>\",\n          \"native_currency\": \"<string>\",\n          \"dest_amount\": \"<string>\",\n          \"dest_currency\": \"<string>\",\n          \"home_amount\": \"<string>\",\n          \"status\": \"posted\",\n          \"transfer_kind\": \"internal_fx\",\n          \"estimated_rate\": \"<string>\",\n          \"recurring_rule_id\": \"<string>\"\n        }\n      ],\n      \"recurring_routes\": [\n        {\n          \"source_id\": \"<string>\",\n          \"target_id\": \"<string>\",\n          \"rule_id\": \"<string>\",\n          \"frequency\": \"<string>\",\n          \"day\": 0\n        }\n      ],\n      \"total_transferred_agg\": {\n        \"per_currency\": [\n          {\n            \"currency_code\": \"<string>\",\n            \"currency_symbol\": \"<string>\",\n            \"currency_decimal_places\": 0,\n            \"amount\": \"<string>\",\n            \"count\": 0\n          }\n        ],\n        \"home_converted\": {\n          \"currency_code\": \"<string>\",\n          \"currency_symbol\": \"<string>\",\n          \"currency_decimal_places\": 0,\n          \"amount\": \"<string>\",\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0,\n          \"rate_date\": \"2026-07-12\"\n        }\n      },\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"55952b77-a458-49a6-a304-24e455fe7343","kind":"apiReference","anchorId":"get-reports-uncategorized-clusters","apiVersion":"v1","feature":"Reports","method":"GET","path":"/api/v1/programmatic/reports/uncategorized-clusters","summary":"Get uncategorized clusters report","description":"Groups uncategorized transactions by similar descriptions.","operationId":"ProgrammaticReportSnapshotsController_getUncategorizedClusters_v1","requiredScope":"reports:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/reports/uncategorized-clusters' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/reports/uncategorized-clusters', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/reports/uncategorized-clusters',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Complete uncategorized clusters report in a JSON:API resource envelope.","example":"{\n  \"data\": {\n    \"type\": \"uncategorized_clusters\",\n    \"id\": \"<string>\",\n    \"attributes\": {\n      \"analysis_period_end\": \"2026-07-12\",\n      \"analysis_period_start\": \"2026-07-12\",\n      \"currency_code\": \"<string>\",\n      \"currency_symbol\": \"<string>\",\n      \"analysis_period_months\": 0,\n      \"transaction_count\": 0,\n      \"total_uncategorized_count\": 0,\n      \"clusters\": [\n        {\n          \"description_pattern\": \"<string>\",\n          \"count\": 0,\n          \"total_amount\": \"<string>\",\n          \"avg_amount\": \"<string>\",\n          \"last_date\": \"2026-07-12\",\n          \"sample_transaction_ids\": [\n            \"<string>\"\n          ],\n          \"transactions\": [\n            {\n              \"id\": \"<string>\",\n              \"date\": \"2026-07-12\",\n              \"amount\": \"<string>\"\n            }\n          ],\n          \"every_days\": 0,\n          \"last_days_ago\": 0,\n          \"total_amount_agg\": {\n            \"per_currency\": [\n              {\n                \"currency_code\": \"<string>\",\n                \"currency_symbol\": \"<string>\",\n                \"currency_decimal_places\": 0,\n                \"amount\": \"<string>\",\n                \"count\": 0\n              }\n            ],\n            \"home_converted\": {\n              \"currency_code\": \"<string>\",\n              \"currency_symbol\": \"<string>\",\n              \"currency_decimal_places\": 0,\n              \"amount\": \"<string>\",\n              \"fx_partial\": false,\n              \"missing_fx_count\": 0,\n              \"rate_date\": \"2026-07-12\"\n            }\n          },\n          \"fx_partial\": false,\n          \"missing_fx_count\": 0\n        }\n      ],\n      \"one_off_count\": 0,\n      \"fx_partial\": false,\n      \"missing_fx_count\": 0\n    },\n    \"window\": {\n      \"applied_months\": 0,\n      \"earliest_visible_date\": \"2026-07-12\",\n      \"plan\": \"free\",\n      \"requested_range\": \"recent\",\n      \"truncated_by_plan\": false\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/transaction-templates","slug":"docs/api/v1/transaction-templates","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Transaction templates API: endpoints and examples","description":"Create reusable transaction templates. Create a transaction template."},"blocks":[{"id":"11e1d314-139d-42f9-858c-2158735479a4","kind":"hero","anchorId":"overview","title":"Transaction templates","text":"Create reusable transaction templates."},{"id":"a8d6ed31-ff36-4d18-a2c2-7ef612c248a2","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>A template stores defaults for a transaction: direction, wallets, category, amount, description and notes. At least one default besides the direction and the name is required.</p><p>Creating a template requires an Idempotency-Key header, so a retried request does not save the template twice.</p><h2>Required scopes</h2><ul><li><code>transaction_templates:create</code> — Create transaction templates.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#post-transaction-templates\">Create a transaction template</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#post-transaction-templates\"><code>POST</code> Create a transaction template</a> — <code>/api/v1/programmatic/transaction-templates</code></li></ul>"},{"id":"5f5e5db4-97b7-46c7-b8fd-4a51d15167aa","kind":"apiReference","anchorId":"post-transaction-templates","apiVersion":"v1","feature":"Transaction templates","method":"POST","path":"/api/v1/programmatic/transaction-templates","summary":"Create a transaction template","description":"Creates a user-saved transaction template in the PAT workspace. At least one transaction default besides direction and name is required.","operationId":"ProgrammaticTransactionTemplatesController_create_v1","requiredScope":"transaction_templates:create","parameters":[{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical template.","example":"template_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"application/json","required":true,"description":"Reusable transaction defaults. Wallet references are optional; their role depends on the selected direction. Supply at least one wallet, category, amount, description, or notes value.","example":"{\n  \"direction\": \"expense\",\n  \"name\": \"Lunch\",\n  \"source_wallet_id\": \"<asset-wallet-id>\",\n  \"amount_minor\": \"1250\",\n  \"currency_code\": \"USD\",\n  \"description\": \"Weekday lunch\"\n}","examples":[{"key":"expense","label":"Create an expense template","value":"{\n  \"direction\": \"expense\",\n  \"name\": \"Lunch\",\n  \"source_wallet_id\": \"<asset-wallet-id>\",\n  \"amount_minor\": \"1250\",\n  \"currency_code\": \"USD\",\n  \"description\": \"Weekday lunch\"\n}"},{"key":"income","label":"Create an income template","value":"{\n  \"direction\": \"income\",\n  \"name\": \"Salary\",\n  \"target_wallet_id\": \"<asset-wallet-id>\",\n  \"amount_minor\": \"250000\",\n  \"currency_code\": \"USD\"\n}"},{"key":"transfer","label":"Create a transfer template","value":"{\n  \"direction\": \"transfer\",\n  \"name\": \"Monthly savings\",\n  \"source_wallet_id\": \"<checking-wallet-id>\",\n  \"target_wallet_id\": \"<savings-wallet-id>\",\n  \"amount_minor\": \"50000\",\n  \"currency_code\": \"USD\",\n  \"recurrence_preset\": \"monthly\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transaction-templates' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: template_20260722_01J2Y8M4R1' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"direction\": \"expense\", \"name\": \"Lunch\", \"source_wallet_id\": \"<asset-wallet-id>\", \"amount_minor\": \"1250\", \"currency_code\": \"USD\", \"description\": \"Weekday lunch\" }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transaction-templates', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"template_20260722_01J2Y8M4R1\",\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"direction\": \"expense\",\n  \"name\": \"Lunch\",\n  \"source_wallet_id\": \"<asset-wallet-id>\",\n  \"amount_minor\": \"1250\",\n  \"currency_code\": \"USD\",\n  \"description\": \"Weekday lunch\"\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"direction\\\": \\\"expense\\\",\\n  \\\"name\\\": \\\"Lunch\\\",\\n  \\\"source_wallet_id\\\": \\\"<asset-wallet-id>\\\",\\n  \\\"amount_minor\\\": \\\"1250\\\",\\n  \\\"currency_code\\\": \\\"USD\\\",\\n  \\\"description\\\": \\\"Weekday lunch\\\"\\n}\")\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/transaction-templates',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"template_20260722_01J2Y8M4R1\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"201","description":"Transaction template created with resolved references.","example":"{\n  \"data\": {\n    \"id\": \"<uuid>\",\n    \"source\": \"user_saved\",\n    \"name\": \"<string>\",\n    \"direction\": \"income\",\n    \"fields\": {\n      \"sourceWallet\": {},\n      \"targetWallet\": {},\n      \"category\": {},\n      \"amountMinor\": \"1250\",\n      \"currencyCode\": \"USD\",\n      \"description\": \"<string>\",\n      \"notes\": \"<string>\",\n      \"note\": \"<string>\",\n      \"tags\": [\n        \"<string>\"\n      ],\n      \"recurrencePreset\": \"daily\"\n    },\n    \"usageCount\": 0,\n    \"lastUsedAt\": \"2026-07-12T12:00:00Z\"\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"422","description":"The payload is syntactically valid but violates a domain constraint.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/transactions","slug":"docs/api/v1/transactions","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Transactions API: endpoints and examples","description":"List and read posted transactions, parse free text into a draft, and create, correct or delete transactions. List transaction categories, List…"},"blocks":[{"id":"0ea6f588-63bf-4768-8cfb-ccc030450ab1","kind":"hero","anchorId":"overview","title":"Transactions","text":"List and read posted transactions, parse free text into a draft, and create, correct or delete transactions."},{"id":"6f3e7622-bbe2-4ed2-bf25-2ef9690be416","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Listing returns posted, non-archived transactions. Use page for offset pagination or after for cursor pagination; the two are mutually exclusive.</p><p>Parsing turns natural-language text into a canonical transaction draft using the workspace context. It does not create anything, so review the draft before posting it.</p><p>Creating posts one withdrawal, deposit or transfer. The account requirements depend on the type, and an Idempotency-Key header makes the request safe to retry. The categories endpoint lists the categories that can be assigned.</p><p>Updating changes the category, description, date or account of a posted transaction and keeps every other field. Deleting removes it. Both need the revision from the latest read as expected_revision and an Idempotency-Key header.</p><h2>Required scopes</h2><ul><li><code>transactions:read</code> — Read posted transactions and categories, and parse transaction text into a draft.</li><li><code>transactions:create</code> — Create transactions.</li><li><code>transactions:update</code> — Change the category, description, date or account of transactions.</li><li><code>transactions:delete</code> — Delete transactions.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-categories\">List transaction categories</a></li><li><a href=\"#post-transactions-parse\">Parse transaction text</a></li><li><a href=\"#post-transactions\">Create a transaction</a></li><li><a href=\"#get-transactions-by-id\">Get a transaction</a></li><li><a href=\"#patch-transactions-by-id\">Update a transaction</a></li><li><a href=\"#delete-transactions-by-id\">Delete a transaction</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-categories\"><code>GET</code> List transaction categories</a> — <code>/api/v1/programmatic/categories</code></li><li><a href=\"#get-transactions\"><code>GET</code> List transactions</a> — <code>/api/v1/programmatic/transactions</code></li><li><a href=\"#post-transactions\"><code>POST</code> Create a transaction</a> — <code>/api/v1/programmatic/transactions</code></li><li><a href=\"#get-transactions-by-id\"><code>GET</code> Get a transaction</a> — <code>/api/v1/programmatic/transactions/{id}</code></li><li><a href=\"#patch-transactions-by-id\"><code>PATCH</code> Update a transaction</a> — <code>/api/v1/programmatic/transactions/{id}</code></li><li><a href=\"#delete-transactions-by-id\"><code>DELETE</code> Delete a transaction</a> — <code>/api/v1/programmatic/transactions/{id}</code></li><li><a href=\"#post-transactions-parse\"><code>POST</code> Parse transaction text</a> — <code>/api/v1/programmatic/transactions/parse</code></li></ul>"},{"id":"bf3c639b-9a2b-42fb-a6c9-a4575388b736","kind":"apiReference","anchorId":"get-categories","apiVersion":"v1","feature":"Transactions","method":"GET","path":"/api/v1/programmatic/categories","summary":"List transaction categories","description":"Returns active categories that can be assigned while parsing or creating transactions.","operationId":"ProgrammaticReferenceDataController_listCategories_v1","requiredScope":"transactions:read","parameters":[{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum resources returned per page.","example":"<limit>"},{"name":"group_id","location":"query","required":false,"schema":"string","description":"Return active categories from this category group only.","example":"<group_id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/categories?page=<page>&limit=<limit>&group_id=<group_id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/categories?page=<page>&limit=<limit>&group_id=<group_id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/categories?page=<page>&limit=<limit>&group_id=<group_id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Active transaction categories and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"categories\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"version\": 0,\n        \"created_by_user_id\": \"<uuid>\",\n        \"group_id\": \"<uuid>\",\n        \"name\": \"Groceries\",\n        \"icon_name\": \"shopping-cart\",\n        \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n        \"accent_color\": \"emerald\",\n        \"is_archived\": false,\n        \"is_system\": false,\n        \"aliases\": [\n          \"coffee\",\n          \"latte\",\n          \"starbucks\"\n        ],\n        \"order\": 0,\n        \"tx_count\": 42,\n        \"recent_tx_count\": 12,\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"updated_at\": \"2026-07-12T12:00:00Z\",\n        \"spent_agg\": \"<string>\",\n        \"earned_agg\": \"<string>\",\n        \"created_by\": {}\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"74d21a3b-f743-44c7-8664-22ea2570d7fe","kind":"apiReference","anchorId":"get-transactions","apiVersion":"v1","feature":"Transactions","method":"GET","path":"/api/v1/programmatic/transactions","summary":"List transactions","description":"Returns posted, non-archived transactions with offset or cursor pagination.","operationId":"ProgrammaticTransactionsController_list_v1","requiredScope":"transactions:read","parameters":[{"name":"type","location":"query","required":false,"schema":"withdrawal | deposit | transfer | loan_payment","description":"Return only transactions with this journal type.","example":"withdrawal"},{"name":"start","location":"query","required":false,"schema":"string","description":"Inclusive start of the financial date range.","example":"2026-07-01"},{"name":"end","location":"query","required":false,"schema":"string","description":"Inclusive end of the financial date range.","example":"2026-07-31"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based offset page. Mutually exclusive with `after`; omit it for cursor pagination.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum transactions returned per page.","example":"<limit>"},{"name":"query","location":"query","required":false,"schema":"string","description":"Case-insensitive transaction description search.","example":"coffee"},{"name":"account_id","location":"query","required":false,"schema":"string","description":"Return transactions that include this account.","example":"<account_id>"},{"name":"category_id","location":"query","required":false,"schema":"string","description":"Return transactions assigned to this category.","example":"<category_id>"},{"name":"after","location":"query","required":false,"schema":"string","description":"Opaque cursor returned as `meta.next_cursor`. Mutually exclusive with `page`.","example":"<opaque-cursor>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions?type=withdrawal&start=2026-07-01&end=2026-07-31&page=<page>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions?type=withdrawal&start=2026-07-01&end=2026-07-31&page=<page>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/transactions?type=withdrawal&start=2026-07-01&end=2026-07-31&page=<page>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Posted transactions with offset pagination metadata, or cursor metadata when `after` is supplied.","example":"{\n  \"data\": [\n    {\n      \"type\": \"transactions\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"revision\": \"2026-07-12T12:00:00Z\",\n        \"group_title\": \"<string>\",\n        \"execution_status\": \"scheduled\",\n        \"executed_at\": \"2026-07-12T12:00:00Z\",\n        \"archived_at\": \"2026-07-12T12:00:00Z\",\n        \"is_archived\": false,\n        \"created_by\": {},\n        \"transactions\": [\n          {\n            \"transaction_journal_id\": \"<uuid>\",\n            \"type\": \"withdrawal\",\n            \"date\": \"2026-07-12T12:00:00Z\",\n            \"occurred_at\": \"2026-07-12T12:00:00Z\",\n            \"business_date\": \"2026-07-12\",\n            \"timezone\": \"Europe/Tbilisi\",\n            \"description\": \"Grocery shopping\",\n            \"amount\": \"42.50\",\n            \"foreign_amount\": \"45.00\",\n            \"foreign_currency_code\": \"EUR\",\n            \"foreign_currency_symbol\": \"€\",\n            \"currency_code\": \"USD\",\n            \"currency_symbol\": \"$\",\n            \"currency_decimal_places\": 2,\n            \"source_id\": \"<uuid>\",\n            \"source_name\": \"<string>\",\n            \"source_type\": \"asset\",\n            \"destination_id\": \"<uuid>\",\n            \"destination_name\": \"<string>\",\n            \"destination_type\": \"expense\",\n            \"category_id\": \"<uuid>\",\n            \"category_name\": \"<string>\",\n            \"budget_id\": \"<uuid>\",\n            \"budget_name\": \"<string>\",\n            \"tags\": [\n              \"<string>\"\n            ],\n            \"notes\": \"<string>\",\n            \"last_reconciled_at\": \"2026-07-12\",\n            \"reconciled\": false,\n            \"status\": \"posted\",\n            \"estimated_rate\": \"1.05\",\n            \"pending_rate_quote\": {},\n            \"final_rate\": \"1.058\",\n            \"settled_at\": \"2026-07-12T12:00:00Z\",\n            \"splits\": [\n              {\n                \"id\": \"<uuid>\",\n                \"amount\": \"42.50\",\n                \"category_id\": \"<uuid>\",\n                \"note\": \"<string>\",\n                \"tag_ids\": [\n                  \"<uuid>\"\n                ]\n              }\n            ],\n            \"has_splits\": false,\n            \"remainder\": \"0.00\"\n          }\n        ]\n      }\n    }\n  ],\n  \"meta\": \"<string>\"\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"7901f89a-d1ba-4982-b521-7249a4b4bf0a","kind":"apiReference","anchorId":"post-transactions","apiVersion":"v1","feature":"Transactions","method":"POST","path":"/api/v1/programmatic/transactions","summary":"Create a transaction","description":"Creates one withdrawal, deposit, or transfer. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionsController_create_v1","requiredScope":"transactions:create","parameters":[{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","example":"tx_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"application/json","required":true,"description":"One posted withdrawal, deposit, or transfer. Account requirements depend on `type`.","example":"{\n  \"type\": \"withdrawal\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"12.50\",\n  \"description\": \"Lunch\",\n  \"source_account_id\": \"<asset-account-id>\"\n}","examples":[{"key":"withdrawal","label":"Create a withdrawal from an asset account","value":"{\n  \"type\": \"withdrawal\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"12.50\",\n  \"description\": \"Lunch\",\n  \"source_account_id\": \"<asset-account-id>\"\n}"},{"key":"foreignCardCharge","label":"Record a USD purchase charged to a GEL card","value":"{\n  \"type\": \"withdrawal\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"326.40\",\n  \"currency_id\": \"<gel-currency-id>\",\n  \"foreign_amount\": \"120.00\",\n  \"foreign_currency_id\": \"<usd-currency-id>\",\n  \"description\": \"Hotel\",\n  \"source_account_id\": \"<gel-card-account-id>\"\n}"},{"key":"deposit","label":"Create a deposit","value":"{\n  \"type\": \"deposit\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"2500.00\",\n  \"description\": \"Salary\",\n  \"destination_account_id\": \"<asset-account-id>\",\n  \"category_id\": \"<income-category-id>\"\n}"},{"key":"transfer","label":"Create a transfer between accounts","value":"{\n  \"type\": \"transfer\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"500.00\",\n  \"description\": \"Move to savings\",\n  \"source_account_id\": \"<source-account-id>\",\n  \"destination_account_id\": \"<destination-account-id>\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: tx_20260722_01J2Y8M4R1' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"type\": \"withdrawal\", \"date\": \"2026-07-12T12:00:00.000Z\", \"amount\": \"12.50\", \"description\": \"Lunch\", \"source_account_id\": \"<asset-account-id>\" }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"tx_20260722_01J2Y8M4R1\",\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"type\": \"withdrawal\",\n  \"date\": \"2026-07-12T12:00:00.000Z\",\n  \"amount\": \"12.50\",\n  \"description\": \"Lunch\",\n  \"source_account_id\": \"<asset-account-id>\"\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"type\\\": \\\"withdrawal\\\",\\n  \\\"date\\\": \\\"2026-07-12T12:00:00.000Z\\\",\\n  \\\"amount\\\": \\\"12.50\\\",\\n  \\\"description\\\": \\\"Lunch\\\",\\n  \\\"source_account_id\\\": \\\"<asset-account-id>\\\"\\n}\")\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/transactions',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"tx_20260722_01J2Y8M4R1\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"201","description":"Transaction created. The response includes cache side effects and mutation metadata.","example":"{\n  \"data\": {\n    \"type\": \"transactions\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"revision\": \"2026-07-12T12:00:00Z\",\n      \"group_title\": \"<string>\",\n      \"execution_status\": \"scheduled\",\n      \"executed_at\": \"2026-07-12T12:00:00Z\",\n      \"archived_at\": \"2026-07-12T12:00:00Z\",\n      \"is_archived\": false,\n      \"created_by\": {},\n      \"transactions\": [\n        {\n          \"transaction_journal_id\": \"<uuid>\",\n          \"type\": \"withdrawal\",\n          \"date\": \"2026-07-12T12:00:00Z\",\n          \"occurred_at\": \"2026-07-12T12:00:00Z\",\n          \"business_date\": \"2026-07-12\",\n          \"timezone\": \"Europe/Tbilisi\",\n          \"description\": \"Grocery shopping\",\n          \"amount\": \"42.50\",\n          \"foreign_amount\": \"45.00\",\n          \"foreign_currency_code\": \"EUR\",\n          \"foreign_currency_symbol\": \"€\",\n          \"currency_code\": \"USD\",\n          \"currency_symbol\": \"$\",\n          \"currency_decimal_places\": 2,\n          \"source_id\": \"<uuid>\",\n          \"source_name\": \"<string>\",\n          \"source_type\": \"asset\",\n          \"destination_id\": \"<uuid>\",\n          \"destination_name\": \"<string>\",\n          \"destination_type\": \"expense\",\n          \"category_id\": \"<uuid>\",\n          \"category_name\": \"<string>\",\n          \"budget_id\": \"<uuid>\",\n          \"budget_name\": \"<string>\",\n          \"tags\": [\n            \"<string>\"\n          ],\n          \"notes\": \"<string>\",\n          \"last_reconciled_at\": \"2026-07-12\",\n          \"reconciled\": false,\n          \"status\": \"posted\",\n          \"estimated_rate\": \"1.05\",\n          \"pending_rate_quote\": {},\n          \"final_rate\": \"1.058\",\n          \"settled_at\": \"2026-07-12T12:00:00Z\",\n          \"splits\": [\n            {\n              \"id\": \"<uuid>\",\n              \"amount\": \"42.50\",\n              \"category_id\": \"<uuid>\",\n              \"note\": \"<string>\",\n              \"tag_ids\": [\n                \"<uuid>\"\n              ]\n            }\n          ],\n          \"has_splits\": false,\n          \"remainder\": \"0.00\"\n        }\n      ]\n    }\n  },\n  \"meta\": {\n    \"accounts_created\": [\n      {\n        \"wallet_id\": \"<uuid>\",\n        \"account_id\": \"<uuid>\",\n        \"currency_id\": \"<uuid>\"\n      }\n    ]\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"77ffa1af-d66d-4fe2-8736-377c37b78399","kind":"apiReference","anchorId":"get-transactions-by-id","apiVersion":"v1","feature":"Transactions","method":"GET","path":"/api/v1/programmatic/transactions/{id}","summary":"Get a transaction","description":"Returns one posted transaction from the PAT workspace.","operationId":"ProgrammaticTransactionsController_get_v1","requiredScope":"transactions:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Transaction journal identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/transactions/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested posted transaction.","example":"{\n  \"data\": {\n    \"type\": \"transactions\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"revision\": \"2026-07-12T12:00:00Z\",\n      \"group_title\": \"<string>\",\n      \"execution_status\": \"scheduled\",\n      \"executed_at\": \"2026-07-12T12:00:00Z\",\n      \"archived_at\": \"2026-07-12T12:00:00Z\",\n      \"is_archived\": false,\n      \"created_by\": {},\n      \"transactions\": [\n        {\n          \"transaction_journal_id\": \"<uuid>\",\n          \"type\": \"withdrawal\",\n          \"date\": \"2026-07-12T12:00:00Z\",\n          \"occurred_at\": \"2026-07-12T12:00:00Z\",\n          \"business_date\": \"2026-07-12\",\n          \"timezone\": \"Europe/Tbilisi\",\n          \"description\": \"Grocery shopping\",\n          \"amount\": \"42.50\",\n          \"foreign_amount\": \"45.00\",\n          \"foreign_currency_code\": \"EUR\",\n          \"foreign_currency_symbol\": \"€\",\n          \"currency_code\": \"USD\",\n          \"currency_symbol\": \"$\",\n          \"currency_decimal_places\": 2,\n          \"source_id\": \"<uuid>\",\n          \"source_name\": \"<string>\",\n          \"source_type\": \"asset\",\n          \"destination_id\": \"<uuid>\",\n          \"destination_name\": \"<string>\",\n          \"destination_type\": \"expense\",\n          \"category_id\": \"<uuid>\",\n          \"category_name\": \"<string>\",\n          \"budget_id\": \"<uuid>\",\n          \"budget_name\": \"<string>\",\n          \"tags\": [\n            \"<string>\"\n          ],\n          \"notes\": \"<string>\",\n          \"last_reconciled_at\": \"2026-07-12\",\n          \"reconciled\": false,\n          \"status\": \"posted\",\n          \"estimated_rate\": \"1.05\",\n          \"pending_rate_quote\": {},\n          \"final_rate\": \"1.058\",\n          \"settled_at\": \"2026-07-12T12:00:00Z\",\n          \"splits\": [\n            {\n              \"id\": \"<uuid>\",\n              \"amount\": \"42.50\",\n              \"category_id\": \"<uuid>\",\n              \"note\": \"<string>\",\n              \"tag_ids\": [\n                \"<uuid>\"\n              ]\n            }\n          ],\n          \"has_splits\": false,\n          \"remainder\": \"0.00\"\n        }\n      ]\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"39d0ca64-7a06-4712-b018-7ec10363037d","kind":"apiReference","anchorId":"patch-transactions-by-id","apiVersion":"v1","feature":"Transactions","method":"PATCH","path":"/api/v1/programmatic/transactions/{id}","summary":"Update a transaction","description":"Changes the category, description, date or account of one posted transaction; every other field is kept. Read `revision` first and send it as `expected_revision`. Transactions with amount splits are rejected, and only a withdrawal or deposit can change its account. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionEditsController_update_v1","requiredScope":"transactions:update","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Transaction journal identifier.","example":"<id>"},{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","example":"tx_20260722_01J2Y8M4R1"}],"requestBody":{"contentType":"application/json","required":true,"description":"The fields to change and the `revision` from the latest read. Omitted fields keep their value; `category_id: null` removes the category.","example":"{\n  \"expected_revision\": \"2026-07-12T12:00:00.000Z\",\n  \"category_id\": \"<category-id>\"\n}","examples":[{"key":"categorize","label":"Set the category of a transaction","value":"{\n  \"expected_revision\": \"2026-07-12T12:00:00.000Z\",\n  \"category_id\": \"<category-id>\"\n}"},{"key":"fix","label":"Correct the description and date","value":"{\n  \"expected_revision\": \"2026-07-12T12:00:00.000Z\",\n  \"description\": \"Lunch with team\",\n  \"date\": \"2026-07-11T12:00:00.000Z\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request PATCH \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: tx_20260722_01J2Y8M4R1' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"expected_revision\": \"2026-07-12T12:00:00.000Z\", \"category_id\": \"<category-id>\" }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions/<id>', {\n  method: 'PATCH',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"tx_20260722_01J2Y8M4R1\",\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"expected_revision\": \"2026-07-12T12:00:00.000Z\",\n  \"category_id\": \"<category-id>\"\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"expected_revision\\\": \\\"2026-07-12T12:00:00.000Z\\\",\\n  \\\"category_id\\\": \\\"<category-id>\\\"\\n}\")\n\nresponse = requests.patch('https://api.tetri.app/api/v1/programmatic/transactions/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"tx_20260722_01J2Y8M4R1\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Transaction updated. The response includes cache side effects and mutation metadata.","example":"{\n  \"data\": {\n    \"type\": \"transactions\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"revision\": \"2026-07-12T12:00:00Z\",\n      \"group_title\": \"<string>\",\n      \"execution_status\": \"scheduled\",\n      \"executed_at\": \"2026-07-12T12:00:00Z\",\n      \"archived_at\": \"2026-07-12T12:00:00Z\",\n      \"is_archived\": false,\n      \"created_by\": {},\n      \"transactions\": [\n        {\n          \"transaction_journal_id\": \"<uuid>\",\n          \"type\": \"withdrawal\",\n          \"date\": \"2026-07-12T12:00:00Z\",\n          \"occurred_at\": \"2026-07-12T12:00:00Z\",\n          \"business_date\": \"2026-07-12\",\n          \"timezone\": \"Europe/Tbilisi\",\n          \"description\": \"Grocery shopping\",\n          \"amount\": \"42.50\",\n          \"foreign_amount\": \"45.00\",\n          \"foreign_currency_code\": \"EUR\",\n          \"foreign_currency_symbol\": \"€\",\n          \"currency_code\": \"USD\",\n          \"currency_symbol\": \"$\",\n          \"currency_decimal_places\": 2,\n          \"source_id\": \"<uuid>\",\n          \"source_name\": \"<string>\",\n          \"source_type\": \"asset\",\n          \"destination_id\": \"<uuid>\",\n          \"destination_name\": \"<string>\",\n          \"destination_type\": \"expense\",\n          \"category_id\": \"<uuid>\",\n          \"category_name\": \"<string>\",\n          \"budget_id\": \"<uuid>\",\n          \"budget_name\": \"<string>\",\n          \"tags\": [\n            \"<string>\"\n          ],\n          \"notes\": \"<string>\",\n          \"last_reconciled_at\": \"2026-07-12\",\n          \"reconciled\": false,\n          \"status\": \"posted\",\n          \"estimated_rate\": \"1.05\",\n          \"pending_rate_quote\": {},\n          \"final_rate\": \"1.058\",\n          \"settled_at\": \"2026-07-12T12:00:00Z\",\n          \"splits\": [\n            {\n              \"id\": \"<uuid>\",\n              \"amount\": \"42.50\",\n              \"category_id\": \"<uuid>\",\n              \"note\": \"<string>\",\n              \"tag_ids\": [\n                \"<uuid>\"\n              ]\n            }\n          ],\n          \"has_splits\": false,\n          \"remainder\": \"0.00\"\n        }\n      ]\n    }\n  },\n  \"meta\": {\n    \"accounts_created\": [\n      {\n        \"wallet_id\": \"<uuid>\",\n        \"account_id\": \"<uuid>\",\n        \"currency_id\": \"<uuid>\"\n      }\n    ]\n  },\n  \"side_effects\": [\n    {\n      \"domain\": \"wallets\",\n      \"id\": \"<string>\",\n      \"action\": \"upsert\",\n      \"data\": {}\n    }\n  ]\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"33ed2df3-ae80-4aeb-9594-e23e8443d407","kind":"apiReference","anchorId":"delete-transactions-by-id","apiVersion":"v1","feature":"Transactions","method":"DELETE","path":"/api/v1/programmatic/transactions/{id}","summary":"Delete a transaction","description":"Soft-deletes one posted transaction. Read `revision` first and send it as the `expected_revision` query parameter. The request is replay-safe per PAT and idempotency key.","operationId":"ProgrammaticTransactionEditsController_delete_v1","requiredScope":"transactions:delete","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Transaction journal identifier.","example":"<id>"},{"name":"expected_revision","location":"query","required":true,"schema":"string","description":"The `revision` returned by the latest read of this transaction. A stale value is rejected with 409.","example":"<expected_revision>"},{"name":"Idempotency-Key","location":"header","required":true,"schema":"string","description":"Unique 16–128 character retry key. Reuse it only when retrying the identical request.","example":"tx_20260722_01J2Y8M4R1"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request DELETE \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions/<id>?expected_revision=<expected_revision>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Idempotency-Key: tx_20260722_01J2Y8M4R1'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions/<id>?expected_revision=<expected_revision>', {\n  method: 'DELETE',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Idempotency-Key': \"tx_20260722_01J2Y8M4R1\",\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.delete('https://api.tetri.app/api/v1/programmatic/transactions/<id>?expected_revision=<expected_revision>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Idempotency-Key\": \"tx_20260722_01J2Y8M4R1\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Transaction deleted.","example":"{\n  \"data\": {\n    \"id\": \"<uuid>\",\n    \"deleted\": true\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"409","description":"The idempotency key was reused with a different request or the resource state conflicts.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"6185f9e7-b6e3-40ad-a350-9142cd21e49a","kind":"apiReference","anchorId":"post-transactions-parse","apiVersion":"v1","feature":"Transactions","method":"POST","path":"/api/v1/programmatic/transactions/parse","summary":"Parse transaction text","description":"Parses natural-language text into a canonical transaction draft using the PAT workspace context.","operationId":"ProgrammaticTransactionsController_parse_v1","requiredScope":"transactions:read","parameters":[],"requestBody":{"contentType":"application/json","required":true,"description":"Natural-language input plus optional locale, timezone, date anchor, and current form context.","example":"{\n  \"text\": \"wolt 42 gel yesterday\",\n  \"locale\": \"en\",\n  \"timezone\": \"Asia/Tbilisi\",\n  \"reference_date\": \"2026-07-22\"\n}","examples":[{"key":"shortExpense","label":"Parse a short expense","value":"{\n  \"text\": \"wolt 42 gel yesterday\",\n  \"locale\": \"en\",\n  \"timezone\": \"Asia/Tbilisi\",\n  \"reference_date\": \"2026-07-22\"\n}"},{"key":"transfer","label":"Parse a transfer with known accounts","value":"{\n  \"text\": \"transfer 500 usd from checking to savings today\",\n  \"locale\": \"en\",\n  \"client_context\": {\n    \"type\": \"transfer\",\n    \"source_account_id\": \"<source-account-id>\",\n    \"destination_account_id\": \"<destination-account-id>\"\n  }\n}"},{"key":"voice","label":"Parse speech recognition text","value":"{\n  \"text\": \"кофе триста рублей сегодня утром\",\n  \"locale\": \"ru\",\n  \"input_mode\": \"voice\",\n  \"timezone\": \"Europe/Moscow\"\n}"}]},"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request POST \\\n  --url 'https://api.tetri.app/api/v1/programmatic/transactions/parse' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"text\": \"wolt 42 gel yesterday\", \"locale\": \"en\", \"timezone\": \"Asia/Tbilisi\", \"reference_date\": \"2026-07-22\" }'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/transactions/parse', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n    'Content-Type': \"application/json\",\n  },\n  body: JSON.stringify({\n  \"text\": \"wolt 42 gel yesterday\",\n  \"locale\": \"en\",\n  \"timezone\": \"Asia/Tbilisi\",\n  \"reference_date\": \"2026-07-22\"\n}),\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import json\nimport os\nimport requests\n\npayload = json.loads(\"{\\n  \\\"text\\\": \\\"wolt 42 gel yesterday\\\",\\n  \\\"locale\\\": \\\"en\\\",\\n  \\\"timezone\\\": \\\"Asia/Tbilisi\\\",\\n  \\\"reference_date\\\": \\\"2026-07-22\\\"\\n}\")\n\nresponse = requests.post('https://api.tetri.app/api/v1/programmatic/transactions/parse',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\", \"Content-Type\": \"application/json\"},\n    json=payload\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Canonical natural-language transaction draft parse.","example":"{\n  \"data\": {\n    \"type\": \"nl_transaction_parse\",\n    \"id\": null,\n    \"attributes\": {\n      \"normalized_text\": \"wolt 42 gel yesterday\",\n      \"tokens\": [\n        {\n          \"index\": 0,\n          \"raw\": \"wolt\",\n          \"normalized\": \"wolt\",\n          \"start\": 0,\n          \"end\": 4,\n          \"kind\": \"word\"\n        }\n      ],\n      \"candidates\": [\n        {\n          \"id\": \"amount:1:2:42\",\n          \"field\": \"amount\",\n          \"value\": \"42\",\n          \"label\": \"42\",\n          \"source\": \"static\",\n          \"match_kind\": \"exact_alias\",\n          \"span_start\": 1,\n          \"span_end\": 2,\n          \"score\": 1,\n          \"metadata\": {}\n        }\n      ],\n      \"selected\": [\n        {\n          \"id\": \"amount:1:2:42\",\n          \"field\": \"amount\",\n          \"value\": \"42\",\n          \"label\": \"42\",\n          \"source\": \"static\",\n          \"match_kind\": \"exact_alias\",\n          \"span_start\": 1,\n          \"span_end\": 2,\n          \"score\": 1,\n          \"metadata\": {}\n        }\n      ],\n      \"draft\": {\n        \"type\": \"withdrawal\",\n        \"amount\": \"42\",\n        \"currency_id\": \"<uuid>\",\n        \"currency_code\": \"GEL\",\n        \"date\": \"2026-07-12\",\n        \"occurred_at\": \"2026-07-12T12:00:00Z\",\n        \"timezone\": \"Asia/Tbilisi\",\n        \"source_wallet_id\": \"<uuid>\",\n        \"source_account_id\": \"<uuid>\",\n        \"destination_wallet_id\": \"<uuid>\",\n        \"destination_account_id\": \"<uuid>\",\n        \"category_id\": \"<uuid>\",\n        \"tags\": [\n          \"<string>\"\n        ],\n        \"description\": \"wolt\"\n      },\n      \"confidence\": \"high\",\n      \"missing_fields\": [\n        {\n          \"field\": \"amount\",\n          \"reason\": \"missing\",\n          \"can_use_default\": false\n        }\n      ],\n      \"alternatives\": [\n        {\n          \"field\": \"amount\",\n          \"candidates\": [\n            {\n              \"id\": \"amount:1:2:42\",\n              \"field\": \"amount\",\n              \"value\": \"42\",\n              \"label\": \"42\",\n              \"source\": \"static\",\n              \"match_kind\": \"exact_alias\",\n              \"span_start\": 1,\n              \"span_end\": 2,\n              \"score\": 1,\n              \"metadata\": {}\n            }\n          ]\n        }\n      ],\n      \"warnings\": [\n        \"invalid_local_time\"\n      ],\n      \"dictionary_version\": \"nl-tx-v5-2026-07-17\"\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]},{"systemKey":"docs/api/v1/wallets","slug":"docs/api/v1/wallets","type":"article","meta":{"eagerBlocks":2,"tags":["documentation","docs","public-api","generated"],"templateSection":"documentation"},"seo":{"title":"Wallets API: endpoints and examples","description":"Read asset wallets, their accounts and balances, and the currency catalog. List transaction accounts, List transaction currencies, List asset wallets."},"blocks":[{"id":"c417e5ac-f21c-47ff-a340-fc383ea2b265","kind":"hero","anchorId":"overview","title":"Wallets","text":"Read asset wallets, their accounts and balances, and the currency catalog."},{"id":"834939f4-b62d-48c0-8c14-21218b1797a5","kind":"richText","anchorId":"intro","html":"<h2>Overview</h2><p>Wallet responses include the accounts of each active asset wallet and their balances.</p><p>The accounts endpoint lists the active asset accounts you can use as the source or destination of a transaction or as the target of an import. The currencies endpoint lists the currency catalog for the workspace, including the enabled and primary flags.</p><h2>Required scopes</h2><ul><li><code>wallets:read</code> — Read wallets, accounts, balances and the currency catalog.</li></ul><p>See <a href=\"/docs/api/v1/getting-started/scopes\">Scopes</a> for how scopes are granted.</p><h2>Typical workflow</h2><ol><li><a href=\"#get-wallets\">List asset wallets</a></li><li><a href=\"#get-wallets-by-id\">Get an asset wallet</a></li><li><a href=\"#get-accounts\">List transaction accounts</a></li></ol><h2>Endpoints</h2><ul><li><a href=\"#get-accounts\"><code>GET</code> List transaction accounts</a> — <code>/api/v1/programmatic/accounts</code></li><li><a href=\"#get-currencies\"><code>GET</code> List transaction currencies</a> — <code>/api/v1/programmatic/currencies</code></li><li><a href=\"#get-wallets\"><code>GET</code> List asset wallets</a> — <code>/api/v1/programmatic/wallets</code></li><li><a href=\"#get-wallets-by-id\"><code>GET</code> Get an asset wallet</a> — <code>/api/v1/programmatic/wallets/{id}</code></li></ul>"},{"id":"bc88eb82-f631-46e6-840a-416556ec226e","kind":"apiReference","anchorId":"get-accounts","apiVersion":"v1","feature":"Wallets","method":"GET","path":"/api/v1/programmatic/accounts","summary":"List transaction accounts","description":"Returns active asset accounts that can be used as transaction source or destination identifiers.","operationId":"ProgrammaticReferenceDataController_listAccounts_v1","requiredScope":"wallets:read","parameters":[{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum resources returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/accounts?page=<page>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/accounts?page=<page>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/accounts?page=<page>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Active asset accounts and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"accounts\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"name\": \"Checking (USD)\",\n        \"type\": \"asset\",\n        \"account_role\": \"defaultAsset\",\n        \"currency_id\": \"<uuid>\",\n        \"currency_code\": \"USD\",\n        \"currency_symbol\": \"$\",\n        \"currency_decimal_places\": 2,\n        \"current_balance\": \"1250.00\",\n        \"native_current_balance\": \"1250.00\",\n        \"active\": true,\n        \"notes\": \"<string>\",\n        \"liability_type\": \"<string>\",\n        \"iban\": \"<string>\",\n        \"account_number\": \"<string>\",\n        \"bic\": \"<string>\",\n        \"opening_balance\": \"0.00\",\n        \"opening_balance_missing\": false,\n        \"opening_balance_date\": \"2025-01-01\",\n        \"virtual_balance\": \"0.00\",\n        \"include_net_worth\": true,\n        \"credit_card_type\": \"<string>\",\n        \"first_payment_date\": \"2026-05-15\",\n        \"payment_day_of_month\": 15,\n        \"interest\": \"0.00\",\n        \"interest_period\": \"monthly\",\n        \"scheduled_payment_amount\": \"1066.20\",\n        \"liability_direction\": \"<string>\",\n        \"expected_settle_date\": \"2026-09-15\",\n        \"order\": 0,\n        \"icon\": \"<string>\",\n        \"icon_color\": \"#3366ff\",\n        \"group_id\": \"<uuid>\",\n        \"group_name\": \"<string>\",\n        \"wallet_id\": \"<uuid>\"\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"5ddf6dc3-4df7-414b-baba-9806be14a438","kind":"apiReference","anchorId":"get-currencies","apiVersion":"v1","feature":"Wallets","method":"GET","path":"/api/v1/programmatic/currencies","summary":"List transaction currencies","description":"Returns the currency catalog ordered for the PAT workspace, including enabled and primary flags.","operationId":"ProgrammaticReferenceDataController_listCurrencies_v1","requiredScope":"wallets:read","parameters":[],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/currencies' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/currencies', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/currencies',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Currency catalog and workspace availability metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"currencies\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"code\": \"USD\",\n        \"name\": \"US Dollar\",\n        \"symbol\": \"$\",\n        \"enabled\": false,\n        \"default\": false,\n        \"decimal_places\": 2,\n        \"kind\": \"fiat\",\n        \"coingecko_id\": \"bitcoin\",\n        \"icon_url\": \"/api/v1/public/currency-icons/BTC.webp?v=8e8f5ec9a89b8d78\",\n        \"is_custom\": false,\n        \"auto_rate\": false\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"823e3c00-2493-440b-9829-6d1deb18aea8","kind":"apiReference","anchorId":"get-wallets","apiVersion":"v1","feature":"Wallets","method":"GET","path":"/api/v1/programmatic/wallets","summary":"List asset wallets","description":"Returns active asset wallets and their account balances.","operationId":"ProgrammaticWalletsController_list_v1","requiredScope":"wallets:read","parameters":[{"name":"group_id","location":"query","required":false,"schema":"string","description":"Return wallets from this wallet group only.","example":"<group_id>"},{"name":"page","location":"query","required":false,"schema":"number","description":"One-based result page.","example":"<page>"},{"name":"limit","location":"query","required":false,"schema":"number","description":"Maximum wallets returned per page.","example":"<limit>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/wallets?group_id=<group_id>&page=<page>&limit=<limit>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/wallets?group_id=<group_id>&page=<page>&limit=<limit>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/wallets?group_id=<group_id>&page=<page>&limit=<limit>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"Active asset wallets with account balances and pagination metadata.","example":"{\n  \"data\": [\n    {\n      \"type\": \"wallets\",\n      \"id\": \"<uuid>\",\n      \"attributes\": {\n        \"version\": 0,\n        \"created_by_user_id\": \"<uuid>\",\n        \"name\": \"Main checking\",\n        \"type\": \"bank\",\n        \"money_place_kind\": \"bank_account\",\n        \"icon\": \"wallet\",\n        \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n        \"accent_color\": \"sky\",\n        \"group_id\": \"<uuid>\",\n        \"include_net_worth\": false,\n        \"notes\": \"<string>\",\n        \"order\": 0,\n        \"liability_type\": \"credit_card\",\n        \"liability_direction\": \"outgoing\",\n        \"interest\": \"5.25\",\n        \"interest_period\": \"yearly\",\n        \"term_periods\": 360,\n        \"repayment_type\": \"french\",\n        \"scheduled_payment_amount\": \"1066.20\",\n        \"first_payment_date\": \"2026-06-15\",\n        \"payment_day_of_month\": 15,\n        \"expected_settle_date\": \"2026-12-31\",\n        \"accounts\": [\n          {\n            \"id\": \"<uuid>\",\n            \"currency\": {},\n            \"current_balance\": \"1234.56\",\n            \"opening_balance\": \"1234.56\",\n            \"opening_balance_date\": \"2026-04-01\",\n            \"opening_balance_missing\": false,\n            \"active\": false,\n            \"iban\": \"<string>\",\n            \"bic\": \"<string>\",\n            \"account_number\": \"<string>\"\n          }\n        ],\n        \"total_balance\": \"1234.56\",\n        \"total_balance_currency\": {},\n        \"balance_aggregate\": {\n          \"contract_version\": \"wallet-setup-v1\",\n          \"amount\": \"1234.56\",\n          \"currency\": {},\n          \"status\": \"complete\",\n          \"reasons\": [\n            \"home_currency_missing\"\n          ],\n          \"missing_opening_balance_account_ids\": [\n            \"<uuid>\"\n          ],\n          \"missing_fx_currency_ids\": [\n            \"<uuid>\"\n          ]\n        },\n        \"per_currency\": [\n          {\n            \"currency_id\": \"<uuid>\",\n            \"currency_code\": \"USD\",\n            \"amount\": \"1234.56\"\n          }\n        ],\n        \"balance_sparkline_30d\": [\n          0\n        ],\n        \"balance_trend_30d_percentage\": \"-3.2\",\n        \"last_transaction_at\": \"2026-07-12T12:00:00Z\",\n        \"usage_score\": 3.25,\n        \"needs_opening_balance_setup\": false,\n        \"last_reconciled_at\": \"2026-07-12\",\n        \"reconciliation_status\": \"draft\",\n        \"credit_card\": {},\n        \"created_at\": \"2026-07-12T12:00:00Z\",\n        \"updated_at\": \"2026-07-12T12:00:00Z\",\n        \"archived_at\": \"2026-07-12T12:00:00Z\",\n        \"is_archived\": false,\n        \"created_by\": {}\n      }\n    }\n  ],\n  \"meta\": {\n    \"pagination\": \"<string>\"\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]},{"id":"0ca80e52-a395-44b5-a190-9e9463142f35","kind":"apiReference","anchorId":"get-wallets-by-id","apiVersion":"v1","feature":"Wallets","method":"GET","path":"/api/v1/programmatic/wallets/{id}","summary":"Get an asset wallet","description":"Returns one active asset wallet from the PAT workspace.","operationId":"ProgrammaticWalletsController_get_v1","requiredScope":"wallets:read","parameters":[{"name":"id","location":"path","required":true,"schema":"string","description":"Asset wallet identifier.","example":"<id>"}],"codeSamples":[{"language":"curl","label":"cURL","code":"curl --request GET \\\n  --url 'https://api.tetri.app/api/v1/programmatic/wallets/<id>' \\\n  --header 'Authorization: Bearer $TETRI_API_TOKEN'"},{"language":"javascript","label":"JavaScript","code":"const token = '<personal-access-token>';\nconst response = await fetch('https://api.tetri.app/api/v1/programmatic/wallets/<id>', {\n  method: 'GET',\n  headers: {\n    'Authorization': `Bearer ${token}`,\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`Tetri API returned ${response.status}`);\n}\n\nconst data = await response.json();"},{"language":"python","label":"Python","code":"import os\nimport requests\n\nresponse = requests.get('https://api.tetri.app/api/v1/programmatic/wallets/<id>',\n    headers={\"Authorization\": f\"Bearer {os.environ['TETRI_API_TOKEN']}\"}\n)\nresponse.raise_for_status()\ndata = response.json()"}],"responses":[{"statusCode":"200","description":"The requested active asset wallet and its account balances.","example":"{\n  \"data\": {\n    \"type\": \"wallets\",\n    \"id\": \"<uuid>\",\n    \"attributes\": {\n      \"version\": 0,\n      \"created_by_user_id\": \"<uuid>\",\n      \"name\": \"Main checking\",\n      \"type\": \"bank\",\n      \"money_place_kind\": \"bank_account\",\n      \"icon\": \"wallet\",\n      \"icon_url\": \"https://cdn.tetri.app/icons/abc.webp\",\n      \"accent_color\": \"sky\",\n      \"group_id\": \"<uuid>\",\n      \"include_net_worth\": false,\n      \"notes\": \"<string>\",\n      \"order\": 0,\n      \"liability_type\": \"credit_card\",\n      \"liability_direction\": \"outgoing\",\n      \"interest\": \"5.25\",\n      \"interest_period\": \"yearly\",\n      \"term_periods\": 360,\n      \"repayment_type\": \"french\",\n      \"scheduled_payment_amount\": \"1066.20\",\n      \"first_payment_date\": \"2026-06-15\",\n      \"payment_day_of_month\": 15,\n      \"expected_settle_date\": \"2026-12-31\",\n      \"accounts\": [\n        {\n          \"id\": \"<uuid>\",\n          \"currency\": {},\n          \"current_balance\": \"1234.56\",\n          \"opening_balance\": \"1234.56\",\n          \"opening_balance_date\": \"2026-04-01\",\n          \"opening_balance_missing\": false,\n          \"active\": false,\n          \"iban\": \"<string>\",\n          \"bic\": \"<string>\",\n          \"account_number\": \"<string>\"\n        }\n      ],\n      \"total_balance\": \"1234.56\",\n      \"total_balance_currency\": {},\n      \"balance_aggregate\": {\n        \"contract_version\": \"wallet-setup-v1\",\n        \"amount\": \"1234.56\",\n        \"currency\": {},\n        \"status\": \"complete\",\n        \"reasons\": [\n          \"home_currency_missing\"\n        ],\n        \"missing_opening_balance_account_ids\": [\n          \"<uuid>\"\n        ],\n        \"missing_fx_currency_ids\": [\n          \"<uuid>\"\n        ]\n      },\n      \"per_currency\": [\n        {\n          \"currency_id\": \"<uuid>\",\n          \"currency_code\": \"USD\",\n          \"amount\": \"1234.56\"\n        }\n      ],\n      \"balance_sparkline_30d\": [\n        0\n      ],\n      \"balance_trend_30d_percentage\": \"-3.2\",\n      \"last_transaction_at\": \"2026-07-12T12:00:00Z\",\n      \"usage_score\": 3.25,\n      \"needs_opening_balance_setup\": false,\n      \"last_reconciled_at\": \"2026-07-12\",\n      \"reconciliation_status\": \"draft\",\n      \"credit_card\": {},\n      \"created_at\": \"2026-07-12T12:00:00Z\",\n      \"updated_at\": \"2026-07-12T12:00:00Z\",\n      \"archived_at\": \"2026-07-12T12:00:00Z\",\n      \"is_archived\": false,\n      \"created_by\": {}\n    }\n  }\n}"},{"statusCode":"400","description":"Request parameters or payload failed validation. Inspect `code` and `details`.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"401","description":"The personal access token is missing, invalid, expired, or revoked.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"403","description":"The token lacks the required scope or no longer has workspace access.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"404","description":"The resource does not exist in the token workspace or is not visible to this API.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"},{"statusCode":"429","description":"The credential exceeded its request rate limit.","example":"{\n  \"statusCode\": 400,\n  \"code\": \"PROGRAMMATIC_PAGINATION_MODE_CONFLICT\",\n  \"message\": \"after and page are mutually exclusive\",\n  \"details\": {\n    \"errors\": {\n      \"limit\": [\n        \"max\"\n      ]\n    }\n  },\n  \"request_id\": \"8cf64dcc-0f73-4f8d-a845-3d80c1040475\"\n}"}]}]}],"nodes":[{"systemKey":"docs/api/v1","kind":"section","parentSystemKey":"docs/api","position":10,"icon":"braces"},{"systemKey":"docs/api/v1/getting-started","kind":"section","parentSystemKey":"docs/api/v1","position":10,"icon":"rocket"},{"systemKey":"docs/api/v1/getting-started/authentication","kind":"chapter","parentSystemKey":"docs/api/v1/getting-started","position":10,"icon":"book-open"},{"systemKey":"docs/api/v1/getting-started/scopes","kind":"chapter","parentSystemKey":"docs/api/v1/getting-started","position":20,"icon":"book-open"},{"systemKey":"docs/api/v1/getting-started/first-request","kind":"chapter","parentSystemKey":"docs/api/v1/getting-started","position":30,"icon":"book-open"},{"systemKey":"docs/api/v1/getting-started/errors-and-conventions","kind":"chapter","parentSystemKey":"docs/api/v1/getting-started","position":40,"icon":"book-open"},{"systemKey":"docs/api/v1/budgets","kind":"chapter","parentSystemKey":"docs/api/v1","position":20,"icon":"folder-tree"},{"systemKey":"docs/api/v1/goals","kind":"chapter","parentSystemKey":"docs/api/v1","position":30,"icon":"folder-tree"},{"systemKey":"docs/api/v1/imports","kind":"chapter","parentSystemKey":"docs/api/v1","position":40,"icon":"folder-tree"},{"systemKey":"docs/api/v1/insights","kind":"chapter","parentSystemKey":"docs/api/v1","position":50,"icon":"folder-tree"},{"systemKey":"docs/api/v1/recurring","kind":"chapter","parentSystemKey":"docs/api/v1","position":60,"icon":"folder-tree"},{"systemKey":"docs/api/v1/reports","kind":"chapter","parentSystemKey":"docs/api/v1","position":70,"icon":"folder-tree"},{"systemKey":"docs/api/v1/transaction-templates","kind":"chapter","parentSystemKey":"docs/api/v1","position":80,"icon":"folder-tree"},{"systemKey":"docs/api/v1/transactions","kind":"chapter","parentSystemKey":"docs/api/v1","position":90,"icon":"folder-tree"},{"systemKey":"docs/api/v1/wallets","kind":"chapter","parentSystemKey":"docs/api/v1","position":100,"icon":"folder-tree"}],"featureCount":9,"operationCount":38}}