> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tight.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Save chart of accounts template

> Save a new (or update an existing) chart of accounts template



## OpenAPI

````yaml https://dev.tight.com/v3/api-docs post /v6/templates/chartOfAccounts
openapi: 3.0.1
info:
  title: Tight API
  contact:
    name: Hurdlr, Inc. (dba Tight)
    url: https://www.tight.com
    email: api@tight.com
  version: 6.0.0
servers:
  - url: https://sandbox.tight.com
    description: Staging Environment
  - url: https://prod.tight.com
    description: Production Environment
security:
  - EmbedToken: []
paths:
  /v6/templates/chartOfAccounts:
    post:
      tags:
        - Templates
      summary: Save chart of accounts template
      description: Save a new (or update an existing) chart of accounts template
      operationId: postTemplateChartOfAccounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CoaTemplatePostDto'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponseCoaTemplateGetDto'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: REQUIRED
                    message: Amount is required
                    param: amount
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: INVALID_TOKEN
                    message: Invalid access token
        '403':
          description: Not authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: FORBIDDEN
                    message: Expired access token
        '404':
          description: Endpoint not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: BAD_REQUEST
                    message: Resource not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: UNKNOWN_ERROR
                    message: Something went wrong. Please try again later.
      security:
        - PartnerAuth: []
components:
  schemas:
    CoaTemplatePostDto:
      required:
        - name
      type: object
      properties:
        id:
          type: string
          description: Id of the CoA template, required when updating an existing template
          example: tcoa_123456
        name:
          type: string
          description: Name of the CoA template
          nullable: false
          example: Standard Business
        businessTypeId:
          type: string
          description: Id of the business type this template applies to
          nullable: true
          example: bzt_123456
        isDefault:
          type: boolean
          description: >-
            When true, designates this template as the partner's default for its
            business-type group (null businessType is its own group); at most
            one template per group may be default; only allowed on fully mapped
            (non-pending) templates
          nullable: true
        accounts:
          type: array
          nullable: true
          items:
            required:
              - accountNo
              - name
              - type
            type: object
            properties:
              id:
                type: string
                description: >-
                  Id of the GL account, required when updating an existing
                  account
                nullable: true
                example: tgla_123456
              name:
                type: string
                description: Name of the GL account
                example: Accounts Receivable
              accountNo:
                type: string
                description: Account number in the chart of accounts
                example: '11500'
              type:
                type: string
                description: Type of the General Ledger account
                example: ASSET
                enum:
                  - ASSET
                  - LIABILITY
                  - EQUITY
                  - INCOME
                  - COGS
                  - EXPENSE
                  - OTHER_INCOME
                  - OTHER_EXPENSE
                  - SUSPENSE
              subType:
                type: string
                description: >-
                  Sub-type of the General Ledger account, based on the account
                  type
                nullable: true
                example: AR
              entityType:
                type: string
                description: >-
                  Entity type this account is specific to; null means it applies
                  to all entity types
                nullable: true
                example: S_CORP
                enum:
                  - SOLE_PROPRIETORSHIP
                  - LLP
                  - LLC
                  - S_CORP
                  - C_CORP
              taxCategory:
                type: string
                description: Tax category for this account
                nullable: true
                example: SCHEDULE_C
                enum:
                  - ADVERTISING
                  - CAR_AND_TRUCK_NOT_DEDUCTIBLE_IF_MILEAGE
                  - COMMISSIONS_AND_FEES
                  - CONTRACT_LABOR
                  - DEPLETION
                  - DEPRECIATION_AND_SECTION_179
                  - EMPLOYEE_BENEFIT_PROGRAMS
                  - INSURANCE_OTHER_THAN_HEALTH
                  - MORTGAGE
                  - OTHER_INTEREST
                  - LEGAL_AND_PROFESSIONAL_SERVICES
                  - OFFICE_EXPENSE
                  - PENSION_AND_PROFIT_SHARING_PLANS
                  - RENT_OR_LEASE_VEHICLES_MACHINERY_AND_EQUIPMENT
                  - RENT_OR_LEASE_OTHER_BUSINESS_PROPERTY
                  - REPAIRS_AND_MAINTENANCE
                  - SUPPLIES
                  - TAXES_AND_LICENSES
                  - TRAVEL
                  - DEDUCTIBLE_MEALS_AND_ENTERTAINMENT_50_PERCENT
                  - UTILITIES
                  - WAGES
                  - OTHER_EXPENSES
                  - NOT_APPLICABLE
                  - BAD_DEBTS
                  - CHARITABLE_CONTRIBUTIONS
                  - COMPENSATION_OF_OFFICERS
                  - DOMESTIC_PRODUCTION_ACTIVITIES
                  - CAR_AND_TRUCK_DEDUCTIBLE_IF_MILEAGE
                  - COST_OF_GOODS_SOLD_PURCHASES
                  - PROPERTY_TAXES
                  - FUEL_COSTS_EXCEPT_MOTOR_VEHICLES
                  - DELIVERY_FREIGHT
                  - COST_OF_GOODS_SOLD_LABOR
                  - DUES_AND_SUBSCRIPTIONS
                  - DEDUCTIBLE_MEALS_AND_ENTERTAINMENT_100_PERCENT
                  - AMORTIZATION
              customData:
                type: string
                description: >-
                  Custom JSON in which you can store any data with max length of
                  2000 characters
                nullable: true
                example: '{"internal_key":"some_internal_key","some_other_field":23434}'
              children:
                type: array
                nullable: true
                items:
                  $ref: '#/components/schemas/CoaTemplateAccountPostDto'
    SuccessResponseCoaTemplateGetDto:
      type: object
      properties:
        result:
          type: string
          description: The result of the action performed.
          enum:
            - SUCCESS
            - FAILURE
        data:
          $ref: '#/components/schemas/CoaTemplateGetDto'
    ErrorResponse:
      type: object
      properties:
        result:
          type: string
          description: The result of the action performed.
          enum:
            - SUCCESS
            - FAILURE
        data:
          type: object
          description: The data generated by the action performed.
          nullable: true
        error:
          type: array
          items:
            $ref: '#/components/schemas/ErrorItem'
    CoaTemplateAccountPostDto:
      required:
        - accountNo
        - name
        - type
      type: object
      properties:
        id:
          type: string
          description: Id of the GL account, required when updating an existing account
          nullable: true
          example: tgla_123456
        name:
          type: string
          description: Name of the GL account
          example: Accounts Receivable
        accountNo:
          type: string
          description: Account number in the chart of accounts
          example: '11500'
        type:
          type: string
          description: Type of the General Ledger account
          example: ASSET
          enum:
            - ASSET
            - LIABILITY
            - EQUITY
            - INCOME
            - COGS
            - EXPENSE
            - OTHER_INCOME
            - OTHER_EXPENSE
            - SUSPENSE
        subType:
          type: string
          description: Sub-type of the General Ledger account, based on the account type
          nullable: true
          example: AR
        entityType:
          type: string
          description: >-
            Entity type this account is specific to; null means it applies to
            all entity types
          nullable: true
          example: S_CORP
          enum:
            - SOLE_PROPRIETORSHIP
            - LLP
            - LLC
            - S_CORP
            - C_CORP
        taxCategory:
          type: string
          description: Tax category for this account
          nullable: true
          example: SCHEDULE_C
          enum:
            - ADVERTISING
            - CAR_AND_TRUCK_NOT_DEDUCTIBLE_IF_MILEAGE
            - COMMISSIONS_AND_FEES
            - CONTRACT_LABOR
            - DEPLETION
            - DEPRECIATION_AND_SECTION_179
            - EMPLOYEE_BENEFIT_PROGRAMS
            - INSURANCE_OTHER_THAN_HEALTH
            - MORTGAGE
            - OTHER_INTEREST
            - LEGAL_AND_PROFESSIONAL_SERVICES
            - OFFICE_EXPENSE
            - PENSION_AND_PROFIT_SHARING_PLANS
            - RENT_OR_LEASE_VEHICLES_MACHINERY_AND_EQUIPMENT
            - RENT_OR_LEASE_OTHER_BUSINESS_PROPERTY
            - REPAIRS_AND_MAINTENANCE
            - SUPPLIES
            - TAXES_AND_LICENSES
            - TRAVEL
            - DEDUCTIBLE_MEALS_AND_ENTERTAINMENT_50_PERCENT
            - UTILITIES
            - WAGES
            - OTHER_EXPENSES
            - NOT_APPLICABLE
            - BAD_DEBTS
            - CHARITABLE_CONTRIBUTIONS
            - COMPENSATION_OF_OFFICERS
            - DOMESTIC_PRODUCTION_ACTIVITIES
            - CAR_AND_TRUCK_DEDUCTIBLE_IF_MILEAGE
            - COST_OF_GOODS_SOLD_PURCHASES
            - PROPERTY_TAXES
            - FUEL_COSTS_EXCEPT_MOTOR_VEHICLES
            - DELIVERY_FREIGHT
            - COST_OF_GOODS_SOLD_LABOR
            - DUES_AND_SUBSCRIPTIONS
            - DEDUCTIBLE_MEALS_AND_ENTERTAINMENT_100_PERCENT
            - AMORTIZATION
        customData:
          type: string
          description: >-
            Custom JSON in which you can store any data with max length of 2000
            characters
          nullable: true
          example: '{"internal_key":"some_internal_key","some_other_field":23434}'
        children:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CoaTemplateAccountPostDto'
    CoaTemplateGetDto:
      required:
        - accounts
        - globalGlAccountMappings
        - id
        - isDefault
        - isPending
        - name
        - status
      type: object
      properties:
        id:
          type: string
          description: Id of the CoA template
          example: tcoa_123456
        name:
          type: string
          description: Name of the CoA template
          example: Standard Business
        businessTypeId:
          type: string
          description: Id of the business type this template applies to
          nullable: true
          example: bzt_123456
        status:
          type: string
          description: Status of the CoA template
          example: ACTIVE
          enum:
            - ACTIVE
            - INACTIVE
            - REMOVED
        isPending:
          type: boolean
          description: >-
            True when not all Global GL Accounts are mapped; false when the
            template is fully mapped and ready for use
        isDefault:
          type: boolean
          description: >-
            True when this is the default CoA template; defaults are scoped per
            business type, or globally if no business type is set
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/TemplateGlAccount'
        globalGlAccountMappings:
          type: array
          items:
            $ref: '#/components/schemas/GlobalGlAccountMappingDto'
      description: The data generated by the action performed.
    ErrorItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the error. Safe for programmatic use.
          enum:
            - UNKNOWN_ERROR
            - INVALID_TOKEN
            - EXPIRED_TOKEN
            - FORBIDDEN
            - BAD_REQUEST
            - JSON_ERROR
            - DUPLICATE
            - REQUIRED
            - INVALID_VALUE
            - NOT_MODIFIABLE
            - INVALID_FORMAT
            - NOT_FOUND
        message:
          type: string
          description: >-
            A human-readable message providing more details about the error.
            Safe for displaying to a user.
        param:
          type: string
          description: >-
            If the error is parameter-specific, the parameter related to the
            error. This can be used to display a message near the correct form
            field.
      description: Errors associated with the action performed, if applicable.
    TemplateGlAccount:
      required:
        - accountNo
        - children
        - id
        - level
        - name
        - subType
        - type
      type: object
      properties:
        id:
          type: string
          description: Id of the template General Ledger account
          example: tgla_324231
        accountNo:
          type: string
          description: Account number in the chart of accounts
          example: '11500'
        name:
          type: string
          description: Name of the template General Ledger account
          example: Accounts Receivable
        level:
          type: integer
          description: Hierarchical level of the account in the chart of accounts
          format: int32
          example: 3
        type:
          type: string
          description: Type of the General Ledger account
          example: ASSET
          enum:
            - ASSET
            - LIABILITY
            - EQUITY
            - INCOME
            - COGS
            - EXPENSE
            - OTHER_INCOME
            - OTHER_EXPENSE
            - SUSPENSE
        subType:
          type: string
          description: Sub-type of the General Ledger account, based on the account type
          nullable: true
          example: AR
        entityType:
          type: string
          description: >-
            Entity type this account is specific to; null means it applies to
            all entity types
          nullable: true
          example: S_CORP
          enum:
            - SOLE_PROPRIETORSHIP
            - LLP
            - LLC
            - S_CORP
            - C_CORP
        taxCategory:
          type: string
          description: Tax category for this account
          nullable: true
          example: SCHEDULE_C
          enum:
            - ADVERTISING
            - CAR_AND_TRUCK_NOT_DEDUCTIBLE_IF_MILEAGE
            - COMMISSIONS_AND_FEES
            - CONTRACT_LABOR
            - DEPLETION
            - DEPRECIATION_AND_SECTION_179
            - EMPLOYEE_BENEFIT_PROGRAMS
            - INSURANCE_OTHER_THAN_HEALTH
            - MORTGAGE
            - OTHER_INTEREST
            - LEGAL_AND_PROFESSIONAL_SERVICES
            - OFFICE_EXPENSE
            - PENSION_AND_PROFIT_SHARING_PLANS
            - RENT_OR_LEASE_VEHICLES_MACHINERY_AND_EQUIPMENT
            - RENT_OR_LEASE_OTHER_BUSINESS_PROPERTY
            - REPAIRS_AND_MAINTENANCE
            - SUPPLIES
            - TAXES_AND_LICENSES
            - TRAVEL
            - DEDUCTIBLE_MEALS_AND_ENTERTAINMENT_50_PERCENT
            - UTILITIES
            - WAGES
            - OTHER_EXPENSES
            - NOT_APPLICABLE
            - BAD_DEBTS
            - CHARITABLE_CONTRIBUTIONS
            - COMPENSATION_OF_OFFICERS
            - DOMESTIC_PRODUCTION_ACTIVITIES
            - CAR_AND_TRUCK_DEDUCTIBLE_IF_MILEAGE
            - COST_OF_GOODS_SOLD_PURCHASES
            - PROPERTY_TAXES
            - FUEL_COSTS_EXCEPT_MOTOR_VEHICLES
            - DELIVERY_FREIGHT
            - COST_OF_GOODS_SOLD_LABOR
            - DUES_AND_SUBSCRIPTIONS
            - DEDUCTIBLE_MEALS_AND_ENTERTAINMENT_100_PERCENT
            - AMORTIZATION
        customData:
          type: object
          description: >-
            Custom JSON in which you can store any data with max length of 2000
            characters
          nullable: true
          example:
            internal_key: some_internal_key
            some_other_field: 23434
        children:
          type: array
          items:
            $ref: '#/components/schemas/TemplateGlAccount'
      description: Template GL account assigned to matched transactions
      nullable: true
    GlobalGlAccountMappingDto:
      required:
        - children
        - id
        - mappedTemplateGlAccounts
        - name
      type: object
      properties:
        id:
          type: string
          description: Id of the Global GL Account
          example: ggla_123456
        name:
          type: string
          description: Name of the Global GL Account
        mappedTemplateGlAccounts:
          type: array
          description: >-
            Template GL Accounts mapped to this Global GL Account for this
            template
          items:
            $ref: '#/components/schemas/MappedTemplateGlAccount'
        children:
          type: array
          description: Child Global GL Account mappings
          items:
            $ref: '#/components/schemas/GlobalGlAccountMappingDto'
      description: GlobalGlAccount mapping status for this template
    MappedTemplateGlAccount:
      required:
        - id
        - name
      type: object
      properties:
        id:
          type: string
          description: Id of the mapped Template GL Account
          example: tgla_123456
        name:
          type: string
          description: Name of the mapped Template GL Account
      description: Template GL Accounts mapped to this Global GL Account for this template
  securitySchemes:
    EmbedToken:
      type: http
      description: >-
        Bearer authentication header of the form `Bearer <token>`, see
        [Authentication for more
        detail](/api-reference/authentication#partner-level-authentication).
      scheme: bearer
    PartnerAuth:
      type: http
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is a [partner-level
        token](/api-reference/authentication#partner-level-authentication).
      scheme: bearer

````