Documentation Index
Fetch the complete documentation index at: https://api-reference.scale.com/llms.txt
Use this file to discover all available pages before exploring further.
Create a task
A task represents an individual unit of work to be done by a Contributor. There’s a 1:1 mapping between a task and the data to be labeled. For example, there’d be 1 task for each image, video, or lidar sequence needing to be labeled. You specify how the labeling should be done for a given task when making an API call specifying a set of task parameters to the endpoint you’d like to leverage. Tasks have a type such as “Image Annotation”, “Video Annotation”, “Lidar Segmentation”, or “Document Transcription”.For information on how to create specific task types, you can click on the links below:
- Image Annotation Task
- Semantic Segmentation Annotation Task
- General Video Annotation Task
- Lidar Cuboid Annotation
- Lidar Segmentation Annotation
- Lidar Linking Annotation
- Lidar Topdown Tasks
- Text Collection Task
- Named Entity Recognition Task
Task Metadata
Tasks objects have a metadata parameter. You can use this parameter to attach key-value data to tasks. Metadata is useful for storing additional, structured information on an object - especially information that can help you ingest the task response or keep track of what content this task corresponds to. Metadata is not used by Scale (e.g., to affect how the task is done). Common use-cases for metadata:
- Internal identifiers
- File paths
- Scenario / Run / Case identifiers
- Environment details (time of day, location)
- Sensor information
- Guideline / Taxonomy versions
Retrieve a task
Efficiently retrieve detailed task information, including the ability to retrieve a specific task using a task ID. This resourceful functionality allows seamless integration and thorough analysis of tasks, enhancing your workflow’s data-driven capabilities. Explore task details effortlessly through this essential endpoint.Retrieve Multiple Tasks
This is a paginated endpoint that retrieves a list of your tasks. The tasks will be returned in descending order based on created_at time. All time filters expect an ISO 8601-formatted string, like ‘2021-04-25’ or ‘2021-04-25T03:14:15-07:00’ The pagination is based on the limit and next_token parameters, which determine the page size and the current page we are on. The value of next_token is a unique pagination token for each page (nerdy details if you were curious). Make the call again using the returned token to retrieve the next page.The minimum value of created_at for tasks to be returned
The maximum value of
created_at for tasks to be returnedThe minimum value of
completed_at for tasks to be returnedThe maximum value of
completed_at for tasks to be returnedThe minimum value of
updated_at for tasks to be returnedThe maximum value of
updated_at for tasks to be returnedThe status of the task - can be:
completed, pending, or canceledThe type of the task.
The name of the project that the returned tasks must belong to.
The status of the audit result of the task can be:
accepted, fixed, commented, or rejected; multiple status values can be specified at the same time either as a joint string separated by comma (e.g. customer_review_status=accepted,fixed), or as an array (e.g. customer_review_status=accepted&customer_review_status=fixed)The name of the batch that the returned tasks must belong to
A number between 1 and 100, the maximum number of results to display per page | optional, default 100
The unique_id of a task; multiple unique IDs can be specified at the same time either as a joint string separated by comma (e.g.
unique_id=a1,a2), or as an array (e.g. unique_id=a1&unique_id=a2)The tags of a task; multiple tags can be specified at the same time either as a joint string separated by comma (e.g.
tags=t1,t2), or as an array (e.g. tags=t1&tags=t2)Set to true if the returned Task Object should include presigned attachment urls.
A token used to retrieve the next page of results if there are more. You can find the
next_token in your last requestCancel Task
You may only cancel pending tasks, and the endpoint will return a 400 error code if you attempt to cancel a completed task If the task to be cancled had a unique id, specifying**clear_unique_id=true** will remove the unique id. Canceling tasks is idempotent such that calling this endpoint multiple times will still return a 200 success response.
If true, will clear a task’s unique_id, thus allowing the same unique id to be used in future tasks.
Set Task Metadata
This endpoint sets the**metadata** field on a task.
You may set the **metadata** field on any existing task using valid key-value data.
Updating a task’s **metadata** field is idempotent such that calling this endpoint multiple times will still return a 200 success response.
Update unique_id
Easily enhance task management and data accuracy with the Scale Update Task Unique ID API endpoint. Seamlessly modify and optimize task identifiers, ensuring your task tracking and organization remain precise and efficient. This endpoint empowers you to maintain data integrity and adaptability, offering a streamlined way to manage unique IDs associated with tasks within your workflow. Explore this versatile endpoint to effortlessly tailor task identification according to your evolving needs.Delete unique_id
Enables the secure removal of task identifiers, providing you with enhanced control over your data management processes. You can confidently eliminate obsolete or redundant task unique IDs from your system, maintaining data accuracy and improving workflow organization. Seamlessly integrate this functionality into your task management workflow to ensure your records remain up-to-date and clutter-free. Explore the convenience and flexibility of the Scale Delete Task Unique ID endpoint to optimize your data management practices.Add Task Tag
With this endpoint, you can include a list of**tags** to be added to a task. If a **tag** is already associated with the task, it will be ignored to avoid duplication. Please note that setting an empty or null string as a **tag** is not allowed. Ensure to provide valid non-empty strings in the **tags** list to update the task’s tags successfully.
Set Task Tag
This endpoint allows you to set a completely new list oftags on a task. This will replace all currently existing tags on it if the target exists.
Delete Task Tag
With this endpoint, you can include a list of**tags** to be added to a task. If a **tag** is already associated with the task, it will be ignored to avoid duplication. Please note that setting an empty or null string as a **tag** is not allowed. Ensure to provide valid non-empty strings in the **tags** list to update the task’s tags successfully.
Avoiding Duplicate Tasks
Creating duplicate tasks is an issue every team should be mindful to avoid. Scale AI provides two different mechanisms to prevent duplicate tasks from being created in its task creation endpoints. This allows you to resubmit requests that may have failed in transit or otherwise need to be retried without the risk of creating duplicate tasks.Option 1: The unique_id field
The unique_id field is a field available on every task type Scale provides.
Once a unique_id has been submitted to Scale, any future task creation requests with the same unique_id will fail with a 409 error that also conveniently points to the conflicting task.
Values passed into the unique_id field are permanently associated with the task and will always be returned to you when retrieving tasks from our platform.
You are able to query for tasks directly based on the unique_id field at any point with our Task Retrieval endpoints.
Best Practices:
unique_idshould be thought of as your own customizable id for a task. Ideally, this id can be easy to look up based on the data you have available on your side. A goodunique_idmight be the filename being submitted, or other types of metadata like a scene or run id that you use internally.unique_idis set globally across all projects and task types. If you’d like to enforce uniqueness only within a project or task type, we recommend simply prepending or appending the project or task type to the unique id itself, problem solved!
Option 2: The Idempotency-Key header
To use this feature, provide a header Idempotency-Key: \<key\>. You, the client, are responsible for ensuring the uniqueness of your chosen keys. We recommend using V4 UUIDs.
The results of requests specifying an idempotency key are saved. If we later receive a matching request with the same idempotency key, the saved response will be returned, and no additional task will be created. Note that this behavior holds even when the response is an error. Keys are removed after 24 hours.
If an incoming request has the same idempotency key as a saved request, but the two requests do not match in parameters or the users associated with the two requests are different, we will return a 409 error.
In rare situations, we may return a 429 error if two matching requests with identical idempotency keys are made simultaneously. In this case, it is safe to retry.
When would I use this instead of the **unique_id** field?Using the header-based approach is useful in retry logic that catches network or other transient failure modes when you would be immediately retrying the exact same request. Specifically, the feature that allows you to seamlessly get the same task response back if the payload didn’t change makes for easier code integrations. You are able to use both options simultaneously as well.
Workflow Support
Because Unique Ids are permanently tied to a task, this means if something unexpected happened, it can be hard to recover on your own. We have added two features to help support more robust workflows. Canceling TasksWhen canceling tasks, there is a
clear_unique_id query parameter you can specify on the request. See the Cancel Task endpoint for more details.
Errored TasksSometimes after a task is submitted, it can run into an error, especially in regards to processing attachments. Everywhere you can specify a unique id, you can also specify
clear_unique_id_on_error: true. As the param name suggests, if the task reaches an error status, the unique id will automatically be unset, such that you could submit a new task with the same new unique id.