GitClear Commits API

Audit the underlying commits, pull requests, and issues behind report numbers, and trace per-line version history across a repository's commit graph.

OpenAPI Specification

gitclear-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: GitClear Public API
  description: >-
    Public REST API for GitClear code and commit analytics. Pull Diff Delta
    reports and underlying data audits, manage repository imports, trace per-line
    code history, and administer developers and teams. All endpoints require a
    Bearer API token. Paths and parameters reflect GitClear's published API
    reference; request/response schemas beyond the documented parameters are not
    fully enumerated by the provider and are modeled conservatively here.
  termsOfService: https://www.gitclear.com/terms
  contact:
    name: GitClear Support
    url: https://www.gitclear.com/api_reference
  version: '1.0'
servers:
  - url: https://www.gitclear.com/api/v1
security:
  - bearerAuth: []
paths:
  /reports:
    get:
      operationId: getReports
      tags:
        - Reports
      summary: Fetch chart data for measured segments.
      description: >-
        Returns historical report data across 160+ available metrics (Diff Delta,
        PR comments, releases) segmented by repos, issue types, code domain, and
        teams over time.
      parameters:
        - name: resource_path
          in: query
          required: true
          description: Entity, organization, or repository path identifier.
          schema:
            type: string
        - name: segment_by
          in: query
          required: false
          schema:
            type: string
        - name: aggregate_by
          in: query
          required: false
          schema:
            type: string
        - name: team_slug
          in: query
          required: false
          schema:
            type: string
        - name: committer_user_name
          in: query
          required: false
          schema:
            type: string
        - name: start_date
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: days_ago
          in: query
          required: false
          schema:
            type: integer
        - name: generate_summary_stats
          in: query
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /segment_introspections:
    get:
      operationId: getSegmentIntrospections
      tags:
        - Reports
      summary: Retrieve metadata about available report segments.
      parameters:
        - name: segment_em
          in: query
          required: true
          description: Segment enum identifier.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /audits:
    get:
      operationId: getAudits
      tags:
        - Data Audit
      summary: Fetch underlying data substantiating reports.
      parameters:
        - name: resource_path
          in: query
          required: true
          schema:
            type: string
        - name: resource_type
          in: query
          required: true
          schema:
            type: string
            enum:
              - commits
              - issues
              - pull_requests
              - teams
              - tags
        - name: committer_user_name
          in: query
          required: false
          schema:
            type: string
        - name: start_date
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: sha
          in: query
          required: false
          schema:
            type: string
        - name: page
          in: query
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /code_introspections/line_history:
    get:
      operationId: getLineHistory
      tags:
        - Code Introspection
      summary: Retrieve per-line version history from a repository.
      parameters:
        - name: resource_path
          in: query
          required: true
          schema:
            type: string
        - name: file_path
          in: query
          required: true
          schema:
            type: string
        - name: sha
          in: query
          required: true
          schema:
            type: string
        - name: line_number_after
          in: query
          required: false
          schema:
            type: integer
        - name: line_number_before
          in: query
          required: false
          schema:
            type: integer
        - name: max_hops
          in: query
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /imports:
    get:
      operationId: listImports
      tags:
        - Imports
      summary: List existing repository imports.
      parameters:
        - name: resource_path
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createImport
      tags:
        - Imports
      summary: Queue a repository import.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - resource_path
                - repo_path
              properties:
                resource_path:
                  type: string
                repo_path:
                  type: string
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
  /releases:
    get:
      operationId: listReleases
      tags:
        - Releases
      summary: List releases.
      parameters:
        - name: resource_path
          in: query
          required: true
          schema:
            type: string
        - name: start_date
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: team_slug
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createRelease
      tags:
        - Releases
      summary: Designate a release or deployment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - resource_path
              properties:
                resource_path:
                  type: string
                name:
                  type: string
                released_at:
                  type: string
                  format: date-time
                release_sha:
                  type: string
                issue_keys_resolved:
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
  /developers:
    get:
      operationId: listDevelopers
      tags:
        - Developers
      summary: List developers with activity.
      parameters:
        - name: resource_path
          in: query
          required: false
          schema:
            type: string
        - name: committer_user_name
          in: query
          required: false
          schema:
            type: string
        - name: start_date
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
        - name: page
          in: query
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeveloperList'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /developers/record_time_off:
    post:
      operationId: recordTimeOff
      tags:
        - Developers
      summary: Record developer PTO or absences.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - resource_path
                - start_date
              properties:
                resource_path:
                  type: string
                start_date:
                  type: string
                  format: date
                end_date:
                  type: string
                  format: date
                committer_user_name:
                  type: string
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
  /developers/remove_time_off:
    post:
      operationId: removeTimeOff
      tags:
        - Developers
      summary: Remove recorded developer time off.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - resource_path
                - start_date
              properties:
                resource_path:
                  type: string
                start_date:
                  type: string
                  format: date
                end_date:
                  type: string
                  format: date
                committer_user_name:
                  type: string
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
  /developers/set_processing:
    post:
      operationId: setDeveloperProcessing
      tags:
        - Developers
      summary: Set developer stat processing status.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - committer_user_name
                - processing_status
              properties:
                committer_user_name:
                  type: string
                processing_status:
                  type: string
                  enum:
                    - processing_stats
                    - limited_processing
                    - not_processing
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
  /teams:
    get:
      operationId: listTeams
      tags:
        - Teams
      summary: List all teams.
      parameters:
        - name: resource_path
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createTeam
      tags:
        - Teams
      summary: Create a team.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                developer_members:
                  type: array
                  items:
                    type: string
                manager_members:
                  type: array
                  items:
                    type: string
                repo_paths:
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
    put:
      operationId: updateTeam
      tags:
        - Teams
      summary: Update a team.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
    delete:
      operationId: deleteTeam
      tags:
        - Teams
      summary: Delete a team.
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
  /teams/associated_repos:
    get:
      operationId: listTeamAssociatedRepos
      tags:
        - Teams
      summary: List repositories associated with a team.
      parameters:
        - name: name
          in: query
          required: false
          schema:
            type: string
        - name: resource_path
          in: query
          required: false
          schema:
            type: string
        - name: page
          in: query
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api_tokens:
    get:
      operationId: validateApiToken
      tags:
        - API Tokens
      summary: Validate the current API token status.
      responses:
        '200':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: GitClear API token passed as a Bearer token in the Authorization header.
  responses:
    Unauthorized:
      description: Missing or invalid API token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        response_em:
          type: string
          description: Response status enum.
        response_detail:
          type: string
          description: Human-readable response message.
    ReportResponse:
      type: object
      properties:
        resource_path:
          type: string
        segment_by:
          type: string
        results:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date
              diff_delta:
                type: number
                description: Core durable-change productivity metric.
              label:
                type: string
              value:
                type: number
    Developer:
      type: object
      properties:
        committer_user_name:
          type: string
          description: Developer's git username.
        diff_delta:
          type: number
        processing_status:
          type: string
          enum:
            - processing_stats
            - limited_processing
            - not_processing
    DeveloperList:
      type: object
      properties:
        developers:
          type: array
          items:
            $ref: '#/components/schemas/Developer'