> ## 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.

# List draft commits

> List draft commits for the current user



## OpenAPI

````yaml get /repos/{repo_id}/draft-commits
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}/draft-commits:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
    get:
      tags:
        - Repository Draft Commits
      summary: List draft commits
      description: List draft commits for the current user
      operationId: src.handlersv2.draft_commit.list_all
      responses:
        '200':
          description: List of draft commits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDraftCommitsResponse'
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/read
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.
  schemas:
    ListDraftCommitsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DraftCommit'
    DraftCommit:
      type: object
      properties:
        id:
          type: string
          description: Draft commit ID
          example: dv.draft.12345678-1234-1234-1234-123456789abc
        draft_branch_id:
          type: string
          description: ID of the hidden draft branch
        source_branch_id:
          type: string
          description: ID of the source branch (e.g., master)
        source_branch_name:
          type: string
          description: Name of the source branch
        title:
          type: string
          description: Title of the review
        review_id:
          type: string
          nullable: true
          description: Associated review ID if created
        status:
          type: string
          enum:
            - open
            - closed
          description: Status of the draft commit
        created_timestamp:
          type: integer
          format: int64
          description: Unix timestamp when created
        updated_timestamp:
          type: integer
          format: int64
          description: Unix timestamp when last updated
      required:
        - id
        - draft_branch_id
        - source_branch_id
        - source_branch_name
        - status
        - created_timestamp
        - updated_timestamp
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        detail:
          type: string
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
  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

````