Skip to main content
PUT
cURL
Set kind to document (the default) or rule. The Body section marks each field as document only or rule only. Documents require the write:memory scope. Rules require the write:operational-rules scope and an API key with an owner. A document write replaces the full file. To replace a document, read it first and send its organization-layer version as expected_version. Document text is reference information; it does not change accounting controls. A saved rule applies to later classification and cash-application runs. It does not process transactions now; to classify selected transactions now, use Classify transactions. Rules apply only to your organization and do not inherit firm documents. Returns the saved document path, or the saved rule and its outcome. The document response does not include the new version; read the document again to get it.
cURL

Authorizations

X-API-Key
string
header
required

Your organization API key. Some operations also need a key that is associated with a user; their pages say so.

Query Parameters

kind
enum<string>
default:document

document (the default) for a memory document, or rule for an operational rule.

Available options:
document,
rule
path
string

Document only, and required for documents. Relative path of a Markdown or YAML file, such as knowledge/vendors.md. Use profile.md, clients.yaml, or a file in a folder. You cannot write JSON or JSONL files, or files in refs/, journal/, artifacts/, timeline/, workstreams/, knowledge/facts/, knowledge/preferences/ or knowledge/decisions/. A skill must be skills/{slug}/SKILL.md. Firm documents allow only policy/, knowledge/, skills/, profile.md and clients.yaml.

Minimum string length: 1

Body

application/json
content
string
required

Document only, and required for documents. The full file body. A write replaces the file; it never merges.

Maximum string length: 200000
rationale
string
required

Document only, and required for documents. Why you make this change. It is recorded with the document.

Required string length: 1 - 2000
expected_version
string | null
required

Document only, and required for documents. The version you read for this path, or null to create a new file. A mismatch returns HTTP 409.

domain
enum<string>

Rule only. classification for transaction rules, or cash_application for deposit matching rules.

Available options:
classification,
cash_application
description_contains
string

Rule only. Classification rules: text that matches the memo or payee of a bank transaction. Saved and returned in lowercase. Matching ignores case.

source_category
string

Rule only. For classification rules: source-platform metadata category (Plaid personal-finance category, Ramp accounting category). Preferred for a class of transactions.

merchant_name
string

Rule only. For classification rules: merchant match for card spend (Ramp/Raincard).

blockchain_address
string

Rule only. Classification rules: address that matches the from or to address. Saved and returned in lowercase. Matching ignores case.

asset_type
string

Rule only. For classification rules: asset match for crypto transactions (USDC, ETH, …).

direction
enum<string>

Rule only. For classification rules: direction constraint. Defaults to ANY.

Available options:
DEPOSIT,
WITHDRAWAL,
ANY
category_ledger_account_id
string

Rule only. Required for classification rules: the ledger account matching transactions are classified to. Get it from List ledger accounts.

resolved_payee
string

Rule only. For classification rules: clean payee name for display.

default_tag_id
string

Rule only. For classification rules: tag applied to matching transactions.

title
string

Rule only. Required for cash-application rules: short human-readable rule name.

statement
string

Rule only. Required for cash-application rules: natural-language statement of the rule.

cash_application_action
enum<string>

Rule only. For cash-application rules: defaults to route_to_account.

Available options:
route_to_account,
require_human_review
matcher
string

Rule only. Required for cash-application rules: the exact phrase matched against invoice line descriptions / product names. Supply the SKU or product text verbatim.

match_operator
enum<string>

Rule only. For cash-application rules: contains (default) fires when the line text contains the matcher anywhere; exact requires the normalized line label to equal it.

Available options:
exact,
contains
ledger_account_id
string

Rule only. Required for cash-application rules with route_to_account: target ledger account id. It is not inferred from the rule text.

ledger_account_name
string

Rule only. Required for cash-application rules with route_to_account: name matching ledger_account_id, for display and auditing.

Response

The organization memory file was saved.

success
boolean
required

true when the file was saved.

path
string
required

Relative file path.

layer
enum<string>
required

The layer written. This endpoint writes organization scope only.

Available options:
org
rationale
string
required

The rationale recorded with the write.