API Sathi docs
← All products

Bank Statement Analyser

ai

AI-powered bank statement analysis. Upload a digital bank-statement PDF (base64) and get parsed transactions, income & EMI detection, monthly summaries, category breakdown, FOIR, and a fraud/tamper check. Works across banks without per-bank templates. SYNC (default): POST returns the full analysis (allow up to ~180s for large 6–12 month statements). ASYNC (recommended for large statements): set "async": true (or pass a "callback_url") — POST returns 202 { job_id } immediately, then either poll GET /v1/bank-statement-analyse-v1/result/{job_id} (200 = done, 202 = still processing, 422 = failed) or receive the result at your callback_url (POST, signed with HMAC-SHA256 in the X-Signature header when configured). Billing: you are charged once per successful analysis; failed statements (422) are not charged.

POST /gw/v1/bank-statement-analyse-v1/SLA p95: 120000 ms

Authentication

Pass your key in the X-API-Key header. Use a test_ key against the sandbox and a live_ key in production. Send an optional Idempotency-Key header to safely retry — the same key returns the same response for 24h.

X-API-Key: live_xxxxxxxxxxxx

Request

Endpoint: POST https://apisathi.in/gw/v1/bank-statement-analyse-v1/

The trailing slash is required. /v1/bank-statement-analyse-v1/ works; /v1/bank-statement-analyse-v1 returns 404 Not Found. This applies to every product.

FieldTypeRequiredConstraints
pdf_base64stringrequiredBase64-encoded bank-statement PDF (digital/native, not a scan). Max 15MB.
passwordstringoptionalPDF password, if the statement is locked.
asyncbooleanoptionalIf true, returns 202 { job_id } immediately; fetch the result by polling or callback.
callback_urlstringoptionalOptional. If set, the analysis is processed async and POSTed here when ready (implies async).

Code snippets

curl -X POST https://apisathi.in/gw/v1/bank-statement-analyse-v1/ \
  -H "X-API-Key: $API_SATHI_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"pdf_base64":"<base64-encoded PDF>","password":"optional-pdf-password"}'

Response

FieldTypeRequiredConstraints
accountobjectoptionalHolder, masked account no., bank, IFSC.
periodobjectoptional
summaryobjectoptionalTotals, transaction count, avg/min/max balance.
incomeobjectoptionalEstimated monthly income + salary credits.
obligationsobjectoptionalEstimated monthly EMI + loan debits.
bouncesobjectoptionalCount + list of returned/bounced entries.
riskobjectoptionalFOIR + tamper check (running-balance reconciliation, PDF fingerprint).
monthlyarrayoptionalPer-month credits, debits, avg balance, salary, EMI.

Sample response

{
  "account": {
    "account_holder": "RAHUL VERMA",
    "account_number": "XXXXXX4321",
    "bank": "HDFC Bank",
    "ifsc": "HDFC0001234"
  },
  "period": {
    "from": "2026-04-01",
    "to": "2026-06-30",
    "months": 3
  },
  "summary": {
    "total_credits": 240000,
    "total_debits": 88000,
    "transaction_count": 16,
    "avg_monthly_balance": 61250.5
  },
  "income": {
    "estimated_monthly_income": 80000,
    "salary_credit_count": 3
  },
  "obligations": {
    "estimated_monthly_emi": 15000,
    "emi_debit_count": 3
  },
  "bounces": {
    "count": 1
  },
  "risk": {
    "foir": 0.1875,
    "tamper": {
      "is_suspicious": false,
      "score": 0,
      "checks": []
    }
  },
  "monthly": [
    {
      "month": "2026-04",
      "credits": 80000,
      "debits": 29300,
      "salary_credited": 80000
    }
  ]
}

Reading a 400

A schema rejection returns INVALID_REQUEST with a details array naming the exact field. Read it before guessing — it gives you the JSON path and what was wrong with it.

{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Request body failed schema validation",
    "details": [
      { "path": "/callback_url",
        "message": "unexpected property 'callback_url' — this endpoint does not accept unknown fields" }
    ]
  }
}

Most endpoints reject unknown top-level fields outright, so an extra key you added for your own bookkeeping will fail the call. Enum errors list the accepted values, and a missing required field is named with its full path.

Error codes

CodeHTTPWhen
INVALID_INPUT422The request was rejected as invalid — either it failed OUR schema validation (malformed input; not charged), or the upstream source rejected the value you sent. NOTE: an identifier that is well-formed but simply has NO RECORD is no longer an error — it returns 200 with `verified: false` and is charged (see the result-code table below). FIX the input before retrying; retrying the same value will fail again.
INVALID_API_KEY401Missing, malformed, or revoked X-API-Key.
OUT_OF_SCOPE403API key is not scoped for this product.
INSUFFICIENT_BALANCE402Wallet balance is below the per-call sale price. Recharge and retry.
RATE_LIMITED429Per-key RPS or RPM limit exceeded. Back off and retry after the Retry-After header.
PRODUCT_DEPRECATED410This API has been retired and is no longer available. Stop calling it — it will not return. Check the catalog for the current equivalent.
ROUTER_NO_VENDOR503No healthy vendor is currently available for this product. Transient — safe to retry after a short backoff. Not charged.
VENDOR_AUTH_FAILED502Upstream vendor rejected our credentials (our config issue). Not charged.
VENDOR_ERROR502A genuine transient upstream error (the source was briefly unavailable). Safe to RETRY after a short backoff. Not charged. NOTE: this is NOT for bad input — invalid values return 422 INVALID_INPUT, not 502.
TIMEOUT504Upstream vendor did not respond within the SLA window. Safe to retry after a short backoff. Not charged.

OpenAPI 3.1

Generated from this product's request/response JSON Schemas.

{
  "openapi": "3.1.0",
  "info": {
    "title": "API Sathi — Bank Statement Analyser",
    "version": "1.0.0",
    "description": "AI-powered bank statement analysis. Upload a digital bank-statement PDF (base64) and get parsed transactions, income & EMI detection, monthly summaries, category breakdown, FOIR, and a fraud/tamper check. Works across banks without per-bank templates.\n\nSYNC (default): POST returns the full analysis (allow up to ~180s for large 6–12 month statements). ASYNC (recommended for large statements): set \"async\": true (or pass a \"callback_url\") — POST returns 202 { job_id } immediately, then either poll GET /v1/bank-statement-analyse-v1/result/{job_id} (200 = done, 202 = still processing, 422 = failed) or receive the result at your callback_url (POST, signed with HMAC-SHA256 in the X-Signature header when configured). Billing: you are charged once per successful analysis; failed statements (422) are not charged."
  },
  "servers": [
    {
      "url": "https://apisathi.in/gw/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Your live or test key, e.g. `live_xxxxxxxxxxxx`."
      }
    }
  },
  "paths": {
    "/bank-statement-analyse-v1": {
      "post": {
        "operationId": "bankStatementAnalyseV1",
        "tags": [
          "ai"
        ],
        "summary": "Bank Statement Analyser",
        "description": "AI-powered bank statement analysis. Upload a digital bank-statement PDF (base64) and get parsed transactions, income & EMI detection, monthly summaries, category breakdown, FOIR, and a fraud/tamper check. Works across banks without per-bank templates.\n\nSYNC (default): POST returns the full analysis (allow up to ~180s for large 6–12 month statements). ASYNC (recommended for large statements): set \"async\": true (or pass a \"callback_url\") — POST returns 202 { job_id } immediately, then either poll GET /v1/bank-statement-analyse-v1/result/{job_id} (200 = done, 202 = still processing, 422 = failed) or receive the result at your callback_url (POST, signed with HMAC-SHA256 in the X-Signature header when configured). Billing: you are charged once per successful analysis; failed statements (422) are not charged.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional. Same key returns the same response for 24h."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "pdf_base64"
                ],
                "properties": {
                  "pdf_base64": {
                    "type": "string",
                    "description": "Base64-encoded bank-statement PDF (digital/native, not a scan). Max 15MB."
                  },
                  "password": {
                    "type": "string",
                    "description": "PDF password, if the statement is locked."
                  },
                  "async": {
                    "type": "boolean",
                    "description": "If true, returns 202 { job_id } immediately; fetch the result by polling or callback."
                  },
                  "callback_url": {
                    "type": "string",
                    "description": "Optional. If set, the analysis is processed async and POSTed here when ready (implies async)."
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "pdf_base64": "<base64-encoded PDF>",
                "password": "optional-pdf-password"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful, normalized response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account": {
                      "type": "object",
                      "description": "Holder, masked account no., bank, IFSC."
                    },
                    "period": {
                      "type": "object"
                    },
                    "summary": {
                      "type": "object",
                      "description": "Totals, transaction count, avg/min/max balance."
                    },
                    "income": {
                      "type": "object",
                      "description": "Estimated monthly income + salary credits."
                    },
                    "obligations": {
                      "type": "object",
                      "description": "Estimated monthly EMI + loan debits."
                    },
                    "bounces": {
                      "type": "object",
                      "description": "Count + list of returned/bounced entries."
                    },
                    "risk": {
                      "type": "object",
                      "description": "FOIR + tamper check (running-balance reconciliation, PDF fingerprint)."
                    },
                    "monthly": {
                      "type": "array",
                      "description": "Per-month credits, debits, avg balance, salary, EMI."
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "account": {
                    "account_holder": "RAHUL VERMA",
                    "account_number": "XXXXXX4321",
                    "bank": "HDFC Bank",
                    "ifsc": "HDFC0001234"
                  },
                  "period": {
                    "from": "2026-04-01",
                    "to": "2026-06-30",
                    "months": 3
                  },
                  "summary": {
                    "total_credits": 240000,
                    "total_debits": 88000,
                    "transaction_count": 16,
                    "avg_monthly_balance": 61250.5
                  },
                  "income": {
                    "estimated_monthly_income": 80000,
                    "salary_credit_count": 3
                  },
                  "obligations": {
                    "estimated_monthly_emi": 15000,
                    "emi_debit_count": 3
                  },
                  "bounces": {
                    "count": 1
                  },
                  "risk": {
                    "foir": 0.1875,
                    "tamper": {
                      "is_suspicious": false,
                      "score": 0,
                      "checks": []
                    }
                  },
                  "monthly": [
                    {
                      "month": "2026-04",
                      "credits": 80000,
                      "debits": 29300,
                      "salary_credited": 80000
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, or revoked X-API-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Wallet balance is below the per-call sale price. Recharge and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "API key is not scoped for this product.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "This API has been retired and is no longer available. Stop calling it — it will not return. Check the catalog for the current equivalent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "The request was rejected as invalid — either it failed OUR schema validation (malformed input; not charged), or the upstream source rejected the value you sent. NOTE: an identifier that is well-formed but simply has NO RECORD is no longer an error — it returns 200 with `verified: false` and is charged (see the result-code table below). FIX the input before retrying; retrying the same value will fail again.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Per-key RPS or RPM limit exceeded. Back off and retry after the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Upstream vendor rejected our credentials (our config issue). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "No healthy vendor is currently available for this product. Transient — safe to retry after a short backoff. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "Upstream vendor did not respond within the SLA window. Safe to retry after a short backoff. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}