Skip to main content
Including its metadata, associated files, and object statistics.
This endpoint returns comprehensive subcategory information including object counts and associated files.

Endpoint

curl -X GET "https://api.g2cplatform.com/api/v2/object/{COMPANY_ID}/category/{CATEGORY_ID}/subcategory/{SUBCATEGORY_ID}" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Request

HTTP Method

GET

URL

https://api.g2cplatform.com/api/v2/object/{COMPANY_ID}/category/{CATEGORY_ID}/subcategory/{SUBCATEGORY_ID}

Path Parameters

ParameterTypeRequiredDescription
COMPANY_IDstring (UUID)Company identifier
CATEGORY_IDstring (UUID)Parent category identifier
SUBCATEGORY_IDstring (UUID)Subcategory identifier

Headers

X-API-Key: YOUR_API_KEY
Content-Type: application/json

Response

Success Response (200)

{
  "status": "success",
  "data": {
    "id": "sub_7f8a9b2c-4d5e-6f7g-8h9i-0j1k2l3m4n5o",
    "name": "Smartphones",
    "status": "active",
    "path": "Electronics/Smartphones",
    "description": "Mobile devices and smartphones including Android and iOS devices",
    "imageId": "img_1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
    "createDate": "2025-08-01T11:00:00Z",
    "categoryId": "cat_8g9h0i1j-2k3l-4m5n-6o7p-8q9r0s1t2u3v",
    "files": [
      {
        "id": "file_2b3c4d5e-6f7g-8h9i-0j1k-2l3m4n5o6p7q",
        "name": "smartphone_specs.pdf",
        "title": "Smartphone Specifications Template",
        "mimeType": "application/pdf",
        "uploadDate": "2025-08-01T15:30:00Z"
      }
    ],
    "statistics": {
      "totalObjects": 15,
      "lastObjectCreated": "2025-08-02T09:15:00Z",
      "averageObjectsPerDay": 2.5
    }
  },
  "timestamp": "2025-08-02T10:30:00Z"
}

Subcategory Properties

FieldTypeDescription
idstring (UUID)Unique subcategory identifier
namestringSubcategory name
statusstringSubcategory status (active, delisted, removed)
pathstringFull hierarchical path
descriptionstringSubcategory description
imageIdstring | nullAssociated image identifier
createDatestring (ISO 8601)Creation timestamp
categoryIdstring (UUID)Parent category ID
filesarrayAssociated files
statisticsobjectUsage statistics

Error Responses

404 Not Found

{
  "error": "Subcategory not found",
  "code": "SUBCATEGORY_NOT_FOUND",
  "timestamp": "2025-08-02T10:30:00Z"
}

Use Cases

Subcategory Overview

async function getSubcategoryOverview(companyId, categoryId, subcategoryId) {
  const response = await fetch(
    `https://api.g2cplatform.com/api/v2/object/${companyId}/category/${categoryId}/subcategory/${subcategoryId}`,
    {
      headers: { 'X-API-Key': 'YOUR_API_KEY' }
    }
  );

  const subcategory = await response.json();

  console.log(`Subcategory: ${subcategory.data.path}`);
  console.log(`Objects: ${subcategory.data.statistics.totalObjects}`);

  return subcategory.data;
}

Next Steps