---
title: "Create and stage a plan"
method: POST
path: "/etl/v1/plans"
tags: ["ETL"]
---

# Create and stage a plan

`POST /etl/v1/plans`

## Request

- Base URL: `https://api.minubo.com`
- URL: `https://api.minubo.com/etl/v1/plans`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Validates the plan, creates it with status staged and stages its data for the tenant's next ETL run; the data appears in the ClickHouse table plan_<sanitized>_<hash8> (see name) only after that run has completed, and the plan's status becomes loaded (or failed if it is still not loaded 36 hours after its creation). Entries are flat objects named after GenericPlanColumn (see GET /etl/v1/plans/schema for the field list, formats and rules). Per entry: exactly one time field (timeDate YYYY-MM-DD, timeDateYearWeek YYYY-WW, timeDateYearMonth YYYY-MM, timeDateYearQuarter YYYY-Q, timeDateYear/timeFiscalYear YYYY), at least one measure, no nulls. The ETL spreads every entry evenly over the days of its period (each measure divided by the number of days). taxRate defaults to 1.0 and only derives the plannedXInclTax columns. "*" in channelKey or employeeKey (as the only key of organisationKey/channelKey/employeeKey/country) is a default entry expanded to all remaining channels resp. employees; "*" in organisationKey or country is not expanded and the entry is dropped. customerNumber and warehouseKey are looked up and become null when unknown. Plan names are unique per tenant; the name of a deleted plan can be used again once the deletion is complete. displayName and description can be changed later, the entries cannot: delete the plan and create it again. Each plan table only has the columns that are non-null and non-zero in at least one row. Fields the ETL accepts but never stores are reported under warnings.

## Request body

- EtlPlanCreateRequest: A plan (budget/forecast) to stage for the tenant's next ETL run.
  - `name` string: Unique plan name per tenant, the plan's key; trimmed, then must match [\p{L}\p{N} _.-]+ and must not be "schema". The data is loaded into the ClickHouse table plan_<sanitized>_<hash8>: every character outside [0-9a-zA-Z_] of the name becomes "_" (prefixed with "_" if it starts with a digit), hash8 is the first 8 hex characters of the SHA-256 of the name. A second POST with a name the tenant already has (in any status) is rejected with 409 plan_already_exists; the name is free again once the plan is deleted.
  - `displayName` string: Optional display name, at most 255 characters; can be changed later with PATCH.
  - `description` string: Optional description of the plan, at most 10000 characters; can be changed later with PATCH.
  - `entries` EtlJsonNode[]
    - unknown

## Response `201`

Plan staged; warnings lists non-fatal findings (dropped fields, missing taxRate)

- EtlPlanCreateResponse
  - `plan` EtlPlanResponse, required: The staged plan.
    - `id` integer, required
    - `key` string, required: The plan name as it appears in the plan data (planName); identifies the plan in the URL.
    - `displayName` string
    - `description` string
    - `status` 'staged' | 'loaded' | 'failed' | 'deleting', required: staged: created by POST /etl/v1/plans, not yet loaded by an ETL run. loaded: in the ClickHouse table since the last completed ETL run. failed: staged, but still not loaded 36 hours after its creation (statusMessage says why); becomes loaded if it arrives later, delete it to reuse the name. deleting: deletion requested; the next ETL run deletes its files and then the plan.
    - `statusMessage` string
    - `source` 'sftp' | 'api', required: Where the plan comes from: sftp (generic plan files uploaded via SFTP) or api (this API).
    - `measures` string[], required
    - `attributes` string[], required
    - `startDate` string, date: First day with planned values (ISO date).
    - `endDate` string, date: Last day with planned values (ISO date).
  - `entryCount` integer, required: Number of staged entries (before the per-day split).
  - `warnings` string[], required

## Other responses

- `400`: Invalid plan
- `409`: Plan already exists (plan_already_exists) or the plans API interface is deactivated
- `500`: Unexpected internal error

## Changes

- **2026-11-24** `ff6f75bd8816`: 4 breaking, 6 info
  - removed the required property `name` from the response with the `201` status
  - removed the required property `name` from the response with the `400` status
  - removed the required property `name` from the response with the `409` status
  - removed the required property `name` from the response with the `500` status
  - …6 more
- **2026-11-18** `d3e0716cb194`: 1 breaking, 4 info
  - the `entries` request property's minItems was increased to `1`
  - added the required property `warnings` to the response with the `201` status
  - added the required property `warnings` to the response with the `400` status
  - added the required property `warnings` to the response with the `409` status
  - …1 more
- **2026-10-20** `d3d5909f678f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/minubo/apis/minubo-api/changes/etl/v1/plans/post.md)

---

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