{
	"info": {
		"_postman_id": "mayapix-api-v1",
		"name": "MayaPix API v1",
		"description": "MayaPix Image Processing API\n\n## Quick Start\n1. Set the `base_url` variable (default: https://mayapix.io)\n2. Set your `api_key` in the collection variables\n3. Start testing!\n\n---\n\n## ⭐ MayaAI (Recommended - start here)\nOne call does everything: tight-crop → scale → pad → smart-compress.\n\nCore params (4 only):\n- `remove_bg` (bool, default TRUE) - BG removal on by default. Free plan: silently skipped. Set false to disable\n- `size` (int, optional) - square canvas e.g. 1000 → 1000×1000. Omit for natural size\n- `background` (string, default ffffff) - canvas fill color or \"transparent\" for alpha PNG output\n- `format` (string, default webp) - output format\n\nCommon scenarios:\n  {\"type\": \"mayaai\"}                                    → BG removed, natural size, WebP\n  {\"type\": \"mayaai\", \"size\": 1000}                      → 1000×1000 catalog\n  {\"type\": \"mayaai\", \"background\": \"transparent\"}       → transparent PNG cut-out\n  {\"type\": \"mayaai\", \"remove_bg\": false}                 → skip BG removal (already clean)\n\nAdvanced params: upscale, padding, model, width+height (non-square), tolerance\n\n---\n\n## Advanced Operations\n\n### Compress\n- `quality` (default 85), `format` (default = keep original), `preset`\n- ⚠️ Preset notes: social=cover-crops to 1200×630, ecommerce=scales down to 1200px, thumbnail=300px\n\n### Resize\n- `fit` modes: contain (default, no crop), cover (crops), fill, max, stretch\n- `upscale` default = false (small images stay small)\n\n### Crop\n- Standard: width, height, position, x, y, aspect_ratio\n- Smart Pad: mode=\"smart_pad\", padding (default 10%), background (auto-detect), tolerance\n\n### Remove Background\n- Default model: isnet-general-use\n- Fashion: u2net_cloth_seg | Portraits: u2net_human_seg | Max quality: birefnet-general",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"variable": [
		{
			"key": "base_url",
			"value": "https://mayapix.io",
			"type": "string"
		},
		{
			"key": "api_key",
			"value": "mpx_YOUR_API_KEY.YOUR_SECRET",
			"type": "string"
		}
	],
	"auth": {
		"type": "apikey",
		"apikey": [
			{
				"key": "value",
				"value": "{{api_key}}",
				"type": "string"
			},
			{
				"key": "key",
				"value": "X-API-Key",
				"type": "string"
			},
			{
				"key": "in",
				"value": "header",
				"type": "string"
			}
		]
	},
	"item": [
		{
			"name": "Health & Status",
			"item": [
				{
					"name": "Health Check",
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/health",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "health"]
						},
						"description": "Check API status. No authentication required."
					}
				},
				{
					"name": "Get Usage Stats",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/usage",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "usage"]
						},
						"description": "Get current month usage statistics and plan info."
					}
				},
				{
					"name": "Get Usage History",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/usage/history?months=6",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "usage", "history"],
							"query": [
								{
									"key": "months",
									"value": "6"
								}
							]
						},
						"description": "Get usage history for the past N months."
					}
				}
			]
		},
		{
			"name": "Image Processing",
			"item": [
				{
					"name": "Process Image (URL)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\"type\": \"resize\", \"width\": 1200, \"height\": 1200, \"fit\": \"contain\"},\n        {\"type\": \"compress\", \"quality\": 85, \"format\": \"webp\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Process an image from URL with resize and compression."
					}
				},
				{
					"name": "⭐ MayaAI - Clean Whitespace (natural size)",
					"request": {
						"method": "POST",
						"header": [{"key": "Content-Type", "value": "application/json"}],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=1200\",\n    \"operations\": [\n        {\"type\": \"mayaai\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Default MayaAI call. BG removal is ON by default (silently skipped on free plan). Tight-crops subject, keeps natural size + 5% breathing room, WebP output."
					}
				},
				{
					"name": "⭐ MayaAI - Full E-commerce (BG removal + 1000×1000)",
					"request": {
						"method": "POST",
						"header": [{"key": "Content-Type", "value": "application/json"}],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=1200\",\n    \"operations\": [\n        {\n            \"type\": \"mayaai\",\n            \"size\": 1000,\n            \"background\": \"ffffff\"\n        }\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Full e-commerce pipeline in one call: removes background, tight-crops to subject, scales to fill 1000×1000 white canvas (5% breathing room), outputs WebP. Replaces 4 separate operations. Starter plan+."
					}
				},
				{
					"name": "⭐ MayaAI - Transparent Cut-out PNG",
					"request": {
						"method": "POST",
						"header": [{"key": "Content-Type", "value": "application/json"}],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=1200\",\n    \"operations\": [\n        {\n            \"type\": \"mayaai\",\n            \"background\": \"transparent\"\n        }\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "MayaAI with transparent background: removes BG, tight-crops subject, adds 5% breathing room on transparent canvas, outputs PNG with alpha channel. Add size:1000 to normalize dimensions."
					}
				},
				{
					"name": "MayaAI Compression Only (no resize)",
					"request": {
						"method": "POST",
						"header": [{"key": "Content-Type", "value": "application/json"}],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\"type\": \"compress\", \"preset\": \"mayaai\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "MayaAI as compress preset only: content-aware quality selection + always WebP, no dimension change. Use when you only want smart compression without resize. Samples luminance grid to pick q65-85 dynamically."
					}
				},
				{
					"name": "Process with Preset",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\"type\": \"compress\", \"preset\": \"ecommerce\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Process using a preset (mayaai, ecommerce, thumbnail, highquality, social, mobile, catalog). Use mayaai for AI-powered content-aware compression."
					}
				},
				{
					"name": "Resize Keep Aspect Ratio",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\"type\": \"resize\", \"width\": 800, \"height\": 600, \"keep_aspect_ratio\": true},\n        {\"type\": \"compress\", \"preset\": \"ecommerce\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Resize while preserving the original aspect ratio (fits within bounds)."
					}
				},
				{
					"name": "Remove Background (Default)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\"type\": \"remove_background\"},\n        {\"type\": \"compress\", \"preset\": \"ecommerce\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Remove background using the default isnet-general-use model (best balance of quality and speed). Requires Starter plan or higher. GIF not supported."
					}
				},
				{
					"name": "Remove Background (Max Quality)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\"type\": \"remove_background\", \"model\": \"birefnet-general\"},\n        {\"type\": \"compress\", \"preset\": \"ecommerce\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Remove background using birefnet-general (SOTA model, best for hair/fur/glass/fine details). Slower than default but highest quality. Available models: u2net, u2netp, u2net_human_seg, u2net_cloth_seg, silueta, isnet-general-use, isnet-anime, birefnet-general"
					}
				},
				{
					"name": "Full E-commerce Pipeline",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\"type\": \"remove_background\"},\n        {\"type\": \"resize\", \"width\": 1200, \"height\": 1200, \"fit\": \"contain\", \"background\": \"ffffff\"},\n        {\"type\": \"compress\", \"preset\": \"ecommerce\"}\n    ],\n    \"webhook_url\": \"https://your-site.com/webhook\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Complete e-commerce pipeline: remove background, resize with white background, compress with ecommerce preset."
					}
				},
				{
					"name": "Crop Image",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\"type\": \"crop\", \"aspect_ratio\": \"1:1\", \"position\": \"center\"},\n        {\"type\": \"compress\", \"preset\": \"thumbnail\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Crop image to 1:1 aspect ratio from center."
					}
				},
				{
					"name": "Smart Pad (Auto-Center Product)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n    \"operations\": [\n        {\n            \"type\": \"crop\",\n            \"mode\": \"smart_pad\",\n            \"padding\": 10,\n            \"background\": \"ffffff\",\n            \"tolerance\": 20,\n            \"width\": 800,\n            \"height\": 800\n        },\n        {\"type\": \"compress\", \"preset\": \"ecommerce\"}\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/process",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "process"]
						},
						"description": "Auto-detect product bounding box, trim background, and re-pad with 10% margin on all sides. Centers the product perfectly on an 800x800 canvas. Ideal for uniform product grids.\n\nParameters:\n- padding: % margin on each side (0-50, default 10)\n- background: hex color auto-detected from corners if omitted\n- tolerance: color distance for background detection (raise for off-white backgrounds)\n- width/height: optional output resize after padding"
					}
				},
				{
					"name": "Batch Process",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"images\": [\n        {\n            \"image_url\": \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=800\",\n            \"operations\": [{\"type\": \"compress\", \"preset\": \"thumbnail\"}]\n        },\n        {\n            \"image_url\": \"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=800\",\n            \"operations\": [{\"type\": \"compress\", \"preset\": \"thumbnail\"}]\n        }\n    ],\n    \"webhook_url\": \"https://your-site.com/batch-webhook\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/images/batch",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "images", "batch"]
						},
						"description": "Process multiple images in a single request (max 20)."
					}
				}
			]
		},
		{
			"name": "Jobs",
			"item": [
				{
					"name": "List Jobs",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/jobs?status=completed&per_page=20",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "jobs"],
							"query": [
								{
									"key": "status",
									"value": "completed",
									"description": "Filter by status: pending, processing, completed, failed, cancelled"
								},
								{
									"key": "per_page",
									"value": "20"
								}
							]
						},
						"description": "List all processing jobs with optional status filter."
					}
				},
				{
					"name": "Get Job Status",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/jobs/:job_id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "jobs", ":job_id"],
							"variable": [
								{
									"key": "job_id",
									"value": "YOUR_JOB_UUID"
								}
							]
						},
						"description": "Get detailed status of a specific job."
					}
				},
				{
					"name": "Download Processed Image",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/jobs/:job_id/download",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "jobs", ":job_id", "download"],
							"variable": [
								{
									"key": "job_id",
									"value": "YOUR_JOB_UUID"
								}
							]
						},
						"description": "Download the processed image file."
					}
				},
				{
					"name": "Cancel Job",
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/jobs/:job_id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "jobs", ":job_id"],
							"variable": [
								{
									"key": "job_id",
									"value": "YOUR_JOB_UUID"
								}
							]
						},
						"description": "Cancel a pending job."
					}
				}
			]
		},
		{
			"name": "API Keys",
			"item": [
				{
					"name": "List API Keys",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/api-keys",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "api-keys"]
						},
						"description": "List all API keys for your account."
					}
				},
				{
					"name": "Create API Key",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Production Key\",\n    \"description\": \"Main production API key\",\n    \"allowed_origins\": [\"https://mystore.com\"],\n    \"allowed_ips\": []\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/api-keys",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "api-keys"]
						},
						"description": "Create a new API key. Save the returned secret - it won't be shown again!"
					}
				},
				{
					"name": "Update API Key",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Updated Key Name\",\n    \"is_active\": true\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/api-keys/:key_id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "api-keys", ":key_id"],
							"variable": [
								{
									"key": "key_id",
									"value": "1"
								}
							]
						},
						"description": "Update an existing API key."
					}
				},
				{
					"name": "Delete API Key",
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/api-keys/:key_id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "api-keys", ":key_id"],
							"variable": [
								{
									"key": "key_id",
									"value": "1"
								}
							]
						},
						"description": "Delete an API key. Cannot delete the key currently in use."
					}
				}
			]
		},
		{
			"name": "Webhooks",
			"item": [
				{
					"name": "List Webhooks",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/webhooks",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "webhooks"]
						},
						"description": "List all registered webhooks."
					}
				},
				{
					"name": "Create Webhook",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Job Notifications\",\n    \"url\": \"https://your-site.com/webhook\",\n    \"events\": [\"job.completed\", \"job.failed\"]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/webhooks",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "webhooks"]
						},
						"description": "Register a new webhook endpoint."
					}
				},
				{
					"name": "Test Webhook",
					"request": {
						"method": "POST",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/webhooks/:webhook_id/test",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "webhooks", ":webhook_id", "test"],
							"variable": [
								{
									"key": "webhook_id",
									"value": "1"
								}
							]
						},
						"description": "Send a test webhook to verify your endpoint."
					}
				},
				{
					"name": "Regenerate Webhook Secret",
					"request": {
						"method": "POST",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/webhooks/:webhook_id/regenerate-secret",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "webhooks", ":webhook_id", "regenerate-secret"],
							"variable": [
								{
									"key": "webhook_id",
									"value": "1"
								}
							]
						},
						"description": "Rotate the HMAC signing secret for a webhook. Do this if your secret is compromised. Old secret is immediately invalidated."
					}
				},
				{
					"name": "Delete Webhook",
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/webhooks/:webhook_id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "webhooks", ":webhook_id"],
							"variable": [
								{
									"key": "webhook_id",
									"value": "1"
								}
							]
						},
						"description": "Delete a webhook."
					}
				}
			]
		},
		{
			"name": "Integrations",
			"item": [
				{
					"name": "List Integrations",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/integrations",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "integrations"]
						},
						"description": "List all connected platform integrations (Salla, Shopify)."
					}
				},
				{
					"name": "Connect Salla",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/integrations/salla/auth",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "integrations", "salla", "auth"]
						},
						"description": "Get Salla OAuth authorization URL."
					}
				},
				{
					"name": "Connect Shopify",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/integrations/shopify/auth?shop=your-store.myshopify.com",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "integrations", "shopify", "auth"],
							"query": [
								{
									"key": "shop",
									"value": "your-store.myshopify.com"
								}
							]
						},
						"description": "Get Shopify OAuth authorization URL."
					}
				},
				{
					"name": "Disconnect Integration",
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/integrations/:integration_id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "integrations", ":integration_id"],
							"variable": [
								{
									"key": "integration_id",
									"value": "1"
								}
							]
						},
						"description": "Disconnect a platform integration."
					}
				}
			]
		}
	]
}
