Create Account
POST /api/v1/accounts
Creates a new account.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Account name |
| category | string | No | Account type: bank or credit_card |
| description | string | No | Account description |
| acc_no | string | No | Account number |
| currency | string | No | Currency code (e.g., INR, USD) |
| color | string | No | Hex color code |
| opening_balance | number | No | Opening balance |
| opening_balance_date | string | No | Date when opening_balance was valid (YYYY-MM-DD). Auto-set to today if not provided when opening_balance is set. |
| upload_frequency | string | No | Upload frequency (default: weekly) |
Valid Values
category:
bank- Savings or current accountcredit_card- Credit card
upload_frequency:
dailyweeklymonthlyquarterlymanual
Example Request
curl -X POST "https://statements.finopsbricks.com/api/v1/accounts" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Savings Account",
"category": "bank",
"acc_no": "9876543210",
"currency": "INR",
"opening_balance": 50000
}'
Response
{
"data": {
"id": "acc456abc",
"name": "Savings Account",
"category": "bank",
"description": null,
"acc_no": "9876543210",
"currency": "INR",
"color": null,
"opening_balance": 50000.00,
"opening_balance_date": "2025-01-05",
"status": "active",
"upload_frequency": "weekly",
"created_at": "2025-01-05T10:30:00.000Z"
}
}
Errors
| Code | Description |
|---|---|
| 400 | Validation error (missing name, invalid category, etc.) |
| 401 | Invalid or missing API credentials |
| 403 | API key lacks accounts:create permission |