Ynab

Learn how to use Ynab with Composio

Overview

SLUG: YNAB

Description

YNAB (You Need A Budget) is a budgeting tool helping users track expenses, plan finances, and gain control over spending to reduce debt

Authentication Details

client_id
stringRequired
client_secret
stringRequired
full
stringDefaults to https://api.ynab.com/v1Required
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to read-only
bearer_token
string

Connecting to Ynab

Create an auth config

Use the dashboard to create an auth config for the Ynab toolkit. This allows you to connect multiple Ynab accounts to Composio for agents to use.

1

Select App

Navigate to Ynab.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Ynab Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4ynab_auth_config_id = "ac_YOUR_YNAB_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate Ynab: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, ynab_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Ynab toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["YNAB"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Create a new account in a budget

Description

Tool to create a new account in a budget. Use when you need to add a manual (non-linked) account to a specific budget.

Action Parameters

account
objectRequired
budget_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Scheduled Transaction

Description

Tool to create a scheduled transaction. Use when you need to set up a repeating transaction in a budget.

Action Parameters

budget_id
stringRequired
scheduled_transaction
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Scheduled Transaction

Description

Tool to delete an existing scheduled transaction. Use after confirming the scheduled transaction ID.

Action Parameters

budget_id
stringRequired
scheduled_transaction_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Account by ID

Description

Tool to retrieve a single account resource. Use when you need details of a specific account by its ID after determining the budget.

Action Parameters

account_id
stringRequired
budget_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Budget By ID

Description

Tool to retrieve a single budget by ID. Use when you need detailed budget info including date and currency formats. Supports optional delta via last_knowledge_of_server.

Action Parameters

budget_id
stringRequired
last_knowledge_of_server
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Budget Month

Description

Tool to retrieve a specific budget month. Use when you need detailed summary and category budgets for a given month after confirming the budget ID.

Action Parameters

budget_id
stringRequired
month
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Budget Settings

Description

Tool to retrieve budget-level settings. Use when you need to fetch currency and date formatting preferences for a specific budget.

Action Parameters

budget_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Category by ID

Description

Tool to retrieve a single budget category by its ID. Use when you need detailed information about one category after confirming the budget selection.

Action Parameters

budget_id
stringRequired
category_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Month Category By ID

Description

Tool to retrieve a single category for a specific budget month. Use after selecting the budget and month when you need month-specific category details.

Action Parameters

budget_id
stringRequired
category_id
stringRequired
month
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Payee by ID

Description

Tool to retrieve a single payee by its ID. Use when you need full details of a payee after confirming the budget and payee selection.

Action Parameters

budget_id
stringRequired
payee_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Scheduled Transaction by ID

Description

Tool to retrieve a single scheduled transaction. Use when you need details of a specific scheduled transaction by its ID after confirming the budget.

Action Parameters

budget_id
stringRequired
scheduled_transaction_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Transaction by ID

Description

Tool to retrieve a single transaction by its ID. Use when you need detailed information for a specific transaction after confirming the budget.

Action Parameters

budget_id
stringRequired
transaction_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Authorized User

Description

Tool to retrieve the authorized user's information. Use after authentication to get current user details.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Accounts

Description

Tool to list all accounts in a budget. Use when you need to retrieve all accounts (optionally only changes since last sync) after confirming the budget ID.

Action Parameters

budget_id
stringRequired
last_knowledge_of_server
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Budgets

Description

Tool to list budgets available to the authorized user. Use when you need to retrieve all budgets for the account.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Categories

Description

Tool to list all category groups and their categories for a budget. Use when you need the full set of budget categories or only those changed since last sync.

Action Parameters

budget_id
stringRequired
last_knowledge_of_server
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Budget Months

Description

Tool to list months for a budget with summary information. Use when you need an overview of all months or only changed months since a given knowledge value (delta requests).

Action Parameters

budget_id
stringRequired
last_knowledge_of_server
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Payee Locations

Description

Tool to list payee locations for a budget. Use when you need to retrieve all stored latitude/longitude details for payees under a specific budget.

Action Parameters

budget_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Payee Locations by Payee

Description

Tool to list locations associated with a payee. Use when you need all location entries of a given payee after confirming the budget.

Action Parameters

budget_id
stringRequired
payee_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List payees in a budget

Description

Tool to list payees in a budget. Use when you need all payees or only those changed since a known server knowledge value.

Action Parameters

budget_id
stringRequired
last_knowledge_of_server
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Scheduled Transactions

Description

Tool to list scheduled transactions for a budget. Use after confirming the budget ID; supports delta sync via last_knowledge_of_server.

Action Parameters

budget_id
stringRequired
last_knowledge_of_server
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Transactions

Description

Tool to list transactions in a budget. Use when you need all or delta-filtered transactions after confirming the budget.

Action Parameters

budget_id
stringRequired
last_knowledge_of_server
integer
since_date
string
type
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Transactions by Account

Description

Tool to list transactions for a specific account. Use when you need all or delta-filtered transactions for a given account after confirming the budget and account ID.

Action Parameters

account_id
stringRequired
budget_id
stringRequired
last_knowledge_of_server
integer
type
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Transactions by Category

Description

Tool to list transactions for a specific category (excludes pending). Use when you need completed transactions for a given category after obtaining budget_id and category_id.

Action Parameters

budget_id
stringRequired
category_id
stringRequired
last_knowledge_of_server
integer
since_date
string
type
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Transactions by Payee

Description

Tool to list transactions for a specific payee in a budget. Use when you need to fetch all non-pending transactions for a payee after confirming budget and payee IDs.

Action Parameters

budget_id
stringRequired
last_knowledge_of_server
integer
payee_id
stringRequired
since_date
string
type
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Payee

Description

Tool to update a payee. Use when you need to rename an existing payee.

Action Parameters

budget_id
stringRequired
name
stringRequired
payee_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Scheduled Transaction

Description

Tool to update an existing scheduled transaction. Use when you need to change details of a scheduled transaction after confirming IDs.

Action Parameters

budget_id
stringRequired
scheduled_transaction
objectRequired
scheduled_transaction_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired