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

# Retrieve project commit

> Retrieve a project version (commit) by its id.



## OpenAPI

````yaml get /versions/{projectVersionId}
openapi: 3.0.3
info:
  contact:
    email: support@openlayer.com
    name: Openlayer
    url: https://openlayer.com/
  description: API for interacting with the Openlayer server.
  title: Openlayer API
  version: '1.0'
  x-logo:
    url: https://logo.clearbit.com/openlayer.com
servers:
  - url: https://api.openlayer.com/v1
    description: Our prod backend
security:
  - bearerAuth: []
paths:
  /versions/{projectVersionId}:
    get:
      summary: Retrieve project commit.
      description: Retrieve a project version (commit) by its id.
      operationId: getVersionById
      parameters:
        - $ref: '#/components/parameters/projectVersionId'
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectVersion'
        default:
          $ref: '#/components/responses/UnexpectedError'
      security:
        - apiKey: []
        - bearerAuth: []
      x-codeSamples:
        - lang: python
          source: >
            from openlayer import Openlayer


            client = Openlayer()

            client.commits.retrieve(project_version_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: typescript
          source: >
            import Openlayer from 'openlayer';


            const openlayer = new Openlayer();

            await openlayer.commits.retrieve({projectVersionId:
            "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"})
        - lang: go
          source: >
            package main


            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )


            client := openlayer.NewClient()

            client.Commits.Get(context.TODO(),
            "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: java
          source: >
            import com.openlayer.api.client.OpenlayerClient;

            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;

            import com.openlayer.api.models.ProjectVersionGetParams;

            import com.openlayer.api.models.ProjectVersionGetResponse;


            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();


            ProjectVersionGetParams params =
            ProjectVersionGetParams.builder().build();

            ProjectVersionGetResponse response = client.commits().get(params);
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/versions/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --header 'Authorization: Bearer <token>'
components:
  parameters:
    projectVersionId:
      name: projectVersionId
      in: path
      description: The project version (commit) id.
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    ProjectVersion:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The project version (commit) id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The project version (commit) creation date.
          example: '2024-03-22T11:31:01.185Z'
        status:
          type: string
          readOnly: true
          enum:
            - queued
            - running
            - paused
            - failed
            - completed
            - unknown
          description: >-
            The commit status. Initially, the commit is `queued`, then, it
            switches to `running`. Finally, it can be `paused`, `failed`, or
            `completed`.
          example: completed
        statusMessage:
          type: string
          nullable: true
          readOnly: true
          description: The commit status message.
          example: Commit successfully processed.
        projectId: cb755fc6-b46a-4bc7-95dd-da3bcf0b1f13
        storageUri:
          type: string
          nullable: false
          writeOnly: true
          description: The storage URI where the commit bundle is stored.
          example: s3://...
        commit:
          type: object
          required:
            - id
            - authorId
            - message
            - mlModelId
            - validationDatasetId
            - trainingDatasetId
            - fileSize
            - storageUri
          description: The details of a commit (project version).
          properties:
            id:
              type: string
              format: uuid
              readOnly: true
              description: The commit id.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            authorId:
              type: string
              format: uuid
              readOnly: true
              description: The author id of the commit.
              example: 589ece63-49a2-41b4-98e1-10547761d4b0
            dateCreated:
              type: string
              format: date-time
              readOnly: true
              description: The commit creation date.
              example: '2024-03-22T11:31:01.185Z'
            fileSize:
              type: integer
              readOnly: true
              nullable: true
              description: The size of the commit bundle in bytes.
              example: 1024
            message:
              type: string
              description: The commit message.
              example: Updated the prompt.
            mlModelId:
              type: string
              format: uuid
              nullable: true
              readOnly: true
              description: The model id.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            validationDatasetId:
              type: string
              format: uuid
              nullable: true
              readOnly: true
              description: The validation dataset id.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            trainingDatasetId:
              type: string
              format: uuid
              nullable: true
              readOnly: true
              description: The training dataset id.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            storageUri:
              type: string
              nullable: false
              readOnly: true
              description: The storage URI where the commit bundle is stored.
              example: s3://...
            gitCommitSha:
              type: integer
              readOnly: true
              description: The SHA of the corresponding git commit.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            gitCommitRef:
              type: string
              readOnly: true
              description: The ref of the corresponding git commit.
              example: main
            gitCommitUrl:
              type: string
              readOnly: true
              description: The URL of the corresponding git commit.
        deploymentStatus:
          type: string
          maxLength: 30
          description: The deployment status associated with the commit's model.
          example: Deployed
        mlModelId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The model id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        validationDatasetId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The validation dataset id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        trainingDatasetId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The training dataset id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        archived:
          type: boolean
          nullable: true
          description: Whether the commit is archived.
          example: false
        dateArchived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: The commit archive date.
          example: '2024-03-22T11:31:01.185Z'
        passingGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tests that are passing for the commit.
          example: 5
        failingGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tests that are failing for the commit.
          example: 1
        totalGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The total number of tests for the commit.
          example: 6
        links:
          type: object
          readOnly: true
          required:
            - app
          properties:
            app:
              type: string
              example: >-
                https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6
      required:
        - id
        - dateCreated
        - status
        - statusMessage
        - projectId
        - commit
        - storageUri
        - mlModelId
        - validationDatasetId
        - trainingDatasetId
        - dateArchived
        - passingGoalCount
        - failingGoalCount
        - totalGoalCount
  responses:
    UnexpectedError:
      description: Unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - error
            properties:
              code:
                type: integer
                format: int32
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your workspace API key. See [Find your API
        key](https://www.openlayer.com/docs/workspace-and-projects/find-your-api-key)
        for more information.

````