Last updated

Subcategories API Documentation

Endpoint

GET https://api.boyahq.com/v1/categories

Description

Retrieves a list of all expense categories and their associated subcategories for a business.

Authentication

  • Required: Yes
  • Type: ApiKeyAuth
  • Header: x-api-key: <apiKey>

Headers

HeaderRequiredDescription
acceptYesShould be set to application/json

Response

Success Response

  • Status Code: 200 OK
  • Content-Type: application/json

Response Body Structure

[
  {
    "_id": "string",
    "groupid": "string",
    "name": "string",
    "description": "string",
    "status": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "__v": number,
    "subcategories": [
      {
        "_id": "string",
        "group_id": "string",
        "category": "string",
        "code": "string",
        "name": "string",
        "description": "string",
        "status": "string",
        "createdAt": "string",
        "updatedAt": "string",
        "__v": number,
        "mapping_id": "string",
        "teams": ["string"]
      }
    ]
  }
]

Response Fields

Category Object

FieldTypeDescription
_idstringUnique identifier for the category
groupidstringGroup identifier
namestringCategory name
descriptionstringCategory description
statusstringCategory status (e.g., "ACTIVE")
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
__vnumberVersion number
subcategoriesarrayArray of subcategory objects

Subcategory Object

FieldTypeDescription
_idstringUnique identifier for the subcategory
group_idstringGroup identifier
categorystringParent category ID
codestringSubcategory code or Chart of account code (must be unique)
namestringSubcategory name
descriptionstringSubcategory description
statusstringSubcategory status (e.g., "ACTIVE")
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
__vnumberVersion number
mapping_idstringMapping identifier i.e external id where applicable
teamsarrayArray of team identifiers. When populated, only people in the selected teams can tag the subcategory

Error Responses

401 Unauthorized

{
  "error": "Unauthorized",
  "message": "Invalid or missing authentication token"
}

403 Forbidden

{
  "error": "Forbidden",
  "message": "Invalid business_id or insufficient permissions"
}

404 Not Found

{
  "error": "Not Found",
  "message": "No categories found for the specified business"
}

Example Categories

The API returns various category types including:

  • Office Expenses
  • Travel
  • Supplies & Hardware
  • IT & Software
  • Growth & Marketing
  • Business Meals
  • Business Entertainment

Each category contains relevant subcategories with specific codes and descriptions for expense tracking and management.

Notes

  • All timestamps are in ISO 8601 format
  • Category and subcategory status can be used for filtering active/inactive items
  • Team assignments are optional and may be empty arrays