> ## Documentation Index
> Fetch the complete documentation index at: https://kosli-reference-docs-v2-30-1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List attestations

> Get a paginated list of attestations for an organization based on filters
provided as query parameters.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /attestations/{org}
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:
  /attestations/{org}:
    get:
      tags:
        - Attestation
      summary: List attestations
      description: >-
        Get a paginated list of attestations for an organization based on
        filters

        provided as query parameters.
      operationId: get_attestations
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
        - name: attestation_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The attestation ID to search for
            title: Attestation Id
          description: The attestation ID to search for
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by exact attestation name. Cannot be combined with
              name_regex.
            title: Name
          description: >-
            Filter by exact attestation name. Cannot be combined with
            name_regex.
        - name: name_regex
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by attestation name (substring regex match)
            title: Name Regex
          description: Filter by attestation name (substring regex match)
        - name: flow
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter by flow name. Repeat the parameter to match several flows.
            title: Flow
          description: Filter by flow name. Repeat the parameter to match several flows.
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Filter by attestation type. Use built-in types (e.g. 'junit',
              'decision') or 'custom:<name>' for custom types. Repeat the
              parameter to match several types.
            title: Type
          description: >-
            Filter by attestation type. Use built-in types (e.g. 'junit',
            'decision') or 'custom:<name>' for custom types. Repeat the
            parameter to match several types.
        - name: is_compliant
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: >-
              Filter by compliance state. Omit to include both compliant and
              non-compliant.
            title: Is Compliant
          description: >-
            Filter by compliance state. Omit to include both compliant and
            non-compliant.
        - name: from_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: 'From timestamp filter. Example: ?from_timestamp=1675167540'
            title: From Timestamp
          description: 'From timestamp filter. Example: ?from_timestamp=1675167540'
        - name: to_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: 'To timestamp filter. Example: ?to_timestamp=1675167540'
            title: To Timestamp
          description: 'To timestamp filter. Example: ?to_timestamp=1675167540'
        - name: after
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Cursor for the next page. Use the token from a previous response's
              _links.next; omit for the first page.
            title: After
          description: >-
            Cursor for the next page. Use the token from a previous response's
            _links.next; omit for the first page.
        - name: per_page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 100
                minimum: 1
              - type: 'null'
            description: How many results to return per page of response (max 100)
            default: 20
            title: Per Page
          description: How many results to return per page of response (max 100)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttestationsPaginatedResponse'
        '400':
          description: Invalid request (bad date range, name+name_regex, or cursor)
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__BadRequestResponse___locals___BadRequestResponseModel__1
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    AttestationsPaginatedResponse:
      properties:
        data:
          $ref: '#/components/schemas/AttestationResponse'
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
        pagination:
          anyOf:
            - $ref: '#/components/schemas/PaginationInfo'
            - type: 'null'
      type: object
      required:
        - data
      title: AttestationsPaginatedResponse
    fastapi_app__errors__BadRequestResponse___locals___BadRequestResponseModel__1:
      properties:
        message:
          type: string
          title: Message
          description: Error message
        errors:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Errors
          description: Validation errors by field
      type: object
      required:
        - message
      title: BadRequestResponseModel
      description: End of range must be greater than start of range.
      examples:
        - message: End of range must be greater than start of range.
    AttestationResponse:
      items:
        additionalProperties: true
        type: object
      type: array
      title: AttestationResponse
      examples:
        - - attestation_id: '1234567890'
            attestation_name: generic-evidence
            attestation_type: generic
            created_at: 1754551048.2005377
            description: generic attestation
            has_audit_package: false
            html_url: >-
              http://localhost/b2cebc00v2-shared/flows/flow.b2cebc00-template/trails/trail-b2cebc00?attestation_id=cd5b2c7f-8e4d-45a4-949c-8a71cbdb
            is_compliant: true
            origin_url: >-
              https://github.com/merkely-development/merkely/actions/runs/1049309666
            reported_by: b2cebc00v2
            schema_version: 1
            user_data:
              foo.bar: this should work
    PaginationInfo:
      properties:
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        per_page:
          type: integer
          title: Per Page
        page_count:
          type: integer
          title: Page Count
      type: object
      required:
        - total
        - page
        - per_page
        - page_count
      title: PaginationInfo
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````