tasks

Lock Tasks Endpoint

Lock available tasks for a specific occupation and prolific_id.

Parameters:

  • occupation_id: The occupation ID to filter tasks
  • prolific_id: The prolific ID to assign tasks to
  • limit: Maximum number of task groups to return (default: 6). Each group contains 1-3 task instances. For example, limit=6 returns 6 groups with a total of 6-18 tasks.
  • preview: Preview mode flag (default: True)
    • True: Returns available tasks without locking them. No database changes are made.
    • False: Actually locks the tasks in the database and assigns them to the prolific_id.

Task Grouping Logic:

  • Tasks are formatted as xxx-1, xxx-2, xxx-3, xxx-4, xxx-5, xxx-6
  • Tasks are grouped by prefix (xxx)
  • Only available tasks are fetched. Completed groups (groups with >= 2 unavailable task instances) are excluded at the database level and are never returned.
  • For each prefix returned, up to 3 newest task instances are selected (created_at desc)
  • Groups are returned in newest-first order (max created_at in the group)
  • Each group will have at least 1 task instance and at most 3 task instances
  • If a prefix has more than 3 available tasks, the 3 newest are selected
  • If a prefix has 1-3 available tasks, all are included
  • Up to 'limit' groups are returned (e.g., limit=6 returns 6 groups)
  • Total tasks returned will be between 6 (6 groups × 1 task min) and 18 (6 groups × 3 tasks max)

Example:

  • Prefix 1: has 3 available tasks (e.g. 1-1, 1-2, 1-4) → group is included with those 3 tasks
  • Prefix 2: is completed (>= 2 unavailable) → group is not fetched at all; only groups with < 2 unavailable are returned

Returns: TaskGroupResponse containing grouped tasks with metadata (total_groups, total_tasks).

post/api/tasks/lock

Request

  • Base URL
    https://api.mit-llm-survey.academy (the document declares no server; this is the origin it was published from)
  • Auth
    none declared

Request body

occupation_idstring required
prolific_idstring required
limitinteger
previewboolean

Response

Successful Response

total_groupsinteger required
total_tasksinteger required

Changes

No recorded changes to this operation across all 2 revisions of this API.