Skip to main content
GET
/
api
/
accounts
List Accounts
curl --request GET \
  --url https://api.example.com/api/accounts
{
  "success": true,
  "accounts": [
    {
      "id": "<string>",
      "name": "<string>",
      "owner_id": "<string>",
      "role": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>"
    }
  ]
}
Returns all accounts where the authenticated user is either an owner or a member.

Authentication

Requires authentication token.

Response

success
boolean
Indicates if the operation was successful
accounts
array
Array of account objects with user role

Example Request

curl -X GET https://api.example.com/api/accounts \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "success": true,
  "accounts": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Personal Finances",
      "owner_id": "user-uuid-here",
      "role": "owner",
      "created_at": "2026-01-15T10:30:00.000Z",
      "updated_at": "2026-03-01T14:20:00.000Z"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "Shared Household",
      "owner_id": "other-user-uuid",
      "role": "member",
      "created_at": "2026-02-01T09:15:00.000Z"
    }
  ]
}

Error Responses

401 Unauthorized

Returned when the authentication token is missing or invalid.

Notes

  • Results are ordered by creation date (newest first)
  • The role field indicates the user’s permission level:
    • owner: Full control over the account, can invite members, modify settings, and delete the account
    • member: Can view and use the account but cannot modify settings or invite others
  • Users can be members of accounts they don’t own through the invitation system

Get Account by ID

Returns a specific account by ID if the user has access to it.

Path Parameters

id
string
required
The account ID (UUID)

Example Request

curl -X GET https://api.example.com/api/accounts/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "success": true,
  "account": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Personal Finances",
    "owner_id": "user-uuid-here",
    "role": "owner",
    "created_at": "2026-01-15T10:30:00.000Z",
    "updated_at": "2026-03-01T14:20:00.000Z"
  }
}

Error Responses

404 Not Found

{
  "error": "Cuenta no encontrada"
}
Returned when the account doesn’t exist or the user doesn’t have access to it.

Build docs developers (and LLMs) love