{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-put-writes-request-schema.json",
  "title": "PutWritesRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-checkpoints-api-openapi.yml#/components/schemas/PutWritesRequest",
  "properties": {
    "thread_id": {
      "type": "string",
      "title": "Thread ID"
    },
    "checkpoint_ns": {
      "type": "string",
      "title": "Checkpoint namespace",
      "default": ""
    },
    "checkpoint_id": {
      "type": "string",
      "title": "Checkpoint ID"
    },
    "writes": {
      "items": {
        "$ref": "#/$defs/WriteData"
      },
      "type": "array",
      "title": "Write data"
    },
    "upsert": {
      "type": "boolean",
      "title": "Upsert mode",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "thread_id",
    "checkpoint_id",
    "writes"
  ],
  "$defs": {
    "WriteData": {
      "properties": {
        "task_id": {
          "type": "string",
          "title": "Task ID"
        },
        "idx": {
          "type": "integer",
          "title": "Write index"
        },
        "channel": {
          "type": "string",
          "title": "Channel name"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Serialization type tag"
        },
        "blob": {
          "type": "string",
          "title": "Base64-encoded binary data"
        },
        "task_path": {
          "type": "string",
          "title": "Task path",
          "default": ""
        }
      },
      "type": "object",
      "required": [
        "task_id",
        "idx",
        "channel",
        "blob"
      ],
      "title": "WriteData"
    }
  }
}