> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnara.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit agent configs

> 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.



## OpenAPI

````yaml /api-reference/openapi.yaml post /orgs/{orgID}/projects/{projectID}/agent-configs/edit
openapi: 3.1.2
info:
  title: Omnara API
  version: 0.1.0
  description: Public HTTP API contract for Omnara.
servers:
  - url: https://api.omnara.com/v1
    description: Hosted Omnara
  - url: /api/v1
    description: Self-hosted Omnara, relative to the deployment origin
security:
  - bearerAuth: []
  - browserSessionCookie: []
tags:
  - name: Agents
    description: >-
      Launch agents, send inputs, manage the input backlog, and work with tool
      calls.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/agents/overview
  - name: Interactions
    description: List and resolve the approvals and questions that pause an agent.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/events/interactions
  - name: Actors
    description: Attribute agent inputs and interaction responses to external users.
    externalDocs:
      description: Guide
      url: >-
        https://docs.omnara.com/events/sending-input#who-said-that-actors-and-attribution
  - name: Events
    description: Read or stream the agent timeline, list turns, and download artifacts.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/events/streaming
  - name: Configs and Profiles
    description: >-
      Create agent configs, manage reusable launch profiles, and set up
      integrations.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/agents/configuration
  - name: Integrations
    description: >-
      Connect project integrations, route conversations, and manage launch
      settings.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/integrations/overview
  - name: Models
    description: Configure model providers and models, and grant projects access to them.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/organization/model-providers
  - name: Machines
    description: Register machines, control project access, and manage daemon tokens.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/machines/connect
  - name: Machine Pools
    description: Define machine pools and grant projects access to them.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/machines/pools
  - name: Secrets
    description: >-
      Manage secret ownership and versions, and inspect or grant project
      availability.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/organization/secrets
  - name: Skills
    description: Manage versioned skill ownership and load skill instructions on demand.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/tools/skills
  - name: Organizations and Projects
    description: Create organizations and projects and manage membership.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/organization/members
  - name: Users and API Keys
    description: >-
      The authenticated user, personal and organization API keys, and
      invitations.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/api/authentication
  - name: Machine Daemon
    description: Routes the Omnara machine daemon uses to connect a machine.
paths:
  /orgs/{orgID}/projects/{projectID}/agent-configs/edit:
    parameters:
      - name: orgID
        in: path
        description: Organization ID (org_...).
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
      - name: projectID
        in: path
        description: Project ID (proj_...).
        required: true
        schema:
          $ref: '#/components/schemas/ProjectID'
    post:
      tags:
        - Configs and Profiles
      summary: Edit agent configs
      description: >-
        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.
      operationId: editAgentConfigs
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditAgentConfigsRequest'
      responses:
        '200':
          description: One result per target.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditAgentConfigsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
        - browserSessionCookie: []
          csrfHeader: []
components:
  schemas:
    OrganizationID:
      type: string
      pattern: ^org_[a-z2-7]{26}$
    ProjectID:
      description: Project ID (proj_...).
      type: string
      pattern: ^proj_[a-z2-7]{26}$
    EditAgentConfigsRequest:
      type: object
      additionalProperties: false
      required:
        - targets
        - edits
      properties:
        targets:
          type: array
          minItems: 1
          maxItems: 500
          uniqueItems: true
          items:
            $ref: '#/components/schemas/AgentConfigEditTarget'
        edits:
          description: Applied in order.
          type: array
          minItems: 1
          maxItems: 100
          items:
            $ref: '#/components/schemas/AgentConfigEdit'
        on_failed_edit:
          description: >-
            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.
          type: string
          enum:
            - continue
            - ignore
            - stop
          x-enum-varnames:
            - OnFailedEditContinue
            - OnFailedEditIgnore
            - OnFailedEditStop
          default: continue
          x-go-type-skip-optional-pointer: true
    EditAgentConfigsResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AgentConfigEditResult'
    AgentConfigEditTarget:
      oneOf:
        - $ref: '#/components/schemas/AgentConfigEditProfileTarget'
        - $ref: '#/components/schemas/AgentConfigEditAgentTarget'
      discriminator:
        propertyName: type
        mapping:
          profile: '#/components/schemas/AgentConfigEditProfileTarget'
          agent: '#/components/schemas/AgentConfigEditAgentTarget'
    AgentConfigEdit:
      oneOf:
        - $ref: '#/components/schemas/SetAgentConfigEdit'
        - $ref: '#/components/schemas/RemoveAgentConfigEdit'
        - $ref: '#/components/schemas/AddItemAgentConfigEdit'
        - $ref: '#/components/schemas/RemoveItemAgentConfigEdit'
        - $ref: '#/components/schemas/ReplaceTextAgentConfigEdit'
      discriminator:
        propertyName: type
        mapping:
          set: '#/components/schemas/SetAgentConfigEdit'
          remove: '#/components/schemas/RemoveAgentConfigEdit'
          add_item: '#/components/schemas/AddItemAgentConfigEdit'
          remove_item: '#/components/schemas/RemoveItemAgentConfigEdit'
          replace_text: '#/components/schemas/ReplaceTextAgentConfigEdit'
    AgentConfigEditResult:
      type: object
      additionalProperties: false
      required:
        - target
        - status
      properties:
        target:
          $ref: '#/components/schemas/AgentConfigEditTarget'
        status:
          description: >-
            unchanged also covers targets where no edit matched; skipped means
            stop skipped the target.
          type: string
          enum:
            - updated
            - unchanged
            - failed
            - skipped
        previous_config_id:
          $ref: '#/components/schemas/AgentConfigID'
        current_config_id:
          $ref: '#/components/schemas/AgentConfigID'
        current_generation:
          type: integer
        edits:
          description: >-
            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.
          type: array
          items:
            type: string
            enum:
              - applied
              - unchanged
              - text_not_found
              - path_not_found
              - not_applied
        code:
          $ref: '#/components/schemas/ErrorCode'
        error:
          type: string
    Error:
      type: object
      additionalProperties: false
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: Human-readable error message. Do not match on it programmatically.
        current_digest:
          type: string
          pattern: ^sha256:[0-9a-f]{64}$
          description: >-
            Current file digest for file_content_conflict or
            expected_digest_required; absent if the file no longer exists. A
            replacement must be confirmed before retrying with this digest.
        issues:
          type: array
          description: >-
            Field-level problems when a submitted document (such as an agent
            config source) failed validation. Absent for errors that are not
            about a specific field.
          items:
            $ref: '#/components/schemas/AgentConfigErrorIssue'
        code:
          type: string
          description: Stable error code for programmatic handling.
          x-go-type: ErrorCode
          x-extensible-enum:
            - 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
    ClientErrorCode:
      type: string
      description: >-
        Stable error code carried by 4XX statuses. Subset of the Error code enum
        whose statuses are client errors.
      x-extensible-enum:
        - invalid_request
        - validation_failed
        - unauthorized
        - machine_token_not_injected
        - forbidden
        - csrf_check_failed
        - not_found
        - conflict
        - file_content_conflict
        - file_read_only
        - expected_digest_required
        - not_a_file
        - path_not_found
        - idempotency_key_conflict
        - agent_backlog_full
        - state_transition_conflict
        - tool_call_already_completed
        - edit_conflict
        - pending_work
        - not_wake_capable
        - gone
        - daemon_runtime_unregistered
        - request_too_large
        - unsupported_media_type
        - unprocessable
        - upstream_unavailable
        - rate_limited
    ServerErrorCode:
      type: string
      description: >-
        Stable error code carried by 5XX statuses. Subset of the Error code enum
        whose statuses are server errors.
      x-extensible-enum:
        - internal_error
        - service_unavailable
        - authentication_unavailable
    AgentConfigEditProfileTarget:
      description: At least one of apply_to_profile and apply_to_instances must be true.
      type: object
      additionalProperties: false
      required:
        - type
        - agent_profile_id
      properties:
        type:
          type: string
          enum:
            - profile
          x-enum-varnames:
            - AgentConfigEditProfileTargetTypeProfile
        agent_profile_id:
          $ref: '#/components/schemas/AgentProfileID'
        apply_to_profile:
          description: Edit the profile's own config, which new agents launch with.
          type: boolean
          default: true
        apply_to_instances:
          description: Edit the active top-level agents launched from the profile.
          type: boolean
          default: false
          x-go-type-skip-optional-pointer: true
    AgentConfigEditAgentTarget:
      type: object
      additionalProperties: false
      required:
        - type
        - agent_id
      properties:
        type:
          type: string
          enum:
            - agent
          x-enum-varnames:
            - AgentConfigEditAgentTargetTypeAgent
        agent_id:
          $ref: '#/components/schemas/AgentID'
    SetAgentConfigEdit:
      type: object
      additionalProperties: false
      required:
        - type
        - path
        - value
      properties:
        type:
          type: string
          enum:
            - set
          x-enum-varnames:
            - SetAgentConfigEditTypeSet
        path:
          $ref: '#/components/schemas/AgentConfigEditPath'
        value:
          $ref: '#/components/schemas/AgentConfigEditValue'
    RemoveAgentConfigEdit:
      type: object
      additionalProperties: false
      required:
        - type
        - path
      properties:
        type:
          type: string
          enum:
            - remove
          x-enum-varnames:
            - RemoveAgentConfigEditTypeRemove
        path:
          $ref: '#/components/schemas/AgentConfigEditPath'
    AddItemAgentConfigEdit:
      description: Appends value to the list at path unless an equal item is already there.
      type: object
      additionalProperties: false
      required:
        - type
        - path
        - value
      properties:
        type:
          type: string
          enum:
            - add_item
          x-enum-varnames:
            - AddItemAgentConfigEditTypeAddItem
        path:
          $ref: '#/components/schemas/AgentConfigEditPath'
        value:
          $ref: '#/components/schemas/AgentConfigEditValue'
    RemoveItemAgentConfigEdit:
      description: Removes every item equal to value from the list at path.
      type: object
      additionalProperties: false
      required:
        - type
        - path
        - value
      properties:
        type:
          type: string
          enum:
            - remove_item
          x-enum-varnames:
            - RemoveItemAgentConfigEditTypeRemoveItem
        path:
          $ref: '#/components/schemas/AgentConfigEditPath'
        value:
          $ref: '#/components/schemas/AgentConfigEditValue'
    ReplaceTextAgentConfigEdit:
      description: Replaces every occurrence of find in the text at path.
      type: object
      additionalProperties: false
      required:
        - type
        - path
        - find
        - replace
      properties:
        type:
          type: string
          enum:
            - replace_text
          x-enum-varnames:
            - ReplaceTextAgentConfigEditTypeReplaceText
        path:
          $ref: '#/components/schemas/AgentConfigEditPath'
        find:
          type: string
          minLength: 1
        replace:
          type: string
    AgentConfigID:
      description: Agent config ID (acfg_...).
      type: string
      pattern: ^acfg_[a-z2-7]{26}$
    ErrorCode:
      type: string
      description: Known error codes.
      enum:
        - 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
    AgentConfigErrorIssue:
      type: object
      additionalProperties: false
      required:
        - path
        - message
      properties:
        path:
          type: string
          description: >-
            JSON Pointer (RFC 6901) to the offending field in the submitted
            document. An empty string refers to the whole document.
        message:
          type: string
          description: Human-readable description of the problem with this field.
        line:
          type: integer
          minimum: 1
          description: >-
            1-based line of the offending field in the submitted source, when it
            can be located.
        column:
          type: integer
          minimum: 1
          description: >-
            1-based column of the offending field in the submitted source, when
            it can be located.
    AgentProfileID:
      type: string
      pattern: ^aprf_[a-z2-7]{26}$
    AgentID:
      type: string
      pattern: ^agt_[a-z2-7]{26}$
    AgentConfigEditPath:
      description: >-
        JSON Pointer into the config source, such as /instruction or
        /tools/web_search. Missing or null top-level sections count as empty.
      type: string
      minLength: 2
      maxLength: 1024
      pattern: ^/
    AgentConfigEditValue:
      description: Any JSON value, including null.
      anyOf:
        - {}
        - type: 'null'
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
      description: Idempotency key for replay-safe mutating requests.
  responses:
    BadRequest:
      description: The request was invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication is required or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The authenticated principal is not authorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found or is not visible.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: The service dependency required to satisfy the request is unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ClientError:
      description: >-
        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.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - error
              - code
            properties:
              error:
                type: string
                description: >-
                  Human-readable error message. Do not match on it
                  programmatically.
              code:
                $ref: '#/components/schemas/ClientErrorCode'
    ServerError:
      description: >-
        Any other server error. The body carries the shared Error envelope
        restricted to server error codes.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - error
              - code
            properties:
              error:
                type: string
                description: >-
                  Human-readable error message. Do not match on it
                  programmatically.
              code:
                $ref: '#/components/schemas/ServerErrorCode'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Omnara personal or organization access token
      description: An opaque Omnara personal or organization bearer token.
    browserSessionCookie:
      type: apiKey
      in: cookie
      name: __Host-omnara_session
      description: >-
        Browser session cookie. HTTPS deployments use __Host-omnara_session;
        local HTTP development uses omnara_session.
    csrfHeader:
      type: apiKey
      in: header
      name: X-Omnara-Csrf
      description: >-
        CSRF token header required for browser-session mutations. The value must
        match the session's CSRF cookie.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.