Skip to main content

Source Imports

A source import moves a whole budget from another product into a Budget Thing workspace: accounts, categories, payees, transactions and, where the export has one, the plan. It is a different thing from a bank-file import, which adds transactions to one existing account (see File Imports). The two share the imports:read and imports:write scopes but have their own paths.

The import runs in the background. Your integration creates it, uploads the export file, asks Budget Thing to inspect the file, sends back a configuration built from that inspection, and then polls until the import finishes.

Scopes and roles​

OperationScope
Create an importimports:write
Inspect an importimports:write
Start an importimports:write
Get an importimports:read

A token that runs a whole import needs both. As always, scopes only restrict: creating, inspecting and starting also require the token's owner to be an owner, admin or editor of the workspace, and anything less is refused with 403 FORBIDDEN. Any member can read an import's status.

The lifecycle​

POST /api/v1/workspaces/{workspaceID}/imports → awaiting_upload
PUT <upload.url> (the file itself)
POST /api/v1/workspaces/{workspaceID}/imports/{importID}/inspect → awaiting_configuration
POST /api/v1/workspaces/{workspaceID}/imports/{importID}/start → queued
GET /api/v1/workspaces/{workspaceID}/imports/{importID} → processing → completed | failed

The same flow as statuses. Each label is the request that moves the import on; poll means reading it with GET until the status changes.

Each step only works from the status the previous one left behind.

StatusMeaning
awaiting_uploadCreated. Upload the file, then inspect.
inspectingInspection is running. You only see this if you read the import while an inspect request is still in flight.
awaiting_configurationInspected. Read inspection and start the import with a configuration.
queuedAccepted and waiting for a worker.
processingRunning. progress and steps update as it goes.
completedFinished. summary reports what was created.
failedEnded without importing. error says why.

The schema also lists cancelled. The API does not currently set it, and there is no cancel operation; if you ever see it, treat it as a final status.

completed, failed and cancelled are final. A failed import cannot be retried — create a new one.

1. Create the import​

curl https://api.budgetthing.com/api/v1/workspaces/wks_3fQ0mZk8Xr2Lp9Va6Ne1Ty/imports \
-H "Authorization: Bearer $BUDGETTHING_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "ynab",
"filename": "My Budget as of 2026-11-01.zip",
"contentType": "application/zip",
"size": 482113
}'
FieldRequiredNotes
typeYesThe product the export comes from. See Import types.
filenameYesThe file's name, 1–512 characters. It is shown back to the user and carried in webhook events.
contentTypeNoThe file's media type.
sizeNoThe file's size in bytes. If you send it, the uploaded file must be exactly this size.

The answer is 201 Created with the import object in status awaiting_upload, plus an upload object:

{
"id": "srcimp_7Hc2LqT9wXe4Nb0Zr5Ka1M",
"workspaceId": "wks_3fQ0mZk8Xr2Lp9Va6Ne1Ty",
"type": "ynab",
"status": "awaiting_upload",
"filename": "My Budget as of 2026-11-01.zip",
"contentType": "application/zip",
"progress": {"percent": 0},
"steps": null,
"createdAt": "2026-11-11T15:04:05Z",
"updatedAt": "2026-11-11T15:04:05Z",
"upload": {
"url": "https://uploads.example.com/imports/...",
"method": "PUT",
"headers": {"Content-Type": "application/zip"},
"expiresAt": "2026-11-11T15:19:05Z"
}
}

Some import types refuse to be created at all in certain workspaces — a YNAB or Actual Budget import, for example, needs a workspace with no transactions. Those checks run here, before you upload anything.

2. Upload the file​

Send the raw file bytes to upload.url with upload.method, adding every header in upload.headers exactly as given. Do not send your Budget Thing token: the URL is pre-signed.

curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/zip" \
--data-binary @"My Budget as of 2026-11-01.zip"

The URL stops working at upload.expiresAt. If it lapses, create a new import.

3. Inspect the file​

curl -X POST https://api.budgetthing.com/api/v1/workspaces/wks_3fQ0mZk8Xr2Lp9Va6Ne1Ty/imports/srcimp_7Hc2LqT9wXe4Nb0Zr5Ka1M/inspect \
-H "Authorization: Bearer $BUDGETTHING_TOKEN"

Inspection reads the uploaded file and reports what is in it, without importing anything. It runs while you wait and answers 200 with the import in status awaiting_configuration and an inspection object. The shape of inspection depends on the import type.

If the file is missing, is a different size from the one you declared, or is not a valid export, inspection answers with an error and the import moves to failed. Create a new import to try again.

4. Start the import​

curl -X POST https://api.budgetthing.com/api/v1/workspaces/wks_3fQ0mZk8Xr2Lp9Va6Ne1Ty/imports/srcimp_7Hc2LqT9wXe4Nb0Zr5Ka1M/start \
-H "Authorization: Bearer $BUDGETTHING_TOKEN" \
-H "Content-Type: application/json" \
-d '{"configuration": { ... }}'

The body is a single configuration object whose shape depends on the import type, and which is checked against the inspection. A configuration the import type rejects answers 422 INVALID_IMPORT_CONFIGURATION, and the import stays in awaiting_configuration so you can correct it and send it again.

An accepted configuration answers 200 with the import in status queued. From here it cannot be changed.

5. Poll for the result​

curl https://api.budgetthing.com/api/v1/workspaces/wks_3fQ0mZk8Xr2Lp9Va6Ne1Ty/imports/srcimp_7Hc2LqT9wXe4Nb0Zr5Ka1M \
-H "Authorization: Bearer $BUDGETTHING_TOKEN"

Poll every few seconds until the status is final. A large budget can take a while. If you would rather be told, subscribe to the transaction_import.* webhook events instead.

The import object​

Every operation returns the same object.

FieldNotes
idThe import's ID, prefixed srcimp_.
workspaceIdThe workspace being imported into.
typeThe import type.
statusSee the lifecycle.
filenameThe name you gave when creating the import.
contentTypeThe media type you gave, if any.
sizeThe uploaded file's size in bytes, once inspected.
inspectionWhat inspection found. Present from awaiting_configuration on.
progress.percentOverall progress, 0–100.
progress.currentStepThe key of the step running now, if any.
stepsThe import type's steps, in order. null until the import is started.
summaryWhat was created. Present once completed.
errorWhy the import failed. Present once failed.
createdAt, updatedAtRFC 3339 timestamps.
startedAt, completedAtSet when a worker picks the import up, and when it ends.

Each entry in steps looks like this:

{
"key": "transactions",
"label": "Import transactions and transfers",
"translationKey": "sourceImports.ynab.steps.transactions",
"status": "processing",
"processed": 1200,
"total": 4810
}

A step's status is pending, processing, completed, failed or skipped. processed and total appear only while a step can count its work. Show label to the user, or resolve translationKey if you localize.

Errors on a failed import​

When an import fails in the background there is no HTTP error to read, so the reason is recorded on the import:

{
"status": "failed",
"error": {
"code": "invalid_import_artifact",
"message": "errors.api.uploadedArtifactIsInvalid.detail",
"messageEnglish": "Uploaded artifact is invalid"
}
}

message is a translation key and messageEnglish is the same explanation in English. code is the stable value to branch on. Note that it is lower case here, while the same failure returned as an HTTP error carries it upper case in the problem body — invalid_import_artifact here, INVALID_IMPORT_ARTIFACT there.

codeWhat happened
artifact_missingNo file was uploaded, or it is gone.
invalid_upload_sizeThe uploaded file is empty, too large, or not the size you declared.
invalid_import_artifactThe file is not a valid export for this import type.
inspection_failedInspection could not finish.
invalid_import_configurationThe configuration no longer fits the file.
ynab_import_requires_empty_workspace, source_import_requires_empty_workspaceThe workspace gained transactions after the import was started (YNAB, Actual Budget).
storage_failureThe uploaded file could not be read from storage.
execution_failureThe import could not be started, or failed while processing.
progress_failureThe import ran, but its result could not be recorded.

Errors from the operations​

These are returned as application/problem+json, in the standard error shape.

StatuscodeWhen
403FORBIDDENThe user's workspace role cannot import.
404NOT_FOUNDNo such import in this workspace — including one that has been cleaned up.
409CONFLICTInspecting an import that is not awaiting_upload, or two requests raced to change it.
409IMPORT_ALREADY_STARTEDStarting an import that is not awaiting_configuration, or that was already queued.
409YNAB_IMPORT_REQUIRES_EMPTY_WORKSPACEA YNAB import into a workspace that has transactions.
409SOURCE_IMPORT_REQUIRES_EMPTY_WORKSPACEAn Actual Budget import into a workspace that has transactions.
422VALIDATION_ERRORThe body failed schema validation — for example, an unknown type.
422VALIDATION_FAILEDfilename is only whitespace, or longer than 512 UTF-8 bytes after trimming. An empty filename fails schema validation (VALIDATION_ERROR) first.
422UPLOAD_TOO_LARGEThe declared size is above the upload limit. A size of zero fails schema validation (VALIDATION_ERROR) first.
422ARTIFACT_MISSINGInspecting or starting before the file was uploaded.
422INVALID_UPLOAD_SIZEThe uploaded file is empty, too large, or not the declared size.
422INVALID_IMPORT_ARTIFACTThe file is not a valid export for this import type.
422INVALID_IMPORT_CONFIGURATIONThe configuration does not fit the inspection.

Time limits​

Imports that are never finished are cleaned up, and so is the uploaded file:

  • An import still awaiting_upload is deleted a day after it was created.
  • An import left in awaiting_configuration is deleted seven days after inspection.
  • After an import ends, the record and its file are deleted — a day after a completed import, seven days after a failed one.

Once deleted, reading the import answers 404. The accounts, categories and transactions it created are not affected. Record the summary you need before then.

The upload URL is valid for 15 minutes, and the largest file accepted is 256 MiB.

Webhook events​

A source import publishes the same three events as any other transaction import: transaction_import.started when a worker picks it up, and transaction_import.completed or transaction_import.failed when it ends. The event's import.source is the import type — ynab for a YNAB import — and import.account_id is absent, because a source import fills a whole workspace rather than one account. A failure event carries only a category (file_invalid, configuration_invalid, storage_unavailable or processing_error); read the import for the full error.

Individual transactions created by an import do not each send an event. See Webhook events.

Import types​

ynab​

Imports a budget exported from YNAB. The workspace must have no transactions — the import builds its history from scratch and cannot merge into an existing one. This is checked when you create the import, again when you start it, and once more when it runs.

The file. Upload the ZIP archive exactly as YNAB exports it. It must contain one register file (a name ending in - Register.csv, or exactly Register.csv) and may contain a plan file (ending in - Plan.csv, or exactly Plan.csv); everything else in the archive is ignored. A bare CSV is not accepted.

The same import type also reads a Zerosum export. When the archive has no register file, a transactions.csv (required) and a budget.csv (optional) at any depth are read instead, and the inspection, configuration and summary have the same shape. There is no separate import type for Zerosum. See Import from Zerosum for what is mapped and what is left behind.

The inspection.

{
"source": "ynab",
"accounts": [
{
"sourceId": "ynab_account_5f0c2e9a41b7d3086ae1c2f4",
"name": "Everyday Checking",
"sourceType": "Checking",
"suggestedAccountType": "checking",
"transactionCount": 1834
}
],
"transactionCount": 4810,
"hasPlan": true,
"dateFormat": {
"suggested": "MM/DD/YYYY",
"candidates": ["MM/DD/YYYY", "DD/MM/YYYY"],
"ambiguous": true,
"rejected": [
{"format": "YYYY-MM-DD", "row": 2, "value": "11/01/2026"}
]
},
"warnings": [
{"code": "zerosum_tags_ignored", "count": 12}
]
}
  • source is the export format the file was recognized as: ynab or zerosum. Zerosum files use the YNAB import type, so this is how you tell them apart, for example to name the source on a progress screen. It is absent on imports inspected before the field was added; treat that as ynab.
  • accounts lists every account in the register. sourceId is the value you send back in the configuration.
  • hasPlan says whether the archive included a plan, so budgeted amounts will be imported as well as transactions.
  • dateFormat reports which date formats read every date in the register. suggested is the recommended one, or null when no supported format reads them all. When ambiguous is true, more than one format works — dates such as 03/04/2026 read either way — and you should let the user confirm the choice. rejected gives, for each format that does not work, the first register row (1-based) whose date it cannot read.
  • warnings is present only when the file has something the import does not carry over. The import still succeeds. Each entry has a stable code and the number of rows it applies to (count). Codes are zerosum_tags_ignored, zerosum_set_aside_ignored and zerosum_transfer_untracked (a transfer to an account that is not in the export, imported as a regular transaction). Treat an unknown code as a generic warning.

The configuration.

{
"configuration": {
"accounts": [
{"sourceId": "ynab_account_5f0c2e9a41b7d3086ae1c2f4", "accountType": "checking"}
],
"dateFormat": "MM/DD/YYYY"
}
}
  • accounts must map every account in the inspection, once each, to a Budget Thing account type: checking, savings, credit_card, cash, digital_wallet, asset, liability or investment. Starting from suggestedAccountType is usually right. A missing, duplicate or unknown sourceId, or an unknown account type, is refused with INVALID_IMPORT_CONFIGURATION.
  • dateFormat is required and must be one of the inspection's candidates. The supported formats are MM/DD/YYYY, DD/MM/YYYY, YYYY-MM-DD, YYYY/MM/DD, DD-MM-YYYY, DD.MM.YYYY and YYYY.MM.DD. A format that was rejected is refused with a message naming the row and date it cannot read. The import uses the format you send and never guesses again.

The steps, in order: load, validate, categories, accounts, payees, transactions, reconciliation, finalize.

The summary. Every field is a count, except negativeBalanceRolloverAmountMinor, which is an amount in the workspace's minor unit.

FieldCounts
accountsCreatedAccounts created.
categoryParentsCreated, categoriesCreatedCategory groups and categories created.
payeesCreatedPayees created.
payeesMatchedSource payees that reused an existing payee instead of creating one.
transactionsCreatedTransactions created.
splitTransactionsCreatedSplit transactions created.
accountTransfersCreatedTransfers between accounts created.
liabilityPaymentsCreatedOf those transfers, the ones recognized as credit card payments.
transactionsCleared, transactionsReconciledTransactions marked cleared, and marked reconciled.
reconciliationsCreatedAccount reconciliations recorded.
zeroValueRowsSkippedRegister rows with a zero amount, skipped.
planRowsProcessedPlan rows read.
zeroAssignedRowsSkippedPlan rows with nothing assigned, skipped.
planActivityRowsValidatedPlan activity rows checked against the imported transactions.
categoryTransfersCreatedEvery movement of money between categories the import made. The five fields below break it down.
fundingTransfersCreatedMonthly amounts assigned to categories, from the plan.
explicitCategoryTransfersCreatedCategory moves recorded in the register.
inferredCategoryTransfersCreatedCategory moves worked out from the plan's activity.
negativeBalanceRolloversCreatedOverspent category balances carried forward. negativeBalanceRolloverAmountMinor is their total.
availableBalanceAdjustmentsCreatedAdjustments made so category balances match the export.

For what a YNAB import brings across and how it maps YNAB concepts, see Import from YNAB in the help centre.

actual​

Imports a budget exported from Actual Budget (Settings → Export data). Like YNAB, the workspace must have no transactions, and the import is all-or-nothing. The refusal is SOURCE_IMPORT_REQUIRES_EMPTY_WORKSPACE. There is no in-app screen yet, so this type is API only.

The file. Upload the ZIP exactly as Actual exports it, containing db.sqlite and metadata.json. The database is read-only and never executed; files that are oversized, malformed or contain unexpected schema objects are refused with INVALID_IMPORT_ARTIFACT.

The inspection.

{
"budgetName": "Household",
"schemaVersion": 1788468782000,
"budgetType": "envelope",
"accounts": [
{
"sourceId": "actual_account_9cc689540e721247074d1a03",
"name": "Everyday Checking",
"offBudget": false,
"closed": false,
"suggestedAccountType": "checking",
"transactionCount": 10
}
],
"transactionCount": 12,
"categoryCount": 3,
"payeeCount": 3,
"budgetRows": 3,
"amountSamples": [-120000, -8250],
"warnings": [{"code": "carryOverNotImported", "count": 1}]
}

budgetType is envelope or tracking; only envelope budgets have their monthly assignments imported. amountSamples are raw integers from the file, in hundredths of a unit: Actual always stores two decimal places whatever the currency, so 100000 is 1,000.00 (¥1,000 in a yen workspace). Show them to the user to confirm against Actual before starting.

The configuration.

{
"configuration": {
"currency": "USD",
"accounts": [
{"sourceId": "actual_account_9cc689540e721247074d1a03", "accountType": "checking"}
]
}
}
  • currency must equal the workspace's base currency. The file carries no currency, so this is the user's confirmation that its amounts are in it.
  • accounts must map every inspection sourceId, once each, to a Budget Thing account type. A mismatch is refused with INVALID_IMPORT_CONFIGURATION.

The summary has the same counters as a YNAB import, plus warnings: an array of {code, count} pairs. Warnings never contain names or other content from the file.

Warning codeCounts
trackingBudgetSkipped1 when a tracking budget's amounts were not imported
orphanTransactionsSkippedRows of deleted accounts, or split lines with no parent
unpairedTransfersImportedAsTransactionsTransfer halves imported as ordinary transactions
splitParentAmountMismatchSplits whose lines did not sum to the total (lines are used)
zeroAmountRowsSkippedRows with a zero amount
unresolvedCategoriesRows imported uncategorized because their category is gone
budgetRowsForUnknownCategoriesBudget amounts on income or deleted categories
duplicateNamesRenamedNames made unique with a numeric suffix
transferCategoriesDroppedTransfers between two asset-type accounts that had a category
carryOverNotImportedCategories with carry-over turned on
holdForNextMonthNotImportedMonths with money held for next month

For what is brought across, see Import from Actual Budget.