---
title: "Datasets.Create"
description: "Create a dataset with the given code name, display name, schema kind, and custom fields."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

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

# Datasets.Create

import { Fragment } from "astro/jsx-runtime";

import ApiReference from "@docs/components/ApiReference.astro";

import ParamField from "@docs/components/ParamField.astro";

```go
func (datasetClient) Create(
    ctx context.Context,
    kind datasets.DatasetKind,
    codeName string,
    name string,
    fields []datasets.Field,
    options ...datasets.DatasetOption,
) (*datasets.Dataset, error)
```

Create a dataset with the given code name, display name, schema kind, and custom fields.

Fields created with `field.String`, `field.Bool`, `field.Int32`, `field.Int64`, `field.Uint64`, or `field.Float64` can be
marked queryable. Queryable fields cannot be repeated, and a dataset can contain at most two queryable string fields.

## Parameters

**kind**

type: datasets.DatasetKind

required: true

The dataset kind.
**codeName**

type: string

required: true

The stable code identifier for the dataset.
**name**

type: string

required: true

The display name of the dataset.
**fields**

type: []datasets.Field

required: true

The custom fields in the dataset schema.
**options**

type: []datasets.DatasetOption

Options for dataset metadata.

## Options

**datasets.WithSummary(summary string)**

Set a short dataset summary.
**datasets.WithDescription(description string)**

Set the dataset's markdown description.

## Field options

**Queryable()**

Make the field available for server-side custom field filters. Choose queryable fields before ingesting datapoints.

## Dataset kinds

**datasets.KindTemporal**

type: datasets.DatasetKind

A dataset that contains timestamp, ID, and ingestion time fields.
**datasets.KindSpatiotemporal**

type: datasets.DatasetKind

A dataset that contains timestamp, ID, ingestion time, and geometry fields.

## Returns

The created dataset object.

See [Queryable fields](/docs/datasets/concepts/datasets#queryable-fields) for schema constraints and
[Filter by custom fields](/docs/datasets/query/filter-by-fields) for query syntax.

<h2 id="request-example">Usage example</h2>

```go
dataset, err := client.Datasets.Create(ctx,
    datasets.KindSpatiotemporal,
    "my_catalog",
    "My catalog",
    []datasets.Field{
        field.String("source").
            Description("Source system").
            Queryable(),
        field.Float64("cloud_cover").Queryable(),
    },
    datasets.WithSummary(
        "Scenes prepared for analysis",
    ),
)
```

Source: https://tilebox.com/docs/api-reference/go/datasets/Create/index.mdx
