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

# Create Dataset

> Create a new dataset to store and organize documents

## Request

Creates a new dataset. Datasets are containers for related documents that can be searched together.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication

  Example: `Bearer fltr_sk_abc123...`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

### Body

<ParamField body="name" type="string" required>
  Name of the dataset (1-200 characters)
</ParamField>

<ParamField body="description" type="string">
  Optional description (max 1000 characters)
</ParamField>

<ParamField body="is_public" type="boolean" default={false}>
  Whether the dataset is publicly accessible
</ParamField>

<ParamField body="metadata" type="object">
  Custom metadata as key-value pairs
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique dataset identifier (e.g., `ds_abc123`)
</ResponseField>

<ResponseField name="name" type="string">
  Dataset name
</ResponseField>

<ResponseField name="description" type="string">
  Dataset description
</ResponseField>

<ResponseField name="is_public" type="boolean">
  Public accessibility status
</ResponseField>

<ResponseField name="document_count" type="integer">
  Number of documents (always 0 for new datasets)
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of creation
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 timestamp of last update
</ResponseField>

<ResponseField name="metadata" type="object">
  Custom metadata
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.fltr.com/v1/datasets \
    -H "Authorization: Bearer fltr_sk_abc123..." \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Product Documentation",
      "description": "All product docs and guides",
      "is_public": false,
      "metadata": {
        "category": "documentation",
        "team": "product"
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.fltr.com/v1/datasets",
      headers={
          "Authorization": "Bearer fltr_sk_abc123...",
          "Content-Type": "application/json"
      },
      json={
          "name": "Product Documentation",
          "description": "All product docs and guides",
          "is_public": False,
          "metadata": {
              "category": "documentation",
              "team": "product"
          }
      }
  )

  dataset = response.json()
  print(f"Created dataset: {dataset['id']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.fltr.com/v1/datasets", {
    method: "POST",
    headers: {
      "Authorization": "Bearer fltr_sk_abc123...",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      name: "Product Documentation",
      description: "All product docs and guides",
      is_public: false,
      metadata: {
        category: "documentation",
        team: "product"
      }
    })
  });

  const dataset = await response.json();
  console.log(`Created dataset: ${dataset.id}`);
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "id": "ds_abc123def456",
  "name": "Product Documentation",
  "description": "All product docs and guides",
  "is_public": false,
  "document_count": 0,
  "created_at": "2024-01-10T12:00:00Z",
  "updated_at": "2024-01-10T12:00:00Z",
  "metadata": {
    "category": "documentation",
    "team": "product"
  }
}
```

## Errors

<ResponseField name="400" type="error">
  **Bad Request** - Invalid parameters

  ```json theme={null}
  {
    "error": "Invalid dataset name",
    "code": "invalid_name",
    "details": {
      "field": "name",
      "issue": "Name cannot be empty"
    }
  }
  ```
</ResponseField>

<ResponseField name="401" type="error">
  **Unauthorized** - Invalid or missing API key

  ```json theme={null}
  {
    "error": "Invalid API key",
    "code": "invalid_api_key"
  }
  ```
</ResponseField>

<ResponseField name="429" type="error">
  **Rate Limit Exceeded**

  ```json theme={null}
  {
    "error": "Rate limit exceeded",
    "code": "rate_limit_exceeded",
    "retry_after": 3600
  }
  ```
</ResponseField>

## Notes

* Dataset names must be unique within your account
* Maximum 1,000 datasets per account
* Use `is_public: true` to make datasets accessible without authentication (read-only)
* Metadata is indexed and searchable
* Deleting a dataset also deletes all its documents
