Skip to main content
POST
Create a dataset

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

The Dataset's name. Should be unique, contain only alpanum chars and underscores. Max length is 256.

schema
object
required

Schema describing a dataset's input file type and the kind of data the file contains. Note: when the file type is "flat" then the order of the properties describing the must be given in the order they appear in the input file.

display_name
string

The Dataset's name to display at UI.

description
string | null

A description of the data contained with the dataset.

data_plane_id
string<uuid>

Optional data plane identifier, must be provided when registering dataset in external dataplane.

external_id
string

Optional external identifier, must be excluded when registering dataset in external dataplane

is_narrative_managed
boolean

Whether the dataset is managed by Narrative

tags
string[]

Tags that describe the dataset.

write_mode
enum<string>

How Narrative will treat new data uploaded for the dataset.

  • append means data will be added to the dataset, this is what to choose if you incrementally update your dataset over time.
  • overwrite means that all existing data will be overwritten with new data.
Available options:
append,
overwrite
derive_metrics_config
boolean

A flag to enable derivation of the config.

Response

OK

A dataset.

The encoder drops nulls and empty collections, so an optional field is absent rather than null, and tags and mappings are absent rather than [] when there are none. DatasetAdminResponse composes this schema with allOf but encodes without that step, so on the admin endpoints the same optional fields arrive as null. Either way they are optional, and both shapes validate.

id
integer
required

Unique identifier for the dataset.

company_id
integer
required

The ID of the company owning the dataset.

data_plane
object
required

The data plane the dataset lives on.

is_narrative_managed
boolean
required

Whether Narrative manages the dataset rather than the owning company.

created_at
string
required

ISO-8601 timestamp indicating when the dataset was created

name
string
required

The Dataset's name. Should be unique, contain only alpanum chars and underscores. Max length is 256.

display_name
string
required

The Dataset's name to display at UI.

retention_policy
object
required

A dataset's retention policies, plus the schedule they are enforced on. This is the shape every dataset response carries; legacy snapshot-only payloads are accepted on write and returned in this form.

Example:
schema
object
required

Schema describing a dataset's input file type and the kind of data the file contains. Note: when the file type is "flat" then the order of the properties describing the must be given in the order they appear in the input file.

status
enum<string>
required

The dataset status.

  • active means that data can be added to the dataset but the schema is locked in place
  • pending means the dataset has been created, but the schema can still be altered and no data can be added to the dataset
  • archived means the dataset has been retired and can no longer be read from or written to
Available options:
active,
pending,
archived
write_mode
enum<string>
required

How Narrative will treat new data uploaded for the dataset.

  • append means data will be added to the dataset, this is what to choose if you incrementally update your dataset over time.
  • overwrite means that all existing data will be overwritten with new data.
Available options:
append,
overwrite
updated_at
string
required

ISO-8601 timestamp indicating when the dataset was last updated.

external_id
string | null

The dataset's identifier in the system it came from. Absent when the dataset did not come from one.

mappings
object[]

The mappings from this dataset's fields to attributes. Absent when the dataset has none.

compute_pool_config
object

Compute pool configuration for the dataset.

description
string | null

A description of the data contained with the dataset.

tags
string[]

Tags that describe the dataset.

subscription_id
string | null

Id of a subscription which writes output to the dataset

last_snapshot_created_at
string | null

ISO-8601 timestamp indicating when the last snapshot was created.

materialized_view_config
object | null

Materialized-view configuration. Present only for materialized-view datasets.

stats
object | null