---
title: "Create a distribution rule"
method: POST
path: "/headcount/distribution-rules"
tags: ["Headcount"]
---

# Create a distribution rule

`POST /headcount/distribution-rules`

## Request

- Base URL: `https://api.cubesoftware.com`
- URL: `https://api.cubesoftware.com/headcount/distribution-rules`
- Auth: OAuth 2
  - Authorization code: `https://portal.cubesoftware.com/o/authorize/`
  - Token URL: `https://api.cubesoftware.com/o/token/`

Creates one distribution rule for a column that already exists on the headcount plan's table. A column_id already used on that plan is rejected.

## Headers

- `X-Company-ID` string, required

## Request body

- DistributionRule: Mixin to delegate create, update, and destroy operations to a service class.
  - `id` integer, required
  - `column_id` string, uuid, required
  - `name` string, required
  - `description` string
  - `target_account_id` integer, nullable
  - `expressions` DistributionRuleExpression[], required
    - `scenario_id` string, nullable, required
    - `expression` string, required

## Response `201`

- DistributionRule: Mixin to delegate create, update, and destroy operations to a service class.
  - `id` integer, required
  - `column_id` string, uuid, required
  - `name` string, required
  - `description` string
  - `target_account_id` integer, nullable
  - `expressions` DistributionRuleExpression[], required
    - `scenario_id` string, nullable, required
    - `expression` string, required

## Changes

> 34 revisions in range; 1 not diffed.

- **2026-10-19** `7c4d6221587a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cubesoftware/apis/cube-api/changes/headcount/distribution-rules/post.md)

---

[API](https://skmtc.dev/cubesoftware/apis/cube-api.md) - [All operations](https://skmtc.dev/cubesoftware/apis/cube-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cubesoftware/apis/cube-api/revisions/92c7a097d975?raw)
