propose_write
costs

Build an approval card for importing a staged expense sheet, after you have CONFIRMED the plan with the user (store mapp

Changed on

Build an approval card for importing a staged expense sheet, after you have CONFIRMED the plan with the user (store mapping, currency, refund handling). Pass store_map: an object mapping each raw store-column value (lowercased, exactly as inspect_expense_import returned it) to either a store id, the literal "split" (shared cost, split equally across all stores), or "skip" (do not import). Set split_anchor_store_id to one store id when any value is "split". Returns a preview card the user approves; nothing is written until they do. Always call inspect_expense_import first and confirm the mapping before this.

post/api/v1/tools/propose_expense_import

Request

  • Base URL
    https://app.magistry.io
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://app.magistry.io/api/oauth/authorize
      Token URLhttps://app.magistry.io/api/oauth/token
      Scopescosts:write

Headers

Idempotency-Key, string

Optional; honoured when sent. A unique string you choose for this request; send the SAME key when retrying and the first answer is returned instead of writing twice (idempotent-replayed: true). The same key with other arguments is 409 idempotency_conflict. If the header and idempotency_key are both sent they must be equal.

Request body

object required
import_id, string uuid required
store_map, object required

Lowercased store-column value → store id | "split" | "skip".

split_anchor_store_id, string

Store id the split rows anchor to.

currency, string

ISO 4217, e.g. EUR. Defaults to the sheet/EUR.

default_frequency, 'one_off' | 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly'

Default frequency for rows (use one_off for a dated ledger).

skip_refunds, boolean

Drop negative/refund rows. Default true.

categorize, boolean

Auto-categorize rows. Default true.

idempotency_key, string

Optional. A unique string you choose for this request. Send the SAME key when retrying after a timeout and Magistry returns the original outcome instead of performing the write twice. Reusing a key with different arguments is refused rather than replayed.

Response

Tool result

object required
ok, boolean required
result, unknown required

Changes

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    11 more changes in this revision