{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "CreateOutput",
  "description": "Request body for POST /v1/outputs via application/json. For multipart/form-data, the same field names apply as form fields.",
  "type": "object",
  "required": [
    "mimeType",
    "content"
  ],
  "additionalProperties": false,
  "required_headers": {
    "Idempotency-Key": {
      "required": true,
      "max_length": 255,
      "charset": "printable ASCII (0x20–0x7E)",
      "description": "Unique key scoped to your API key. Replaying the same key with the same payload returns the cached response (HTTP 201). A different payload with the same key returns HTTP 409 idempotency_conflict. A concurrent in-flight request with the same key returns HTTP 503 idempotency_in_flight with Retry-After: 5 — retry with the same key and payload after 5 seconds."
    }
  },
  "properties": {
    "mimeType": {
      "type": "string",
      "enum": [
        "application/json",
        "application/octet-stream",
        "application/pdf",
        "application/xml",
        "application/zip",
        "image/gif",
        "image/jpeg",
        "image/png",
        "image/webp",
        "text/csv",
        "text/html",
        "text/plain"
      ],
      "description": "MIME type of the content. Must be in the supported list."
    },
    "content": {
      "type": "string",
      "description": "Base64-encoded file content. Max decoded size is 25 MB; body limit is 1 MB for JSON path."
    },
    "label": {
      "type": "string",
      "maxLength": 200,
      "description": "Optional human-readable filename."
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 expiry timestamp. Defaults to 7 days from now. Max 30 days."
    },
    "public": {
      "type": "boolean",
      "default": false,
      "description": "If true, a CDN public URL is generated and returned in publicUrl."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": false,
      "description": "Structured metadata for agent tracking.",
      "properties": {
        "agentId": {
          "type": "string",
          "maxLength": 100
        },
        "jobId": {
          "type": "string",
          "maxLength": 100
        },
        "sourceSystem": {
          "type": "string",
          "maxLength": 100
        },
        "tags": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "type": "string",
            "maxLength": 50
          }
        },
        "custom": {
          "type": "object",
          "description": "Arbitrary key-value store. Max 4096 bytes serialized, depth 3, 50 keys."
        }
      }
    }
  }
}