{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/multi-upload-tool-com/json-schema/multi-upload-tool-com-presign-response-schema.json",
  "title": "PresignResponse",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/multi-upload-tool-com-openapi.json#/components/schemas/PresignResponse",
  "type": "object",
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "required": [
        "route",
        "files"
      ],
      "properties": {
        "route": {
          "$ref": "#/$defs/PresignRoute"
        },
        "partSize": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Bytes per part on multipart routes, `null` on single-request routes. Repeated inside each file's `multipart` block."
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "description": "When the returned upload URLs stop being accepted: one hour out for single-request routes, six for multipart ones. There is no refresh; presign again."
        },
        "usage": {
          "$ref": "#/$defs/StorageUsage"
        },
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PresignedFile"
          }
        }
      }
    }
  },
  "$defs": {
    "PresignMultipart": {
      "type": "object",
      "description": "Present on multipart routes. Upload every part, then complete; abort if you give up.",
      "properties": {
        "uploadId": {
          "type": "string",
          "description": "Storage-side identifier of the multipart upload."
        },
        "partSize": {
          "type": "integer",
          "description": "Bytes per part, except the last one."
        },
        "completeUrl": {
          "type": "string",
          "format": "uri",
          "description": "`POST` the `CompleteMultipartUpload` XML here, `Content-Type: application/xml`, parts sorted ascending. Valid 6 hours."
        },
        "abortUrl": {
          "type": "string",
          "format": "uri",
          "description": "`DELETE` here to discard an abandoned upload. Parts left behind are stored and billed."
        },
        "parts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PresignPart"
          }
        }
      }
    },
    "PresignPart": {
      "type": "object",
      "description": "One part of a multipart upload.",
      "properties": {
        "partNumber": {
          "type": "integer",
          "description": "1-based. Part `n` covers the bytes starting at `(n - 1) * partSize`."
        },
        "size": {
          "type": "integer",
          "description": "Bytes this part must carry, sent as its `Content-Length`. The last part is shorter than `partSize`."
        },
        "uploadUrl": {
          "type": "string",
          "format": "uri",
          "description": "`PUT` the part's bytes here."
        }
      }
    },
    "PresignRoute": {
      "type": "string",
      "description": "Validation preset applied to the declared files: it fixes the accepted MIME types, the maximum number of files, the maximum size per file, and whether the upload is multipart. It does not tie the media to a platform.",
      "enum": [
        "youtube_videos",
        "tiktok_videos",
        "pinterest_videos",
        "threads_videos",
        "x_videos",
        "linkedin_videos",
        "documents",
        "photos",
        "thumbnails",
        "instagram_photos",
        "threads_photos",
        "x_photos",
        "bluesky_photos"
      ]
    },
    "PresignedFile": {
      "type": "object",
      "description": "Where to send one file's bytes, and the URLs to publish it with afterwards.",
      "properties": {
        "name": {
          "type": "string"
        },
        "size": {
          "type": "integer"
        },
        "contentType": {
          "type": "string"
        },
        "key": {
          "type": "string",
          "description": "Object key the media is stored under."
        },
        "bucketUrl": {
          "type": "string",
          "format": "uri",
          "description": "Preferred for large video: pass it as the `video` field of `POST /upload` or `POST /upload/bulk` and the media is read straight from storage, instead of streaming every gigabyte back through this API. Points at private storage, so it is not fetchable on its own - only this API can read it."
        },
        "accessUrl": {
          "type": "string",
          "format": "uri",
          "description": "The publicly fetchable form of the same object: pass it as the `video`, `photo` or `file` field of `POST /upload` or `POST /upload/bulk`. Served from a platform-verified domain, so pull-based platforms can fetch it. Readable once the bytes are stored. Pass it through unchanged; a rehosted copy on your own domain is rejected by those platforms."
        },
        "uploadUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Single-request routes only: `PUT` the whole file here, with `uploadHeaders`. Valid 1 hour. `null` on multipart routes."
        },
        "uploadHeaders": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": "string"
          },
          "description": "Headers to send verbatim with the single `PUT`. They are part of the signature. `null` on multipart routes."
        },
        "multipart": {
          "description": "Multipart routes only; `null` on single-request routes.",
          "anyOf": [
            {
              "$ref": "#/$defs/PresignMultipart"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "StorageUsage": {
      "type": "object",
      "description": "Presigned bytes charged against the caller's rolling allowance.",
      "properties": {
        "windowDays": {
          "type": "integer",
          "description": "Length of the rolling window, in days."
        },
        "used": {
          "type": "integer",
          "description": "Bytes presigned inside the window, including the current request."
        },
        "limit": {
          "type": "integer",
          "description": "Allowance in bytes for the window. `-1` when the plan has no allowance configured."
        },
        "remaining": {
          "type": "integer",
          "description": "Bytes still available. `-1` when unlimited."
        },
        "unlimited": {
          "type": "boolean",
          "description": "When true the quota never blocks the request."
        }
      }
    }
  }
}