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

# Undo one of the AI's changes on an opportunity

> Puts back the value one of the AI's changes replaced, as Undo on the app's Changes tab does: a person's edit of that field, recorded as reversing the change, so the AI is told before its next pass. It holds the field for your workspace's default. Only a change list_ai_changes marks `undoable` can be undone: a person's change, or one a newer change or a person's edit has overtaken, is a 422 (edit the field instead). An id that is not a change on this record is a 404. The edit is recorded as the person the key acts for, as in the app, so a workspace key or a digital worker cannot make it (a 403); a Member edits only the records in their book.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/objects/opportunity/records/{opportunity_id}/ai-changes/{change_id}/undo
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/objects/opportunity/records/{opportunity_id}/ai-changes/{change_id}/undo:
    post:
      tags:
        - opportunities
      summary: Undo one of the AI's changes on an opportunity
      description: >-
        Puts back the value one of the AI's changes replaced, as Undo on the
        app's Changes tab does: a person's edit of that field, recorded as
        reversing the change, so the AI is told before its next pass. It holds
        the field for your workspace's default. Only a change list_ai_changes
        marks `undoable` can be undone: a person's change, or one a newer change
        or a person's edit has overtaken, is a 422 (edit the field instead). An
        id that is not a change on this record is a 404. The edit is recorded as
        the person the key acts for, as in the app, so a workspace key or a
        digital worker cannot make it (a 403); a Member edits only the records
        in their book.
      operationId: opportunities_undo_ai_change
      parameters:
        - description: The change's `id`, from list_ai_changes; it must be `undoable`
          in: path
          name: change_id
          required: true
          schema:
            pattern: ^[1-9][0-9]{0,18}$
            type: string
        - description: The opportunity's Statisfy id
          in: path
          name: opportunity_id
          required: true
          schema:
            maxLength: 255
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                reason:
                  anyOf:
                    - maxLength: 5000
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    Why. Left out, the reason recorded is that you undid the
                    AI's change
                  title: Reason
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiFieldWrite'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    AiFieldWrite:
      properties:
        changed:
          description: >-
            Whether the value moved; false when you saved the value it already
            had
          title: Changed
          type: boolean
        field_key:
          title: Field Key
          type: string
        locked_until:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the AI may update the field again; null when it is not held
          title: Locked Until
      required:
        - field_key
        - changed
      title: AiFieldWrite
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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