POST
Add an analytic section (organization)
Organization space Accounting module For: Accountant · Permission: analytic_sections.create Conditions
  • The accounting module must be included in the plan of the organization.
  • The caller must have been granted access to the book named in the path.
  • analytic_axis_id is required and must be an axis of the book.
  • parent_id, when sent, must be a section of the same axis and book.
  • The code is required, at most 32 characters, and must be unique within the axis of the book.
  • A parent that already holds allocations, or is the target of an active rule, cannot take child sections.
  • The label is required (255 characters at most).
What else happens
  • The section is created with status active; is_postable defaults to true when omitted.
  • The creating actor is recorded in created_by and created_by_type.
  • The parent, if any, becomes a group that can no longer receive allocations.
Part of Set up analytic axes, sections and rules.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

book
string
required

Identifier of the accounting book (27-character KSUID) whose records are handled.

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, analytic_axis_id, parent_id, code, label, is_postable, status, created_by, created_by_type, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: axis, parent, parent.axis, parent.parent.

Body

application/json
analytic_axis_id
string
required

Required. Axis of the book that the section belongs to.

code
string
required

Required. At most 32 characters, unique within the axis of the book. Cannot be changed later.

Maximum string length: 32
label
string
required

Required. Display name, at most 255 characters.

Maximum string length: 255
parent_id
string | null

Optional parent section on the same axis. A parent that holds allocations or is targeted by an active rule is refused.

is_postable
boolean | null

Optional boolean; true when omitted. Whether the section can receive allocations.

Response

Resource (only with response=resource).

id

Identifier of the section (27-character KSUID).

analytic_axis_id

Identifier of the axis the section belongs to.

axis
object | null

The axis, included only when the caller may retrieve analytic axes.

parent_id

Identifier of the parent section; null for a top-level section.

parent
object | null

The parent section, included only when the caller may retrieve analytic sections.

code

Code of the section, unique within its axis and book.

label

Display name of the section.

is_postable
boolean

Whether the section is marked postable. A section receives allocations only when it is postable, active, has no child sections and its axis is active.

status

active or archived.

created_by

Identifier of the actor that created the section.

created_by_type

Kind of actor that created the section (the actor's morph alias); null when it could not be resolved.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).