{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Finish an upload. This call is idempotent and safe to retry. On deduplication completedJobId may differ from the input jobId; poll getJobStatus with completedJobId. Probe-based validation failures surface later as JOB_STATE_FAILED from getJobStatus, not as errors from this call.",
      "errors": [
        {
          "description": "The job ID is unknown or aged out of retention; known terminal sessions are never reported as not found.",
          "name": "UploadNotFound"
        },
        {
          "description": "The upload session expired before finalization began.",
          "name": "UploadExpired"
        },
        {
          "description": "Not all parts are recorded; the error message lists the missing part numbers.",
          "name": "MissingParts"
        },
        {
          "description": "A finish is in progress; check getUploadStatus and retry.",
          "name": "UploadNotReady"
        },
        {
          "description": "The assembled object's detected content type is not supported.",
          "name": "UnsupportedContentType"
        },
        {
          "description": "The session is known to have failed; the error carries its failure reason.",
          "name": "UploadFailed"
        },
        {
          "description": "The session is known to have been aborted.",
          "name": "UploadAborted"
        },
        {
          "description": "The service is draining or temporarily at capacity; retry later.",
          "name": "ServiceOverloaded"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "jobId": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "jobId"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "completedJobId": {
              "description": "The processing job to poll with getJobStatus; on deduplication this may differ from the input jobId.",
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            },
            "jobStatus": {
              "ref": "town.delve.video.defs#jobStatus",
              "type": "ref"
            }
          },
          "required": [
            "completedJobId",
            "jobStatus"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "town.delve.video.finishUpload",
  "lexicon": 1
}
