Lightly Datasets API

Create and manage LightlyOne datasets.

OpenAPI Specification

lightly-ai-datasets-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: LightlyOne Platform Datasets API
  description: REST API for the LightlyOne data-curation and active-learning platform for computer vision. The API manages datasets, samples, embeddings, cloud datasources, selection / active-learning runs (the LightlyOne Worker), tags, and asynchronous jobs. Paths and verbs mirror the OpenAPI-generated client shipped inside the open-source `lightly` Python package (lightly.openapi_generated.swagger_client). The open-source self-supervised learning SDK is a separate, pip-installable library and is not part of this HTTP surface.
  termsOfService: https://www.lightly.ai/terms-of-service
  contact:
    name: Lightly Support
    email: support@lightly.ai
    url: https://www.lightly.ai
  license:
    name: Proprietary
    url: https://www.lightly.ai/terms-of-service
  version: '1.0'
servers:
- url: https://api.lightly.ai
  description: LightlyOne platform production API
security:
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: Datasets
  description: Create and manage LightlyOne datasets.
paths:
  /v1/datasets:
    get:
      operationId: getDatasets
      tags:
      - Datasets
      summary: List all datasets the user has access to.
      parameters:
      - name: shared
        in: query
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: A list of datasets.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DatasetData'
    post:
      operationId: createDataset
      tags:
      - Datasets
      summary: Create a new dataset.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetCreateRequest'
      responses:
        '201':
          description: The created dataset id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEntityResponse'
  /v1/datasets/{datasetId}:
    get:
      operationId: getDatasetById
      tags:
      - Datasets
      summary: Get a dataset by id.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      responses:
        '200':
          description: The dataset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetData'
    put:
      operationId: updateDatasetById
      tags:
      - Datasets
      summary: Update a dataset by id.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetUpdateRequest'
      responses:
        '200':
          description: Updated.
    delete:
      operationId: deleteDatasetById
      tags:
      - Datasets
      summary: Delete a dataset by id.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      responses:
        '200':
          description: Deleted.
  /v1/datasets/{datasetId}/children:
    get:
      operationId: getChildrenOfDatasetById
      tags:
      - Datasets
      summary: List child datasets of a dataset.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      responses:
        '200':
          description: A list of child datasets.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DatasetData'
  /v1/datasets/query/name/{datasetName}:
    get:
      operationId: getDatasetsQueryByName
      tags:
      - Datasets
      summary: Find datasets by exact name.
      parameters:
      - name: datasetName
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Matching datasets.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DatasetData'
  /v1/datasets/{datasetId}/registerDatasetUpload:
    put:
      operationId: registerDatasetUpload
      tags:
      - Datasets
      summary: Register a dataset upload for the given dataset.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      responses:
        '200':
          description: Registered.
components:
  schemas:
    DatasetType:
      type: string
      enum:
      - Images
      - Videos
      - Crops
    DatasetData:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        userId:
          type: string
        type:
          $ref: '#/components/schemas/DatasetType'
        imgType:
          type: string
          enum:
          - full
          - thumbnail
          - meta
        nSamples:
          type: integer
        sizeInBytes:
          type: integer
          format: int64
        createdAt:
          type: integer
          format: int64
        lastModifiedAt:
          type: integer
          format: int64
      required:
      - id
      - name
      - type
    DatasetUpdateRequest:
      type: object
      properties:
        name:
          type: string
    DatasetCreateRequest:
      type: object
      properties:
        name:
          type: string
        type:
          $ref: '#/components/schemas/DatasetType'
      required:
      - name
      - type
    CreateEntityResponse:
      type: object
      properties:
        id:
          type: string
      required:
      - id
  parameters:
    DatasetId:
      name: datasetId
      in: path
      required: true
      schema:
        type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: token
      description: LightlyOne API token passed as the `token` query parameter. Find your token in the preferences menu of the LightlyOne Platform.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Public JWT bearer token passed in the `Authorization: Bearer <token>` header for browser / public-token authenticated calls.'