Raw schema
{
"type": "object",
"properties": {
"delivery": {
"oneOf": [
{
"properties": {
"mode": {
"type": "string",
"const": "inline",
"title": "Mode",
"default": "inline"
}
},
"additionalProperties": false,
"type": "object",
"title": "InlineDelivery"
},
{
"properties": {
"mode": {
"type": "string",
"const": "put_url",
"title": "Mode"
},
"put_url": {
"type": "string",
"maxLength": 2083,
"minLength": 1,
"format": "uri",
"title": "Put Url",
"description": "Customer-signed presigned PUT URL where the optimized bytes will be written. Must be https://. Cloud credentials never reach our infrastructure; only the URL itself is used and discarded after the request."
},
"headers": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Headers",
"description": "Optional storage headers to include on the PUT call (Content-Type, Cache-Control, x-amz-acl, etc.). Whitelisted at SSRF layer."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"mode",
"put_url"
],
"title": "PutUrlDelivery"
},
{
"properties": {
"mode": {
"type": "string",
"const": "callback_url",
"title": "Mode"
},
"callback_url": {
"type": "string",
"maxLength": 2083,
"minLength": 1,
"format": "uri",
"title": "Callback Url",
"description": "Customer endpoint where the optimized bytes will be POSTed. Must be https://. For async/large jobs. We send an X-Pig-Sha256 header of the body so the receiver can verify integrity. No credentials are stored on our side; secure the endpoint with a token in the URL itself."
},
"headers": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Headers",
"description": "Optional headers to include on the POST call (Content-Type, Cache-Control, x-amz-*, etc.). Whitelisted at SSRF layer."
},
"secret": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Secret",
"description": "Optional HMAC secret. When set, we sign the POST body with HMAC-SHA256 and send 'X-Pig-Signature: sha256=<hex>'. Used per request and never stored. Recompute the HMAC on your endpoint to authenticate the callback (constant-time compare)."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"mode",
"callback_url"
],
"title": "CallbackDelivery"
}
],
"title": "delivery",
"discriminator": {
"propertyName": "mode",
"mapping": {
"callback_url": "#/components/schemas/CallbackDelivery",
"inline": "#/components/schemas/InlineDelivery",
"put_url": "#/components/schemas/PutUrlDelivery"
}
},
"type": "string"
},
"source": {
"type": "string",
"title": "source",
"description": "Image source: a public URL (https://...) or a base64-encoded string (optionally as a data URI like data:image/png;base64,...)."
},
"x": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "x",
"description": "Left edge of the crop rectangle in pixels. Manual mode only.",
"type": "integer"
},
"y": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "y",
"description": "Top edge of the crop rectangle in pixels. Manual mode only.",
"type": "integer"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "width",
"description": "Width of the crop rectangle in pixels. Required in manual and gravity modes.",
"type": "integer"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "height",
"description": "Height of the crop rectangle in pixels. Required in manual and gravity modes.",
"type": "integer"
},
"gravity": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "gravity",
"description": "Smart-crop mode: picks the window automatically. One of ('attention', 'entropy', 'centre'). Requires width and height; mutually exclusive with x/y and trim. A target larger than the source clamps to the source size.",
"type": "string"
},
"trim": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "trim",
"description": "Trim mode: removes a uniform background border via content detection. Mutually exclusive with x/y/width/height/gravity.",
"type": "boolean"
},
"threshold": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "threshold",
"description": "Trim sensitivity (must be positive; default 10.0). Only valid together with trim: true.",
"type": "number"
},
"autorot": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "autorot",
"description": "Apply EXIF orientation before cropping. Opt-in; default false, which preserves current byte-for-byte behavior.",
"type": "boolean"
},
"denoise": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "denoise",
"description": "Median denoise before cropping: radius 1-3 (window 3x3 to 7x7). Opt-in; no surcharge.",
"type": "integer"
},
"equalize": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "equalize",
"description": "Auto-contrast (histogram equalisation of the value channel; hue and saturation preserved) before cropping. Opt-in.",
"type": "boolean"
},
"sharpen": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "sharpen",
"description": "Unsharp-mask sharpen after cropping (libvips defaults). Opt-in.",
"type": "boolean"
},
"format": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "format",
"description": "Output format: jpeg, png, webp, tiff, gif, or avif. If omitted, the original format is preserved.",
"type": "string"
}
},
"required": [
"source"
],
"title": "crop_imageArguments"
}