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

# Get Change

> Fetch a single Ontology change with its diffs and your capabilities.

<Note>
  The `git_ref` returned here is required as `expected_git_ref` when approving,
  denying, or restoring — it makes review optimistic-concurrency safe: if the
  change was modified since you read it, the action returns `409` instead of
  acting on a stale view. An unknown or foreign-org id returns `404`.
</Note>


## OpenAPI

````yaml GET /v2/changes/{id}
openapi: 3.1.0
info:
  title: TextQL v2 API
  version: '2.0'
  description: >
    REST API for TextQL platform operations. All endpoints require Bearer token
    authentication.
servers:
  - url: https://app.textql.com
security:
  - bearerAuth: []
tags:
  - name: Chat
    description: Create and manage AI chat sessions
  - name: Connectors
    description: List available data connectors
  - name: Playbooks
    description: Create, configure, and run automated playbooks
  - name: Sandcastles
    description: Manage Python sandbox environments for code execution
  - name: Changes
    description: Review, approve, and deny Ontology changes
  - name: API Keys
    description: Mint and revoke scoped platform API keys
paths:
  /v2/changes/{id}:
    get:
      tags:
        - Changes
      summary: Get Change
      description: |
        Fetch a single change with its file diffs and the caller's
        `capabilities`. Read access is scoped to the caller's `OWNERS`
        permissions. The `git_ref` is required as `expected_git_ref` when
        approving, denying, or restoring.
      operationId: v2.getChange
      parameters:
        - $ref: '#/components/parameters/ChangeId'
        - name: revision
          in: query
          required: false
          description: Fetch a historical revision (1-based); defaults to latest.
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: The change
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Change'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    ChangeId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Change ID
  schemas:
    Change:
      type: object
      description: A reviewable Ontology change.
      properties:
        id:
          type: string
        number:
          type: integer
          format: int32
        author_id:
          type: string
        author_email:
          type: string
        author_name:
          type: string
        title:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - reserved
            - draft
            - open
            - approved
            - denied
        git_ref:
          type: string
          description: Echo this as expected_git_ref when approving/denying/restoring.
        revision:
          type: integer
          format: int32
        ai_generated:
          type: boolean
        chat_id:
          type: string
        approval_count:
          type: integer
          format: int32
        required_approvals:
          type: integer
          format: int32
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        diffs:
          type: array
          items:
            $ref: '#/components/schemas/LibraryChangeDiff'
        capabilities:
          $ref: '#/components/schemas/ChangeCapabilities'
    LibraryChangeDiff:
      type: object
      description: One changed file in an Ontology change.
      properties:
        name:
          type: string
          description: Display name for the change.
        old_path:
          type: string
        new_path:
          type: string
        additions:
          type: integer
          format: int64
        deletions:
          type: integer
          format: int64
        is_new:
          type: boolean
        is_delete:
          type: boolean
        is_rename:
          type: boolean
        is_binary:
          type: boolean
    ChangeCapabilities:
      type: object
      description: Actions the calling member may take on a change.
      properties:
        can_approve:
          type: boolean
        can_deny:
          type: boolean
        can_restore:
          type: boolean
        caller_approved:
          type: boolean
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code
              enum:
                - invalid_request
                - unauthenticated
                - permission_denied
                - not_found
                - conflict
                - rate_limit_exceeded
                - internal
                - timeout
                - cancelled
                - execution_failed
                - no_report
            message:
              type: string
              description: Human-readable error message
  responses:
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: unauthenticated
              message: Authentication required
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: permission_denied
              message: Insufficient permissions
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: not_found
              message: Resource not found
    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limit_exceeded
              message: Rate limit exceeded
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: internal
              message: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or JWT token

````