---
title: "Edit agent configs"
method: POST
path: "/orgs/{orgID}/projects/{projectID}/agent-configs/edit"
tags: ["Configs and Profiles"]
---

# Edit agent configs

`POST /orgs/{orgID}/projects/{projectID}/agent-configs/edit`

## Request

- Base URL: `https://api.omnara.com/v1`
- URL: `https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agent-configs/edit`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-omnara_session` and API key in header `X-Omnara-Csrf`

Applies the same edits to agent profiles and agents, at most 500 after profile targets expand into their agents. Each target reports its own result, and on_failed_edit decides what happens to the others when one fails. Results come back in this order: profiles, then listed agents, then each profile's instances oldest first. Agents launched during the request may be skipped. YAML sources keep their text outside the changed entries when possible. Reusing an Idempotency-Key returns earlier results for targets it already edited, even with a different body.

## Path parameters

- `orgID` string, required
- `projectID` string, required: Project ID (proj_...).

## Headers

- `Idempotency-Key` string

## Request body

- EditAgentConfigsRequest
  - `targets` AgentConfigEditTarget[], required
    - union
      - AgentConfigEditProfileTarget: At least one of apply_to_profile and apply_to_instances must be true.
        - `type` 'profile', required
        - `agent_profile_id` string, required
        - `apply_to_profile` boolean: Edit the profile's own config, which new agents launch with.
        - `apply_to_instances` boolean: Edit the active top-level agents launched from the profile.
      - AgentConfigEditAgentTarget
        - `type` 'agent', required
        - `agent_id` string, required
  - `edits` AgentConfigEdit[], required: Applied in order.
    - union
      - SetAgentConfigEdit
        - `type` 'set', required
        - `path` string, required: JSON Pointer into the config source, such as /instruction or /tools/web_search. Missing or null top-level sections count as empty.
        - `value` unknown, required
      - RemoveAgentConfigEdit
        - `type` 'remove', required
        - `path` string, required: JSON Pointer into the config source, such as /instruction or /tools/web_search. Missing or null top-level sections count as empty.
      - AddItemAgentConfigEdit: Appends value to the list at path unless an equal item is already there.
        - `type` 'add_item', required
        - `path` string, required: JSON Pointer into the config source, such as /instruction or /tools/web_search. Missing or null top-level sections count as empty.
        - `value` unknown, required
      - RemoveItemAgentConfigEdit: Removes every item equal to value from the list at path.
        - `type` 'remove_item', required
        - `path` string, required: JSON Pointer into the config source, such as /instruction or /tools/web_search. Missing or null top-level sections count as empty.
        - `value` unknown, required
      - ReplaceTextAgentConfigEdit: Replaces every occurrence of find in the text at path.
        - `type` 'replace_text', required
        - `path` string, required: JSON Pointer into the config source, such as /instruction or /tools/web_search. Missing or null top-level sections count as empty.
        - `find` string, required
        - `replace` string, required
  - `on_failed_edit` 'continue' | 'ignore' | 'stop': continue keeps going after a failed target; ignore also saves a target's matching edits when others miss; stop skips the targets after the first failure.

## Response `200`

One result per target.

- EditAgentConfigsResponse
  - `data` AgentConfigEditResult[], required
    - `target` union, required
      - AgentConfigEditProfileTarget: At least one of apply_to_profile and apply_to_instances must be true.
        - `type` 'profile', required
        - `agent_profile_id` string, required
        - `apply_to_profile` boolean: Edit the profile's own config, which new agents launch with.
        - `apply_to_instances` boolean: Edit the active top-level agents launched from the profile.
      - AgentConfigEditAgentTarget
        - `type` 'agent', required
        - `agent_id` string, required
    - `status` 'updated' | 'unchanged' | 'failed' | 'skipped', required: unchanged also covers targets where no edit matched; skipped means stop skipped the target.
    - `previous_config_id` string: Agent config ID (acfg_...).
    - `current_config_id` string: Agent config ID (acfg_...).
    - `current_generation` integer
    - `edits` string[]: One entry per request edit, in order. unchanged means the edit was already satisfied; not_applied means it would have changed a target that wasn't saved. Omitted for replayed results, for server errors (the target may have been saved, so retry with the same Idempotency-Key), and for targets that failed or were skipped before all edits ran.
    - `code` 'invalid_request' | 'unauthorized' | 'forbidden' | 'not_found' | 'conflict' | 'file_content_conflict' | 'file_read_only' | 'expected_digest_required' | 'not_a_file' | 'path_not_found' | 'gone' | 'request_too_large' | 'unsupported_media_type' | 'unprocessable' | 'upstream_unavailable' | 'rate_limited' | 'internal_error' | 'service_unavailable' | 'idempotency_key_conflict' | 'agent_backlog_full' | 'state_transition_conflict' | 'tool_call_already_completed' | 'managed_work_admission_denied' | 'pending_work' | 'not_wake_capable' | 'daemon_runtime_unregistered' | 'validation_failed' | 'csrf_check_failed' | 'authentication_unavailable' | 'machine_token_not_injected' | 'edit_conflict': Known error codes.
    - `error` string

## Other responses

- `400`: The request was invalid.
- `401`: Authentication is required or invalid.
- `403`: The authenticated principal is not authorized.
- `404`: The requested resource was not found or is not visible.
- `503`: The service dependency required to satisfy the request is unavailable.
- `4XX`: Any other client error. The body carries the shared Error envelope restricted to client error codes; statuses with a dedicated response above are documented precisely.
- `5XX`: Any other server error. The body carries the shared Error envelope restricted to server error codes.

## Changes

- **2026-11-25** `eb7f7735a109`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/omnara/apis/omnara-api-2/changes/orgs/:orgID/projects/:projectID/agent-configs/edit/post.md)

---

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