Skip to main content
PATCH
/
api
/
accounts
/
:id
{
  "name": "Emergency Fund",
  "color": "#EF4444"
}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Emergency Fund",
  "type": "SAVINGS",
  "currency": "USD",
  "balance": 3250,
  "color": "#EF4444",
  "icon": "shield",
  "targetAmount": 10000,
  "targetDate": "2027-06-30T00:00:00Z",
  "isDefault": false,
  "userId": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2026-02-01T14:00:00Z",
  "updatedAt": "2026-03-04T11:45:00Z"
}
Updates an existing account. All fields from the create request are available for update, and all are optional.

Path Parameters

id
string
required
The unique identifier of the account to update

Request Body

The update DTO extends the create DTO as a partial type, meaning all fields are optional. Only include fields you want to update.
name
string
The name of the account
type
enum
The type of accountOptions: WALLET, SAVINGS, INVESTMENT, CREDIT_CARD
currency
string
The currency code for the accountOptions: ARS, USD, EUR
color
string
Hex color identifier for the account
icon
string
Icon identifier for the account
targetAmount
number
Target amount goal (primarily for SAVINGS accounts)Must be at least 1 if provided
targetDate
string
Target date for reaching the goalFormat: ISO 8601 date string

Validation Rules

  • The account must exist and belong to the authenticated user
  • If type is provided, it must be a valid AccountType enum value
  • If currency is provided, it must be one of: ARS, USD, EUR
  • If color is provided, it must be a valid hex color code
  • If targetAmount is provided, it must be at least 1
  • If targetDate is provided, it must be a valid ISO 8601 date string

Response

Returns the updated account object with all fields.
id
string
Unique identifier for the account
name
string
Updated account name
type
string
Account type enum value
currency
string
Currency code
balance
number
Current balance (unchanged by update)
color
string
Hex color code
icon
string
Icon identifier
targetAmount
number | null
Target amount goal
targetDate
string | null
Target date for goal
isDefault
boolean
Whether this is the default account
userId
string
Owner user ID
createdAt
string
Creation timestamp
updatedAt
string
Last update timestamp (will be updated)

Error Responses

404
error
Account not found - The account doesn’t exist or doesn’t belong to the user
400
error
Bad Request - Invalid field values or validation errors
{
  "name": "Emergency Fund",
  "color": "#EF4444"
}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Emergency Fund",
  "type": "SAVINGS",
  "currency": "USD",
  "balance": 3250,
  "color": "#EF4444",
  "icon": "shield",
  "targetAmount": 10000,
  "targetDate": "2027-06-30T00:00:00Z",
  "isDefault": false,
  "userId": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2026-02-01T14:00:00Z",
  "updatedAt": "2026-03-04T11:45:00Z"
}

Build docs developers (and LLMs) love