Skip to main content
Create a data collection task with POST /v1/task/datacollectionv2, authenticated with your Scale API key. The body is JSON, and upload_type determines which attachment fields are required and which are allowed. Any top-level field that is not part of the upload type’s schema is rejected. On success, the endpoint returns 200 with the task object and starts the task’s processing pipeline.

Upload types

All URL fields accept s3://, gs://, and https:// URLs.

Video item

Each entry in video_attachment requires all of the following fields:
sfs-annotation tasks require the project to be configured with the right processing steps. If it is not, the request returns 400 with Project is not set up for upload_type. Ask your Scale contact to set this up.

Request parameters

These fields are shared by both upload types, in addition to the attachment fields above.
object
string
required
One of video-annotation or sfs-annotation. See Upload types.
string
required
The project name (not its ID). It must be a datacollectionv2 project owned by the account of the API key.
object
required
Free-form metadata stored on the task. metadata.id is used as the recording ID for deduplication.
string
Task instructions shown to annotators.
array of objects
Annotation definitions to use for labeling. Defaults to the project’s taxonomy.
string
URL of pre-labels to load into the task.
string
URL of a calibration file for the recording.
string
Rejects a second task with the same ID in the project.
string
Adds the task to an existing batch by ID. Takes precedence over batch_name.
string
Adds the task to an existing batch by name. batch is accepted as an alias.

Example

The response is the task object, in the same format as GET /v1/task/:id. Store its task_id and check its status.

Errors

  • Invalid payload: the payload is validated before the task is saved. A bad payload returns 400 and no task is created. When required fields are missing, the error lists them; otherwise it reports only the first problem.
  • Pipeline failure: if the task’s processing pipeline fails to start, the request still returns 200, but the task’s status is error.

Duplicates and retries

  • metadata.id (or metadata.recordingId) is the recording ID. A second request for the same recording in the same project returns the existing task instead of creating a new one.
  • If a request for the same recording is still in progress, the call fails with Another process is creating a task for this recording, please retry. Retry after a short wait; a stuck request expires after 2 minutes.