---
title: "Set Segment Budget"
method: PATCH
path: "/api/app-auto-gtm/segments/{segment_id}/budget"
tags: ["AppAutoGtm"]
---

# Set Segment Budget

`PATCH /api/app-auto-gtm/segments/{segment_id}/budget`

The user edits one campaign's daily budget from the dashboard table.

Thin adapter over :func:`set_segment_budget_for_org` (the same org-scoped
service the public API calls). Reconcile semantic (Q3, confirmed): the edited
campaign's ``daily_limit_usd`` is set DIRECTLY and the project total becomes
the SUM of the outreach campaigns' budgets — the OTHER campaigns are NOT
touched. It preserves the ``sum(campaigns) == anchor`` invariant by
construction, so the reconcile safety-net stays a no-op.

Gated on ``project.autopilot_enabled`` (agent-owned split → 409); budget
belongs to RUNNING campaigns only (paused/pre-launch → 409). Ownership: the
segment's project.org_id must match the caller's current org (miss → 404).

## Path parameters

- `segment_id` integer, required

## Cookies

- `ex_access` string, nullable
- `ex_org` string, nullable

## Request body

- SetSegmentBudgetRequest — Body for PATCH /segments/{id}/budget — the user edits ONE campaign's daily budget from the dashboard table (T-558, Variant C). Clamped to the per-campaign bounds; the server stays permissive within [MIN, MAX] (ADR-0004, the UI floor lives in ``projections``).
  - `daily_limit_usd` integer, required

## Response `200`

Successful Response

- SegmentBudgetResponse — Result of a per-campaign budget edit — the campaign's new budget and the project total that followed it (total = sum of campaign budgets).
  - `segment_id` integer, required
  - `daily_limit_usd` integer, required
  - `project_daily_budget_usd` integer, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/explee/apis/explee-api.md) · [All operations](https://skmtc.dev/explee/apis/explee-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/explee/explee-api/revisions/f169bc6e9447/schema)
