---
updatedAt: 2025-03-06T23:35:27.000Z
agentTools:
  projectIndex: https://docs.tenyks.ai/llms.txt
---

# Create a Dataset

This endpoint creates a dataset.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "API Endpoints",
    "version": "1.0.1"
  },
  "servers": [
    {
      "url": "https://{base_url}.tenyks.ai",
      "description": "The Tenyks API",
      "variables": {
        "base_url": {
          "enum": [
            "dashboard",
            "sandbox"
          ],
          "default": "dashboard"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Data Upload GCS"
    }
  ],
  "paths": {
    "/api/workspaces/tenyks/datasets": {
      "post": {
        "tags": [
          "Data Upload GCS"
        ],
        "summary": "Create a Dataset",
        "description": "This endpoint creates a dataset.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetPayloadGCS"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DatasetPayloadGCS": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Unique key assigned to your dataset",
            "example": "face_detection"
          },
          "display_name": {
            "type": "string",
            "description": "Label assigned to your dataset_key",
            "example": "face_detection"
          },
          "task_type": {
            "type": "string",
            "enum": [
              "object_detection"
            ],
            "default": "object_detection"
          },
          "images_location": {
            "$ref": "#/components/schemas/GCSImagesLocation"
          },
          "metadata_location": {
            "$ref": "#/components/schemas/GCSMetadataLocation"
          }
        },
        "required": [
          "key",
          "display_name",
          "task_type",
          "images_location",
          "metadata_location"
        ]
      },
      "GCSImagesLocation": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "gcs"
            ],
            "default": "gcs"
          },
          "gcs_uri": {
            "type": "string",
            "example": "gs://tenyks_datasets_bucket/kitti/images/"
          },
          "credentials": {
            "$ref": "#/components/schemas/GCSCredentials"
          }
        },
        "required": [
          "type",
          "gcs_uri",
          "credentials"
        ]
      },
      "GCSMetadataLocation": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "gcs"
            ],
            "default": "gcs"
          },
          "gcs_uri": {
            "type": "string",
            "example": "gs://tenyks_datasets_bucket/kitti/metadata/"
          },
          "credentials": {
            "$ref": "#/components/schemas/GCSCredentials"
          }
        },
        "required": [
          "type",
          "gcs_uri",
          "credentials"
        ]
      },
      "GCSCredentials": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "private_key_id": {
            "type": "string"
          },
          "private_key": {
            "type": "string"
          },
          "client_email": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "auth_uri": {
            "type": "string"
          },
          "token_uri": {
            "type": "string"
          },
          "auth_provider_x509_cert_url": {
            "type": "string"
          },
          "client_x509_cert_url": {
            "type": "string"
          },
          "universe_domain": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```