Boya Categories API (1.0.0)

API for managing expense categories in the Boya platform

Download OpenAPI description
Languages
Servers
Mock server
https://developer.boyahq.com/_mock/categories/
Boya API server
https://api.boyahq.com/v1/

List all categories with subcategories

Request

curl -i -X GET \
  https://developer.boyahq.com/_mock/categories/categories \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Successful response

Bodyapplication/jsonArray [
_idstring
groupidstring
namestring
descriptionstring
statusstring
Enum"ACTIVE""ARCHIVED"
createdAtstring(date-time)
updatedAtstring(date-time)
__vinteger
subcategoriesArray of objects(Subcategory)
]
Response
application/json
[ { "_id": "string", "groupid": "string", "name": "string", "description": "string", "status": "ACTIVE", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "__v": 0, "subcategories": [] } ]

Create a new category

Request

Bodyapplication/jsonrequired
namestringrequired
Example: "PT Certs"
descriptionstring
Example: "PT Certs"
curl -i -X POST \
  https://developer.boyahq.com/_mock/categories/categories \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "name": "PT Certs",
    "description": "PT Certs"
  }'

Responses

Category created successfully

Bodyapplication/json
_idstring
groupidstring
namestring
descriptionstring
statusstring
Enum"ACTIVE""ARCHIVED"
createdAtstring(date-time)
updatedAtstring(date-time)
__vinteger
subcategoriesArray of objects(Subcategory)
Response
application/json
{ "_id": "string", "groupid": "string", "name": "string", "description": "string", "status": "ACTIVE", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "__v": 0, "subcategories": [ {} ] }

Get a specific category

Request

Path
categoryIdstringrequired
curl -i -X GET \
  'https://developer.boyahq.com/_mock/categories/categories/{categoryId}' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Successful response

Bodyapplication/json
_idstring
groupidstring
namestring
descriptionstring
statusstring
Enum"ACTIVE""ARCHIVED"
createdAtstring(date-time)
updatedAtstring(date-time)
__vinteger
subcategoriesArray of objects(Subcategory)
Response
application/json
{ "_id": "string", "groupid": "string", "name": "string", "description": "string", "status": "ACTIVE", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "__v": 0, "subcategories": [ {} ] }

Update a category

Request

Update a category's details

Path
categoryIdstringrequired
Bodyapplication/jsonrequired
namestring

Updated name of the category

Example: "Updated PT Certs"
descriptionstring

Updated description of the category

Example: "Updated PT Certs description"
statusstring

Updated status of the category

Enum"ACTIVE""ARCHIVED"
curl -i -X PATCH \
  'https://developer.boyahq.com/_mock/categories/categories/{categoryId}' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "name": "Updated PT Certs",
    "description": "Updated PT Certs description",
    "status": "ACTIVE"
  }'

Responses

Category updated successfully

Bodyapplication/json
_idstring
groupidstring
namestring
descriptionstring
statusstring
Enum"ACTIVE""ARCHIVED"
createdAtstring(date-time)
updatedAtstring(date-time)
__vinteger
subcategoriesArray of objects(Subcategory)
Response
application/json
{ "_id": "string", "groupid": "string", "name": "string", "description": "string", "status": "ACTIVE", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "__v": 0, "subcategories": [ {} ] }

Archive a category

Request

Archives a category by setting its status to INACTIVE

Path
categoryIdstringrequired
curl -i -X DELETE \
  'https://developer.boyahq.com/_mock/categories/categories/{categoryId}' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Category archived successfully

Bodyapplication/json
messagestring
Example: "Category archived successfully"
statusstring
Example: "ARCHIVED"
Response
application/json
{ "message": "Category archived successfully", "status": "ARCHIVED" }

Add a subcategory to a category

Request

Create a new subcategory within a category. Can be made available to specific teams or all teams.

Path
categoryIdstringrequired
Bodyapplication/jsonrequired
namestringrequired

Name of the subcategory

codestringrequired

Unique code for the subcategory

descriptionstring

Description of the subcategory

groupidstringrequired

ID of the group this subcategory belongs to

category_idstringrequired

ID of the parent category

teamsArray of strings

Array of team IDs. Empty array means available to all teams.

statusstring

Status of the subcategory

Default "ACTIVE"
Enum"ACTIVE""INACTIVE"
curl -i -X POST \
  'https://developer.boyahq.com/_mock/categories/categories/{categoryId}/subcategories' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "name": "Free",
    "description": "free courses",
    "code": "F9034",
    "groupid": "67bb3fecdc7a527982f1b790",
    "category_id": "67bb3fecdc7a527982f1b790",
    "teams": [
      "672dd361617c24141539cd96"
    ]
  }'

Responses

Subcategory created successfully

Bodyapplication/json
_idstring
group_idstring
categorystring
codestring
namestring
descriptionstring
statusstring
Enum"ACTIVE""INACTIVE"
createdAtstring(date-time)
updatedAtstring(date-time)
__vinteger
mapping_idstring
teamsArray of strings
Response
application/json
{ "_id": "string", "group_id": "string", "category": "string", "code": "string", "name": "string", "description": "string", "status": "ACTIVE", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "__v": 0, "mapping_id": "string", "teams": [ "string" ] }

Update a subcategory

Request

Update a subcategory's details

Path
categoryIdstringrequired
subcategoryIdstringrequired
Bodyapplication/jsonrequired
namestring

Updated name of the subcategory

descriptionstring

Updated description of the subcategory

codestring

Updated code for the subcategory

teamsArray of strings

Updated array of team IDs. Empty array means available to all teams.

statusstring

Updated status of the subcategory

Enum"ACTIVE""ARCHIVED"
curl -i -X PATCH \
  'https://developer.boyahq.com/_mock/categories/categories/{categoryId}/subcategories/{subcategoryId}' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "name": "Updated Free",
    "description": "Updated free courses description",
    "teams": [
      "672dd361617c24141539cd96"
    ]
  }'

Responses

Subcategory updated successfully

Bodyapplication/json
_idstring
group_idstring
categorystring
codestring
namestring
descriptionstring
statusstring
Enum"ACTIVE""INACTIVE"
createdAtstring(date-time)
updatedAtstring(date-time)
__vinteger
mapping_idstring
teamsArray of strings
Response
application/json
{ "_id": "string", "group_id": "string", "category": "string", "code": "string", "name": "string", "description": "string", "status": "ACTIVE", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "__v": 0, "mapping_id": "string", "teams": [ "string" ] }

Archive a subcategory

Request

Archives a subcategory by setting its status to INACTIVE

Path
categoryIdstringrequired
subcategoryIdstringrequired
curl -i -X DELETE \
  'https://developer.boyahq.com/_mock/categories/categories/{categoryId}/subcategories/{subcategoryId}' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Subcategory archived successfully

Bodyapplication/json
messagestring
Example: "Subcategory archived successfully"
statusstring
Example: "INACTIVE"
Response
application/json
{ "message": "Subcategory archived successfully", "status": "INACTIVE" }