{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/revyl/json-schema/revyl-build-multipart-upload-start-response-schema.json",
  "title": "BuildMultipartUploadStartResponse",
  "description": "Response with everything a client needs to upload parts directly to S3.\n\nLike upload-session, no build row exists yet: the client uploads the\nparts, assembles them by POSTing the part ETags to complete_url, then\ncreates the build via POST /{app_id}/builds with upload_id. Unfinished\nmultipart uploads are aborted by the bucket lifecycle rule and abandoned\nstaging objects are swept server-side; abort_url is a courtesy for\nprompt cleanup.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/revyl-apps-api-openapi.yml#/components/schemas/BuildMultipartUploadStartResponse",
  "properties": {
    "abort_url": {
      "description": "Presigned S3 AbortMultipartUpload URL",
      "title": "Abort Url",
      "type": "string"
    },
    "branch_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Branch Id"
    },
    "complete_url": {
      "description": "Presigned S3 CompleteMultipartUpload URL",
      "title": "Complete Url",
      "type": "string"
    },
    "part_size": {
      "description": "Size in bytes of every part except the last",
      "title": "Part Size",
      "type": "integer"
    },
    "parts": {
      "items": {
        "$ref": "#/$defs/BuildMultipartUploadPartURL"
      },
      "title": "Parts",
      "type": "array"
    },
    "s3_upload_id": {
      "description": "Native S3 multipart UploadId. Already embedded in every presigned URL above; surfaced explicitly so a client can persist it and resume an interrupted upload via the multipart-upload/resume route.",
      "title": "S3 Upload Id",
      "type": "string"
    },
    "upload_expires_at": {
      "description": "Unix timestamp after which the presigned URLs expire",
      "title": "Upload Expires At",
      "type": "integer"
    },
    "upload_id": {
      "description": "Staging upload session id, passed to POST /{app_id}/builds",
      "format": "uuid",
      "title": "Upload Id",
      "type": "string"
    }
  },
  "required": [
    "upload_id",
    "s3_upload_id",
    "part_size",
    "upload_expires_at",
    "parts",
    "complete_url",
    "abort_url"
  ],
  "type": "object",
  "$defs": {
    "BuildMultipartUploadPartURL": {
      "description": "A presigned URL for uploading one part of a multipart upload.",
      "properties": {
        "part_number": {
          "description": "1-indexed S3 part number",
          "minimum": 1.0,
          "title": "Part Number",
          "type": "integer"
        },
        "upload_url": {
          "description": "Presigned upload_part URL",
          "title": "Upload Url",
          "type": "string"
        }
      },
      "required": [
        "part_number",
        "upload_url"
      ],
      "title": "BuildMultipartUploadPartURL",
      "type": "object"
    }
  }
}