Create an expense
Creates an expense (and, when isTaxDeductible is true, its tax deduction in the same database transaction). Emits expense.created to your webhooks.
Authorizations
OAuth 2.1 authorization code flow with PKCE (S256 only) and exact redirect-URI matching. Clients register by Dynamic Client Registration (/api/oauth/register) or a Client ID Metadata Document. Discovery: /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource/mcp. Access tokens last one hour and refresh tokens rotate. Tokens carry the audience https://api.ai2fin.com/mcp and are accepted on /mcp and /api/integrations/v1 only. A request with no scope gets read:transactions write:transactions read:bills write:bills; write:expenses and webhooks:manage must be asked for explicitly.
Headers
Optional. 1 to 128 characters of letters, digits, _, ., : or -. Stored in the database for 24 hours per account and endpoint. A completed request with the same key is replayed (200, Idempotency-Replayed: true); a request still in progress with the same key returns 409 IDEMPOTENCY_IN_PROGRESS. A failed request releases its key so a retry runs. A key that does not match the pattern is ignored (the request runs without idempotency).
128^[\w.:-]+$Body
Response
Replay of an earlier completed request with the same Idempotency-Key
