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

# Get history

> Get change history for a topic. Returns audit trail of modifications with user attribution.



## OpenAPI

````yaml /api-reference/openapi.json get /topics/{topicId}/history
openapi: 3.1.1
info:
  description: >-
    The public Modem API. Authenticate with an organization API key:
    `Authorization: Bearer modem_…`.
  title: Modem API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.modem.dev/v1
security:
  - bearerAuth: []
paths:
  /topics/{topicId}/history:
    get:
      tags:
        - Topics
      summary: Get history
      description: >-
        Get change history for a topic. Returns audit trail of modifications
        with user attribution.
      operationId: topics.getHistory
      parameters:
        - in: path
          name: topicId
          required: true
          schema:
            anyOf:
              - format: uuid
                type: string
              - format: uuid
                type: string
        - allowEmptyValue: true
          allowReserved: true
          explode: true
          in: query
          name: changedByFilter
          required: false
          schema:
            description: >-
              Filter by actor type. Defaults to user and agent changes (excludes
              system).
            items:
              description: >-
                Actor type that initiated the change: system
                (internal/cascading), agent (AI), or user (manual).
              enum:
                - agent
                - system
                - user
              title: Changed By Type
              type: string
            title: Changed By Filter
            type: array
          style: deepObject
        - allowEmptyValue: true
          allowReserved: true
          in: query
          name: limit
          required: false
          schema:
            default: 20
            description: Maximum number of history records to return (default 20, max 50).
            exclusiveMinimum: 0
            maximum: 50
            title: Limit
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  actions:
                    items:
                      properties:
                        actionAt:
                          format: date-time
                          type: string
                        actionType:
                          description: >-
                            Semantic category of the action taken: started (a
                            discrete unit of work was initiated, e.g. a PR was
                            opened — per-artifact, not a topic-level state),
                            merged (a code change was integrated into a
                            canonical branch — NOT the same as
                            deployed/shipped/released), resolved (a tracked task
                            was completed positively, e.g. issue closed as
                            completed), dismissed (a task was closed as wontfix
                            / not pursued). User-initiated rows (created via
                            dashboard, agent MCP tool, or direct API call) use
                            the same enum values as auto rows — origin is
                            encoded in metadata.source.
                          enum:
                            - dismissed
                            - merged
                            - resolved
                            - started
                          title: Topic Action Type
                          type: string
                        createdByUser:
                          anyOf:
                            - properties:
                                id:
                                  anyOf:
                                    - type: string
                                    - type: string
                                image:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: Optional URL to the user avatar image.
                                  title: Image
                                name:
                                  description: Human-readable name of the user.
                                  title: Name
                                  type: string
                              required:
                                - id
                                - image
                                - name
                              type: object
                            - type: 'null'
                        externalLink:
                          anyOf:
                            - properties:
                                authorLogin:
                                  type: string
                                createdAt:
                                  format: date-time
                                  type: string
                                draft:
                                  type: boolean
                                linkType:
                                  const: github_pull_request
                                merged:
                                  type: boolean
                                number:
                                  type: integer
                                state:
                                  enum:
                                    - closed
                                    - open
                                  type: string
                                title:
                                  type: string
                                url:
                                  format: uri
                                  type: string
                              required:
                                - authorLogin
                                - draft
                                - linkType
                                - merged
                                - number
                                - state
                                - title
                                - url
                              type: object
                            - properties:
                                linkType:
                                  const: github_issue
                                number:
                                  type: integer
                                title:
                                  type: string
                                url:
                                  format: uri
                                  type: string
                              required:
                                - linkType
                                - number
                                - title
                                - url
                              type: object
                            - properties:
                                linkType:
                                  const: none
                              required:
                                - linkType
                              type: object
                        id:
                          description: Unique identifier for the action record.
                          format: uuid
                          title: Action ID
                          type: string
                        metadata: {}
                        note:
                          anyOf:
                            - type: string
                            - type: 'null'
                      required:
                        - actionType
                        - createdByUser
                        - externalLink
                        - id
                        - note
                      type: object
                    type: array
                  history:
                    items:
                      properties:
                        changedAt:
                          format: date-time
                          type: string
                        changedBy:
                          description: >-
                            Actor type that initiated the change: system
                            (internal/cascading), agent (AI), or user (manual).
                          enum:
                            - agent
                            - system
                            - user
                          title: Changed By Type
                          type: string
                        changes:
                          additionalProperties: {}
                          propertyNames:
                            type: string
                          type: object
                        id:
                          anyOf:
                            - format: uuid
                              type: string
                            - format: uuid
                              type: string
                        operation:
                          description: >-
                            Type of database operation that triggered the
                            history record.
                          enum:
                            - DELETE
                            - INSERT
                            - UPDATE
                          title: Topic History Operation
                          type: string
                        previousValues:
                          anyOf:
                            - additionalProperties: {}
                              propertyNames:
                                type: string
                              type: object
                            - type: 'null'
                        user:
                          anyOf:
                            - properties:
                                id:
                                  anyOf:
                                    - type: string
                                    - type: string
                                image:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: Optional URL to the user avatar image.
                                  title: Image
                                name:
                                  description: Human-readable name of the user.
                                  title: Name
                                  type: string
                              required:
                                - id
                                - image
                                - name
                              type: object
                            - type: 'null'
                      required:
                        - changedBy
                        - changes
                        - id
                        - operation
                        - previousValues
                        - user
                      type: object
                    type: array
                  mergedInto:
                    anyOf:
                      - properties:
                          id:
                            type: string
                          mergedAt:
                            format: date-time
                            type: string
                          targetTopic:
                            anyOf:
                              - properties:
                                  id:
                                    type: string
                                  title:
                                    type: string
                                required:
                                  - id
                                  - title
                                type: object
                              - type: 'null'
                          user:
                            anyOf:
                              - properties:
                                  id:
                                    anyOf:
                                      - type: string
                                      - type: string
                                  image:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    description: Optional URL to the user avatar image.
                                    title: Image
                                  name:
                                    description: Human-readable name of the user.
                                    title: Name
                                    type: string
                                required:
                                  - id
                                  - image
                                  - name
                                type: object
                              - type: 'null'
                        required:
                          - id
                          - targetTopic
                          - user
                        type: object
                      - type: 'null'
                  merges:
                    items:
                      properties:
                        id:
                          type: string
                        mergedAt:
                          format: date-time
                          type: string
                        sourceTopics:
                          items:
                            properties:
                              id:
                                type: string
                              title:
                                type: string
                            required:
                              - id
                              - title
                            type: object
                          type: array
                        user:
                          anyOf:
                            - properties:
                                id:
                                  anyOf:
                                    - type: string
                                    - type: string
                                image:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: Optional URL to the user avatar image.
                                  title: Image
                                name:
                                  description: Human-readable name of the user.
                                  title: Name
                                  type: string
                              required:
                                - id
                                - image
                                - name
                              type: object
                            - type: 'null'
                      required:
                        - id
                        - sourceTopics
                        - user
                      type: object
                    type: array
                  totalCount:
                    type: number
                required:
                  - actions
                  - history
                  - mergedInto
                  - merges
                  - totalCount
                type: object
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid request (validation failed).
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid API key.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The API key does not have access to this resource.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The requested resource was not found.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Rate limit exceeded.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error.
components:
  schemas:
    Error:
      properties:
        code:
          description: Machine-readable error code, e.g. `NOT_FOUND`.
          examples:
            - NOT_FOUND
          type: string
        data:
          description: Optional structured error details.
        defined:
          description: True if the error was declared in the procedure contract.
          type: boolean
        message:
          description: Human-readable error message.
          type: string
        status:
          description: HTTP status code.
          examples:
            - 404
          type: integer
      required:
        - code
        - defined
        - message
        - status
      type: object
  securitySchemes:
    bearerAuth:
      description: Organization API key (`modem_…`).
      scheme: bearer
      type: http

````