openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 80.1 kB
JSON
{"openapi":"3.0.1","servers":[{"description":"Production","url":"https://api.pocketsmith.com/v2"}],"info":{"contact":{"email":"api@pocketsmith.com","name":"API Support"},"description":"The PocketSmith API","title":"PocketSmith","version":"2.0","x-apisguru-categories":["financial"],"x-origin":[{"format":"openapi","url":"https://raw.githubusercontent.com/pocketsmith/api/master/openapi.json","version":"3.0"}],"x-providerName":"pocketsmith.com"},"security":[{"developerKey":[]}],"paths":{"/accounts/{id}":{"delete":{"description":"Deletes an account and all its data by ID, optionally merge scenarios into another account.","parameters":[{"description":"The unique identifier of the account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Delete account","tags":["Accounts"]},"get":{"description":"Gets an account by its ID.","parameters":[{"description":"The unique identifier of the account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get account","tags":["Accounts"]},"put":{"description":"Updates and returns an account by its ID.","parameters":[{"description":"The unique identifier of the account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"currency_code":{"description":"A new currency code for the account.","example":"NZD","type":"string"},"is_net_worth":{"description":"Whether the account is a net worth account.","example":false,"type":"boolean"},"title":{"description":"A new title for the account.","example":"Savings","type":"string"},"type":{"description":"The type of the account.","enum":["bank","credits","cash","loans","mortgage","stocks","vehicle","property","insurance","other_asset","other_liability"],"example":"bank","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Update account","tags":["Accounts"]}},"/accounts/{id}/transactions":{"get":{"description":"Lists transactions belonging to an account by its ID.","parameters":[{"description":"The unique identifier of the account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Limit to transactions on or after this date. Required if end_date is provided. If not provided, defaults to the furtherest date allowed by the user's subscription.","example":"2025-04-15T13:50:52.814Z","in":"query","name":"start_date","required":false,"schema":{"type":"string"}},{"description":"Limit to transactions on or before this date. Required if start_date is provided. If not provided, defaults to today's date.","example":"2025-04-15T13:50:52.814Z","in":"query","name":"end_date","required":false,"schema":{"type":"string"}},{"description":"Limit to transactions updated since an ISO 8601 timestamp.","example":"2025-04-15T13:50:52.814Z","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Limit to uncategorised transactions.","example":1,"in":"query","name":"uncategorised","required":false,"schema":{"type":"integer"}},{"description":"Limit to transactions of this type.","example":"debit","in":"query","name":"type","required":false,"schema":{"enum":["debit","credit"],"type":"string"}},{"description":"Limit to transactions that need to be reviewed.","example":1,"in":"query","name":"needs_review","required":false,"schema":{"type":"integer"}},{"description":"Limit to transactions matching a keyword search string. The provided string is matched against the transaction amount, account name, payee, category title, note, labels, and the date in ISO 8601 format.","example":"Paypal","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"Choose a particular page of the results.","example":3,"in":"query","name":"page","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Transaction"},"type":"array"}}},"description":"Success"},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List transactions in account","tags":["Transactions"]}},"/attachments/{id}":{"delete":{"description":"Deletes a particular attachment by its ID.","parameters":[{"description":"The unique identifier of the attachment.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Delete attachment","tags":["Attachments"]},"get":{"description":"Gets a particular attachment by its ID.","parameters":[{"description":"The unique identifier of the attachment.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachment"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get attachment","tags":["Attachments"]},"put":{"description":"Updates the title of the attachment.","parameters":[{"description":"The unique identifier of the attachment.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"title":{"description":"The new title of the attachment. If the title is blank or not provided, the server will derive a title from the file name.","example":"Invoice for taxi","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachment"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Update attachment","tags":["Attachments"]}},"/categories/{id}":{"delete":{"description":"Deletes a particular category by its ID. This will delete all budgets within the category, and uncategorize all transactions assigned to the category.","parameters":[{"description":"The unique identifier of the category.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Delete category","tags":["Categories"]},"get":{"description":"Gets a particular category by its ID.","parameters":[{"description":"The unique identifier of the category.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get category","tags":["Categories"]},"put":{"description":"Updates a category by its ID.","parameters":[{"description":"The unique identifier of the category.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"colour":{"description":"A new CSS-style hex colour for the category.","example":"#e0e7ff","type":"string"},"is_bill":{"description":"Set the category as a bill category.","example":true,"type":"boolean"},"is_transfer":{"description":"Set the category as a transfer category.","example":false,"type":"boolean"},"parent_id":{"description":"The unique identifier of a parent category for the category, making this category a child of that category.","example":42,"type":"integer"},"refund_behaviour":{"description":"Set the refund behaviour of the category.","enum":["debits_are_deductions","credits_are_refunds",null],"example":"credits_are_refunds","nullable":true,"type":"string"},"roll_up":{"description":"Set the category to be rolled up into its parent category.","example":false,"type":"boolean"},"title":{"description":"A new title for the category.","example":"Food","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Update category","tags":["Categories"]}},"/categories/{id}/category_rules":{"post":{"description":"Creates a rule to allocate a category to transactions.","parameters":[{"description":"The unique identifier of the category.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apply_to_all":{"description":"Apply the created category rule to all transactions.","example":false,"type":"boolean"},"apply_to_uncategorised":{"description":"Apply the created category rule to all uncategorised transactions.","example":true,"type":"boolean"},"payee_matches":{"description":"The keyword/s to match the transaction payees.","example":"Countdown","type":"string"}},"required":["category_id","payee_matches"],"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryRule"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Create category rule in category","tags":["Category Rules"]}},"/categories/{id}/transactions":{"get":{"description":"Lists transactions belonging to one or more categories by their IDs.","parameters":[{"description":"A comma-separated list of category IDs.","example":"42,43","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Limit to transactions on or after this date. Required if end_date is provided. If not provided, defaults to the furtherest date allowed by the user's subscription.","example":"2025-04-15T13:50:52.814Z","in":"query","name":"start_date","required":false,"schema":{"type":"string"}},{"description":"Limit to transactions on or before this date. Required if start_date is provided. If not provided, defaults to today's date.","example":"2025-04-15T13:50:52.814Z","in":"query","name":"end_date","required":false,"schema":{"type":"string"}},{"description":"Limit to transactions updated since an ISO 8601 timestamp.","example":"2025-04-15T13:50:52.814Z","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Limit to uncategorised transactions.","example":1,"in":"query","name":"uncategorised","required":false,"schema":{"type":"integer"}},{"description":"Limit to transactions of this type.","example":"debit","in":"query","name":"type","required":false,"schema":{"enum":["debit","credit"],"type":"string"}},{"description":"Limit to transactions that need to be reviewed.","example":1,"in":"query","name":"needs_review","required":false,"schema":{"type":"integer"}},{"description":"Limit to transactions matching a keyword search string. The provided string is matched against the transaction amount, account name, payee, category title, note, labels, and the date in ISO 8601 format.","example":"Paypal","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"Choose a particular page of the results.","example":3,"in":"query","name":"page","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Transaction"},"type":"array"}}},"description":"Success"},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List transactions in categories","tags":["Transactions"]}},"/currencies":{"get":{"description":"Lists currencies supported by PocketSmith.","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Currency"},"type":"array"}}},"description":"Success"}},"summary":"List currencies","tags":["Currencies"]}},"/currencies/{id}":{"get":{"description":"Gets a particular currency by its ID.","parameters":[{"description":"The unique identifier of the currency.","example":"nzd","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Currency"}}},"description":"Success"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get currency","tags":["Currencies"]}},"/events/{id}":{"delete":{"description":"Deletes an event by its ID.","parameters":[{"$ref":"#/components/parameters/eventId"},{"description":"Whether the delete applies only to this event, to all events within the series from this event or to all events within the series.","in":"query","name":"behaviour","required":true,"schema":{"enum":["one","forward","all"],"type":"string"}}],"responses":{"204":{"description":"Success"},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"}},"summary":"Delete event","tags":["Events"]},"get":{"description":"Gets a particular event by its ID.","parameters":[{"$ref":"#/components/parameters/eventId"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get event","tags":["Events"]},"put":{"description":"Updates an event by its ID.","parameters":[{"$ref":"#/components/parameters/eventId"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"description":"The amount of the event. A positive amount is a credit, and a negative amount is a debit.","example":11.5,"type":"number"},"behaviour":{"description":"Whether the update applies only to this event, to all events within the series from this event or to all events within the series.","enum":["one","forward","all"],"example":"all","type":"string"},"note":{"description":"A note for the event.","example":"Need more beer.","type":"string"},"repeat_interval":{"description":"The repeat interval of the event.","example":1,"type":"integer"},"repeat_type":{"description":"The repeat type of the event.","enum":["once","daily","weekly","fortnightly","monthly","yearly","each weekday"],"example":"weekly","type":"string"}},"required":["behaviour"],"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}},"description":"Success"},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"}},"summary":"Update event","tags":["Events"]}},"/institutions/{id}":{"delete":{"description":"Deletes an institution and all data within. Alternatively, another institution can be provided to merge the data into to avoid losing it.","parameters":[{"description":"The unique identifier of the institution.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"The unique identifier of the institution to merge into.","example":44,"in":"query","name":"merge_into_institution_id","required":false,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Delete institution","tags":["Institutions"]},"get":{"description":"Gets an institution by its ID.","parameters":[{"description":"The unique identifier of the institution.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Institution"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get institution","tags":["Institutions"]},"put":{"description":"Updates the title and currency code for an institution.","parameters":[{"description":"The unique identifier of the institution.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"currency_code":{"description":"A new currency code for the institution.","example":"NZD","type":"string"},"title":{"description":"A new title for the institution.","example":"Bank of Foo","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Institution"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Update institution","tags":["Institutions"]}},"/institutions/{id}/accounts":{"get":{"description":"Lists accounts belonging to an institution by its ID.","parameters":[{"description":"The unique identifier of the institution.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Account"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List accounts in institution","tags":["Accounts"]}},"/me":{"get":{"description":"Gets the user that corresponds to the access token used in the request.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"}},"summary":"Get the authorised user","tags":["Users"]}},"/scenarios/{id}/events":{"get":{"description":"Lists events belonging to a scenario by their ID.","parameters":[{"$ref":"#/components/parameters/scenarioId"},{"description":"Return the events from and including this date.","example":"2025-04-15T13:50:52.814Z","in":"query","name":"start_date","required":true,"schema":{"type":"string"}},{"description":"Return the events until and including this date.","example":"2025-04-15T13:50:52.814Z","in":"query","name":"end_date","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Event"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List events in scenario.","tags":["Events"]},"post":{"description":"Creates an event in a scenario by its ID.","parameters":[{"$ref":"#/components/parameters/scenarioId"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"description":"The amount of the event. A positive amount is a credit, and a negative amount is a debit.","example":11.5,"type":"number"},"category_id":{"description":"The unique identifier of the category for the event.","example":42,"type":"integer"},"date":{"description":"The starting date of the event.","example":"2025-04-15T13:50:52.814Z","type":"string"},"note":{"description":"A note for the event.","example":"New beers for sampling over the weekends.","type":"string"},"repeat_interval":{"default":1,"description":"The repeat interval of the event.","example":1,"type":"integer"},"repeat_type":{"description":"The repeat type of the event.","enum":["once","daily","weekly","fortnightly","monthly","yearly","each weekday"],"example":"weekly","type":"string"}},"required":["category_id","date","amount","repeat_type"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"}},"summary":"Create event in scenario","tags":["Events"]}},"/time_zones":{"get":{"description":"Lists time zones.","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TimeZone"},"type":"array"}}},"description":"Success"}},"summary":"List time zones","tags":["Time Zones"]}},"/transaction_accounts/{id}":{"get":{"description":"Gets a transaction account by its ID.","parameters":[{"description":"The unique identifier of the transaction account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionAccount"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get transaction account","tags":["Transaction Accounts"]},"put":{"description":"Updates the transaction account by its ID.","parameters":[{"description":"The unique identifier of the transaction account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"institution_id":{"description":"The unique identifier of a new institution for the transaction account.","example":42,"type":"integer"},"starting_balance":{"description":"The starting balance amount of the transaction account.","example":3547.45,"type":"number"},"starting_balance_date":{"description":"The starting balance date of the transaction account.","example":"2025-04-15T13:50:52.818Z","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionAccount"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Update transaction account","tags":["Transaction Accounts"]}},"/transaction_accounts/{id}/transactions":{"get":{"description":"Lists transactions belonging to a transaction account by its ID.","parameters":[{"description":"The unique identifier of the transaction account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Limit to transactions on or after this date. Required if end_date is provided. If not provided, defaults to the furtherest date allowed by the user's subscription.","example":"2025-04-15T13:50:52.818Z","in":"query","name":"start_date","required":false,"schema":{"type":"string"}},{"description":"Limit to transactions on or before this date. Required if start_date is provided. If not provided, defaults to today's date.","example":"2025-04-15T13:50:52.818Z","in":"query","name":"end_date","required":false,"schema":{"type":"string"}},{"description":"Limit to transactions updated since an ISO 8601 timestamp.","example":"2025-04-15T13:50:52.818Z","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Limit to uncategorised transactions.","example":1,"in":"query","name":"uncategorised","required":false,"schema":{"type":"integer"}},{"description":"Limit to transactions of this type.","example":"debit","in":"query","name":"type","required":false,"schema":{"enum":["debit","credit"],"type":"string"}},{"description":"Limit to transactions that need to be reviewed.","example":1,"in":"query","name":"needs_review","required":false,"schema":{"type":"integer"}},{"description":"Limit to transactions matching a keyword search string. The provided string is matched against the transaction amount, account name, payee, category title, note, labels, and the date in ISO 8601 format.","example":"Paypal","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"Choose a particular page of the results.","example":3,"in":"query","name":"page","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Transaction"},"type":"array"}}},"description":"Success"},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List transactions in transaction account","tags":["Transactions"]},"post":{"description":"Creates a transaction in a transaction account by its ID.","parameters":[{"description":"The unique identifier of the transaction account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"description":"The amount of the transaction. A positive amount is a credit, and a negative amount is a debit.","example":11.5,"type":"number"},"category_id":{"description":"The unique identifier of a category for the transaction.","example":42,"type":"integer"},"cheque_number":{"description":"A cheque number for the transaction.","type":"string"},"date":{"description":"The date when the transaction occurred.","example":"2025-04-15T13:50:52.818Z","type":"string"},"is_transfer":{"description":"Whether the transaction should be indicated as a transfer.","example":false,"type":"boolean"},"labels":{"description":"A set of comma-separated labels for the transaction.","example":"lunch,mexican","type":"string"},"memo":{"description":"A memo for the transaction.","type":"string"},"needs_review":{"description":"Whether the transaction needs to be reviewed or not.","example":false,"type":"boolean"},"note":{"description":"A note for the transaction.","example":"I really enjoyed the loaded corn chips","type":"string"},"payee":{"description":"The payee/merchant of the transaction.","example":"Tex Otago","type":"string"}},"required":["payee","amount","date"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Create a transaction in transaction account","tags":["Transactions"]}},"/transactions/{id}":{"delete":{"description":"Deletes a transaction and all its data by ID.","parameters":[{"description":"The unique identifier of the transaction.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Delete transaction","tags":["Transactions"]},"get":{"description":"Gets a transaction by its ID.","parameters":[{"description":"The unique identifier of the transaction.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get a transaction","tags":["Transactions"]},"put":{"description":"Updates a transaction by its ID.","parameters":[{"description":"The unique identifier of the transaction.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"description":"A new amount for the transaction.","example":225,"type":"number"},"category_id":{"description":"The unique identifier of a new category for the transaction.","example":42,"type":"integer"},"cheque_number":{"description":"A new cheque number for the transaction.","example":"503113643691","type":"string"},"date":{"description":"A new date for the transaction.","example":"2025-04-15T13:50:52.819Z","type":"string"},"is_transfer":{"description":"Whether the transaction is a transfer or not.","example":false,"type":"boolean"},"labels":{"description":"A new comma-separated set of labels for the transaction.","example":"foo,bar,baz","type":"string"},"memo":{"description":"A new memo for the transaction.","example":"Rent","type":"string"},"needs_review":{"description":"Whether the transaction needs to be reviewed or not.","example":false,"type":"boolean"},"note":{"description":"A new note for the transaction.","type":"string"},"payee":{"description":"A new payee for the transaction.","example":"Bill","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Update a transaction","tags":["Transactions"]}},"/transactions/{id}/attachments":{"get":{"description":"Lists attachments belonging to a transaction by their ID.","parameters":[{"description":"The unique identifier of the transaction.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List attachments in transaction","tags":["Attachments"]},"post":{"description":"Assigns an attachment to the transaction by their ID.","parameters":[{"description":"The unique identifier of the transaction.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"attachment_id":{"description":"The unique identifier of the attachment.","example":1438154,"type":"integer"}},"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachment"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Assigns attachment to transaction","tags":["Attachments"]}},"/transactions/{transaction_id}/attachments/{attachment_id}":{"delete":{"description":"Unassigns a particular attachment by its ID from the transaction ID. This does not delete the attachment, it only removes its association from the transaction.","parameters":[{"description":"The unique identifier of the transaction.","example":42,"in":"path","name":"transaction_id","required":true,"schema":{"type":"integer"}},{"description":"The unique identifier of the attachment.","example":1438154,"in":"path","name":"attachment_id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Unassigns attachment in transaction","tags":["Attachments"]}},"/users/{id}":{"get":{"description":"Gets a user by ID. You must be authorised as the target user in order to make this request.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get user","tags":["Users"]},"put":{"description":"Updates the user by their ID. You must be authorised as the target user in order to make this request.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"always_show_base_currency":{"description":"Whether the user wishes to have all monetary values converted to their base currency.","example":true,"type":"boolean"},"base_currency_code":{"description":"A new base currency code for the user.","example":"nzd","type":"string"},"beta_user":{"description":"Whether the user is a beta user, and wishes to try out new features.","example":true,"type":"boolean"},"email":{"description":"A new email address for the user.","example":"foo@bar.com","type":"string"},"name":{"description":"A new name for the user.","example":"John Appleseed","type":"string"},"time_zone":{"description":"A new time zone for the user.","example":"Auckland","type":"string"},"week_start_day":{"description":"The day of the week the user wishes their calendars to start on. A number between 0 and 6, where 0 is Sunday and 6 is Saturday.","example":1,"type":"integer"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Update user","tags":["Users"]}},"/users/{id}/accounts":{"get":{"description":"Lists all accounts belonging to the user by their ID.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Account"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List accounts in user","tags":["Accounts"]},"post":{"description":"Creates and returns an account belonging to the user by their ID.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"currency_code":{"description":"A currency code for the account.","example":"NZD","type":"string"},"institution_id":{"description":"The ID of the institution to create this account in.","example":42,"type":"integer"},"title":{"description":"A title for the account.","example":"Foo","type":"string"},"type":{"description":"The type of the account.","enum":["bank","credits","cash","loans","mortgage","stocks","vehicle","property","insurance","other_asset","other_liability"],"example":"bank","type":"string"}},"required":["institution_id","title","currency_code","type"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Create an account in user","tags":["Accounts"]},"put":{"description":"Updates the display order of accounts belonging to the user, by accepting an array of accounts in their new display order.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"accounts":{"description":"List the account objects in their new display order.","items":{"$ref":"#/components/schemas/Account"},"type":"array"}},"required":["accounts"],"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Account"},"type":"array"}}},"description":"Success"},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Update the display order of accounts in user","tags":["Accounts"]}},"/users/{id}/attachments":{"get":{"description":"Lists attachments belonging to a user by their ID.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"If set, returns unassigned attachments, that are available for assigning to a transaction.","example":1,"in":"query","name":"unassigned","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Lists attachments in user","tags":["Attachments"]},"post":{"description":"Creates an attachment belonging to the user by their ID.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"file_data":{"description":"The base64-encoded contents of the source file. The supported file types are png, jpg, pdf, xls, xlsx, doc, docx.","format":"base64","type":"string"},"file_name":{"description":"The file name of the attachment.","example":"taxi.png","type":"string"},"title":{"description":"The title of the attachment. If the title is blank or not provided, the title will derived from the file name.","example":"Invoice for taxi","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachment"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Create attachment in user","tags":["Attachments"]}},"/users/{id}/budget":{"get":{"description":"Lists the user's budget, consisting of one or more budget analysis packages, one per category. Akin to the list on the Budget page in PocketSmith.","parameters":[{"description":"The unique identifier of the account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Whether parent categories should have their children rolled up into them. When used, the children will still appear in the collection on their own, but their actual and forecast figures will be rolled up to the root parent.","example":true,"in":"query","name":"roll_up","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BudgetAnalysisPackage"},"type":"array"}}},"description":"Success"}},"summary":"List budget for user","tags":["Budgeting"]}},"/users/{id}/budget_summary":{"get":{"description":"Get the user's budget summary, containing an expense and income analysis for all categories (excluding transfer categories) for the given period and date range. Akin to the overall budget shown on the Budget page in PocketSmith.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"The period to analyse in, one of `weeks`, `months` or `years`. Also supported is `event`, although event period analysis is only possible when the budget events gathered align, so in this case where all categories are analysed together, it's highly unlikely that event period analysis will be possible.","example":"weeks","in":"query","name":"period","required":true,"schema":{"enum":["weeks","months","years","event"],"type":"string"}},{"description":"The period interval, e.g. if the interval is 2 and the period is weeks, the budget will be analysed fortnightly.","example":2,"in":"query","name":"interval","required":true,"schema":{"type":"integer"}},{"description":"The date to start analysing the budget from. This will be bumped out to make full periods as necessary.","example":"2025-04-15T13:50:52.819Z","in":"query","name":"start_date","required":true,"schema":{"type":"string"}},{"description":"The date to stop analysing the budget from. This will be bumped out to make full periods as necessary.","example":"2025-04-15T13:50:52.819Z","in":"query","name":"end_date","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BudgetAnalysisPackage"},"type":"array"}}},"description":"Success"},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Get budget summary for user","tags":["Budgeting"]}},"/users/{id}/categories":{"get":{"description":"Lists all categories belonging to a user by their ID.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Category"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List categories in user","tags":["Categories"]},"post":{"description":"Creates a category belonging to the user by their ID.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"colour":{"description":"A CSS-style hex colour for the category.","example":"#e0e7ff","type":"string"},"is_bill":{"description":"Set the category as a bill category.","example":true,"type":"boolean"},"is_transfer":{"description":"Set the category as a transfer category.","example":false,"type":"boolean"},"parent_id":{"description":"The unique identifier of a category to be the parent of this category.","example":42,"type":"integer"},"refund_behaviour":{"description":"Set the refund behaviour of the category.","enum":["debits_are_deductions","credits_are_refunds",null],"example":"credits_are_refunds","nullable":true,"type":"string"},"roll_up":{"description":"Set the category to be rolled up into its parent category.","example":false,"type":"boolean"},"title":{"description":"A title for the category.","example":"Food","type":"string"}},"required":["title"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Create category in user","tags":["Categories"]}},"/users/{id}/category_rules":{"get":{"description":"Lists all category rules belonging to a user by their ID.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CategoryRule"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List category rules in user","tags":["Category Rules"]}},"/users/{id}/events":{"get":{"description":"Lists events belonging to a user by their ID.","parameters":[{"$ref":"#/components/parameters/userId"},{"description":"Return the events from and including this date.","example":"2025-04-15T13:50:52.819Z","in":"query","name":"start_date","required":true,"schema":{"type":"string"}},{"description":"Return the events until and including this date.","example":"2025-04-15T13:50:52.819Z","in":"query","name":"end_date","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Event"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List events in user.","tags":["Events"]}},"/users/{id}/forecast_cache":{"delete":{"description":"Delete the user's cached forecast by recalculating the forecast.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"Delete forecast cache for user","tags":["Budgeting"]}},"/users/{id}/institutions":{"get":{"description":"Lists all the institutions belonging to the user.","parameters":[{"description":"The unique identifier of the user","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Institution"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List institutions in user","tags":["Institutions"]},"post":{"description":"Creates an institution belonging to a user.","parameters":[{"description":"The unique identifier of the user","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"currency_code":{"description":"A currency code for the institution.","example":"NZD","type":"string"},"title":{"description":"A title for the institution.","example":"Bank of Foo","type":"string"}},"required":["title","currency_code"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Institution"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"}},"summary":"Create institution in user","tags":["Institutions"]}},"/users/{id}/labels":{"get":{"description":"Lists labels belonging to a user by their ID.","parameters":[{"$ref":"#/components/parameters/userId"}],"responses":{"200":{"content":{"application/json":{"example":["craftbeer","bargains","gaming","Trip to Auckland"],"schema":{"items":{"type":"string"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List labels in user","tags":["Labels"]}},"/users/{id}/saved_searches":{"get":{"description":"Lists saved searches belonging to a user by their ID.","parameters":[{"$ref":"#/components/parameters/userId"}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SavedSearch"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List saved searches in user","tags":["Saved Searches"]}},"/users/{id}/transaction_accounts":{"get":{"description":"List all transaction accounts belonging to a user.","parameters":[{"description":"The unique identifier of the user.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TransactionAccount"},"type":"array"}}},"description":"Success"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"summary":"List transaction accounts in user","tags":["Transaction Accounts"]}},"/users/{id}/transactions":{"get":{"description":"Lists transactions belonging to a user by their ID.","parameters":[{"description":"The unique identifier of the account.","example":42,"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Limit to transactions on or after this date. Required if end_date is provided. If not provided, defaults to the furtherest date allowed by the user's subscription.","example":"2025-04-15T13:50:52.819Z","in":"query","name":"start_date","required":false,"schema":{"type":"string"}},{"description":"Limit to transactions on or before this date. Required if start_date is provided. If not provided, defaults to today's date.","example":"2025-04-15T13:50:52.819Z","in":"query","name":"end_date","required":false,"schema":{"type":"string"}},{"description":"Limit to transactions updated since an ISO 8601 timestamp.","example":"2025-04-15T13:50:52.819Z","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Limit to uncategorised transactions.","example":1,"in":"query","name":"uncategorised","required":false,"schema":{"type":"integer"}},{"description":"Limit to transactions of this type.","example":"debit","in":"query","name":"type","required":false,"schema":{"enum":["debit","credit"],"type":"string"}},{"description":"Limit to transactions that need to be reviewed.","example":1,"in":"query","name":"needs_review","required":false,"schema":{"type":"integer"}},{"description":"Limit to transactions matching a keyword search string. The provided string is matched against the transaction amount, account name, payee, category title, note, labels, and the date in ISO 8601 format.","example":"Paypal","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"Choose a particular page of the results.","example":3,"in":"query","name":"page","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{