---
title: "Create a GL account"
method: POST
path: "/companies/{companyId}/gl-accounts"
tags: ["GL Accounts"]
---

# Create a GL account

`POST /companies/{companyId}/gl-accounts`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/gl-accounts`
- Auth: HTTP bearer

Creates a GL account, audited with the acting user. An exact replay (#2883) — an active account with the same code whose name, type, detail type, subtype, parent and normal balance all match the request — returns that account with 200 and writes nothing. A same-code request that differs is a 409 GL_ACCOUNT_CODE_CONFLICT naming the fields; a code held by a retired account is a 409 GL_ACCOUNT_CODE_RETIRED.

## Request body

- CreateGlAccountInput
  - `code` string, required
  - `name` string, required
  - `type` 'Asset' | 'Liability' | 'Equity' | 'Revenue' | 'Expense', required
  - `subtype` string
  - `parentAccountId` string, uuid
  - `normalBalance` 'debit' | 'credit'
  - `detailTypeKey` string, nullable
  - `reportSectionKey` string, nullable
  - `description` string, nullable

## Response `200`

Exact replay; the existing GL account

- GlAccountResponse
  - `success` boolean
  - `data` GlAccount
    - `id` string, uuid
    - `companyId` string, uuid
    - `code` string
    - `name` string
    - `type` 'Asset' | 'Liability' | 'Equity' | 'Revenue' | 'Expense'
    - `subtype` string, nullable
    - `parentAccountId` string, uuid, nullable
    - `normalBalance` 'debit' | 'credit'
    - `detailTypeKey` string: Canonical COA detail type used for report grouping.
    - `detailTypeLabel` string
    - `detailTypeDescription` string
    - `reportSectionKey` string
    - `reportSectionLabel` string
    - `accountExplanation` CoaAccountExplanation: Read-only COA account context returned only when the customer company is allowlisted by CUSTOMER_APP_INTELLIGENCE_HOME_COMPANY_IDS.
      - `accountType` CoaAccountExplanationPart
        - `key` string
        - `label` string
        - `description` string
      - `detailType` CoaAccountExplanationPart
        - `key` string
        - `label` string
        - `description` string
      - `reportSection` CoaAccountExplanationPart
        - `key` string
        - `label` string
        - `description` string
      - `classification` CoaAccountExplanationPart
        - `key` string
        - `label` string
        - `description` string
    - `cashFlowSection` 'operating' | 'investing' | 'financing' | 'cash' | 'non_cash' | 'null', nullable
    - `taxFormSectionKey` string, nullable
    - `description` string, nullable
    - `source` 'system' | 'template' | 'integration' | 'migration' | 'manual' | 'repair'
    - `isSystem` boolean
    - `isLocked` boolean: Locked accounts cannot be selected for new direct posting.
    - `isPostable` boolean: False for parent, locked, inactive, or otherwise non-postable accounts.
    - `isParent` boolean: True when at least one active child account references this account.
    - `isActive` boolean
    - `isMonetary` boolean, nullable: Null is fail-closed and blocks foreign-balance revaluation.
    - `monetaryClassificationSource` 'account_type_subtype' | 'manual' | 'null', nullable
    - `monetaryClassifiedAt` string, date-time, nullable
    - `monetaryClassifiedByUserId` string, uuid, nullable
    - `deactivatedAt` string, date-time, nullable
    - `deactivatedByUserId` string, uuid, nullable
    - `deactivationReason` string, nullable
    - `expectedNormalBalance` 'debit' | 'credit'
    - `healthFindings` object[]
      - `code` string
      - `severity` 'critical' | 'high' | 'medium' | 'low'
      - `message` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `201`: GL account created
- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `409`: Account code already exists with different fields (GL_ACCOUNT_CODE_CONFLICT) or belongs to a retired account (GL_ACCOUNT_CODE_RETIRED)
- `422`: Validation error

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
