---
title: "Thêm / cập nhật danh mục theo code"
method: PUT
path: "/admin/excel/templates/categories"
tags: ["ExcelTemplatesAdmin"]
---

# Thêm / cập nhật danh mục theo code

`PUT /admin/excel/templates/categories`

## Request

- Base URL: `https://api.fireant.vn`
- URL: `https://api.fireant.vn/admin/excel/templates/categories`
- Auth: OAuth 2
  - Implicit: `https://accounts.fireant.vn/connect/authorize`
  - Scopes: `user-data-write`
- TypeScript: <https://skmtc.dev/fireant/apis/fireant-restful-api/docs/admin/excel/templates/categories/put.ts> (a function with typed inputs; its response is checked against the schema)

Body: danh sách ExcelTemplateCategory (code, name, nameEn, description, icon, orderIndex, isActive; bỏ qua categoryId,
templateCount). Danh mục không có trong danh sách giữ nguyên; tắt danh mục bằng isActive = false (không xóa).

## Request body

- FireAntApiModelsExcelTemplatesExcelTemplateCategory[]
  - `categoryId` integer: ID danh mục (bỏ qua khi upsert)
  - `code` string, required: Mã danh mục chữ thường a-z, 0-9, _, - (market, financials, valuation...)
  - `name` string, required: Tên tiếng Việt
  - `nameEn` string: Tên tiếng Anh
  - `description` string: Mô tả
  - `icon` string: Tên icon (client tự ánh xạ)
  - `orderIndex` integer: Thứ tự hiển thị (nhỏ lên trước)
  - `templateCount` integer: Số mẫu của ứng dụng đang xem (tham số app, mặc định excel) hiện trong thư viện cộng đồng thuộc danh mục (bỏ qua khi upsert)
  - `isActive` boolean: Đang sử dụng (API công khai chỉ trả danh mục đang bật; mặc định true khi upsert)

## Response `200`

Mọi danh mục sau cập nhật

- FireAntApiModelsExcelTemplatesExcelTemplateCategory[]
  - `categoryId` integer: ID danh mục (bỏ qua khi upsert)
  - `code` string, required: Mã danh mục chữ thường a-z, 0-9, _, - (market, financials, valuation...)
  - `name` string, required: Tên tiếng Việt
  - `nameEn` string: Tên tiếng Anh
  - `description` string: Mô tả
  - `icon` string: Tên icon (client tự ánh xạ)
  - `orderIndex` integer: Thứ tự hiển thị (nhỏ lên trước)
  - `templateCount` integer: Số mẫu của ứng dụng đang xem (tham số app, mặc định excel) hiện trong thư viện cộng đồng thuộc danh mục (bỏ qua khi upsert)
  - `isActive` boolean: Đang sử dụng (API công khai chỉ trả danh mục đang bật; mặc định true khi upsert)

## Other responses

- `400`: Dữ liệu không hợp lệ

## Changes

- **2026-10-10** `300cfd8b632c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fireant/apis/fireant-restful-api/changes/admin/excel/templates/categories/put.md)

---

[API](https://skmtc.dev/fireant/apis/fireant-restful-api.md) - [All operations](https://skmtc.dev/fireant/apis/fireant-restful-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fireant/apis/fireant-restful-api/revisions/c9b3aa855f95?raw)
