curl --request POST \
--url https://api.example.com/api/accounts \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"encryptedAccountKey": "<string>"
}
'{
"success": true,
"account": {
"id": "<string>",
"name": "<string>",
"owner_id": "<string>",
"created_at": "<string>"
},
"categoriesCopied": {
"categories": 123,
"subcategories": 123
},
"error": "<string>"
}Create a new account with default categories
curl --request POST \
--url https://api.example.com/api/accounts \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"encryptedAccountKey": "<string>"
}
'{
"success": true,
"account": {
"id": "<string>",
"name": "<string>",
"owner_id": "<string>",
"created_at": "<string>"
},
"categoriesCopied": {
"categories": 123,
"subcategories": 123
},
"error": "<string>"
}curl -X POST https://api.example.com/api/accounts \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
-d '{
"name": "Personal Finances",
"encryptedAccountKey": "encrypted_key_string_here"
}'
{
"success": true,
"account": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Personal Finances",
"owner_id": "user-uuid-here",
"created_at": "2026-03-05T10:30:00.000Z"
},
"categoriesCopied": {
"categories": 12,
"subcategories": 48
}
}
{
"error": "El nombre es requerido"
}
{
"error": "Account limit reached"
}
account_users entry is automatically created with role owner