Datasets

Upsert Dataset

Create a Dataset or update it with a new version if it already exists.

Datasets are identified by the ID or their path. The datapoints determine the versions of the Dataset.

By default, the new Dataset version will be set to the list of Datapoints provided in the request. You can also create a new version by adding or removing Datapoints from an existing version by specifying action as add or remove respectively. In this case, you may specify the version_id or environment query parameters to identify the existing version to base the new version on. If neither is provided, the latest created version will be used.

You can provide version_name and version_description to identify and describe your versions. Version names must be unique within a Dataset - attempting to create a version with a name that already exists will result in a 409 Conflict error.

Humanloop also deduplicates Datapoints. If you try to add a Datapoint that already exists, it will be ignored. If you intentionally want to add a duplicate Datapoint, you can add a unique identifier to the Datapoint's inputs such as {_dedupe_id: <unique ID>}.

post/datasets

Request

  • Base URL: https://api.humanloop.com/v5
  • URL: https://api.humanloop.com/v5/datasets
  • Auth: API key in header X-API-KEY

Query parameters

version_idstring

ID of the specific Dataset version to base the created Version on. Only used when action is "add" or "remove".

environmentstring

Name of the Environment identifying a deployed Version to base the created Version on. Only used when action is "add" or "remove".

include_datapointsboolean

If set to true, include all Datapoints in the response. Defaults to false. Consider using the paginated List Datapoints endpoint instead.

Request body

pathstring

Path of the Dataset, including the name. This locates the Dataset in the Humanloop filesystem and is used as as a unique identifier. For example: folder/name or just name.

idstring

ID for an existing Dataset.

action'set' | 'add' | 'remove'

An enumeration.

attributesobject

Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used.

version_namestring

Unique name for the Dataset version. Version names must be unique for a given Dataset.

version_descriptionstring

Description of the version, e.g., the changes made in this version.

Response

Successful Response

pathstring required

Path of the Dataset, including the name, which is used as a unique identifier.

idstring required

Unique identifier for the Dataset. Starts with ds_.

directory_idstring

ID of the directory that the file is in on Humanloop.

namestring required

Name of the Dataset, which is used as a unique identifier.

descriptionstring

Description of the Dataset.

schemaobject

The JSON schema for the File.

readmestring

Long description of the file.

tagsstring[]

List of tags associated with the file.

version_idstring required

Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with dsv_.

type'dataset'
created_atstring date-time required
updated_atstring date-time required
created_byunknown
last_used_atstring date-time required
version_namestring

Unique name for the Dataset version. Version names must be unique for a given Dataset.

version_descriptionstring

Description of the version, e.g., the changes made in this version.

datapoints_countinteger required

The number of Datapoints in this Dataset version.

attributesobject

Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used.

Changes

No recorded changes to this operation across all 1 revision of this API.