Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/soker90/finper/llms.txt

Use this file to discover all available pages before exploring further.

The Goals API lets you define savings targets with a name, an amount to reach, an optional deadline, a color, and an icon. POST /api/goals/:id/fund and POST /api/goals/:id/withdraw adjust currentAmount in real time. All amounts are rounded to 2 decimal places.

GOAL_COLORS enum

Hex value
#4CAF50
#2196F3
#9C27B0
#FF9800
#F44336
#00BCD4
#795548
#607D8B
#E91E63
#FFC107

GOAL_ICONS enum

Icon name
DollarOutlined
HomeOutlined
CarOutlined
LaptopOutlined
HeartOutlined
RocketOutlined
GiftOutlined
BankOutlined
TrophyOutlined
StarOutlined

POST /api/goals

Create a new savings goal.
name
string
required
Descriptive label for the goal (e.g. "Emergency Fund", "Holiday 2025").
targetAmount
number
required
The amount you want to reach. Must be positive.
currentAmount
number
Starting balance. Defaults to 0 if omitted. Must be ≥ 0.
deadline
string
Target date in ISO 8601 format (e.g. "2025-12-31"). Optional.
color
string
required
Hex colour for the UI indicator. Must be one of the GOAL_COLORS values listed above.
icon
string
required
Ant Design icon name. Must be one of the GOAL_ICONS values listed above.
curl -X POST http://localhost:3008/api/goals \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Emergency Fund",
    "targetAmount": 5000,
    "currentAmount": 200,
    "deadline": "2025-12-31",
    "color": "#4CAF50",
    "icon": "BankOutlined"
  }'
Response 201 — the created goal object.

GET /api/goals

List all goals for the authenticated user.
curl http://localhost:3008/api/goals \
  -H 'token: <your-jwt>'
Response 200
[
  {
    "_id": "65a1b...",
    "name": "Emergency Fund",
    "targetAmount": 5000,
    "currentAmount": 200,
    "deadline": "2025-12-31T00:00:00.000Z",
    "color": "#4CAF50",
    "icon": "BankOutlined",
    "user": "alice"
  }
]

GET /api/goals/:id

Retrieve a single goal by ID.
id
string
required
Goal ID.
curl http://localhost:3008/api/goals/65a1b... \
  -H 'token: <your-jwt>'
Response 200 — the goal object.

PUT /api/goals/:id

Edit an existing goal. All fields are optional; only provided fields are updated. Note that currentAmount is not editable via this endpoint — use /fund and /withdraw instead.
id
string
required
Goal ID.
name
string
New label.
targetAmount
number
New target amount. Must be positive.
deadline
string
New deadline in ISO 8601 format, or null to clear.
color
string
New colour hex from GOAL_COLORS.
icon
string
New icon name from GOAL_ICONS.
curl -X PUT http://localhost:3008/api/goals/65a1b... \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{"targetAmount": 6000, "color": "#2196F3"}'
Response 200 — the updated goal object.

DELETE /api/goals/:id

Permanently delete a goal.
id
string
required
Goal ID.
curl -X DELETE http://localhost:3008/api/goals/65a1b... \
  -H 'token: <your-jwt>'
Response 204 — no content.

POST /api/goals/:id/fund

Add money to a goal. Increases currentAmount by amount.
id
string
required
Goal ID.
amount
number
required
Amount to add. Must be positive.
currentAmount is rounded to 2 decimal places after each fund or withdraw operation.
curl -X POST http://localhost:3008/api/goals/65a1b.../fund \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{"amount": 500}'
Response 200 — the updated goal object with the new currentAmount.

POST /api/goals/:id/withdraw

Remove money from a goal. Decreases currentAmount by amount.
id
string
required
Goal ID.
amount
number
required
Amount to withdraw. Must be positive.
curl -X POST http://localhost:3008/api/goals/65a1b.../withdraw \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{"amount": 100}'
Response 200 — the updated goal object with the new currentAmount.

Build docs developers (and LLMs) love