{
  "openapi": "3.1.0",
  "info": {
    "title": "Liminal local API",
    "version": "1.0.0",
    "summary": "What a script on the same machine can ask Liminal to do.",
    "description": "Turned on in Settings → API & Automation. The service listens on 127.0.0.1 only, and the port it bound is written to the address file (Local API/status.json) inside Liminal’s user-data directory — read it rather than hardcoding the server address below. Operations marked x-liminal-released false are not in a build you can download today and answer 404 there.",
    "contact": {
      "email": "support@liminalbrowser.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://liminalbrowser.com/terms/"
    }
  },
  "servers": [
    {
      "url": "http://127.0.0.1:48361",
      "description": "The address a fresh install offers. The one your app actually bound is in the address file."
    }
  ],
  "security": [
    {
      "bearerKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "The key the app issues once when the API is turned on: 64 lowercase hexadecimal characters, kept in Keychain on macOS and Credential Manager on Windows."
      }
    }
  },
  "paths": {
    "/v1/status": {
      "get": {
        "operationId": "status",
        "summary": "Is Liminal running, and is anyone signed in",
        "description": "The cheapest call there is, and the one to poll while you wait for the app. It answers without an account: a false signedIn is a state, not an error.",
        "x-liminal-released": true,
        "responses": {
          "200": {
            "description": "The operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "status": "running",
                  "version": "<version>",
                  "signedIn": true
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, malformed or has been regenerated since.",
            "x-liminal-codes": [
              "invalid_key"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_key"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/profiles": {
      "get": {
        "operationId": "listProfiles",
        "summary": "The profiles in the catalog, filtered and paged",
        "description": "Reads the same catalog the app shows. Filters combine, and every one of them is exact except name, which matches any profile whose name contains what you typed, in any case.",
        "x-liminal-released": true,
        "responses": {
          "200": {
            "description": "The operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "page": 1,
                  "pageSize": 100,
                  "total": 1,
                  "items": [
                    "<profile>"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "page or pageSize is outside the accepted range.",
            "x-liminal-codes": [
              "invalid_pagination"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_pagination"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, malformed or has been regenerated since.",
            "x-liminal-codes": [
              "invalid_key"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_key"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Nobody is signed in to the app; the catalog operations need an account.",
            "x-liminal-codes": [
              "not_signed_in"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_signed_in"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The profile catalog is not ready yet. Ask again.",
            "x-liminal-codes": [
              "catalog_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "catalog_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Which page to read, counting from one.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "How many profiles a page holds. The ceiling is the default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "workspaceId",
            "in": "query",
            "required": false,
            "description": "Only profiles of that workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "folderId",
            "in": "query",
            "required": false,
            "description": "Only profiles of that folder.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only profiles in that state; running is the state of an open profile.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Only profiles whose name contains this, ignoring case.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/profiles/{id}": {
      "get": {
        "operationId": "getProfile",
        "summary": "One profile, with its proxy and its fingerprint",
        "description": "The same object the list returns, for one identifier. The proxy address is shown; its password never is.",
        "x-liminal-released": true,
        "responses": {
          "200": {
            "description": "The operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "<profile-id>",
                  "name": "Shop EU",
                  "workspaceId": "<workspace-id>",
                  "folderId": "<folder-id>",
                  "status": "running",
                  "health": "ok",
                  "proxy": {
                    "id": "<proxy-id>",
                    "name": "Residential DE",
                    "type": "socks5",
                    "host": "proxy.example.net",
                    "port": 1080,
                    "working": true,
                    "lastCheckedExternalIp": "203.0.113.10",
                    "lastCheckedCountryCode": "DE"
                  },
                  "fingerprint": {
                    "platform": "MacIntel",
                    "language": "de-DE",
                    "timezone": "Europe/Berlin"
                  },
                  "lastOpenedAt": "2026-09-30T08:15:00.000Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, malformed or has been regenerated since.",
            "x-liminal-codes": [
              "invalid_key"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_key"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Nobody is signed in to the app; the catalog operations need an account.",
            "x-liminal-codes": [
              "not_signed_in"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_signed_in"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No profile with that identifier is in the catalog.",
            "x-liminal-codes": [
              "profile_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_not_found"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The profile catalog is not ready yet. Ask again.",
            "x-liminal-codes": [
              "catalog_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "catalog_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The profile identifier, as the catalog operations return it.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/profiles/{id}/start": {
      "post": {
        "operationId": "startProfile",
        "summary": "Open a profile and get the address a driver connects to",
        "description": "Starts the profile the way the app does — its fingerprint, its proxy, its cookies — and answers with the CDP address once the browser is up. The call waits; it does not return a job to poll.",
        "x-liminal-released": true,
        "responses": {
          "200": {
            "description": "The operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "<profile-id>",
                  "status": "running",
                  "cdpDiscoveryUrl": "http://127.0.0.1:48361/devtools/<token>/json/version",
                  "cdpBrowserUrl": "ws://127.0.0.1:9222/devtools/browser/<token>",
                  "seleniumDebuggerUrl": "127.0.0.1:9222",
                  "chromedriverPath": "/Applications/Liminal.app/.../chromedriver",
                  "debugPort": 9222,
                  "debugAddress": "127.0.0.1:9222",
                  "externalIp": "203.0.113.10",
                  "countryCode": "DE"
                }
              }
            }
          },
          "400": {
            "description": "The body is not a JSON object. debugPort is neither 0 nor a port in the accepted range. timeoutSeconds is outside the accepted range. maskAutomation was sent as false, which the app does not offer.",
            "x-liminal-codes": [
              "invalid_start_options",
              "invalid_port",
              "invalid_start_timeout",
              "masking_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_start_options",
                            "invalid_port",
                            "invalid_start_timeout",
                            "masking_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, malformed or has been regenerated since.",
            "x-liminal-codes": [
              "invalid_key"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_key"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Nobody is signed in to the app; the catalog operations need an account.",
            "x-liminal-codes": [
              "not_signed_in"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_signed_in"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No profile with that identifier is in the catalog.",
            "x-liminal-codes": [
              "profile_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_not_found"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The profile is open already, a start for it is still running, or a driver address handed out earlier is still good. The debug port you asked for is taken. The debug port could not be bound for another reason. The profile did not come up. A safe `detail` names the stage when the app can say it. The profile requires its proxy, and the proxy did not answer.",
            "x-liminal-codes": [
              "profile_already_running",
              "port_in_use",
              "listen_failed",
              "start_failed",
              "proxy_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_already_running",
                            "port_in_use",
                            "listen_failed",
                            "start_failed",
                            "proxy_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Preparing the profile failed before the browser was asked to start.",
            "x-liminal-codes": [
              "start_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "start_failed"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The app cannot start or stop a profile right now. The profile started but its CDP endpoint did not come up.",
            "x-liminal-codes": [
              "runtime_unavailable",
              "cdp_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "runtime_unavailable",
                            "cdp_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "The profile did not come up within timeoutSeconds.",
            "x-liminal-codes": [
              "start_timeout"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "start_timeout"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The profile identifier, as the catalog operations return it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "debugPort": {
                    "type": "integer",
                    "minimum": 1024,
                    "maximum": 65534,
                    "default": 0,
                    "description": "The port the CDP endpoint binds. 0 lets the app pick a free one; any other value has to be one your user can bind."
                  },
                  "timeoutSeconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 180,
                    "default": 60,
                    "description": "How long the call waits for the profile to come up before it gives up."
                  },
                  "maskAutomation": {
                    "type": "boolean",
                    "default": true,
                    "description": "Only true is accepted. Automation masking cannot be turned off: a profile under a script is the same profile a site sees when you open it by hand."
                  }
                },
                "required": []
              }
            }
          }
        }
      }
    },
    "/v1/profiles/{id}/attach-automation": {
      "post": {
        "operationId": "attachAutomation",
        "summary": "Get a driver address for a profile that is already open",
        "description": "For a profile you opened by hand and now want to drive. It does not restart anything: the session, its tabs and its cookies stay as they are.",
        "x-liminal-released": true,
        "responses": {
          "200": {
            "description": "The operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "<profile-id>",
                  "status": "running",
                  "cdpDiscoveryUrl": "http://127.0.0.1:48361/devtools/<token>/json/version",
                  "cdpBrowserUrl": "ws://127.0.0.1:9222/devtools/browser/<token>",
                  "seleniumDebuggerUrl": "127.0.0.1:9222",
                  "chromedriverPath": "/Applications/Liminal.app/.../chromedriver",
                  "debugPort": 9222,
                  "debugAddress": "127.0.0.1:9222",
                  "externalIp": "203.0.113.10",
                  "countryCode": "DE"
                }
              }
            }
          },
          "400": {
            "description": "The body is not a JSON object. debugPort is neither 0 nor a port in the accepted range. timeoutSeconds is outside the accepted range. maskAutomation was sent as false, which the app does not offer.",
            "x-liminal-codes": [
              "invalid_start_options",
              "invalid_port",
              "invalid_start_timeout",
              "masking_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_start_options",
                            "invalid_port",
                            "invalid_start_timeout",
                            "masking_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, malformed or has been regenerated since.",
            "x-liminal-codes": [
              "invalid_key"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_key"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Nobody is signed in to the app; the catalog operations need an account.",
            "x-liminal-codes": [
              "not_signed_in"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_signed_in"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No profile with that identifier is in the catalog.",
            "x-liminal-codes": [
              "profile_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_not_found"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The profile is open already, a start for it is still running, or a driver address handed out earlier is still good. The debug port you asked for is taken. The debug port could not be bound for another reason. The profile did not come up. A safe `detail` names the stage when the app can say it. The profile requires its proxy, and the proxy did not answer. The profile is not open, so there is nothing to attach to.",
            "x-liminal-codes": [
              "profile_already_running",
              "port_in_use",
              "listen_failed",
              "start_failed",
              "proxy_unavailable",
              "profile_not_running"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_already_running",
                            "port_in_use",
                            "listen_failed",
                            "start_failed",
                            "proxy_unavailable",
                            "profile_not_running"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Preparing the profile failed before the browser was asked to start.",
            "x-liminal-codes": [
              "start_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "start_failed"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The app cannot start or stop a profile right now. The profile started but its CDP endpoint did not come up.",
            "x-liminal-codes": [
              "runtime_unavailable",
              "cdp_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "runtime_unavailable",
                            "cdp_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "The profile did not come up within timeoutSeconds.",
            "x-liminal-codes": [
              "start_timeout"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "start_timeout"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The profile identifier, as the catalog operations return it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "debugPort": {
                    "type": "integer",
                    "minimum": 1024,
                    "maximum": 65534,
                    "default": 0,
                    "description": "The port the CDP endpoint binds. 0 lets the app pick a free one; any other value has to be one your user can bind."
                  },
                  "timeoutSeconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 180,
                    "default": 60,
                    "description": "How long the call waits for the profile to come up before it gives up."
                  },
                  "maskAutomation": {
                    "type": "boolean",
                    "default": true,
                    "description": "Only true is accepted. Automation masking cannot be turned off: a profile under a script is the same profile a site sees when you open it by hand."
                  }
                },
                "required": []
              }
            }
          }
        }
      }
    },
    "/v1/profiles/{id}/stop": {
      "post": {
        "operationId": "stopProfile",
        "summary": "Close a profile the way its window would",
        "description": "Lets the session finish writing its state. This is the one to call between scripted runs on the same profile.",
        "x-liminal-released": true,
        "responses": {
          "200": {
            "description": "The operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "<profile-id>",
                  "status": "closed"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, malformed or has been regenerated since.",
            "x-liminal-codes": [
              "invalid_key"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_key"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Nobody is signed in to the app; the catalog operations need an account.",
            "x-liminal-codes": [
              "not_signed_in"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_signed_in"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No profile with that identifier is in the catalog.",
            "x-liminal-codes": [
              "profile_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_not_found"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The profile is not open, so there is nothing to close. The app could not close the profile.",
            "x-liminal-codes": [
              "profile_not_running",
              "stop_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_not_running",
                            "stop_failed"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The app cannot start or stop a profile right now.",
            "x-liminal-codes": [
              "runtime_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "runtime_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The profile identifier, as the catalog operations return it.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/profiles/{id}/force-stop": {
      "post": {
        "operationId": "forceStopProfile",
        "summary": "Close a profile that will not close",
        "description": "The same answer, without waiting for the session to settle. Reach for it when a stop did not return, not as a matter of course.",
        "x-liminal-released": true,
        "responses": {
          "200": {
            "description": "The operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "<profile-id>",
                  "status": "closed"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, malformed or has been regenerated since.",
            "x-liminal-codes": [
              "invalid_key"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_key"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Nobody is signed in to the app; the catalog operations need an account.",
            "x-liminal-codes": [
              "not_signed_in"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_signed_in"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No profile with that identifier is in the catalog.",
            "x-liminal-codes": [
              "profile_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_not_found"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The profile is not open, so there is nothing to close. The app could not close the profile.",
            "x-liminal-codes": [
              "profile_not_running",
              "stop_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "profile_not_running",
                            "stop_failed"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The app cannot start or stop a profile right now.",
            "x-liminal-codes": [
              "runtime_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "runtime_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The profile identifier, as the catalog operations return it.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/running-profiles": {
      "get": {
        "operationId": "runningProfiles",
        "summary": "What is open right now, and what can be driven",
        "description": "Every profile that is open, whether a window or a call opened it — startedBy says which — with its driver address when one is available. Reconnect from here after your script restarts.",
        "x-liminal-released": true,
        "responses": {
          "200": {
            "description": "The operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "items": [
                    {
                      "id": "<profile-id>",
                      "workspaceId": "<workspace-id>",
                      "status": "running",
                      "automationAvailable": true,
                      "startedBy": "api",
                      "cdpBrowserUrl": "ws://127.0.0.1:9222/devtools/browser/<token>",
                      "seleniumDebuggerUrl": "127.0.0.1:9222",
                      "chromedriverPath": "/Applications/Liminal.app/.../chromedriver",
                      "debugPort": 9222,
                      "debugAddress": "127.0.0.1:9222"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, malformed or has been regenerated since.",
            "x-liminal-codes": [
              "invalid_key"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_key"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Nobody is signed in to the app; the catalog operations need an account.",
            "x-liminal-codes": [
              "not_signed_in"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_signed_in"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The profile catalog is not ready yet. Ask again.",
            "x-liminal-codes": [
              "catalog_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "catalog_unavailable"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "The app’s own wording, for a log. Branch on code, not on this."
                        },
                        "detail": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
