---
title: "Add an operating expense row to the forecast"
method: POST
path: "/companies/{companyId}/forecast/{forecastId}/opex"
tags: ["Forecast"]
---

# Add an operating expense row to the forecast

`POST /companies/{companyId}/forecast/{forecastId}/opex`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/forecast/{forecastId}/opex`
- Auth: HTTP bearer

## Request body

- CreateForecastOpexInput
  - `name` string, required
  - `behavior` 'fixed' | 'pct_revenue' | 'per_head', required
  - `amountCents` integer, nullable
  - `pct` number, nullable
  - `position` integer

## Response `200`

Created opex row

- object
  - `success` boolean
  - `data` ForecastOpex
    - `id` string, uuid
    - `forecastId` string, uuid
    - `name` string
    - `behavior` 'fixed' | 'pct_revenue' | 'per_head'
    - `amountCents` integer, nullable: Fixed or per-head amount in the model's authoritative minor units
    - `pct` number, nullable: Percentage of revenue (for pct_revenue), in [0,1]
    - `position` integer

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `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)
