---
title: "Create a data store"
method: POST
path: "/data-stores"
tags: ["Data stores"]
---

# Create a data store

`POST /data-stores`

## Request

- Base URL: `https://www.fandom.ai/api/v1`
- URL: `https://www.fandom.ai/api/v1/data-stores`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api/docs/data-stores/post.ts> (a function with typed inputs; its response is checked against the schema)

Collects YouTube channels and videos, with their comments, in the background. Starts as `collecting`; poll Get a data store until `ready`.

Scope: `datasets:write`.

Send an `Idempotency-Key` header to make retries safe.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `name` string, required
  - `sources` object[], required
    - `url` string, required: A YouTube channel or video URL.
    - `type` 'channel' | 'video': Detected from the URL when left out.
    - `videosPerChannel` integer: Recent videos to read per channel. Default 10.
  - `private` boolean: Only visible to the key's creator. Default false.

## Response `201`

Success

- object
  - `id` string, required
  - `name` string, required
  - `description` string, required
  - `status` string, required: `collecting`, `ready` or `error`. Collection usually takes minutes.
  - `error` string, nullable, required
  - `scope` 'workspace' | 'private' | 'library', required: `library` stores are shared by Fandom and read-only.
  - `channelCount` number, required
  - `videoCount` number, required
  - `createdAt` string, nullable, required
  - `updatedAt` string, nullable, required
  - `readyAt` string, nullable, required

## Other responses

- `400`: The request is missing something or has a bad value. The message says what.
- `401`: No API key, or the key is wrong or revoked.
- `403`: The key doesn't have the scope, or isn't allowed this campaign or account.
- `409`: The current state doesn't allow this (for example, it's already done or still generating).
- `429`: More than 120 requests in a minute. Wait and retry.

## Changes

- **2026-10-07** `dfe5b1c3d84f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api/changes/data-stores/post.md)

---

[API](https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api.md) - [All operations](https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api/llms.txt) - [OpenAPI document](https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api/revisions/6c1a68a75970?raw)
