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

# Workspace status

> Retrieves the current status of a workspace including:
- Counts of new files
- Counts of modified files
- Counts of deleted files
- Optionally detailed file entries

**Features:**
- Pagination via `limit` and `skip`
- Filtering by `path_prefix`
- Recursive/non-recursive listing via `recurse` parameter
- `detail_items` parameter controls whether full file entries are returned
- Results filtered based on path permissions
- Supports caching and ETags for performance




## OpenAPI

````yaml get /repos/{repo_id}/workspaces/{workspace_id}/status
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/workspaces/{workspace_id}/status:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
      - $ref: '#/components/parameters/WorkspaceParam'
    get:
      tags:
        - Repository Workspace Manipulation
      summary: Get status of changes in workspace
      operationId: src.handlersv2.workspace.get_status
      parameters:
        - $ref: '#/components/parameters/DetailWorkspaceStatusItems'
        - $ref: '#/components/parameters/FileEntriesLimit'
        - $ref: '#/components/parameters/FileWalkRecurseParam'
        - $ref: '#/components/parameters/PathPrefixParam'
      responses:
        '200':
          description: The changes made to this workspace since the commit it's based upon.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceStatus'
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/read
        - OAuth2:
            - coreapi/write
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
    WorkspaceParam:
      in: path
      name: workspace_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: The repo ID of the workspace.
    DetailWorkspaceStatusItems:
      in: query
      name: detail_items
      schema:
        type: boolean
        default: true
      description: Should detail all the changed items in status response
    FileEntriesLimit:
      in: query
      name: limit
      schema:
        type: integer
        example: 17
        minimum: 1
      description: Limit the number of entries returned from walk
    FileWalkRecurseParam:
      in: query
      name: recurse
      schema:
        type: boolean
        default: true
      description: Specifies if to recursively iterate file tree to next directory levels
    PathPrefixParam:
      in: query
      name: path_prefix
      schema:
        type: string
        format: path
        example: path/to/file
      description: A path prefix in the file tree to walk under
  schemas:
    WorkspaceStatus:
      description: >
        The status of the workspace, meaning its bill of changes. It will
        contain the total number of changed items and specifically changed
        files. If paths details were requested, it will also contain an object
        having 'new', 'modified', 'deleted' arrays of file entries, sorted
        lexicographically.
      type: object
      properties:
        changed_items_count:
          type: number
          description: Number of changed items of all types
        changed_files_count:
          type: number
          description: Number of changed files
        incomplete_result:
          type: boolean
          description: The result list was trimmed and the counts are a lower bound only
        items:
          type: object
          description: Drill down into modified items by change type
          properties:
            new:
              type: array
              items:
                $ref: '#/components/schemas/FileEntry'
            modified:
              type: array
              items:
                $ref: '#/components/schemas/FileEntry'
            deleted:
              type: array
              items:
                $ref: '#/components/schemas/FileEntry'
          required:
            - new
            - modified
            - deleted
        conflicts:
          type: array
          nullable: true
          description: >-
            List of conflicted file paths, compared to the base branch, if
            applicable
          items:
            type: string
      required:
        - changed_items_count
        - changed_files_count
    FileEntry:
      type: object
      properties:
        path:
          type: string
          example: hello.cc
        prev_path:
          type: string
          description: Optional hint in case the item was renamed or moved
        status:
          $ref: '#/components/schemas/ObjectStatus'
        mode:
          $ref: '#/components/schemas/FileMode'
        mtime:
          type: string
          format: date-time
        blob:
          type: object
          properties:
            storage_uri:
              $ref: '#/components/schemas/StorageUri'
            storage_backend:
              $ref: '#/components/schemas/StorageBackend'
            size:
              type: integer
              format: int64
              description: Size in bytes
            sha:
              type: string
          required:
            - storage_uri
            - storage_backend
            - size
            - sha
      required:
        - path
        - status
        - size
        - mode
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
          example: 403
        detail:
          type: string
          example: User not authorized to perform the requested action on the resource
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
    ObjectStatus:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
      description: 'One of: 1 - INTACT, 2 - ADDED, 3 - MODIFIED, 4 - DELETED'
      x-ogen-enum-naming:
        '1': ObjectStatus_INTACT
        '2': ObjectStatus_ADDED
        '3': ObjectStatus_MODIFIED
        '4': ObjectStatus_DELETED
    FileMode:
      type: integer
      description: The file mode (as Unix mode)
      enum:
        - 16877
        - 33188
        - 33261
        - 40960
      x-ogen-enum-naming:
        '16877': FileMode_TREE
        '33188': FileMode_FILE
        '33261': FileMode_EXECUTABLE
        '40960': FileMode_SYMLINK
    StorageUri:
      type: string
      description: Coupled with storage_backend, a uri to storage location
      example: repo_id/2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
    StorageBackend:
      type: integer
      enum:
        - 1
        - 2
      description: 'One of: 1 - EFS, 2 - S3'
      x-ogen-enum-naming:
        '1': StorageBackend_EFS
        '2': StorageBackend_S3
  responses:
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````