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

# List Task Mutations

> Return the paginated mutation log for a task.

Each entry surfaces a full before/after snapshot plus the list of
fields that changed. Entries are ordered newest first and can be
paged forward via ``next_cursor``. Sensitive fields on the
snapshots are masked by default. Pass ``reveal=true`` to return
actual values, matching the ``/resources`` endpoint's convention.

Returns:
    ``TaskMutationPage`` with the current page and a cursor for the
    next page (``None`` when there are no more entries).

Raises:
    NotFoundError: If task not found.
    InvalidCursorError: If the cursor is malformed.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json get /agents/tasks/{task_id}/mutations
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /agents/tasks/{task_id}/mutations:
    get:
      tags:
        - tasks
      summary: List Task Mutations
      description: |-
        Return the paginated mutation log for a task.

        Each entry surfaces a full before/after snapshot plus the list of
        fields that changed. Entries are ordered newest first and can be
        paged forward via ``next_cursor``. Sensitive fields on the
        snapshots are masked by default. Pass ``reveal=true`` to return
        actual values, matching the ``/resources`` endpoint's convention.

        Returns:
            ``TaskMutationPage`` with the current page and a cursor for the
            next page (``None`` when there are no more entries).

        Raises:
            NotFoundError: If task not found.
            InvalidCursorError: If the cursor is malformed.
      operationId: tasks-list_task_mutations
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: Maximum mutations to return per page
            default: 50
            title: Limit
          description: Maximum mutations to return per page
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Composite cursor '<iso-timestamp>|<edge-id>'; returns mutations
              strictly older than this point under (timestamp DESC, edge_id
              DESC).
            title: Cursor
          description: >-
            Composite cursor '<iso-timestamp>|<edge-id>'; returns mutations
            strictly older than this point under (timestamp DESC, edge_id DESC).
        - name: reveal
          in: query
          required: false
          schema:
            type: boolean
            description: Reveal sensitive field values on before/after snapshots
            default: false
            title: Reveal
          description: Reveal sensitive field values on before/after snapshots
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskMutationPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TaskMutationPage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ResourceMutation'
          type: array
          title: Items
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - items
      title: TaskMutationPage
      description: |-
        Paginated page of mutation log entries.

        Attributes:
            items: Mutation entries for the current page, newest first.
            next_cursor: Composite cursor for the next page, or ``None`` when
                no more entries exist. Built as ``"<iso-timestamp>|<edge-id>"``
                over the last entry in ``items``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResourceMutation:
      properties:
        edge_id:
          type: string
          title: Edge Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        operation:
          $ref: '#/components/schemas/MutationOperation'
        resource_table:
          type: string
          title: Resource Table
        resource_id:
          type: string
          title: Resource Id
        before:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Before
        after:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: After
        fields_changed:
          items:
            type: string
          type: array
          title: Fields Changed
          default: []
        version_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Version Before
        version_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Version After
        actor_type:
          $ref: '#/components/schemas/MutationActorType'
        actor_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Actor Id
      type: object
      required:
        - edge_id
        - timestamp
        - operation
        - resource_table
        - resource_id
        - actor_type
      title: ResourceMutation
      description: |-
        A single resource mutation tied to a task.

        Each entry corresponds to one ``task->mutated->resource`` edge in the
        shared SurrealDB namespace.

        Attributes:
            edge_id: SurrealDB edge identifier (id part, no table prefix).
                Stable across reads — used together with ``timestamp`` as a
                composite pagination cursor.
            timestamp: When the mutation was persisted.
            operation: ``create``, ``update``, or ``delete``.
            resource_table: SurrealDB table that holds the target resource.
                Always ``resources`` in the current schema — emitted so
                downstream consumers can tell the shape of ``resource_id``
                without having to parse the SurrealDB thing literal.
            resource_id: SurrealDB record id part for the target resource
                (e.g. ``gcp_storage_bucket_mybucket``). No table prefix.
            before: Resource snapshot before the mutation, or ``None`` on
                create.
            after: Resource snapshot after the mutation, or ``None`` on
                delete.
            fields_changed: Top-level field names whose value differs between
                ``before`` and ``after``. Noise fields (``updated_at``,
                ``version``, etc.) are filtered out.
            version_before: Resource version before the mutation, or ``None``
                on create.
            version_after: Resource version after the mutation, or ``None`` on
                delete.
            actor_type: ``user`` or ``agent_instance`` — who initiated the
                mutation.
            actor_id: Identifier of the actor (user id or instance id). May
                be ``None`` for system-level writes.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MutationOperation:
      type: string
      enum:
        - create
        - update
        - delete
      title: MutationOperation
      description: Discriminator for the underlying resource write on a mutation edge.
    MutationActorType:
      type: string
      enum:
        - user
        - agent_instance
      title: MutationActorType
      description: Who initiated the mutation.

````