---
title: "Create or replace a workspace dataset"
method: POST
path: "/v1/data-library/datasets"
tags: ["Data Library"]
---

# Create or replace a workspace dataset

`POST /v1/data-library/datasets`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/data-library/datasets`
- Auth: HTTP bearer

Creates the workspace's dataset with this `key`, or replaces its definition when it exists; every field the body omits returns to its default. The dataset belongs to the workspace of the key; shared datasets are written by Talonic only. Requires the `write` scope. A `document.extract` dataset needs `record_schema` and a string `params.url`. `source_url` defaults to `params.url` when omitted.

## Request body

- DataLibraryDatasetInput
  - `key` string, required: Dataset key, case-insensitive match of the pattern.
  - `label` string, required
  - `kind` string
  - `publisher` string, nullable
  - `source_url` string, nullable
  - `licence` string, nullable
  - `connector` 'manual' | 'document.extract' | 'eu_ets.union_registry': Code that reads the source. `manual` datasets are written only through the records endpoint.
  - `record_schema` string, nullable: What the records look like, for example `grid_fee_gas`, `grid_fee_power`, `district_heat_prices`, `default_supply_prices`, `eu_ets_installation_emissions`. An unknown name answers 422.
  - `params` object: Connector parameters, for example `url` for `document.extract`.
  - `sync_hours` integer: Hours between scheduled reads.
  - `active` boolean

## Response `201`

The stored dataset.

- object
  - `data` DataLibraryDatasetRow, required: A stored dataset definition with its sync state.
    - `id` string, uuid
    - `customer_id` string, uuid, nullable: Null for a dataset of the shared library.
    - `key` string
    - `label` string
    - `kind` string
    - `publisher` string, nullable
    - `source_url` string, nullable
    - `licence` string, nullable
    - `connector` string
    - `record_schema` string, nullable
    - `params` object
    - `sync_hours` integer
    - `active` boolean
    - `last_synced_at` string, date-time, nullable
    - `last_status` 'ok' | 'error', nullable
    - `last_error` string, nullable
    - `last_stored` integer, nullable: Records stored by the last read.
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `400`: The request is invalid.
- `401`: Missing or invalid API key.
- `403`: The API key does not have the required scope.
- `422`: The request is well-formed but violates the declared task contract.
- `429`: Daily rate limit exceeded.

## Changes

- **2026-10-28** `0a485a46163e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/data-library/datasets/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
