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

# List trails for a commit

> Get the trails that report the commit, newest first, across all flows.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /search/{org}/commit/{sha}/trails
openapi: 3.1.0
info:
  title: Kosli API
  summary: The API for communicating with Kosli
  description: >

    # Authentication 


    When making requests against Kosli API, you can authenticate your requests
    using a bearer token. 

    Set the bearer token in the request Authorization header to a valid API
    key. 

    API Keys can be personal or for service accounts. Check the [service
    accounts
    documentation](https://docs.kosli.com/getting_started/service-accounts/) for
    details. 


    ## Curl example


    ```shell

    curl -H "Authorization: Bearer <<your-api-key>>"
    https://app.kosli.com/api/v2/environments/<<your-org-name>>

    ```
  version: '2.0'
servers:
  - url: https://app.kosli.com/api/v2
    description: EU
  - url: https://app.us.kosli.com/api/v2
    description: US
security:
  - HTTPBearer: []
paths:
  /search/{org}/commit/{sha}/trails:
    get:
      tags:
        - Search
      summary: List trails for a commit
      description: Get the trails that report the commit, newest first, across all flows.
      operationId: list_trails_for_commit
      parameters:
        - name: sha
          in: path
          required: true
          schema:
            type: string
            description: The full 40 character commit SHA-1.
            title: Sha
          description: The full 40 character commit SHA-1.
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
        - name: page
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000000
            minimum: 1
            description: Page number
            default: 1
            title: Page
          description: Page number
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            minimum: 1
            description: Number of trails per page
            default: 15
            title: Per Page
          description: Number of trails per page
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommitTrailsResponse'
        '400':
          description: The value is not a full 40 character commit SHA-1.
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    CommitTrailsResponse:
      properties:
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
        page:
          type: integer
          title: Page
        per_page:
          type: integer
          title: Per Page
        total_pages:
          type: integer
          title: Total Pages
        total_count:
          type: integer
          title: Total Count
        trails:
          items:
            $ref: '#/components/schemas/CommitTrailItem'
          type: array
          title: Trails
          description: Trails that report the commit, newest first.
      additionalProperties: false
      type: object
      required:
        - page
        - per_page
        - total_pages
        - total_count
        - trails
      title: CommitTrailsResponse
    CommitTrailItem:
      properties:
        flow_name:
          type: string
          title: Flow Name
          description: Name of the trail's flow.
        trail_name:
          type: string
          title: Trail Name
          description: Name of the trail.
        branch:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch
          description: Branch the commit was on when this trail reported it.
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: URL of the commit as this trail reported it.
        _links:
          additionalProperties: true
          type: object
          title: Links
          description: Links to the trail, its flow and any repos it belongs to.
      type: object
      required:
        - flow_name
        - trail_name
        - _links
      title: CommitTrailItem
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.