Skip to navigation

Update a Dataset Schema

View as MarkdownOpen in Claude

Updates the schema of an existing V4 dataset. Each successful update writes a new schema version.

Schema migration. If the dataset already had a schema, changing it starts an asynchronous schema migration that re-normalises the dataset’s existing datapoints against the new version. In that case the response includes a migration_job_id; poll GET /datasets/{dataset_id}/schema-migrations/{job_id} with it until the job reaches a terminal status. When this is the dataset’s first schema, no migration is needed and migration_job_id is omitted.

Constraints:

  • V4 datasets only — a 400 is returned for V3 datasets.
  • The task_group_id column designation cannot be changed once the dataset has datapoints; attempting to do so returns 400.

Authentication

AuthorizationToken

The Prolific API uses API token to authenticate requests. You can create an API token directly from your settings.

Your API token does not have an expiry date and carries full permission, so be sure to keep them secure.

If your token is leaked, delete it and create a new one directly in the app.

In your requests add Authorization header with the value Token <your token>.

Path parameters

dataset_idstringRequiredformat: "uuid"
The unique identifier of the V4 dataset to update

Request

This endpoint expects an object.
schemaobjectRequired
The new schema definition for the dataset.

Response

Dataset updated. Returns the updated dataset. When the update triggered a schema migration, migration_job_id is present — poll the schema-migration endpoint with it.

idstringformat: "uuid"
namestring
created_atdatetime
created_bystring
workspace_idstring
total_datapoint_countinteger>=0
schema_versionenum

Internal dataset version. 3 = legacy CSV/ZIP; 4 = structured schema with JSONL/CSV import tracking.

Allowed values:
statusenumOptional

Processing status. V3 datasets only. V4 datasets track status per import job via imports.

Allowed values:
filenamestring or nullOptional

Filename of the uploaded data file. V3 datasets only.

has_predetermined_grouping_idboolean or nullOptional

Whether the dataset contains a META_TASK_GROUP_ID column. V3 datasets only.

schemaobject or nullOptional

The researcher-defined field schema for this dataset. V4 datasets only. null if no schema has been set yet.

importslist of objects or nullOptional

Import jobs for this dataset, most recent first. V4 datasets only. null for V3 datasets.

migration_job_idstringOptionalformat: "uuid"

The schema migration job started by this update. Present only when the dataset already had a schema (i.e. the schema was changed, not set for the first time). Use with GET /datasets/{dataset_id}/schema-migrations/{job_id}.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error