{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/microworker/main/json-schema/microworker-task-update-schema.json",
  "title": "TaskUpdate",
  "x-generated": "2026-10-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/microworker-v1-openapi.json#/components/schemas/TaskUpdate",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 5,
      "maxLength": 140
    },
    "instructions": {
      "type": "string",
      "minLength": 20,
      "maxLength": 8000
    },
    "proofs": {
      "type": "array",
      "minItems": 1,
      "maxItems": 5,
      "items": {
        "$ref": "#/$defs/ProofRequirement"
      }
    },
    "category_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "target_countries": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "target_devices": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "enum": [
          "android",
          "ios",
          "desktop",
          "windows",
          "mac"
        ]
      }
    },
    "audience": {
      "type": "string",
      "enum": [
        "everyone",
        "my_workers",
        "project"
      ]
    },
    "hiring": {
      "type": "boolean"
    },
    "project_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "null takes the draft out of its project."
    },
    "backup_hours": {
      "type": "integer",
      "enum": [
        0,
        6,
        24,
        72
      ]
    },
    "max_per_country": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "description": "null clears it. Checked against the worker count the edit leaves: at or above it, it is stored as null."
    },
    "target_profile": {
      "$ref": "#/$defs/TargetProfile",
      "description": "null clears it (anybody)."
    },
    "x_check": {
      "type": "boolean",
      "description": "Turn X checks on or off on a draft; `fee_minor` follows. 503 `x_check_unavailable` / 422 `x_check_no_target` as on create."
    },
    "action": {
      "type": "string",
      "enum": [
        "pause",
        "unpause",
        "cancel"
      ],
      "description": "`pause` (open → paused), `unpause` (paused → open, once its links answer again) or `cancel` (draft, open or paused → cancelled, the unspent escrow refunded). Any other field sent with it is ignored."
    }
  },
  "$defs": {
    "ProofRequirement": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "must_show": {
          "type": "string",
          "maxLength": 100,
          "description": "Screenshot rows only: text the screenshot must show (a group or channel name, a username). We read each screenshot on our own server and hold a submission that does not show it."
        },
        "type": {
          "type": "string",
          "enum": [
            "screenshot",
            "text",
            "url",
            "file",
            "code"
          ],
          "description": "`code`: a completion code you show at the end of your own flow; a matching code pays on the spot. At most one per task."
        },
        "note": {
          "type": "string",
          "maxLength": 500,
          "description": "What the proof must show. Workers are judged against it."
        },
        "answer": {
          "type": "string",
          "maxLength": 200,
          "writeOnly": true,
          "description": "For `code` only: the code (5–64 letters or digits). Stored hashed and never returned; on an edit, omit it to keep the stored one."
        }
      }
    },
    "TargetProfile": {
      "type": [
        "object",
        "null"
      ],
      "description": "Who can do this (2026-10-07): only workers whose Skills & assets match see the task and can claim it (others get 403 `profile_not_matching`). Within a part ANY choice will do; every part given must be met. null or every part empty = anybody. Each part given raises the price guide ×1.2, at most ×2.",
      "properties": {
        "languages": {
          "type": "array",
          "maxItems": 5,
          "items": {
            "type": "object",
            "required": [
              "code"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "en",
                  "ar",
                  "arq",
                  "arz",
                  "ary",
                  "kab",
                  "tzm",
                  "fr",
                  "es",
                  "pt",
                  "de",
                  "it",
                  "nl",
                  "pl",
                  "ro",
                  "ru",
                  "uk",
                  "tr",
                  "fa",
                  "ps",
                  "ur",
                  "sd",
                  "pa",
                  "hi",
                  "bn",
                  "ne",
                  "si",
                  "ta",
                  "te",
                  "mr",
                  "gu",
                  "ml",
                  "kn",
                  "id",
                  "ms",
                  "fil",
                  "vi",
                  "th",
                  "my",
                  "zh",
                  "ja",
                  "ko",
                  "sw",
                  "ha",
                  "yo",
                  "ig",
                  "pcm",
                  "am",
                  "so",
                  "om",
                  "zu",
                  "xh",
                  "af",
                  "tw"
                ]
              },
              "min": {
                "type": "string",
                "enum": [
                  "basic",
                  "good",
                  "fluent",
                  "native"
                ],
                "default": "good",
                "description": "This level or better."
              }
            }
          }
        },
        "skills": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "video_editing",
              "graphic_design",
              "writing",
              "translation",
              "transcription",
              "voice",
              "photos",
              "data_entry",
              "research",
              "social_media",
              "app_testing",
              "ai_rating",
              "coding"
            ]
          }
        },
        "wants": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "games",
              "surveys",
              "social",
              "signups",
              "testing",
              "videos",
              "clipping",
              "ai_data",
              "writing",
              "research"
            ]
          },
          "description": "The kinds of work they asked for."
        },
        "game_platforms": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "android",
              "ios",
              "pc",
              "console"
            ]
          }
        },
        "apps": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "tiktok",
              "instagram",
              "youtube",
              "facebook",
              "x",
              "telegram",
              "whatsapp",
              "snapchat",
              "discord",
              "reddit",
              "linkedin",
              "pinterest",
              "threads",
              "twitch"
            ]
          }
        },
        "channel": {
          "type": [
            "object",
            "null"
          ],
          "description": "Runs a page or channel of at least `min_followers` (a band), on one of `platforms` (empty = any).",
          "properties": {
            "platforms": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "youtube",
                  "tiktok",
                  "instagram",
                  "facebook",
                  "x",
                  "telegram",
                  "twitch",
                  "snapchat",
                  "other"
                ]
              }
            },
            "min_followers": {
              "type": "string",
              "enum": [
                "under_1k",
                "1k_10k",
                "10k_100k",
                "100k_1m",
                "over_1m"
              ],
              "default": "under_1k"
            }
          }
        }
      }
    }
  }
}