Defining a Dataset Schema
A dataset schema lets you describe the structure of your data before uploading it. Schemas are a feature of V4 datasets and enable:
- Named, typed fields that drive what participants see
dataset_fielditems inbatch_itemsthat pull dataset values directly into your task layout- Per-record validation during import (with strict mode)
- Structured metadata and custom task grouping
Creating a dataset with a schema
Pass a schema object when creating a dataset.
Field types
Audio URL fields
Use audio_url for externally hosted source audio that participants should listen to during a Batch task.
- Prolific does not host source media.
audio_urlfields must point to audio files hosted outside Prolific. - URLs must remain valid for the full study duration. The audio URL should stay reachable and accessible from dataset import through participant completion.
- Use direct-file HTTPS URLs only. Manifest-based streaming formats such as
.m3u8and.mpdare not supported. - Supported audio formats:
.mp3,.wav,.aac, and.m4a. Access-Control-Allow-Origin(CORS): without it the audio can still play, but the player shows a generic placeholder waveform instead of the decoded waveform preview because waveform generation uses a cross-origin fetch.Cache-Controland/orETag: without cache headers the same file may be downloaded twice — once to decode the waveform and once again for playback.
Video URL fields
Use video_url for externally hosted source video that participants should watch during a Batch task.
- Prolific does not host source media.
video_urlfields must point to video files hosted outside Prolific. - URLs must remain valid for the full study duration. The video URL should stay reachable and accessible from dataset import through participant completion.
- Use direct-file HTTPS URLs only. Manifest-based streaming formats such as
.m3u8and.mpdare not supported and are rejected during dataset validation. - Supported video formats:
.mp4,.mov,.webm, and.m4v. Access-Control-Allow-Origin(CORS): without it the video can still play, but the player shows a generic placeholder poster frame instead of the real one, because the poster frame is decoded via a cross-originfetch.Cache-Controland/orETag: without cache headers the same file may be downloaded twice — once to decode the poster frame and once again for playback.
Strict mode
The strict flag controls how missing fields are handled during import.
Schema constraints
- Maximum 200 fields per schema.
- Field keys: 1–128 characters.
- Field labels: maximum 255 characters.
- At most one field of type
task_group_idper schema.
Referencing schema fields in the batch layout
Once a dataset with a schema is attached to a batch, you can use dataset_field items in batch_items to display dataset values to participants.
Only fields of type text, image_url, audio_url, or video_url can be referenced by dataset_field items. metadata and task_group_id fields are not displayed to participants.
Retrieving a dataset with its schema
The response includes the current schema and all import jobs: