v4

latestOpenAPI 3.1.02026-07-31121440441.0 KB
aiTaskBuilder

Append Datapoints to a Dataset

Synchronously appends one or more JSONL records to an existing V4 dataset. Unlike the file-upload flow, this endpoint processes the whole payload within the request and returns the accepted/rejected counts directly — there is no async import job to poll.

Request body: JSONL — one JSON object per line — sent with a JSONL content type (e.g. application/x-ndjson). Blank lines are skipped. CSV is not supported on this endpoint.

Each record is validated against the dataset's current schema. Valid records are persisted as datapoints and sort after every existing datapoint. Records that are malformed or violate the schema are rejected individually and reported in errors — they do not fail the whole request. Re-appending an identical record is idempotent (counted as accepted, not written twice).

Limits and preconditions:

  • At most 1000 records per request. Larger imports should use the file-upload flow.
  • The dataset must be V4 and have a schema defined.
  • Rejected with 409 Conflict while a dataset import or a schema migration is in progress.

If the dataset is attached to any batches with auto_sync_enabled, a sync is triggered automatically for the newly written datapoints.

post/api/v1/data-collection/datasets/{dataset_id}/datapoints

Path parameters

dataset_idstring uuid required

The unique identifier of the V4 dataset to append to

Headers

Authorizationstring required

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>.

Request body

string required

Response

Append processed. Returns per-request accepted/rejected counts. A 200 is returned even when some (or all) records were rejected — inspect rejected and errors.

acceptedinteger required

Number of records that passed validation (newly written or idempotent duplicates).

rejectedinteger required

Number of records rejected. Equal to the length of errors.