---
title: "Edit Studio Opportunity"
method: PUT
path: "/playground/opportunities"
tags: ["AI_PLAYGROUND", "OPPORTUNITIES"]
---

# Edit Studio Opportunity

`PUT /playground/opportunities`

Edit a published Studio opportunity in place (AI-7498).

Re-runs the same gates as validate and submit — an edit can introduce an
implausible savings figure as easily as a first publish — then writes a new
higher-version row to both opportunity tables. Gate failures, an attempt to
change the primary resource (which the id and the comments are keyed on), and
an opportunity that was not created in Studio all come back as HTTP 422 with
the ``{errors: [{code, message}]}`` shape the form already parses.

## Query parameters

- `navigationSource` string, nullable

## Request body

- EditStudioOpportunityRequest — Body for ``PUT /studio/opportunities`` — edit an ALREADY-PUBLISHED opportunity in place. Unlike submit, this carries no ``session_id``: you are editing a published opportunity, not a draft anchored to a conversation. The published ``opportunity_id`` is derived from the primary resource, and ClickHouse ``opportunity_comments`` is keyed on it, so an edit that would change the primary resource is rejected (``primary_resource_immutable``) rather than silently orphaning comments, audit rows and implemented-snapshots.
  - `opportunity_id` string, required
  - `instance_id` integer, required
  - `finding` OpportunityFinding, required — A draft finding — the fields a real opportunity carries. Mirrors the tissues cost_savings_ops shape a published opportunity actually stores: a title, a description, the target resource(s), a monthly savings estimate, an effort level, and the Issue/Goal/Context ``agent_instructions`` markdown shown in the opportunity detail's "Agent Instructions" tab.
    - `opportunity_id` string
    - `title` string, required
    - `description` string
    - `resource_name` string
    - `resources` FindingResource[]
      - `resource_name` string, required
      - `resource_type` string, required
      - `resource_uri` string
      - `resource_id` string
      - `workspace_id` string
      - `instance_id` integer, nullable
      - `verified` boolean
    - `estimated_savings_usd_per_month` number
    - `effort` 'low' | 'medium' | 'high'
    - `agent_instructions` string

## Response `200`

Successful Response

- CreateStudioOpportunityResponse
  - `opportunity_id` string, required
  - `instance_id` integer, required
  - `already_existed` boolean

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-11** `70e0a3e5cb0d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/myaltimate/apis/fastapi/changes/playground/opportunities/put.md)

---

[API](https://skmtc.dev/myaltimate/apis/fastapi.md) · [All operations](https://skmtc.dev/myaltimate/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc.dev/myaltimate/apis/fastapi/revisions/4dfe86ff412c?raw)
