---
title: "Update Task Availability Endpoint"
method: POST
path: "/api/tasks/update_availability"
tags: ["tasks"]
---

# Update Task Availability Endpoint

`POST /api/tasks/update_availability`

## Request

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

Update task availability based on the cleaning result.

**Parameters:**
- **prolific_id**: The prolific ID of the user
- **action**: The action to perform - must be 'available' or 'unavailable' or 'locked'
    - **'available'**: Makes tasks available again and clears their prolific_id
    - **'unavailable'**: Keeps tasks unavailable
    - **'locked'**: Keeps tasks locked

**Behavior:**
- Finds all tasks with the specified prolific_id
- Updates their availability status based on the action
- Only operates on non-deleted tasks (is_deleted is None)

**Returns:**
The first task from the updated group.

**Raises:**
- 400: Invalid action (must be 'available' or 'unavailable' or 'locked')
- 404: No tasks found for the specified prolific_id

## Request body

- UpdateTaskAvailabilityRequest
  - `prolific_id` string, required
  - `action` string, required

## Response `200`

Successful Response

- TaskRead: Model for reading task data
  - `occupation_id` string, required
  - `task_url` string, required
  - `task_desc` string, required
  - `response_url_1` string, nullable
  - `response_url_2` string, nullable
  - `response_url_3` string, nullable
  - `response_url_4` string, nullable
  - `response_url_5` string, nullable
  - `available` string
  - `prolific_id` string, nullable
  - `qualtrics_id` string, nullable
  - `history` string, nullable
  - `locked_history` string, nullable
  - `is_deleted` string, date-time, nullable
  - `models_order` string, nullable
  - `task_id` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mit-llm-survey/apis/llm-survey-backend.md) - [All operations](https://skmtc.dev/mit-llm-survey/apis/llm-survey-backend/llms.txt) - [OpenAPI document](https://skmtc.dev/mit-llm-survey/apis/llm-survey-backend/revisions/6a5ef49cfcc4?raw)
