{
 "openapi": "3.0.3",
 "info": {
  "title": "Bramble Flows API",
  "version": "2026-11-13",
  "description": "Bramble Flows: building and running automations. Flows and their versions, runs and their step outputs, connections (stored credentials), tables, variables, templates, approvals and forms waiting for an answer — and the public webhook endpoints that start flows from outside.\n"
 },
 "servers": [
  {
   "url": "https://{org}.brambleit.cloud/flows",
   "variables": {
    "org": {
     "default": "your-org"
    }
   }
  },
  {
   "url": "https://{org}.brambleit.cloud/api",
   "variables": {
    "org": {
     "default": "your-org"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key"
   },
   "session": {
    "type": "apiKey",
    "in": "cookie",
    "name": "sso_session"
   },
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT"
   }
  }
 },
 "tags": [
  {
   "name": "Flows",
   "description": "Create, save, version, switch on and off, copy, import and export flows; run one now; the catalogue of steps."
  },
  {
   "name": "Runs",
   "description": "A run's steps and outputs, cancelling, and running again with the same input."
  },
  {
   "name": "Connections",
   "description": "Stored credentials steps use (mailboxes, HTTP auth, chat webhooks, FTP…), tested before saving."
  },
  {
   "name": "Tables",
   "description": "Simple data tables flows can read and write."
  },
  {
   "name": "Variables",
   "description": "Values flows read as `$vars`."
  },
  {
   "name": "Templates",
   "description": "Built-in, organisation and MSP-shared templates, and making a flow from one."
  },
  {
   "name": "Approvals & forms",
   "description": "Approvals and forms waiting for you, and answering them."
  },
  {
   "name": "Editor helpers",
   "description": "Lists the editor uses for pickers, sample event data, schedule previews and test events."
  },
  {
   "name": "Webhooks & public links",
   "description": "No sign-in: the token in the address is the secret. `/hook/<token>` starts a flow; `/hook/a/<token>` and `/hook/w/<token>` are the approval and form links Flows emails.\n"
  },
  {
   "name": "Bramble bridge (BRM-API)",
   "description": "How Flows reaches RMM devices: list devices and run a script on one as the flow's owner. Used by Flows itself with `X-Flows-Key`; not for outside callers.\n"
  }
 ],
 "paths": {
  "/hook/w/{token}": {
   "get": {
    "tags": [
     "Webhooks & public links"
    ],
    "summary": "Open a form link",
    "operationId": "get-hook-w-token",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Webhooks & public links"
    ],
    "summary": "Answer a form link",
    "operationId": "post-hook-w-token",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "decision": {
          "type": "string"
         },
         "note": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/hook/a/{token}": {
   "get": {
    "tags": [
     "Webhooks & public links"
    ],
    "summary": "Open an approval link",
    "operationId": "get-hook-a-token",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "File, page or redirect"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Webhooks & public links"
    ],
    "summary": "Answer an approval link",
    "operationId": "post-hook-a-token",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/me": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "Who you are: the signed-in person and what they can do here",
    "operationId": "get-api-me",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "user": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/catalogue": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "Steps and triggers available",
    "operationId": "get-api-catalogue",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "nodes": {
           "type": "array",
           "items": {}
          },
          "events": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "type": {
              "type": "string"
             },
             "app": {},
             "app_label": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "audience": {},
             "live": {
              "type": "boolean"
             },
             "sample": {}
            }
           }
          },
          "operators": {
           "type": "array",
           "items": {}
          },
          "functions": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/flows": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "List flows",
    "operationId": "get-api-flows",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "view",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "flows": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Only Flows admins can see everyone's flows"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Flows"
    ],
    "summary": "Create a flow",
    "operationId": "post-api-flows",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "403": {
      "description": "Only Flows admins can create organisation flows"
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "The flow's name."
         },
         "scope": {
          "type": "string",
          "description": "`personal` or `tenant`."
         },
         "graph": {
          "description": "The steps and connections between them (editor JSON)."
         },
         "description": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/flows/{id}": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "Get a flow",
    "operationId": "get-api-flows-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Flows"
    ],
    "summary": "Save a flow",
    "operationId": "put-api-flows-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "409": {
      "description": "Someone else saved this flow since you opened it. Reload to see their changes."
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "version": {
          "type": "number",
          "description": "The version you started from. If someone saved since, you get `409`."
         },
         "graph": {
          "description": "The steps."
         },
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "auto": {
          "type": "boolean",
          "description": "`true` for an auto-save (not kept as a named version)."
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Flows"
    ],
    "summary": "Delete a flow",
    "operationId": "delete-api-flows-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not allowed"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/subflows": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "Sub-flows a flow may run: same scope (personal: the owner's own; organisation: organisation flows), starting \"When another flow runs it\"",
    "operationId": "get-api-subflows",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "flow",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "flows": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "is_active": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Flow not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/flows/{id}/settings": {
   "post": {
    "tags": [
     "Flows"
    ],
    "summary": "Flow settings: what happens if it's triggered while still running",
    "operationId": "post-api-flows-id-settings",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "concurrency": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/flows/{id}/versions": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "Version history (lib/versions.js)",
    "operationId": "get-api-flows-id-versions",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "versions": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/flows/{id}/versions/{vid}": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "Get an older version of a flow",
    "operationId": "get-api-flows-id-versions-vid",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "vid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "version": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "version": {},
            "name": {
             "type": "string"
            },
            "saved_at": {
             "type": "string",
             "format": "date-time"
            },
            "reason": {
             "type": "string"
            },
            "graph": {}
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Version not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/flows/{id}/activate": {
   "post": {
    "tags": [
     "Flows"
    ],
    "summary": "Switch a flow on",
    "operationId": "post-api-flows-id-activate",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/flows/{id}/deactivate": {
   "post": {
    "tags": [
     "Flows"
    ],
    "summary": "Switch a flow off",
    "operationId": "post-api-flows-id-deactivate",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/flows/{id}/duplicate": {
   "post": {
    "tags": [
     "Flows"
    ],
    "summary": "Copy a flow",
    "operationId": "post-api-flows-id-duplicate",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/flows/{id}/run": {
   "post": {
    "tags": [
     "Flows"
    ],
    "summary": "Run now. Body: { data?, nodeId?, graph?",
    "operationId": "post-api-flows-id-run",
    "description": "Run now. Body: { data?, nodeId?, graph? } — graph runs the builder's unsaved version (a test run); nodeId picks which trigger to start from. Event and activity triggers start with their sample data unless data is given.\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "202": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "run_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "graph": {},
         "nodeId": {},
         "data": {
          "type": "object"
         },
         "stopAt": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/flows/{id}/runs": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "A flow's runs",
    "operationId": "get-api-flows-id-runs",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "before",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "running",
        "success",
        "error",
        "cancelled"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "runs": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "flow_version": {
              "type": "integer"
             },
             "trigger_kind": {
              "type": "string"
             },
             "mode": {
              "type": "string",
              "enum": [
               "live",
               "manual"
              ]
             },
             "status": {
              "type": "string",
              "enum": [
               "running",
               "success",
               "error",
               "cancelled"
              ]
             },
             "started_by": {
              "type": "integer",
              "nullable": true
             },
             "error": {
              "type": "string",
              "nullable": true
             },
             "error_node_id": {
              "type": "string",
              "nullable": true
             },
             "steps": {
              "type": "integer"
             },
             "started_at": {
              "type": "string",
              "format": "date-time"
             },
             "finished_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/flows/{id}/checks": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "Checks made by polling triggers (New email), newest first: the last 3 days, including the ones that found nothing",
    "operationId": "get-api-flows-id-checks",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "checks": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "node_id": {
              "type": "string"
             },
             "checked_at": {
              "type": "string",
              "format": "date-time"
             },
             "ms": {
              "type": "integer"
             },
             "found": {
              "type": "integer"
             },
             "started": {
              "type": "integer"
             },
             "skipped": {
              "type": "integer"
             },
             "note": {
              "type": "string",
              "nullable": true
             },
             "error": {
              "type": "string",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/runs/{id}": {
   "get": {
    "tags": [
     "Runs"
    ],
    "summary": "Get a run with its steps",
    "operationId": "get-api-runs-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "run": {
           "type": "object",
           "properties": {
            "graph": {},
            "pending_steps": {
             "type": "array",
             "items": {}
            },
            "waiting_until": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            },
            "waiting_on": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "integer",
                "nullable": true
               },
               "kind": {
                "type": "string",
                "enum": [
                 "approval",
                 "form"
                ]
               },
               "title": {
                "type": "string"
               },
               "expires_at": {
                "type": "string",
                "format": "date-time"
               }
              }
             }
            }
           }
          },
          "graph": {},
          "steps": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "node_id": {
              "type": "string"
             },
             "node_name": {
              "type": "string"
             },
             "node_type": {
              "type": "string"
             },
             "status": {
              "type": "string",
              "enum": [
               "success",
               "error",
               "waiting"
              ]
             },
             "pinned": {},
             "attempt": {
              "type": "integer"
             },
             "input_count": {
              "type": "integer"
             },
             "output_counts": {
              "type": "array",
              "items": {}
             },
             "input_preview": {},
             "output_preview": {},
             "error": {
              "type": "string",
              "nullable": true
             },
             "logs": {
              "type": "array",
              "items": {}
             },
             "started_at": {
              "type": "string",
              "format": "date-time"
             },
             "finished_at": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/runs/{id}/outputs/{nodeId}": {
   "get": {
    "tags": [
     "Runs"
    ],
    "summary": "A step's whole output from a run (the steps list only has the first 25 items) — for pinning",
    "operationId": "get-api-runs-id-outputs-nodeid",
    "description": "A step's whole output from a run (the steps list only has the first 25 items) — for pinning. Kept for 2 days (the trigger's for 30).\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "nodeId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "outputs": {
           "type": "array",
           "items": {}
          },
          "complete": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "That step didn't run in this run"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/runs/{id}/cancel": {
   "post": {
    "tags": [
     "Runs"
    ],
    "summary": "Cancel a run",
    "operationId": "post-api-runs-id-cancel",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not allowed"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/runs/{id}/retry": {
   "post": {
    "tags": [
     "Runs"
    ],
    "summary": "Run the flow again (as it is now) with the same trigger data",
    "operationId": "post-api-runs-id-retry",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "202": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "run_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Only the owner can run this flow"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/connection-types": {
   "get": {
    "tags": [
     "Connections"
    ],
    "summary": "Kinds of connection",
    "operationId": "get-api-connection-types",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "types": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "type": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "icon": {},
             "help": {},
             "use": {},
             "fields": {
              "type": "array",
              "items": {}
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/connections": {
   "get": {
    "tags": [
     "Connections"
    ],
    "summary": "?type=a,b  ?flow=<id> → only ones that flow could use",
    "operationId": "get-api-connections",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "flow",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "type",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "connections": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "can_edit": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Flow not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Connections"
    ],
    "summary": "Create a connection",
    "operationId": "post-api-connections",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "err.status": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string",
          "description": "The kind of connection."
         },
         "name": {
          "type": "string",
          "description": "Its name."
         },
         "scope": {
          "description": "`personal` or `tenant`."
         },
         "data": {
          "description": "Its settings and secrets."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/connections/{id}": {
   "get": {
    "tags": [
     "Connections"
    ],
    "summary": "Editing form: the non-secret fields, and which secrets are set",
    "operationId": "get-api-connections-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {}
          },
          "secrets_set": {},
          "used_by": {}
         }
        }
       }
      }
     },
     "403": {
      "description": "Only the owner can edit this connection"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Connections"
    ],
    "summary": "Update a connection",
    "operationId": "put-api-connections-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "403": {
      "description": "Only the owner can edit this connection"
     },
     "err.status": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "data": {}
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Connections"
    ],
    "summary": "Delete a connection",
    "operationId": "delete-api-connections-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "force",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "`1` to delete it even though flows use it."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Only the owner can delete this connection"
     },
     "409": {
      "description": "Used by …. Those steps will stop working."
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/connections/{id}/folders": {
   "get": {
    "tags": [
     "Connections"
    ],
    "summary": "A mailbox connection's folders (for the IMAP trigger's folder pickers), if the flow (?flow=) may use the connection",
    "operationId": "get-api-connections-id-folders",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "flow",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "folders": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Couldn't list the folders: …"
     },
     "404": {
      "description": "Flow not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/connections/test": {
   "post": {
    "tags": [
     "Connections"
    ],
    "summary": "Test a connection: a saved one (:id, optionally with changed fields) or an unsaved one (body.type + body.data)",
    "operationId": "post-api-connections-test",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Connection not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string"
         },
         "id": {
          "type": "integer"
         },
         "data": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/flows/{id}/export": {
   "get": {
    "tags": [
     "Flows"
    ],
    "summary": "A flow as a file: secrets and webhook tokens blanked; the connections and tables it uses listed by name so an import can match them up",
    "operationId": "get-api-flows-id-export",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/templates": {
   "get": {
    "tags": [
     "Templates"
    ],
    "summary": "List templates",
    "operationId": "get-api-templates",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Templates"
    ],
    "summary": "Save a flow as a template",
    "operationId": "post-api-templates",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "err.status": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "category": {},
         "share": {},
         "flow_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/templates/{id}": {
   "delete": {
    "tags": [
     "Templates"
    ],
    "summary": "Delete a template",
    "operationId": "delete-api-templates-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "err.status": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/templates/use": {
   "post": {
    "tags": [
     "Templates"
    ],
    "summary": "Create a flow from a template",
    "operationId": "post-api-templates-use",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          },
          "warnings": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Only Flows admins can make organisation flows"
     },
     "err.status || 400": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "scope": {
          "type": "string"
         },
         "source": {},
         "id": {
          "type": "integer"
         },
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/flows/import": {
   "post": {
    "tags": [
     "Flows"
    ],
    "summary": "Body: { data: <a Flows export or an n8n workflow export>, scope?, name?",
    "operationId": "post-api-flows-import",
    "description": "Body: { data: <a Flows export or an n8n workflow export>, scope?, name? }\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "flow": {},
          "warnings": {
           "type": "array",
           "items": {}
          },
          "source": {}
         }
        }
       }
      }
     },
     "403": {
      "description": "Only Flows admins can create organisation flows"
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "scope": {},
         "data": {},
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/flows/{id}/preview": {
   "post": {
    "tags": [
     "Flows"
    ],
    "summary": "What an expression gives, using a run's data for a step (the editor's live preview)",
    "operationId": "post-api-flows-id-preview",
    "description": "What an expression gives, using a run's data for a step (the editor's live preview). body: { template, nodeId, runId?, graph?, itemIndex? }\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          },
          "has_data": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "template": {},
         "runId": {
          "type": "number"
         },
         "graph": {},
         "nodeId": {},
         "itemIndex": {
          "type": "number"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/devices": {
   "get": {
    "tags": [
     "Editor helpers"
    ],
    "summary": "RMM devices (for the device step)",
    "operationId": "get-api-devices",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "flow",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "404": {
      "description": "Flow not found"
     },
     "err.status && err.status < 500 ? 400 : 502": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/actions/{token}": {
   "get": {
    "tags": [
     "Approvals & forms"
    ],
    "summary": "Open an action link",
    "operationId": "get-api-actions-token",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "action": {
           "type": "object",
           "properties": {
            "label": {
             "type": "string"
            },
            "title": {
             "type": "string"
            },
            "expired": {
             "type": "boolean"
            },
            "flow": {},
            "clicks": {
             "type": "array",
             "items": {}
            },
            "last_clicked_at": {
             "type": "string",
             "format": "date-time"
            },
            "last_clicked_by": {}
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "This link isn't valid"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Approvals & forms"
    ],
    "summary": "Answer an action link",
    "operationId": "post-api-actions-token",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "404": {
      "description": "This link isn't valid"
     },
     "err.status || 400": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/variables": {
   "get": {
    "tags": [
     "Variables"
    ],
    "summary": "List variables",
    "operationId": "get-api-variables",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "variables": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Variables"
    ],
    "summary": "Create or update a variable",
    "operationId": "post-api-variables",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "err.status": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "integer"
         },
         "scope": {},
         "name": {
          "type": "string"
         },
         "value": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/variables/{id}": {
   "delete": {
    "tags": [
     "Variables"
    ],
    "summary": "Delete a variable",
    "operationId": "delete-api-variables-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "err.status": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/waits": {
   "get": {
    "tags": [
     "Approvals & forms"
    ],
    "summary": "Approvals and forms waiting for me",
    "operationId": "get-api-waits",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "waits": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/waits/{id}": {
   "get": {
    "tags": [
     "Approvals & forms"
    ],
    "summary": "Get an approval or form",
    "operationId": "get-api-waits-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "wait": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "kind": {
             "type": "string"
            },
            "title": {
             "type": "string"
            },
            "details": {},
            "spec": {},
            "needs": {
             "type": "array",
             "items": {}
            },
            "status": {
             "type": "string"
            },
            "expired": {
             "type": "boolean"
            },
            "result": {},
            "created_at": {
             "type": "string",
             "format": "date-time"
            },
            "expires_at": {
             "type": "string",
             "format": "date-time"
            },
            "decided_at": {
             "type": "string",
             "format": "date-time"
            },
            "run_id": {
             "type": "integer"
            },
            "flow": {
             "type": "object",
             "nullable": true,
             "properties": {
              "id": {
               "type": "integer"
              },
              "name": {
               "type": "string"
              }
             }
            },
            "people": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "email": {
                "type": "string"
               },
               "name": {
                "type": "string"
               },
               "decision": {},
               "note": {
                "type": "string"
               },
               "decided_at": {
                "type": "string",
                "format": "date-time"
               }
              }
             }
            }
           }
          },
          "me": {
           "type": "object",
           "nullable": true,
           "properties": {
            "decision": {},
            "can_answer": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/waits/{id}/answer": {
   "post": {
    "tags": [
     "Approvals & forms"
    ],
    "summary": "Answer an approval or form",
    "operationId": "post-api-waits-id-answer",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "403": {
      "description": "You weren't asked"
     },
     "err.status": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "answers": {
          "type": "array",
          "items": {},
          "description": "The form's answers (forms)."
         },
         "approve": {
          "type": "boolean",
          "description": "`true` to approve, `false` to reject (approvals)."
         },
         "note": {
          "type": "string",
          "description": "A note."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/bramble/form": {
   "get": {
    "tags": [
     "Editor helpers"
    ],
    "summary": "A form's questions, for the \"Form response submitted\" trigger (as the flow's owner: their own access decides)",
    "operationId": "get-api-bramble-form",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "flow",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "form",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "404": {
      "description": "Flow not found"
     },
     "err.status === 404 || err.status === 403 ? 403 : 502": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/bramble/options": {
   "get": {
    "tags": [
     "Editor helpers"
    ],
    "summary": "Pickers in Bramble steps (engine/nodes/bramble.js OPTION_SOURCES), as the flow's owner: ?flow=&source=psa.queues[&project=12]",
    "operationId": "get-api-bramble-options",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "flow",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "source",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "project",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "options": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Unknown list"
     },
     "404": {
      "description": "Flow not found"
     },
     "err.status && err.status < 500 ? 400 : 502": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/tables": {
   "get": {
    "tags": [
     "Tables"
    ],
    "summary": "List tables",
    "operationId": "get-api-tables",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "flow",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tables": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "can_edit": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Flow not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Tables"
    ],
    "summary": "Create a table",
    "operationId": "post-api-tables",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "scope": {},
         "columns": {
          "type": "array",
          "items": {}
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/tables/{id}": {
   "get": {
    "tags": [
     "Tables"
    ],
    "summary": "Get a table and its rows",
    "operationId": "get-api-tables-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "can_edit": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Tables"
    ],
    "summary": "Update a table's columns",
    "operationId": "put-api-tables-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "columns": {
          "type": "array",
          "items": {}
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Tables"
    ],
    "summary": "Delete a table",
    "operationId": "delete-api-tables-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/tables/{id}/rows": {
   "post": {
    "tags": [
     "Tables"
    ],
    "summary": "Add a row",
    "operationId": "post-api-tables-id-rows",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "data": {}
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Tables"
    ],
    "summary": "Delete every row",
    "operationId": "delete-api-tables-id-rows",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "deleted": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/tables/{id}/rows/{rowId}": {
   "put": {
    "tags": [
     "Tables"
    ],
    "summary": "Update a row",
    "operationId": "put-api-tables-id-rows-rowid",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "rowId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "data": {}
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Tables"
    ],
    "summary": "Delete a row",
    "operationId": "delete-api-tables-id-rows-rowid",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "rowId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/events/test": {
   "post": {
    "tags": [
     "Editor helpers"
    ],
    "summary": "Sends a \"flows.test\" event for the current user, to try event triggers",
    "operationId": "post-api-events-test",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "event_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "message": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/schedule/preview": {
   "post": {
    "tags": [
     "Editor helpers"
    ],
    "summary": "When a schedule would next run, for the settings panel",
    "operationId": "post-api-schedule-preview",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "description": {
           "type": "string"
          },
          "next": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "schedule": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/events/{type}/sample": {
   "get": {
    "tags": [
     "Editor helpers"
    ],
    "summary": "Example data for an app event",
    "operationId": "get-api-events-type-sample",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Flows.",
    "parameters": [
     {
      "name": "type",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sample": {
           "type": "object",
           "properties": {
            "event": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Unknown event"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/v1/flows/devices": {
   "get": {
    "tags": [
     "Bramble bridge (BRM-API)"
    ],
    "summary": "Devices a flow's owner can use",
    "operationId": "get-v1-flows-devices",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM. Permission (any of): `rmm.devices.view`.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "devices": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/flows/devices/{id}/run": {
   "post": {
    "tags": [
     "Bramble bridge (BRM-API)"
    ],
    "summary": "Run a script on a device for a flow",
    "operationId": "post-v1-flows-devices-id-run",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM. Permission (any of): `rmm.scripts.run`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "command_id": {
           "type": "integer"
          },
          "device": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "Unsupported language: …"
     },
     "404": {
      "description": "Device not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "language": {},
         "script": {},
         "args": {
          "type": "array",
          "items": {}
         },
         "timeout_seconds": {
          "type": "number"
         },
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/flows/commands/{id}": {
   "get": {
    "tags": [
     "Bramble bridge (BRM-API)"
    ],
    "summary": "Result of a device script",
    "operationId": "get-v1-flows-commands-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM. Permission (any of): `rmm.scripts.run`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          },
          "status": {
           "type": "string"
          },
          "exit_code": {},
          "stdout": {},
          "stderr": {},
          "timed_out": {
           "type": "boolean"
          },
          "created_at": {
           "type": "string",
           "format": "date-time"
          },
          "started_at": {
           "type": "string",
           "format": "date-time"
          },
          "finished_at": {
           "type": "string",
           "format": "date-time"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Command not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  }
 }
}