{
 "openapi": "3.1.0",
 "info": {
  "title": "Blend Browser local API",
  "version": "0.6.0",
  "description": "Local-only REST API (127.0.0.1). Use `Authorization: Bearer <token>` — the token is in Settings → API or `blend token`."
 },
 "servers": [
  {
   "url": "/api/v1"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/health": {
   "get": {
    "tags": [
     "Service"
    ],
    "summary": "Liveness check (no token needed)",
    "operationId": "getHealth",
    "security": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/openapi.json": {
   "get": {
    "tags": [
     "Service"
    ],
    "summary": "This OpenAPI document",
    "operationId": "getOpenapi.json",
    "security": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/docs": {
   "get": {
    "tags": [
     "Service"
    ],
    "summary": "Swagger UI (HTML)",
    "operationId": "getDocs",
    "security": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/meta": {
   "get": {
    "tags": [
     "Service"
    ],
    "summary": "Statuses, folders, tags and trash count",
    "operationId": "getMeta",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles": {
   "get": {
    "tags": [
     "Profiles"
    ],
    "summary": "List profiles (lite rows)",
    "operationId": "getProfiles",
    "parameters": [
     {
      "name": "trash",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "1 to list the trash"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "post": {
    "tags": [
     "Profiles"
    ],
    "summary": "Create a profile",
    "operationId": "postProfiles",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "os": {
          "type": "string"
         },
         "folder": {
          "type": "string"
         },
         "tags": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "proxy": {
          "type": "string"
         },
         "startUrls": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "notes": {
          "type": "string"
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/bulk-create": {
   "post": {
    "tags": [
     "Profiles"
    ],
    "summary": "Create many profiles",
    "operationId": "postProfilesBulkCreate",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "count": {
          "type": "number"
         },
         "namePrefix": {
          "type": "string"
         },
         "template": {
          "type": "object"
         }
        },
        "required": [
         "count"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/quick": {
   "post": {
    "tags": [
     "Profiles"
    ],
    "summary": "Create a quick profile with defaults",
    "operationId": "postProfilesQuick",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/bulk": {
   "post": {
    "tags": [
     "Profiles"
    ],
    "summary": "Bulk start/stop/update/trash/restore/purge",
    "operationId": "postProfilesBulk",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "ids": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "action": {
          "type": "string",
          "enum": [
           "start",
           "stop",
           "update",
           "trash",
           "restore",
           "purge"
          ]
         },
         "patch": {
          "type": "object"
         }
        },
        "required": [
         "ids",
         "action"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}": {
   "get": {
    "tags": [
     "Profiles"
    ],
    "summary": "Get one profile (full fingerprint)",
    "operationId": "getProfilesId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "patch": {
    "tags": [
     "Profiles"
    ],
    "summary": "Update a profile",
    "operationId": "patchProfilesId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "delete": {
    "tags": [
     "Profiles"
    ],
    "summary": "Delete a profile permanently",
    "operationId": "deleteProfilesId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/devices": {
   "get": {
    "tags": [
     "Fingerprint"
    ],
    "summary": "Device presets",
    "operationId": "getDevices",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/health": {
   "get": {
    "tags": [
     "Fingerprint"
    ],
    "summary": "Fingerprint health report",
    "operationId": "getProfilesIdHealth",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/health/check": {
   "post": {
    "tags": [
     "Fingerprint"
    ],
    "summary": "Re-check proxy and recompute health",
    "operationId": "postProfilesIdHealthCheck",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/fingerprint-test": {
   "post": {
    "tags": [
     "Fingerprint"
    ],
    "summary": "Run the built-in fingerprint test page",
    "operationId": "postProfilesIdFingerprintTest",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "open": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/clone": {
   "post": {
    "tags": [
     "Profiles"
    ],
    "summary": "Clone a profile",
    "operationId": "postProfilesIdClone",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "copyData": {
          "type": "boolean"
         },
         "keepFingerprint": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/trash": {
   "post": {
    "tags": [
     "Profiles"
    ],
    "summary": "Move to trash",
    "operationId": "postProfilesIdTrash",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/restore": {
   "post": {
    "tags": [
     "Profiles"
    ],
    "summary": "Restore from trash",
    "operationId": "postProfilesIdRestore",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/start": {
   "post": {
    "tags": [
     "Browser"
    ],
    "summary": "Start the profile; returns wsEndpoint for Puppeteer/Playwright",
    "operationId": "postProfilesIdStart",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "headless": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/stop": {
   "post": {
    "tags": [
     "Browser"
    ],
    "summary": "Stop the profile",
    "operationId": "postProfilesIdStop",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/trash/purge": {
   "post": {
    "tags": [
     "Profiles"
    ],
    "summary": "Purge old (or all) trashed profiles",
    "operationId": "postTrashPurge",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "all": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/cookies": {
   "get": {
    "tags": [
     "Cookies"
    ],
    "summary": "Export cookies (JSON or Netscape)",
    "operationId": "getProfilesIdCookies",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     },
     {
      "name": "format",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "netscape for cookies.txt"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "post": {
    "tags": [
     "Cookies"
    ],
    "summary": "Import cookies",
    "operationId": "postProfilesIdCookies",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "cookies": {
          "type": "array"
         },
         "text": {
          "type": "string"
         },
         "format": {
          "type": "string"
         },
         "replace": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/proxies": {
   "get": {
    "tags": [
     "Proxies"
    ],
    "summary": "Proxy library",
    "operationId": "getProxies",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "post": {
    "tags": [
     "Proxies"
    ],
    "summary": "Add a proxy",
    "operationId": "postProxies",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "proxy": {
          "type": "string"
         },
         "name": {
          "type": "string"
         },
         "tags": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "changeIpUrl": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/proxies/import": {
   "post": {
    "tags": [
     "Proxies"
    ],
    "summary": "Bulk import (one per line)",
    "operationId": "postProxiesImport",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "text": {
          "type": "string"
         },
         "protocol": {
          "type": "string"
         },
         "tags": {
          "type": "array",
          "items": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/proxies/{id}": {
   "patch": {
    "tags": [
     "Proxies"
    ],
    "summary": "Update a proxy",
    "operationId": "patchProxiesId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "delete": {
    "tags": [
     "Proxies"
    ],
    "summary": "Delete a proxy (unlinks profiles)",
    "operationId": "deleteProxiesId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/proxies/{id}/check": {
   "post": {
    "tags": [
     "Proxies"
    ],
    "summary": "Check a saved proxy",
    "operationId": "postProxiesIdCheck",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/proxies/{id}/change-ip": {
   "post": {
    "tags": [
     "Proxies"
    ],
    "summary": "Call the proxy change-IP URL",
    "operationId": "postProxiesIdChangeIp",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/proxy/check": {
   "post": {
    "tags": [
     "Proxies"
    ],
    "summary": "Check an ad-hoc proxy string",
    "operationId": "postProxyCheck",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "proxy": {
          "type": "string"
         }
        },
        "required": [
         "proxy"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/extensions": {
   "get": {
    "tags": [
     "Extensions"
    ],
    "summary": "Extension library",
    "operationId": "getExtensions",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "post": {
    "tags": [
     "Extensions"
    ],
    "summary": "Add an unpacked folder or .crx/.zip (base64)",
    "operationId": "postExtensions",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "path": {
          "type": "string"
         },
         "base64": {
          "type": "string"
         },
         "filename": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/extensions/{id}": {
   "delete": {
    "tags": [
     "Extensions"
    ],
    "summary": "Delete an extension",
    "operationId": "deleteExtensionsId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/running": {
   "get": {
    "tags": [
     "Browser"
    ],
    "summary": "Running profiles",
    "operationId": "getRunning",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/debug": {
   "get": {
    "tags": [
     "Browser"
    ],
    "summary": "Remote debugging endpoint of a running profile (wsEndpoint, browserURL, debuggerAddress)",
    "operationId": "getProfilesIdDebug",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/profiles/{id}/cookies/cached": {
   "get": {
    "tags": [
     "Cookies"
    ],
    "summary": "Last cookie snapshot without launching the browser (used by cloud sync)",
    "operationId": "getProfilesIdCookiesCached",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Profile id or exact name"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/flows": {
   "get": {
    "tags": [
     "Automation"
    ],
    "summary": "RPA flows",
    "operationId": "getFlows",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "post": {
    "tags": [
     "Automation"
    ],
    "summary": "Create or replace a flow",
    "operationId": "postFlows",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string"
         },
         "name": {
          "type": "string"
         },
         "nodes": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "type": {
             "type": "string",
             "enum": [
              "start",
              "open",
              "click",
              "type",
              "wait",
              "scroll",
              "extract",
              "condition",
              "loop",
              "end"
             ]
            },
            "data": {
             "type": "object"
            }
           }
          }
         },
         "edges": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "source": {
             "type": "string"
            },
            "target": {
             "type": "string"
            },
            "sourceHandle": {
             "type": "string"
            }
           }
          }
         },
         "vars": {
          "type": "object"
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/flows/validate": {
   "post": {
    "tags": [
     "Automation"
    ],
    "summary": "Validate a flow without saving",
    "operationId": "postFlowsValidate",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string"
         },
         "name": {
          "type": "string"
         },
         "nodes": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "type": {
             "type": "string",
             "enum": [
              "start",
              "open",
              "click",
              "type",
              "wait",
              "scroll",
              "extract",
              "condition",
              "loop",
              "end"
             ]
            },
            "data": {
             "type": "object"
            }
           }
          }
         },
         "edges": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "source": {
             "type": "string"
            },
            "target": {
             "type": "string"
            },
            "sourceHandle": {
             "type": "string"
            }
           }
          }
         },
         "vars": {
          "type": "object"
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/flows/{id}": {
   "get": {
    "tags": [
     "Automation"
    ],
    "summary": "Get a flow",
    "operationId": "getFlowsId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "put": {
    "tags": [
     "Automation"
    ],
    "summary": "Update a flow",
    "operationId": "putFlowsId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string"
         },
         "name": {
          "type": "string"
         },
         "nodes": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "type": {
             "type": "string",
             "enum": [
              "start",
              "open",
              "click",
              "type",
              "wait",
              "scroll",
              "extract",
              "condition",
              "loop",
              "end"
             ]
            },
            "data": {
             "type": "object"
            }
           }
          }
         },
         "edges": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "source": {
             "type": "string"
            },
            "target": {
             "type": "string"
            },
            "sourceHandle": {
             "type": "string"
            }
           }
          }
         },
         "vars": {
          "type": "object"
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "delete": {
    "tags": [
     "Automation"
    ],
    "summary": "Delete a flow (and its tasks)",
    "operationId": "deleteFlowsId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/flows/{id}/run": {
   "post": {
    "tags": [
     "Automation"
    ],
    "summary": "Run a flow on many profiles",
    "operationId": "postFlowsIdRun",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "profileIds": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "concurrency": {
          "type": "number"
         },
         "headless": {
          "type": "boolean"
         },
         "vars": {
          "type": "object"
         }
        },
        "required": [
         "profileIds"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/runs": {
   "get": {
    "tags": [
     "Automation"
    ],
    "summary": "Recent runs with per-profile progress",
    "operationId": "getRuns",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/runs/{id}": {
   "get": {
    "tags": [
     "Automation"
    ],
    "summary": "One run",
    "operationId": "getRunsId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/runs/{id}/cancel": {
   "post": {
    "tags": [
     "Automation"
    ],
    "summary": "Cancel a run",
    "operationId": "postRunsIdCancel",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/cookie-robot": {
   "post": {
    "tags": [
     "Automation"
    ],
    "summary": "Warm up cookies by visiting sites like a person",
    "operationId": "postCookieRobot",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "profileIds": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "sites": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "dwellMs": {
          "type": "array",
          "items": {
           "type": "number"
          }
         },
         "scrollPx": {
          "type": "array",
          "items": {
           "type": "number"
          }
         },
         "shuffle": {
          "type": "boolean"
         },
         "headless": {
          "type": "boolean"
         },
         "concurrency": {
          "type": "number"
         }
        },
        "required": [
         "profileIds",
         "sites"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/tasks": {
   "get": {
    "tags": [
     "Scheduler"
    ],
    "summary": "Scheduled tasks",
    "operationId": "getTasks",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "post": {
    "tags": [
     "Scheduler"
    ],
    "summary": "Create a task (\"every 15m\", \"daily 09:30\", \"weekly mon 09:30\", \"once 2026-10-20T09:30\")",
    "operationId": "postTasks",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "flowId": {
          "type": "string"
         },
         "profileIds": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "schedule": {
          "type": "string"
         },
         "enabled": {
          "type": "boolean"
         },
         "headless": {
          "type": "boolean"
         }
        },
        "required": [
         "flowId",
         "schedule"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/tasks/{id}": {
   "put": {
    "tags": [
     "Scheduler"
    ],
    "summary": "Update a task",
    "operationId": "putTasksId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "delete": {
    "tags": [
     "Scheduler"
    ],
    "summary": "Delete a task",
    "operationId": "deleteTasksId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/tasks/{id}/run": {
   "post": {
    "tags": [
     "Scheduler"
    ],
    "summary": "Run a task now",
    "operationId": "postTasksIdRun",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/webhooks": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Webhooks (secrets hidden)",
    "operationId": "getWebhooks",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   },
   "post": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Add a webhook; the signing secret is returned once",
    "operationId": "postWebhooks",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         },
         "events": {
          "type": "array",
          "items": {
           "type": "string"
          }
         }
        },
        "required": [
         "url"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/webhooks/deliveries": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Recent delivery attempts",
    "operationId": "getWebhooksDeliveries",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/webhooks/{id}": {
   "delete": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Delete a webhook",
    "operationId": "deleteWebhooksId",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/webhooks/{id}/test": {
   "post": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Send a test delivery",
    "operationId": "postWebhooksIdTest",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/synchronizer": {
   "get": {
    "tags": [
     "Synchronizer"
    ],
    "summary": "Synchronizer status",
    "operationId": "getSynchronizer",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/synchronizer/start": {
   "post": {
    "tags": [
     "Synchronizer"
    ],
    "summary": "Mirror leader input to followers",
    "operationId": "postSynchronizerStart",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "leader": {
          "type": "string"
         },
         "followers": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "jitterMs": {
          "type": "number"
         }
        },
        "required": [
         "leader",
         "followers"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/synchronizer/stop": {
   "post": {
    "tags": [
     "Synchronizer"
    ],
    "summary": "Stop mirroring",
    "operationId": "postSynchronizerStop",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/synchronizer/arrange": {
   "post": {
    "tags": [
     "Synchronizer"
    ],
    "summary": "Tile or cascade profile windows",
    "operationId": "postSynchronizerArrange",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "mode": {
          "type": "string",
          "enum": [
           "tile",
           "cascade"
          ]
         },
         "ids": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "area": {
          "type": "object",
          "properties": {
           "left": {
            "type": "number"
           },
           "top": {
            "type": "number"
           },
           "width": {
            "type": "number"
           },
           "height": {
            "type": "number"
           }
          }
         }
        },
        "required": [
         "mode",
         "ids"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/browser": {
   "get": {
    "tags": [
     "Browser"
    ],
    "summary": "Bundled Chromium install status",
    "operationId": "getBrowser",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/browser/install": {
   "post": {
    "tags": [
     "Browser"
    ],
    "summary": "Download Chrome for Testing",
    "operationId": "postBrowserInstall",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "400": {
      "description": "Error: { error }"
     },
     "401": {
      "description": "Missing or invalid token"
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  }
 }
}