{
  "openapi": "3.1.0",
  "info": {
    "title": "Stacksync API",
    "version": "v1",
    "description": "The Stacksync API manages a workspace from your own code: connections, syncs, workflows, queues, variables, folders, files, knowledge bases, Genies and API proxies. Authenticate with a workspace or user API key in `Authorization: Bearer <key>`; regional resources take `region=besg` (Europe) or `region=usnv` (United States)."
  },
  "tags": [
    {
      "name": "Workspaces",
      "description": "The workspaces your API key can reach, their members and default data region."
    },
    {
      "name": "Regions",
      "description": "The data regions where a workspace's resources live."
    },
    {
      "name": "Connections",
      "description": "Credentials to the apps and databases Stacksync connects to."
    },
    {
      "name": "Connectors",
      "description": "The apps available to workflows, their modules, forms and one-off module runs."
    },
    {
      "name": "Syncs",
      "description": "Real-time two-way syncs between two apps: create, configure, switch on and off, inspect."
    },
    {
      "name": "Sync triggers",
      "description": "Triggers that run when a sync writes records."
    },
    {
      "name": "Sync webhooks",
      "description": "Webhooks a sync calls when records change."
    },
    {
      "name": "Sync issues",
      "description": "Records a sync could not write and how to resolve them."
    },
    {
      "name": "App schema",
      "description": "The tables and fields an app exposes, read from a connection."
    },
    {
      "name": "Workflows",
      "description": "Workflows: drafts, versions, deployments and runs on demand."
    },
    {
      "name": "Workflow runs",
      "description": "Workflow run logs: search, export, replay and resolve."
    },
    {
      "name": "Queues",
      "description": "Queues that batch records between workflows and syncs."
    },
    {
      "name": "Variables",
      "description": "Workspace variables and secrets workflows read at run time."
    },
    {
      "name": "Folders",
      "description": "Folders that organise the workspace's resources."
    },
    {
      "name": "Files",
      "description": "Files produced or consumed by workflows and Genies."
    },
    {
      "name": "Knowledge bases",
      "description": "Knowledge bases Genies read from."
    },
    {
      "name": "Knowledge base documents",
      "description": "The documents inside a knowledge base."
    },
    {
      "name": "Genies",
      "description": "Genies, the AI agents of a workspace: configuration and logs."
    },
    {
      "name": "Genie tasks",
      "description": "Scheduled tasks a Genie runs on its own."
    },
    {
      "name": "Genie access grants",
      "description": "Who may talk to a Genie and what role they act with."
    },
    {
      "name": "Genie conversations",
      "description": "Past Genie conversations, their tool executions and browser sessions."
    },
    {
      "name": "API proxies",
      "description": "Managed API proxies to your customers' apps."
    }
  ],
  "paths": {
    "/v1/workspaces": {
      "get": {
        "summary": "List workspaces",
        "operationId": "list_workspaces",
        "description": "The workspaces the API key can act in, with the caller's role in each. A workspace API key lists its own workspace.",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}": {
      "get": {
        "summary": "Get a workspace",
        "operationId": "get_workspace",
        "description": "The workspace's name, the caller's role in it and its default region (where new resources go).",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/members": {
      "get": {
        "summary": "List the members of a workspace",
        "operationId": "list_workspace_members",
        "description": "The people of the workspace with their role, and its groups with their members: the user_id and group_id an access grant names its principal by. Pending invitations are not members yet.",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceMembers"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/regions": {
      "get": {
        "summary": "List regions",
        "operationId": "list_regions",
        "description": "The regions a resource can live in. Routes acting on a regional resource take one as the `region` parameter.",
        "tags": [
          "Regions"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegionList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/folders/tree": {
      "get": {
        "summary": "Get the folder tree",
        "operationId": "get_folder_tree",
        "description": "Every folder of the workspace in one region, nested under its parent, as the web app's sidebar shows it.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderTree"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/folders/{folder_id}": {
      "get": {
        "summary": "Get a folder",
        "operationId": "get_folder",
        "description": "The folder's details in the region asked: name, resource id, parent folder and timestamps.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The folder."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Folder"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "patch": {
        "summary": "Rename a folder",
        "operationId": "update_folder",
        "description": "A name another folder has in the region of the workspace is refused with 409, as a create refuses it. With validate_only, every check runs and 204 answers, nothing is saved.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The folder."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Folder"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFolderBody"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete an empty folder",
        "operationId": "delete_folder",
        "description": "A folder that still holds sub-folders or resources is refused with 409: move or delete them first. Answers the deleted folder. With validate_only, the same checks run and 204 answers, nothing is deleted.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The folder."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "validate_only",
            "in": "query",
            "schema": {
              "default": false,
              "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
              "title": "Validate Only",
              "type": "boolean"
            },
            "required": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Folder"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/folders/root/resources": {
      "get": {
        "summary": "List the resources at the root",
        "operationId": "list_root_folder_resources",
        "description": "The workflows, syncs, connections, genies, knowledge bases, queues, variables, API proxies and folders at the root of the workspace. `limit` and `offset` apply to each resource type.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "resource_types",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "$ref": "#/components/schemas/ResourceType"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only these resource types; all types when absent",
              "title": "Resource Types"
            },
            "required": false,
            "description": "Only these resource types; all types when absent"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only resources whose name or id contains this text, searched in sub-folders too",
              "title": "Search"
            },
            "required": false,
            "description": "Only resources whose name or id contains this text, searched in sub-folders too"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderResourceList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Move resources to the root",
        "operationId": "move_resources_to_root_folder",
        "description": "Each resource leaves its folder for the root of the workspace. A retry is safe.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MovedResources"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveResourcesBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/folders/{folder_id}/resources": {
      "get": {
        "summary": "List the resources in a folder",
        "operationId": "list_folder_resources",
        "description": "What the folder holds, sub-folders included. `limit` and `offset` apply to each resource type.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The folder."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "resource_types",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "$ref": "#/components/schemas/ResourceType"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only these resource types; all types when absent",
              "title": "Resource Types"
            },
            "required": false,
            "description": "Only these resource types; all types when absent"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only resources whose name or id contains this text, searched in sub-folders too",
              "title": "Search"
            },
            "required": false,
            "description": "Only resources whose name or id contains this text, searched in sub-folders too"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderResourceList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Move resources into a folder",
        "operationId": "move_resources_to_folder",
        "description": "Each resource (from GET .../resources) is filed under the folder; a resource of another region than the folder is not moved. Moving again to the same folder changes nothing, so a retry is safe. With validate_only, the answer tells what would move, without moving anything.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The folder."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MovedResources"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveResourcesBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/folders": {
      "post": {
        "summary": "Create a folder",
        "operationId": "create_folder",
        "description": "At the root, or inside another folder of the same region (parent_folder_id). A folder_resource_id or name already used in the region of the workspace is refused with 409. With validate_only, every check runs and 204 answers, nothing is created.",
        "tags": [
          "Folders"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedFolder"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFolderBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/connections": {
      "get": {
        "summary": "List connections",
        "operationId": "list_connections",
        "description": "The connections of the workspace in one region that the caller can see: the ones they created and the ones shared with the workspace.",
        "tags": [
          "Connections"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "description": "Region of the connection: besg or usnv",
              "enum": [
                "besg",
                "usnv"
              ],
              "examples": [
                "usnv"
              ],
              "title": "Region",
              "type": "string"
            },
            "required": true,
            "description": "Region of the connection: besg or usnv"
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only the connection with exactly this name",
              "title": "Name"
            },
            "required": false,
            "description": "Only the connection with exactly this name"
          },
          {
            "name": "connection_name",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Same as name",
              "title": "Connection Name"
            },
            "required": false,
            "description": "Same as name"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only connections whose name contains this text, case-insensitive",
              "title": "Search"
            },
            "required": false,
            "description": "Only connections whose name contains this text, case-insensitive"
          },
          {
            "name": "app_type",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only connections of this app type: the type shown in Stacksync (app_type) or the underlying connector type, case-insensitive",
              "title": "App Type"
            },
            "required": false,
            "description": "Only connections of this app type: the type shown in Stacksync (app_type) or the underlying connector type, case-insensitive"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "operationId": "create_connection",
        "summary": "Create a connection",
        "description": "Create a connection to an app with the credentials given, after testing them against the app. Only the user of the API key can use the connection unless `is_shared_with_workspace` is true. Answers the connection without its secrets.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region the connection is stored in",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The connection to create",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnectionBody"
              },
              "example": {
                "connection_name": "Production Postgres",
                "is_shared_with_workspace": true,
                "app_type": "postgres",
                "credentials": {
                  "connection_string": "postgresql://sync_user:********@db.example.com:5432/crm",
                  "schema": "public"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The connection created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionDetailsResponse"
                },
                "example": {
                  "data": {
                    "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",
                    "connection_name": "Production Postgres",
                    "app_type": "postgres",
                    "is_shared_with_workspace": true,
                    "created_time": "2026-10-01 09:12:44",
                    "last_modified_time": "2026-10-01 09:12:44",
                    "credentials_options": {
                      "uses_ssh_tunnel": false,
                      "connection_mode": "direct"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; a required field is missing or of the wrong type; the app type is not supported; the credentials miss a field the app type needs; the app refused the credentials (`Error creating connection`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/connections/{connection_id}": {
      "get": {
        "summary": "Get a connection",
        "operationId": "get_connection",
        "description": "One connection, with every sync, workflow, API proxy and scheduled task that uses it and whether it can be deleted. Never its credentials.",
        "tags": [
          "Connections"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The connection."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "description": "Region of the connection: besg or usnv",
              "enum": [
                "besg",
                "usnv"
              ],
              "examples": [
                "usnv"
              ],
              "title": "Region",
              "type": "string"
            },
            "required": true,
            "description": "Region of the connection: besg or usnv"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionWithUsageResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a connection",
        "operationId": "delete_connection",
        "description": "Refused while a sync, workflow, API proxy or scheduled task uses the connection.",
        "tags": [
          "Connections"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The connection."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "description": "Region of the connection: besg or usnv",
              "enum": [
                "besg",
                "usnv"
              ],
              "examples": [
                "usnv"
              ],
              "title": "Region",
              "type": "string"
            },
            "required": true,
            "description": "Region of the connection: besg or usnv"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedConnectionResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/connections/{connection_id}/update": {
      "post": {
        "summary": "Update a connection",
        "operationId": "update_connection",
        "description": "Rename a connection, share it with the workspace, or replace its credentials (validated by the app first). Any editor who can see a connection shared with the workspace can update it.",
        "tags": [
          "Connections"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The connection."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "description": "Region of the connection: besg or usnv",
              "enum": [
                "besg",
                "usnv"
              ],
              "examples": [
                "usnv"
              ],
              "title": "Region",
              "type": "string"
            },
            "required": true,
            "description": "Region of the connection: besg or usnv"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateConnectionBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/modules/apps": {
      "get": {
        "summary": "List connector apps",
        "operationId": "list_connector_apps",
        "description": "The apps whose actions and triggers can be workflow steps, as the workflow builder lists them, with how many of each and whether they need a connection.",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "description": "Region whose catalog to read: besg or usnv",
              "enum": [
                "besg",
                "usnv"
              ],
              "examples": [
                "usnv"
              ],
              "title": "Region",
              "type": "string"
            },
            "required": true,
            "description": "Region whose catalog to read: besg or usnv"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only apps with a module whose name, type or app contains this text",
              "title": "Search"
            },
            "required": false,
            "description": "Only apps with a module whose name, type or app contains this text"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowModuleAppList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/modules/apps/{app_type}": {
      "get": {
        "summary": "Get a connector app",
        "operationId": "get_connector_app",
        "description": "One app's actions and triggers, each with the module_id and module_version the module form takes.",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "app_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The connector's app type, as listed by List connector apps."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "description": "Region whose catalog to read: besg or usnv",
              "enum": [
                "besg",
                "usnv"
              ],
              "examples": [
                "usnv"
              ],
              "title": "Region",
              "type": "string"
            },
            "required": true,
            "description": "Region whose catalog to read: besg or usnv"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowModuleAppDetail"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/modules/forms": {
      "post": {
        "summary": "Get a connector module form",
        "operationId": "get_connector_module_form",
        "description": "The form of an action or trigger, for the connection and values chosen so far (the form changes as it is filled), and the options of the dropdowns asked for: the form a workflow step or a run of the action is filled from. No workflow is needed. A read: nothing is saved.",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "description": "Region whose catalog to read: besg or usnv",
              "enum": [
                "besg",
                "usnv"
              ],
              "examples": [
                "usnv"
              ],
              "title": "Region",
              "type": "string"
            },
            "required": true,
            "description": "Region whose catalog to read: besg or usnv"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModuleForm"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetModuleFormBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/modules/runs": {
      "post": {
        "summary": "Run an action",
        "operationId": "run_connector_module",
        "description": "Run one action of an app on its own, outside any workflow, with a connection and the values of its form: the values are checked against the app's live form, then the app runs them once. A read action (get, list, search...) is open to a viewer; any other can change data in the app and needs an editor. A run the app failed or did not answer is answered with its status. With validate_only, every check runs and the answer tells what would run, nothing runs; with validate_only_for_writes, a read runs and an action that can change data only answers that dry run.",
        "tags": [
          "Connectors"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "description": "Region whose catalog to read: besg or usnv",
              "enum": [
                "besg",
                "usnv"
              ],
              "examples": [
                "usnv"
              ],
              "title": "Region",
              "type": "string"
            },
            "required": true,
            "description": "Region whose catalog to read: besg or usnv"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModuleRun"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunModuleBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/queues": {
      "get": {
        "summary": "List queues",
        "operationId": "list_queues",
        "description": "The live queues of the workspace in one region, newest first.",
        "tags": [
          "Queues"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions"
            },
            "required": true,
            "description": "Data region of the resources: besg (Europe) or usnv (United States), as GET /v1/regions lists them."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Create a queue",
        "operationId": "create_queue",
        "description": "A queue, running unless sent paused: records added by workflows (and syncs) wait in it until its flush rules send them to its consumer workflow. Send the status, rate limit and strategy of a queue read with GET to copy it. Send an Idempotency-Key to retry safely.",
        "tags": [
          "Queues"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedQueue"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQueueBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/queues/{workflows_app_queue_id}": {
      "get": {
        "summary": "Get a queue",
        "operationId": "get_queue",
        "description": "The queue, the workflows and syncs that feed it (producers) and the workflow that consumes it.",
        "tags": [
          "Queues"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_app_queue_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The queue."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueDetails"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a queue",
        "operationId": "update_queue",
        "description": "Rename a queue, pause or resume it, or change its flush rules. Only the fields sent change.",
        "tags": [
          "Queues"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_app_queue_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The queue."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queue"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQueueBody"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a queue",
        "operationId": "delete_queue",
        "description": "Its waiting records are removed; workflows using it can no longer add or receive records.",
        "tags": [
          "Queues"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_app_queue_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The queue."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedQueue"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/queues/{workflows_app_queue_id}/flush": {
      "post": {
        "summary": "Flush a queue",
        "operationId": "flush_queue",
        "description": "Send the next record_count waiting records to the queue's consumer workflow now, whatever its flush rules. A queue without a consumer workflow is refused with 409: nothing could receive the records. With validate_only, the same checks run and 204 answers, nothing is requested.",
        "tags": [
          "Queues"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_app_queue_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The queue."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueFlushRequested"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlushQueueBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/queues/{workflows_app_queue_id}/records": {
      "get": {
        "summary": "List a queue's waiting records",
        "operationId": "list_queue_records",
        "description": "The records waiting in the queue, oldest or newest first, with their payload, and how many wait in total.",
        "tags": [
          "Queues"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_app_queue_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The queue."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 20,
              "description": "Maximum number of records returned, at most 100",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of records returned, at most 100"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions"
            },
            "required": true,
            "description": "Data region of the resources: besg (Europe) or usnv (United States), as GET /v1/regions lists them."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/QueueRecordOrder",
              "default": "oldest",
              "description": "Which waiting records come first: the oldest (the next to be flushed) or the newest"
            },
            "required": false,
            "description": "Which waiting records come first: the oldest (the next to be flushed) or the newest"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueRecordList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "delete": {
        "summary": "Clear a queue's waiting records",
        "operationId": "clear_queue_records",
        "description": "Every record waiting in the queue is removed and never reaches the consumer workflow. The queue itself stays.",
        "tags": [
          "Queues"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_app_queue_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The queue."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClearedQueueRecords"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/variables": {
      "get": {
        "summary": "List variables",
        "operationId": "list_variables",
        "description": "The variables and secrets of the workspace in one region, newest first. A secret's value is never answered.",
        "tags": [
          "Variables"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions"
            },
            "required": true,
            "description": "Data region of the resources: besg (Europe) or usnv (United States), as GET /v1/regions lists them."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariableList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Create a variable",
        "operationId": "create_variable",
        "description": "A workspace variable, or a secret (is_secret: its value is encrypted and never answered again). Send an Idempotency-Key to retry safely.",
        "tags": [
          "Variables"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedVariable"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVariableBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/variables/{workflows_variable_id}": {
      "get": {
        "summary": "Get a variable",
        "operationId": "get_variable",
        "description": "A variable or secret: its value (never a secret's), type, description and reference.",
        "tags": [
          "Variables"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_variable_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The variable."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Variable"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a variable",
        "operationId": "update_variable",
        "description": "Change a variable's name, description, value or value type, or turn it into a secret (for good). Only the fields sent change. A secret's value is never read back: to change its type, send its value too.",
        "tags": [
          "Variables"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_variable_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The variable."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Variable"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVariableBody"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a variable",
        "operationId": "delete_variable",
        "description": "Delete a variable or secret; workflow steps referencing it no longer resolve it.",
        "tags": [
          "Variables"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflows_variable_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The variable."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedVariable"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/api-proxy": {
      "get": {
        "summary": "List API proxies",
        "operationId": "list_api_proxies",
        "description": "The API proxies of the workspace in one region that the caller may see (created by them, or shared), newest first.",
        "tags": [
          "API proxies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only the API proxies with exactly this name",
              "title": "Name"
            },
            "required": false,
            "description": "Only the API proxies with exactly this name"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProxyList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Create an API proxy",
        "operationId": "create_api_proxy",
        "description": "A proxy on an existing connection; its app is the connection's. The token is in this answer only. Send an Idempotency-Key to retry safely.",
        "tags": [
          "API proxies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedApiProxy"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiProxyBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/api-proxy/{api_proxy_id}": {
      "get": {
        "summary": "Get an API proxy",
        "operationId": "get_api_proxy",
        "description": "Its app, the connection it calls the app with, and whether it is shared with the workspace. Never its token.",
        "tags": [
          "API proxies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "api_proxy_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The API proxy."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProxy"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "patch": {
        "summary": "Update an API proxy",
        "operationId": "update_api_proxy",
        "description": "Rename it, share it with the workspace (or stop), or switch it to another connection. Only the fields sent change.",
        "tags": [
          "API proxies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "api_proxy_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The API proxy."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProxy"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApiProxyBody"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete an API proxy",
        "operationId": "delete_api_proxy",
        "description": "Its tokens stop working.",
        "tags": [
          "API proxies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "api_proxy_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The API proxy."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedApiProxy"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies": {
      "get": {
        "summary": "List Genies",
        "operationId": "list_genies",
        "description": "The Genies of the workspace in one region, newest first.",
        "tags": [
          "Genies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region to list: besg or usnv"
            },
            "required": true,
            "description": "Region to list: besg or usnv"
          },
          {
            "name": "folder_id",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only the genies of this folder; every genie of the workspace when absent",
              "title": "Folder Id"
            },
            "required": false,
            "description": "Only the genies of this folder; every genie of the workspace when absent"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only genies whose name contains this text",
              "title": "Search"
            },
            "required": false,
            "description": "Only genies whose name contains this text"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Create a genie",
        "operationId": "create_genie",
        "description": "The configuration's defaults are the web app's (every tool on); the description is written by Stacksync from the instructions. Send a configuration made by the genies setup wizard (genies.stacksync.com .../genies/wizard/generate-config) after filling the connection of each skill.",
        "tags": [
          "Genies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedGenie"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGenieBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/genies/{genie_id}": {
      "get": {
        "summary": "Get a Genie",
        "operationId": "get_genie",
        "description": "The Genie and its configuration.",
        "tags": [
          "Genies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genie"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a Genie",
        "operationId": "update_genie",
        "description": "Changes a Genie: name, configuration (only the keys sent), knowledge bases, who may use it, active or not.",
        "tags": [
          "Genies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genie"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGenieBody"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a Genie",
        "operationId": "delete_genie",
        "description": "Deletes a Genie, the access grants on it and its scheduled tasks.",
        "tags": [
          "Genies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedGenie"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies/{genie_id}/access-grants": {
      "post": {
        "summary": "Set a Genie access grant",
        "operationId": "set_genie_access_grant",
        "description": "Gives a user or a group a role on a Genie (operator uses it, editor changes it, owner manages its access), changes it, or removes it (role null). Who may change access is decided per genie, as in the web app: an owner of the genie, or a workspace admin adding an owner. A genie always keeps one owner.",
        "tags": [
          "Genie access grants"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieAccessGrant"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetGenieAccessGrantBody"
              }
            }
          }
        }
      },
      "get": {
        "summary": "List Genie access grants",
        "operationId": "list_genie_access_grants",
        "description": "Who holds a role on a Genie: the users and groups its sharing dialog lists, as Set a Genie access grant sets them.",
        "tags": [
          "Genie access grants"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieAccessGrantList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies/email-aliases/availability": {
      "get": {
        "summary": "Check a Genie email alias",
        "operationId": "check_genie_email_alias",
        "description": "Whether an email alias is free for a Genie's email channel (<alias>@stacksync.email); checked in every region.",
        "tags": [
          "Genies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "alias",
            "in": "query",
            "schema": {
              "description": "The part before @stacksync.email, without the @",
              "maxLength": 64,
              "minLength": 1,
              "pattern": "^[^@]+$",
              "title": "Alias",
              "type": "string"
            },
            "required": true,
            "description": "The part before @stacksync.email, without the @"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieEmailAliasAvailability"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies/{genie_id}/tasks": {
      "get": {
        "summary": "List Genie tasks",
        "operationId": "list_genie_tasks",
        "description": "The tasks of a Genie you can see: yours and the ones shared with the workspace.",
        "tags": [
          "Genie tasks"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieTaskList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Create a Genie task",
        "operationId": "create_genie_task",
        "description": "Gives a Genie a task to run once (run_at) or on a cron schedule (UTC). An editor role is required: a task makes the genie act in the apps it is connected to.",
        "tags": [
          "Genie tasks"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedGenieTask"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGenieTaskBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/genies/{genie_id}/tasks/{scheduled_task_id}": {
      "get": {
        "summary": "Get a Genie task",
        "operationId": "get_genie_task",
        "description": "One task of a Genie: its instruction, schedule (cron expression or one-time run), next run and whether it is paused.",
        "tags": [
          "Genie tasks"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "scheduled_task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie task."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieTask"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a Genie task",
        "operationId": "update_genie_task",
        "description": "Changes a Genie task: name, instruction, schedule (cron_expression or run_at), start time, paused or not.",
        "tags": [
          "Genie tasks"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "scheduled_task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie task."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieTask"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGenieTaskBody"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a Genie task",
        "operationId": "delete_genie_task",
        "description": "Deletes a Genie task and its queued run.",
        "tags": [
          "Genie tasks"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "scheduled_task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie task."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedGenieTask"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies/conversations": {
      "get": {
        "summary": "List Genie conversations",
        "operationId": "list_genie_conversations",
        "description": "The Genie conversations of a workspace in one region, newest activity first, in cursor pages.",
        "tags": [
          "Genie conversations"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions"
            },
            "required": true,
            "description": "Data region of the resources: besg (Europe) or usnv (United States), as GET /v1/regions lists them."
          },
          {
            "name": "genie_id",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only the conversations of this genie",
              "title": "Genie Id"
            },
            "required": false,
            "description": "Only the conversations of this genie"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of conversations returned, at most 100",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of conversations returned, at most 100"
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "next_cursor of the previous page",
              "title": "Cursor"
            },
            "required": false,
            "description": "next_cursor of the previous page"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieConversationList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies/conversations/{genie_conversation_id}": {
      "get": {
        "summary": "Get a Genie conversation",
        "operationId": "get_genie_conversation",
        "description": "One conversation: its messages and the customer-visible steps the Genie took. Internal steps and raw prompts are never returned.",
        "tags": [
          "Genie conversations"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie conversation."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieConversation"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies/conversations/{genie_conversation_id}/tool-executions/{execution_log_id}": {
      "get": {
        "summary": "Get a Genie tool execution",
        "operationId": "get_genie_tool_execution",
        "description": "One tool run of a conversation (a step's execution_log_id): how the tool was called and what came back.",
        "tags": [
          "Genie conversations"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie conversation."
          },
          {
            "name": "execution_log_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The tool execution, a step's execution_log_id in the conversation."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieToolExecution"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies/conversations/{genie_conversation_id}/browser-sessions/{session_id}": {
      "get": {
        "summary": "Get a Genie browser session",
        "operationId": "get_genie_browser_session",
        "description": "A browser session a Genie opened in a conversation: its status and, while live, its live view.",
        "tags": [
          "Genie conversations"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie conversation."
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The browser session, as the conversation's steps name it."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the genie: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the genie: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieBrowserSession"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/genies/{genie_id}/logs": {
      "get": {
        "summary": "List Genie logs",
        "operationId": "list_genie_logs",
        "description": "A Genie's logs by conversation: per message, what it was asked, what it answered, the tools it called and the tokens and cost used.",
        "tags": [
          "Genies"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "genie_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Genie."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions"
            },
            "required": true,
            "description": "Data region of the resources: besg (Europe) or usnv (United States), as GET /v1/regions lists them."
          },
          {
            "name": "time_range_start",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only logs at or after this time, ISO 8601 UTC",
              "title": "Time Range Start"
            },
            "required": false,
            "description": "Only logs at or after this time, ISO 8601 UTC"
          },
          {
            "name": "time_range_end",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only logs at or before this time, ISO 8601 UTC",
              "title": "Time Range End"
            },
            "required": false,
            "description": "Only logs at or before this time, ISO 8601 UTC"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenieLogs"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/knowledge-bases": {
      "get": {
        "summary": "List knowledge bases",
        "operationId": "list_knowledge_bases",
        "description": "The knowledge bases of the workspace in a region, newest first.",
        "tags": [
          "Knowledge bases"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region whose knowledge bases are listed: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region whose knowledge bases are listed: besg (Europe) or usnv (United States)"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only knowledge bases whose name contains this text",
              "title": "Search"
            },
            "required": false,
            "description": "Only knowledge bases whose name contains this text"
          },
          {
            "name": "folder_id",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only the knowledge bases of this folder",
              "title": "Folder Id"
            },
            "required": false,
            "description": "Only the knowledge bases of this folder"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Create a knowledge base",
        "operationId": "create_knowledge_base",
        "description": "Creates an empty knowledge base; add documents with Add a knowledge base document. With validate_only, the checks run and 204 answers, nothing is created.",
        "tags": [
          "Knowledge bases"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBase"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKnowledgeBaseBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/knowledge-bases/{knowledge_base_id}": {
      "get": {
        "summary": "Get a knowledge base",
        "operationId": "get_knowledge_base",
        "description": "The knowledge base and its settings.",
        "tags": [
          "Knowledge bases"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The knowledge base."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBase"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a knowledge base",
        "operationId": "update_knowledge_base",
        "description": "Renames a knowledge base or changes whether every member of the workspace may use it. With validate_only, the checks run and 204 answers, nothing changes.",
        "tags": [
          "Knowledge bases"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The knowledge base."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBase"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKnowledgeBaseBody"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a knowledge base",
        "operationId": "delete_knowledge_base",
        "description": "Deletes a knowledge base and its documents. Their files stay in the workspace's files.",
        "tags": [
          "Knowledge bases"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The knowledge base."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedKnowledgeBase"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/knowledge-bases/{knowledge_base_id}/documents": {
      "get": {
        "summary": "List knowledge base documents",
        "operationId": "list_knowledge_base_documents",
        "description": "The documents of a knowledge base, newest first, with their processing status.",
        "tags": [
          "Knowledge base documents"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The knowledge base."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of items returned, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of items returned, at most 200"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "description": "Number of items skipped before the first one returned",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            },
            "required": false,
            "description": "Number of items skipped before the first one returned"
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the knowledge base: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the knowledge base: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseDocumentList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "post": {
        "summary": "Add a knowledge base document",
        "operationId": "add_knowledge_base_document",
        "description": "Adds a file of the workspace (uploaded with the files API) to a knowledge base as a document, and processes it. The file must be a document Stacksync can read (PDF, Word, Excel, CSV, JSON, Markdown or plain text) and not already a document of the knowledge base. With validate_only, the checks run and 204 answers, nothing is added.",
        "tags": [
          "Knowledge base documents"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The knowledge base."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseDocument"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddKnowledgeBaseDocumentBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/knowledge-bases/{knowledge_base_id}/documents/{knowledge_base_document_id}": {
      "get": {
        "summary": "Get a knowledge base document",
        "operationId": "get_knowledge_base_document",
        "description": "A document of a knowledge base, with its processing status.",
        "tags": [
          "Knowledge base documents"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The knowledge base."
          },
          {
            "name": "knowledge_base_document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The document of the knowledge base."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseDocument"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      },
      "delete": {
        "summary": "Remove a knowledge base document",
        "operationId": "remove_knowledge_base_document",
        "description": "Removes a document from a knowledge base. Its file stays in the workspace's files.",
        "tags": [
          "Knowledge base documents"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The knowledge base."
          },
          {
            "name": "knowledge_base_document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The document of the knowledge base."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemovedKnowledgeBaseDocument"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/files": {
      "get": {
        "summary": "List files",
        "operationId": "list_files",
        "description": "The files of the workspace in a region, newest first.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region whose files are listed: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region whose files are listed: besg (Europe) or usnv (United States)"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only files whose name contains this text",
              "title": "Search"
            },
            "required": false,
            "description": "Only files whose name contains this text"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 50,
              "description": "Maximum number of files returned, at most 100",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of files returned, at most 100"
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 1000,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "next_cursor of the previous page; absent for the first page",
              "title": "Cursor"
            },
            "required": false,
            "description": "next_cursor of the previous page; absent for the first page"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/files/{file_id}": {
      "get": {
        "summary": "Get a file",
        "operationId": "get_file",
        "description": "A file's details. Its content is downloaded through the file proxy.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The file."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the file: besg (Europe) or usnv (United States)"
            },
            "required": true,
            "description": "Region of the file: besg (Europe) or usnv (United States)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceFile"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/metrics": {
      "get": {
        "summary": "Get sync metrics",
        "operationId": "get_sync_metrics",
        "description": "The record, issue and pending change counts of a sync, per app and table: what the sync page's Statistics tab shows.",
        "tags": [
          "Syncs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sync."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "The region of the sync"
            },
            "required": true,
            "description": "The region of the sync"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseMetrics"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/diagnostics": {
      "get": {
        "summary": "Get sync diagnostics",
        "operationId": "get_sync_diagnostics",
        "description": "The work queued, in flight, locked and waiting for a rescrape per app and table of a sync, and how much of it is stuck.",
        "tags": [
          "Syncs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sync."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "The region of the sync"
            },
            "required": true,
            "description": "The region of the sync"
          },
          {
            "name": "stuck_threshold_in_seconds",
            "in": "query",
            "schema": {
              "default": 3600,
              "description": "Work older than this is counted as stuck, in seconds",
              "minimum": 1,
              "title": "Stuck Threshold In Seconds",
              "type": "integer"
            },
            "required": false,
            "description": "Work older than this is counted as stuck, in seconds"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseDiagnostics"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/settings": {
      "patch": {
        "summary": "Update sync settings",
        "operationId": "update_sync_settings",
        "description": "Sets the sync frequency: the longest a change may wait before it is synced (0 for real time).\n\nSpecial Conditions: - 0 removes the stored delay (real time), so a sync set to 0 answers 0, as a sync never set does.",
        "tags": [
          "Syncs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sync."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "The region of the sync"
            },
            "required": true,
            "description": "The region of the sync"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseSettings"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBaseSettingsBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/apps/{app_id}/bulk-api-access": {
      "post": {
        "summary": "Set Salesforce Bulk API access",
        "operationId": "set_sync_app_bulk_api_access",
        "description": "Switches the Salesforce Bulk API on or off for one app of a sync.",
        "tags": [
          "Syncs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sync."
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One of the sync's two apps, as listed in the sync's apps."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "The region of the sync"
            },
            "required": true,
            "description": "The region of the sync"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppBulkApiAccess"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToggleBulkApiAccessBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/apps/{app_id}/cdc-method": {
      "post": {
        "summary": "Set the change capture method",
        "operationId": "set_sync_app_cdc_method",
        "description": "Sets how changes are captured from one Postgres app of a sync: triggers, or logical replication.",
        "tags": [
          "Syncs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sync."
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One of the sync's two apps, as listed in the sync's apps."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "The region of the sync"
            },
            "required": true,
            "description": "The region of the sync"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppCDCMethod"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCDCMethodBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/": {
      "get": {
        "summary": "List workflows",
        "operationId": "list_workflows",
        "description": "The workflows of the workspace the caller sees on the web app's Resources page (their own and those shared with the workspace), newest first, one page per region (or of the region asked for). Optionally only the workflows directly in a folder, or those whose name or id contains a text.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Regions"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Region to filter workflows by. If not provided, all regions will be included."
            },
            "required": false,
            "description": "Region to filter workflows by. If not provided, all regions will be included."
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": 0,
              "description": "Offset for pagination. Used to skip a number of workflows.",
              "title": "Offset"
            },
            "required": false,
            "description": "Offset for pagination. Used to skip a number of workflows."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 20,
              "description": "Maximum number of workflows of each region, at most 200",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            },
            "required": false,
            "description": "Maximum number of workflows of each region, at most 200"
          },
          {
            "name": "folder_id",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only the workflows directly in this folder",
              "title": "Folder Id"
            },
            "required": false,
            "description": "Only the workflows directly in this folder"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Only the workflows whose name, id or resource id contains this text",
              "title": "Search"
            },
            "required": false,
            "description": "Only the workflows whose name, id or resource id contains this text"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/": {
      "get": {
        "summary": "Get workflow",
        "operationId": "get_workflow",
        "description": "A version of a workflow (the latest when no version is given) with its document, and the workflow's region.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Regions"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Region to get the workflow from. If not provided, multiple regions will be searched. To increase performance, it is recommended to provide a region."
            },
            "required": false,
            "description": "Region to get the workflow from. If not provided, multiple regions will be searched. To increase performance, it is recommended to provide a region."
          },
          {
            "name": "version",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Version of the workflow to get. If not provided, the latest version will be returned.",
              "title": "Version"
            },
            "required": false,
            "description": "Version of the workflow to get. If not provided, the latest version will be returned."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowVersionWithRegion"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/versions": {
      "get": {
        "summary": "List workflow versions",
        "operationId": "list_workflow_versions",
        "description": "Every version of a workflow, newest first, as a JSON array; minimized=true leaves each version's document and options out.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Region"
            },
            "required": false,
            "description": "Data region of the resources: besg (Europe) or usnv (United States), as GET /v1/regions lists them."
          },
          {
            "name": "minimized",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "true to leave each version's document and options out",
              "title": "Minimized"
            },
            "required": false,
            "description": "true to leave each version's document and options out"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowVersionList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/info": {
      "get": {
        "summary": "Get workflow info",
        "operationId": "get_workflow_info",
        "description": "The workflow itself: name, status (running or paused), sharing, folders, apps.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workflow"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows": {
      "post": {
        "summary": "Create workflow",
        "operationId": "create_workflow",
        "description": "Create a workflow with only its Input step, as the builder's New workflow does: its other steps are saved in its draft once it exists (PATCH /draft), which sets up their triggers. A document refused leaves no workflow behind.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedWorkflow"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkflowBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/{workflow_id}": {
      "patch": {
        "summary": "Update workflow",
        "operationId": "update_workflow",
        "description": "Rename a workflow, switch it on (running) or off (paused) with its schedules and sync triggers, or share it with the workspace.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowWithRegion"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkflowBody"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete workflow",
        "operationId": "delete_workflow",
        "description": "Delete a workflow; its schedules and sync triggers stop.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowWithRegion"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/{workflow_id}/duplicate": {
      "post": {
        "summary": "Duplicate workflow",
        "operationId": "duplicate_workflow",
        "description": "Copy a version of a workflow into a new workflow (its first draft), in the same or another region, with its schedules.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedWorkflow"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DuplicateWorkflowBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/{workflow_id}/draft": {
      "patch": {
        "summary": "Save workflow draft",
        "operationId": "save_workflow_draft",
        "description": "Save a whole document over the latest draft, as the builder's Save does: the triggers of the new and changed steps (schedules, email, Gmail, queue consumers, sync triggers) are set up first, then the document is saved. A deployed latest version needs a new draft first (POST /workflows/<workflow_id>/drafts).",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDraft"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveWorkflowDraftBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/{workflow_id}/drafts": {
      "post": {
        "summary": "Create workflow draft",
        "operationId": "create_workflow_draft",
        "description": "Open a new editable draft as a copy of a version (the latest when none is given), as the web app's \"New draft\" does: each step's triggers are then updated for the new draft.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedWorkflowDraft"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkflowDraftBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/{workflow_id}/deployments": {
      "post": {
        "summary": "Deploy workflow",
        "operationId": "deploy_workflow",
        "description": "Make a version live (the latest when none is given) and set up its triggers for it in the same request: webhooks, schedules, email, Gmail, queue consumers and sync triggers start using this version.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployedWorkflowVersion"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeployWorkflowBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/{workflow_id}/options": {
      "patch": {
        "summary": "Update workflow options",
        "operationId": "update_workflow_options",
        "description": "Merge options (the builder's canvas settings) into a version; a deployed version gets a new draft. Answers the latest version without its document.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowVersion"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkflowOptionsBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs": {
      "post": {
        "summary": "Run workflow",
        "operationId": "run_workflow",
        "description": "Run a workflow now from its input step's test data, replay a finished run (all steps, failed steps, failed steps and the steps after them, up to a step, from a step), or run one step. Follow the run with list-logs.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions",
              "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
            },
            "required": true,
            "description": "Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuedRun"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunWorkflowBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/{workflow_id}/email-aliases/{alias}": {
      "get": {
        "summary": "Check a workflow email alias",
        "operationId": "check_workflow_email_alias",
        "description": "Whether <alias>@stacksync.email is free for an email trigger step of this workflow (aliases are unique across every workspace); the step's own alias counts as free.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "alias",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The email alias to check, the part before @stacksync.email."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Regions"
            },
            "required": true,
            "description": "Data region of the resources: besg (Europe) or usnv (United States), as GET /v1/regions lists them."
          },
          {
            "name": "step_id",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "The email trigger step that would use it: its own alias does not count as taken",
              "title": "Step Id"
            },
            "required": false,
            "description": "The email trigger step that would use it: its own alias does not count as taken"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailAliasAvailability"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/executions/list-logs": {
      "post": {
        "summary": "List execution logs",
        "operationId": "list_workflow_runs",
        "description": "The runs of a workflow (or of several, options.workflows) matching the log explorer's query and time range, with the sections asked for (rows, count and chart, payload keys) and the cursors of the listing mode.",
        "tags": [
          "Workflow runs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows",
              "examples": [
                "usnv"
              ],
              "title": "Region"
            },
            "required": false,
            "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionLogs"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListExecutionLogsBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/executions/logs/between": {
      "get": {
        "summary": "List workflow run step logs",
        "operationId": "list_workflow_run_logs",
        "description": "Every log of the given runs, from each run's start to its end (one entry per step with its input and output), as a JSON array ordered by created_time.",
        "tags": [
          "Workflow runs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Region of the workflow: besg or usnv. Required: without it the route answers 404",
              "examples": [
                "usnv"
              ],
              "title": "Region"
            },
            "required": false,
            "description": "Region of the workflow: besg or usnv. Required: without it the route answers 404"
          },
          {
            "name": "include_execution_ids",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "The runs, comma-separated UUIDs",
              "title": "Include Execution Ids"
            },
            "required": false,
            "description": "The runs, comma-separated UUIDs"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunLogList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/executions/export-capabilities": {
      "get": {
        "summary": "Get export capabilities",
        "operationId": "get_workflow_run_export_capabilities",
        "description": "Whether the workspace stores plaintext logs (an export then always includes the step logs) and the export limits.",
        "tags": [
          "Workflow runs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows",
              "examples": [
                "usnv"
              ],
              "title": "Region"
            },
            "required": false,
            "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportCapabilities"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/executions/batch-create": {
      "post": {
        "summary": "Replay executions",
        "operationId": "replay_workflow_runs",
        "description": "Replay chosen runs (workflow_execution_ids, or a query) with a replay mode (metadata.run_mode_details.run_mode), each with its own version or the version given.",
        "tags": [
          "Workflow runs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows",
              "examples": [
                "usnv"
              ],
              "title": "Region"
            },
            "required": false,
            "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayedRuns"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplayRunsBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/executions/batch-create-by-filter": {
      "post": {
        "summary": "Replay executions by filter",
        "operationId": "replay_workflow_runs_by_filter",
        "description": "Replay every failed run matching the log explorer's query and time range (refused above the cap).",
        "tags": [
          "Workflow runs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows",
              "examples": [
                "usnv"
              ],
              "title": "Region"
            },
            "required": false,
            "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.",
              "title": "Idempotency-Key"
            },
            "required": false,
            "description": "Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayedRuns"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplayRunsByFilterBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/workflows/id/{workflow_id}/executions/batch-resolve-by-filter": {
      "post": {
        "summary": "Resolve executions by filter",
        "operationId": "resolve_workflow_runs_by_filter",
        "description": "Mark every failed run matching the log explorer's query and time range as resolved, with every replay of each.",
        "tags": [
          "Workflow runs"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The workspace. List the ones your key can reach with GET /v1/workspaces."
          },
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The workflow."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows",
              "examples": [
                "usnv"
              ],
              "title": "Region"
            },
            "required": false,
            "description": "Region of the workflow: besg or usnv. Required, except when List workflow runs reads several workflows through options.workflows"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolvedRuns"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveRunsByFilterBody"
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/connections/{connection_id}/reauthorize": {
      "post": {
        "operationId": "reauthorize_connection",
        "summary": "Reauthorize a connection",
        "description": "Replace the credentials of a connection after testing them on the app of a sync that uses it. The test covers that sync only, not the other syncs or API proxies of the connection. Answers the connection without its secrets.",
        "tags": [
          "Connections"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "description": "The connection to reauthorize",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the resources",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The new credentials and the sync app to test them on",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReauthorizeConnectionBody"
              },
              "example": {
                "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                "app_id": "3f9a1c2e",
                "credentials": {
                  "code": "aPrxk9...",
                  "account_type": "standard"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The reauthorized connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionDetailsResponse"
                },
                "example": {
                  "data": {
                    "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",
                    "connection_name": "Salesforce production",
                    "app_type": "salesforce",
                    "is_shared_with_workspace": true,
                    "created_time": "2026-10-01 09:12:44",
                    "last_modified_time": "2026-10-01 09:12:44",
                    "credentials_options": {
                      "instance_url": "https://acme.my.salesforce.com",
                      "organization_id": "00D5g000004abcdEAA"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `connection_id` is not a UUID; a body field is missing or of the wrong type; `base_id` and `app_id` name no app of a sync of the workspace (`Error reauthorizing connection`); the credentials miss a field the app type needs (`Invalid Credentials`); `credentials.connection_id` differs from the path; the app refused the credentials (`Error Authenticating`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/helpers/app-schema": {
      "get": {
        "operationId": "get_app_schema",
        "summary": "Get an app schema",
        "description": "List the tables Stacksync can sync through a connection, with the primary key of each. Columns are not read by this route: use the generate app schema route with `table_names` to read them.",
        "tags": [
          "App schema"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the connection",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "required": true,
            "description": "The connection to read the schema through; the user of the API key must have created it or it must be shared with the workspace",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tables of the app",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSchema"
                },
                "example": {
                  "app_type": "postgres",
                  "can_create_tables": true,
                  "tables": [
                    {
                      "table_name": "accounts",
                      "table_id": "accounts",
                      "table_options": {
                        "primary_key": {
                          "column_name": "id",
                          "column_type": "uuid"
                        }
                      },
                      "columns": []
                    },
                    {
                      "table_name": "contacts",
                      "table_id": "contacts",
                      "table_options": {},
                      "columns": []
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `connection_id` is missing or not a UUID; the app does not support syncs (`App Not Supported`); the app refused the credentials (`Connection Authorization Error`); Stacksync could not connect to the app (`Connection Error`); the schema could not be read (`Error generating app schema`, `Error retrieving app schema`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "The connection does not exist in the workspace and region, or is not visible to the user of the API key (`Error retrieving connection`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/helpers/generate-app-schema": {
      "post": {
        "operationId": "generate_app_schema",
        "summary": "Generate an app schema",
        "description": "Read the tables of a connection and the columns of the tables named, so a sync can be built from exact table and column names. The credentials are read from the connection, never sent. Readable with a read-only key.",
        "tags": [
          "App schema"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the connection",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The connection and the tables to read the columns of",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateAppSchemaBody"
              },
              "example": {
                "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",
                "table_names": [
                  "accounts"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tables of the app, with the columns of the tables named",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSchema"
                },
                "example": {
                  "app_type": "postgres",
                  "can_create_tables": true,
                  "tables": [
                    {
                      "table_name": "accounts",
                      "table_id": "accounts",
                      "table_options": {
                        "primary_key": {
                          "column_name": "id",
                          "column_type": "uuid"
                        }
                      },
                      "columns": [
                        {
                          "column_name": "id",
                          "column_type": "uuid",
                          "writable": false
                        },
                        {
                          "column_name": "name",
                          "column_type": "string",
                          "writable": true
                        },
                        {
                          "column_name": "website",
                          "column_type": "string",
                          "writable": true
                        }
                      ]
                    },
                    {
                      "table_name": "contacts",
                      "table_id": "contacts",
                      "table_options": {},
                      "columns": []
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the body is not a JSON object; `connection_id` is missing or not a UUID; `table_names` is not an array of strings; the app does not support syncs (`App Not Supported`); the app refused the credentials (`Connection Authorization Error`); Stacksync could not connect to the app (`Connection Error`); the schema could not be read (`Error generating app schema`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "The connection does not exist in the workspace and region, or is not visible to the user of the API key (`Error retrieving connection`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases": {
      "get": {
        "operationId": "list_syncs",
        "summary": "List syncs",
        "description": "List the syncs of the workspace in every region, newest first, with their apps, tables, columns and settings. Deleted syncs are not listed. No `region` parameter: both regions are read.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Only the sync with exactly this name. 3 to 63 characters: unaccented letters (A-Z, a-z), numbers, underscores, dashes and spaces only; unique in the workspace",
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 63,
              "pattern": "^[A-Za-z0-9_\\- ]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The syncs of the workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncListResponse"
                },
                "example": {
                  "data": [
                    {
                      "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                      "base_name": "Salesforce accounts to Postgres",
                      "base_status": "running",
                      "base_region": "usnv",
                      "settings": {
                        "max_records_sync_delay_in_seconds": 0
                      },
                      "apps": [
                        {
                          "app_id": "3f9a1c2e",
                          "app_type": "salesforce",
                          "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",
                          "connection_name": "Salesforce production",
                          "rate_limit": {
                            "rate": 50,
                            "frequency": 1
                          },
                          "delete_protection": false,
                          "bulk_api_access": false,
                          "cdc_method": null,
                          "tables": [
                            {
                              "table_name": "Account",
                              "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                              "sync_direction": "bidirectional",
                              "columns": [
                                {
                                  "column_name": "Name",
                                  "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                                },
                                {
                                  "column_name": "Website",
                                  "column_mapping_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "app_id": "b71d04e5",
                          "app_type": "postgres",
                          "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",
                          "connection_name": "Production Postgres",
                          "rate_limit": null,
                          "delete_protection": true,
                          "bulk_api_access": false,
                          "cdc_method": "triggers",
                          "tables": [
                            {
                              "table_name": "accounts",
                              "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                              "sync_direction": "bidirectional",
                              "columns": [
                                {
                                  "column_name": "name",
                                  "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                                },
                                {
                                  "column_name": "website",
                                  "column_mapping_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`name` is not a string of 3 to 63 allowed characters (`Invalid Request Body`); the syncs could not be read (`Error retrieving bases`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create_sync",
        "summary": "Create a sync",
        "description": "Create a sync between two apps from the tables and columns you pair with mapping ids. Stacksync reads both apps, checks every table and column, creates the tables marked `create_new_table` and stores the sync switched off: switch it on with the switch route. Send `validate_only: true` to run every check and get the sync as it would be stored without creating it.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The sync to create",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSyncBody"
              },
              "example": {
                "base_name": "Salesforce accounts to Postgres",
                "base_region": "usnv",
                "base_resource_id": "salesforce_accounts_to_postgres",
                "folder_id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
                "apps": [
                  {
                    "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",
                    "tables": [
                      {
                        "table_name": "Account",
                        "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                        "sync_direction": "bidirectional",
                        "table_options": {
                          "create_new_table": false
                        },
                        "columns": [
                          {
                            "column_name": "Name",
                            "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                          },
                          {
                            "column_name": "Website",
                            "column_mapping_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
                          }
                        ]
                      }
                    ],
                    "rate_limit": {
                      "rate": 50,
                      "frequency": 1
                    }
                  },
                  {
                    "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",
                    "tables": [
                      {
                        "table_name": "accounts",
                        "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                        "sync_direction": "bidirectional",
                        "table_options": {
                          "create_new_table": true,
                          "primary_key": {
                            "column_name": "account_id",
                            "data_type": "text"
                          }
                        },
                        "columns": [
                          {
                            "column_name": "name",
                            "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                          },
                          {
                            "column_name": "website",
                            "column_mapping_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
                          }
                        ]
                      }
                    ],
                    "app_options": {
                      "delete_protection": true
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sync created (with `validate_only`, the sync as it would be stored, without `base_id`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncSchemaResponse"
                },
                "example": {
                  "data": {
                    "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                    "base_name": "Salesforce accounts to Postgres",
                    "base_region": "usnv",
                    "base_resource_id": "salesforce_accounts_to_postgres",
                    "apps": [
                      {
                        "app_id": "3f9a1c2e",
                        "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",
                        "rate_limit": {
                          "rate": 50,
                          "frequency": 1
                        },
                        "tables": [
                          {
                            "table_name": "Account",
                            "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                            "sync_direction": "bidirectional",
                            "columns": [
                              {
                                "column_name": "Name",
                                "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                              },
                              {
                                "column_name": "Website",
                                "column_mapping_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "app_id": "b71d04e5",
                        "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",
                        "tables": [
                          {
                            "table_name": "accounts",
                            "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                            "sync_direction": "bidirectional",
                            "columns": [
                              {
                                "column_name": "name",
                                "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                              },
                              {
                                "column_name": "website",
                                "column_mapping_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON; a required field is missing, of the wrong type or not allowed (`Invalid Request Body`, `Invalid Input`): `base_name`, `base_region`, `apps` with `connection_id` and `tables` of `table_name`, `table_mapping_id`, `sync_direction`, `table_options.create_new_table`; the name breaks the name rule; `base_resource_id` breaks its pattern; `folder_id` is not a folder of the workspace in the sync's region; the name or resource id is already taken (`Validation Error`); the apps are not two, the tables or columns do not pair (counts, mapping ids, directions, duplicates); a table or column does not exist in its app, a table to create already exists or its app cannot create tables, a rate limit or primary key is invalid; the app refused the credentials or could not be reached; the sync could not be created (`Error creating base`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}": {
      "get": {
        "operationId": "get_sync",
        "summary": "Get a sync",
        "description": "Read one sync with its apps, tables, columns and settings. A deleted sync is answered as not existing.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sync",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResponse"
                },
                "example": {
                  "data": {
                    "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                    "base_name": "Salesforce accounts to Postgres",
                    "base_status": "running",
                    "base_region": "usnv",
                    "settings": {
                      "max_records_sync_delay_in_seconds": 0
                    },
                    "apps": [
                      {
                        "app_id": "3f9a1c2e",
                        "app_type": "salesforce",
                        "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",
                        "connection_name": "Salesforce production",
                        "rate_limit": {
                          "rate": 50,
                          "frequency": 1
                        },
                        "delete_protection": false,
                        "bulk_api_access": false,
                        "cdc_method": null,
                        "tables": [
                          {
                            "table_name": "Account",
                            "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                            "sync_direction": "bidirectional",
                            "columns": [
                              {
                                "column_name": "Name",
                                "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                              },
                              {
                                "column_name": "Website",
                                "column_mapping_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "app_id": "b71d04e5",
                        "app_type": "postgres",
                        "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",
                        "connection_name": "Production Postgres",
                        "rate_limit": null,
                        "delete_protection": true,
                        "bulk_api_access": false,
                        "cdc_method": "triggers",
                        "tables": [
                          {
                            "table_name": "accounts",
                            "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                            "sync_direction": "bidirectional",
                            "columns": [
                              {
                                "column_name": "name",
                                "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                              },
                              {
                                "column_name": "website",
                                "column_mapping_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; no sync with this id exists in the workspace or it was deleted (`Error retrieving base`, answered with 400, not 404)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "edit_sync",
        "summary": "Edit a sync",
        "description": "Replace the mapping of a sync with the whole sync you send: read it, change tables, columns, directions, rate limits or delete protection, and send it back. A table left out of both apps is removed, a new pair is added. The sync is paused while the edit applies and restarted after it. Send `validate_only: true` to run every check without changing the sync.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The whole sync after the edit",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditSyncBody"
              },
              "example": {
                "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                "base_name": "Salesforce accounts to Postgres",
                "base_region": "usnv",
                "apps": [
                  {
                    "app_id": "3f9a1c2e",
                    "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",
                    "tables": [
                      {
                        "table_name": "Account",
                        "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                        "sync_direction": "outgoing",
                        "columns": [
                          {
                            "column_name": "Name",
                            "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "app_id": "b71d04e5",
                    "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",
                    "tables": [
                      {
                        "table_name": "accounts",
                        "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                        "sync_direction": "incoming",
                        "columns": [
                          {
                            "column_name": "name",
                            "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sync after the edit (with `validate_only`, as it would be stored)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncSchemaResponse"
                },
                "example": {
                  "data": {
                    "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                    "base_name": "Salesforce accounts to Postgres",
                    "base_region": "usnv",
                    "base_resource_id": "salesforce_accounts_to_postgres",
                    "apps": [
                      {
                        "app_id": "3f9a1c2e",
                        "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",
                        "tables": [
                          {
                            "table_name": "Account",
                            "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                            "sync_direction": "outgoing",
                            "columns": [
                              {
                                "column_name": "Name",
                                "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "app_id": "b71d04e5",
                        "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",
                        "tables": [
                          {
                            "table_name": "accounts",
                            "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",
                            "sync_direction": "incoming",
                            "columns": [
                              {
                                "column_name": "name",
                                "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON or not an object; `base_id` in the body differs from the path (`Invalid Request`); a required field is missing, of the wrong type or not allowed (`Invalid Input`): `base_id`, `base_name`, `base_region`, two `apps` each with `app_id`, `connection_id` and `tables`; an `app_id` the sync does not hold; the apps, tables or columns do not pair; a table or column does not exist in its app; a rate limit or primary key is invalid; the sync does not exist (`Error editing base`: `Base not found`); the app refused the credentials or could not be reached; the edit failed (`Error editing base`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_sync",
        "summary": "Delete a sync",
        "description": "Switch the sync off and delete it. Its data in both apps is kept; the sync's own storage is cleaned up in the background. The sync can no longer be read or listed.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sync deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedSyncResponse"
                },
                "example": {
                  "data": {
                    "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the sync could not be marked deleted (`Error setting base status to removed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No sync with this id exists in the workspace (`Base not found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/update": {
      "post": {
        "operationId": "rename_sync",
        "summary": "Rename a sync",
        "description": "Change the name of a sync. The name must follow the name rule and be free in the workspace. Send `validate_only: true` to check the name without renaming.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The new name",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameSyncBody"
              },
              "example": {
                "base_name": "Salesforce accounts to Postgres - production"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sync renamed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenamedSync"
                },
                "example": {
                  "message": "Base name updated successfully",
                  "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01"
                }
              }
            }
          },
          "204": {
            "description": "Every check passed and nothing was written (`validate_only: true`)"
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `base_name` is missing, not a string, not 3 to 63 characters or holds a character outside letters, numbers, underscores, dashes and spaces (`Invalid Request Body`); `validate_only` is not a boolean; another sync of the workspace has this name (`Validation Error`); no sync with this id exists in the workspace (`Error updating base`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/status": {
      "get": {
        "operationId": "get_sync_status",
        "summary": "Get the status of a sync",
        "description": "Read the state of a sync and whether an initial full read (backfill) is still running.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The state of the sync",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncStatusResponse"
                },
                "example": {
                  "data": {
                    "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                    "base_status": "running",
                    "backfill_in_progress": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the state could not be read (`Error retrieving base status`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No sync with this id exists in the workspace or it was deleted (`Base not found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/switch": {
      "post": {
        "operationId": "switch_sync",
        "summary": "Switch a sync on or off",
        "description": "Start or pause a sync. The sync answers in state `processing` while it starts or stops; read its status to follow. A sync switched off can be switched on again only after a short wait, which the error names in seconds.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync (its presence is checked; the value is used as given)",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The switch to apply",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchSyncBody"
              },
              "example": {
                "switch_mode": "ON"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sync after the switch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SwitchedSyncResponse"
                },
                "example": {
                  "data": {
                    "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                    "switch_mode": "ON",
                    "base_status": "processing"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing; the body is not valid JSON; `switch_mode` is missing or not `ON` or `OFF` (`Invalid Request Body`); the sync was switched off too recently to switch on (`Minimum switch on time has not passed`, the message names the seconds left); the switch failed (`Error setting base status to processing`, or the platform's error)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No sync with this id exists in the workspace (`Base not found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/apps/{app_id}/delete-protection": {
      "post": {
        "operationId": "set_sync_app_delete_protection",
        "summary": "Set delete protection of an app",
        "description": "Turn delete protection on or off for one app of the sync. With it on, a record deleted in the other app is kept in this app. Turning it off releases the deletes held back so far.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "One of the two apps of the sync, by its app_id (read it from the sync)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The setting to apply",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDeleteProtectionBody"
              },
              "example": {
                "action": "ON"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete protection set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteProtectionResult"
                },
                "example": {
                  "msg": "Successfully Toggled Delete Protection for app",
                  "app_id": "b71d04e5"
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the body is not valid JSON; `action` is not `ON` or `OFF` (`Invalid action`); `base_id` is not a UUID; `app_id` is not an app of the sync (`Invalid app_id`); the held-back deletes could not be released when turning it off (`Error notifying schedulers of delete protection being disabled`, protection stays on)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/apps/{app_id}/rate-limit": {
      "post": {
        "operationId": "set_sync_app_rate_limit",
        "summary": "Set the rate limit of an app",
        "description": "Set the most requests Stacksync makes to one app of the sync per period. The sync may stay on. Leave rate limits at Stacksync's default unless the app asks for less.",
        "tags": [
          "Syncs"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "One of the two apps of the sync, by its app_id (read it from the sync)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The rate limit",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetRateLimitBody"
              },
              "example": {
                "rate": 20,
                "frequency": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rate limit stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitResponse"
                },
                "example": {
                  "data": {
                    "rate": 20,
                    "frequency": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the body is not valid JSON; `rate` is missing or not an integer (`Invalid Request Body`); `rate` is below 1 or above 2147483647, or `frequency` is not 1, 60, 3600 or 86400 (`Error validating rate limit`); the sync does not exist in the workspace (`Error retrieving base schema`); `app_id` is not an app of the sync (`Error retrieving app schema`); the rate limit could not be stored (`Error updating the app rate limit`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/webhooks": {
      "get": {
        "operationId": "list_sync_webhooks",
        "summary": "List sync webhooks",
        "description": "List the webhooks of a sync: the URLs Stacksync posts its notifications to.",
        "tags": [
          "Sync webhooks"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The webhooks of the sync",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncWebhookListResponse"
                },
                "example": {
                  "msg": "Successfully retrieved webhooks",
                  "webhooks": [
                    {
                      "webhook_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                      "url": "https://hooks.example.com/stacksync",
                      "notification_type": "real_time_issue_notification",
                      "api_key": "whsec_7f3a9c2e4b1d"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the webhooks could not be read (`Error retrieving webhooks`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No sync with this id exists in the workspace (`Error retrieving webhooks`: `Sync does not exist.`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create_sync_webhook",
        "summary": "Create a sync webhook",
        "description": "Add a webhook to a sync. When an event of the `notification_type` happens, Stacksync posts the event as JSON to the URL with `Authorization: Bearer <api_key>`. The URL is checked to be reachable before the webhook is stored. Send `validate_only: true` to run the checks without storing.",
        "tags": [
          "Sync webhooks"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The webhook to add. The example's host hooks.example.com is a placeholder: replace it with your own HTTPS endpoint; it must resolve publicly.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncWebhookInput"
              },
              "example": {
                "url": "https://hooks.example.com/stacksync",
                "notification_type": "real_time_issue_notification",
                "api_key": "whsec_7f3a9c2e4b1d"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncWebhookResponse"
                },
                "example": {
                  "msg": "Successfully created webhook",
                  "webhook": {
                    "webhook_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                    "url": "https://hooks.example.com/stacksync",
                    "notification_type": "real_time_issue_notification",
                    "api_key": "whsec_7f3a9c2e4b1d"
                  }
                }
              }
            }
          },
          "204": {
            "description": "Every check passed and nothing was written (`validate_only: true`)"
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the body is not valid JSON; `base_id` is not a UUID; `url` is not an https URL on a public internet host, holds an unsafe character or did not answer within 2 seconds, `notification_type` is not one of the three types, `api_key` is empty (`Error validating webhook`); the sync already has a webhook of this type to this URL (`Duplicate webhook`); the webhook could not be stored (`Error creating webhook`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No sync with this id exists in the workspace (`Error creating webhook`: `Sync does not exist.`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/webhooks/{webhook_id}": {
      "get": {
        "operationId": "get_sync_webhook",
        "summary": "Get a sync webhook",
        "description": "Read one webhook of a sync.",
        "tags": [
          "Sync webhooks"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncWebhookResponse"
                },
                "example": {
                  "msg": "Successfully retrieved webhook",
                  "webhook": {
                    "webhook_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                    "url": "https://hooks.example.com/stacksync",
                    "notification_type": "real_time_issue_notification",
                    "api_key": "whsec_7f3a9c2e4b1d"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the webhook could not be read (`Error retrieving webhook`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No sync with this id exists in the workspace, or no webhook of the sync has this id (`Sync or webhook does not exist.`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "update_sync_webhook",
        "summary": "Update a sync webhook",
        "description": "Replace the URL, notification type and API key of a webhook. The URL is checked to be reachable before the change is stored. Send `validate_only: true` to run the checks without storing.",
        "tags": [
          "Sync webhooks"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook to update",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The whole webhook after the change. The example's host hooks.example.com is a placeholder: replace it with your own HTTPS endpoint; it must resolve publicly.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncWebhookInput"
              },
              "example": {
                "url": "https://hooks.example.com/stacksync",
                "notification_type": "base_activity",
                "api_key": "whsec_7f3a9c2e4b1d"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncWebhookResponse"
                },
                "example": {
                  "msg": "Successfully updated webhook",
                  "webhook": {
                    "webhook_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                    "url": "https://hooks.example.com/stacksync",
                    "notification_type": "base_activity",
                    "api_key": "whsec_7f3a9c2e4b1d"
                  }
                }
              }
            }
          },
          "204": {
            "description": "Every check passed and nothing was written (`validate_only: true`)"
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the body is not valid JSON; `base_id` is not a UUID; `url` is not an https URL on a public internet host, holds an unsafe character or did not answer within 2 seconds, `notification_type` is not one of the three types, `api_key` is empty (`Error validating webhook`); the sync already has a webhook of this type to this URL (`Duplicate webhook`); the webhook could not be stored (`Error updating webhook`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No sync with this id exists in the workspace, or no webhook of the sync has this id (`Sync or webhook does not exist.`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_sync_webhook",
        "summary": "Delete a sync webhook",
        "description": "Remove a webhook from a sync. Notifications of its type stop being posted to its URL.",
        "tags": [
          "Sync webhooks"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook to delete",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedSyncWebhook"
                },
                "example": {
                  "msg": "Successfully deleted webhook",
                  "webhook_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the webhook could not be deleted (`Error deleting webhook`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No sync with this id exists in the workspace, or no webhook of the sync has this id (`Sync or webhook does not exist.`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/triggers": {
      "get": {
        "operationId": "list_sync_triggers",
        "summary": "List sync triggers",
        "description": "List the triggers of a sync with their stored actions. A trigger whose stored action no longer exists is left out.",
        "tags": [
          "Sync triggers"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The triggers of the sync",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncTriggerListResponse"
                },
                "example": {
                  "triggers": [
                    {
                      "id": "0d1e2f3a-4b5c-4d6e-9f70-1a2b3c4d5e6f",
                      "name": "Notify on new customer accounts",
                      "trigger_type": "webhook",
                      "table": "Account",
                      "column_names_from_app": "salesforce",
                      "operations": [
                        "created",
                        "updated"
                      ],
                      "source": [
                        "salesforce"
                      ],
                      "columns_to_ignore": [
                        "Website"
                      ],
                      "filters": {
                        "type": "group",
                        "operator": "and",
                        "conditions": [
                          {
                            "type": "condition",
                            "column": "Type",
                            "operator": "eq",
                            "value": "Customer"
                          },
                          {
                            "type": "group",
                            "operator": "or",
                            "conditions": [
                              {
                                "type": "condition",
                                "column": "Rating",
                                "operator": "eq",
                                "value": "Hot"
                              },
                              {
                                "type": "condition",
                                "column": "Website",
                                "operator": "has_ch",
                                "value": ""
                              }
                            ]
                          }
                        ]
                      },
                      "is_paused": false,
                      "action": {
                        "body": "{\"url\": \"https://hooks.example.com/accounts\", \"method\": \"POST\", \"headers\": [\"Content-Type: application/json\"], \"data\": {\"record\": \"<<data>>\", \"changes\": \"<<changes>>\"}}",
                        "task_type": "http_request",
                        "options": {
                          "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                          "trigger_id": "0d1e2f3a-4b5c-4d6e-9f70-1a2b3c4d5e6f"
                        },
                        "created_time": "Thu, 01 Oct 2026 09:12:44 GMT",
                        "task_name": null,
                        "workspace_id": 2790,
                        "base_name": "Salesforce accounts to Postgres"
                      }
                    }
                  ],
                  "msg": "Triggers retrieved successfully"
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; no sync with this id exists in the workspace (`Base not found`, answered with 400)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create_sync_trigger",
        "summary": "Create a sync trigger",
        "description": "Add a trigger to a sync: when a record of the chosen table is created, updated or deleted in a source app and passes the filters, the action runs with the record (`<<data>>`) and its changes (`<<changes>>`). Send `validate_only: true` to run every check without storing.",
        "tags": [
          "Sync triggers"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The trigger to add. The example's host hooks.example.com is a placeholder: replace it with your own HTTPS endpoint; it must resolve publicly.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncTriggerInput"
              },
              "example": {
                "name": "Notify on new customer accounts",
                "trigger_type": "webhook",
                "table": "Account",
                "column_names_from_app": "salesforce",
                "operations": [
                  "created",
                  "updated"
                ],
                "source": [
                  "salesforce"
                ],
                "columns_to_ignore": [
                  "Website"
                ],
                "filters": {
                  "type": "group",
                  "operator": "and",
                  "conditions": [
                    {
                      "type": "condition",
                      "column": "Type",
                      "operator": "eq",
                      "value": "Customer"
                    },
                    {
                      "type": "group",
                      "operator": "or",
                      "conditions": [
                        {
                          "type": "condition",
                          "column": "Rating",
                          "operator": "eq",
                          "value": "Hot"
                        },
                        {
                          "type": "condition",
                          "column": "Website",
                          "operator": "has_ch",
                          "value": ""
                        }
                      ]
                    }
                  ]
                },
                "action": "curl -X POST https://hooks.example.com/accounts -H 'Content-Type: application/json' -d '{\"record\": <<data>>, \"changes\": <<changes>>}'"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The trigger created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedSyncTrigger"
                },
                "example": {
                  "id": "0d1e2f3a-4b5c-4d6e-9f70-1a2b3c4d5e6f",
                  "msg": "Trigger created successfully"
                }
              }
            }
          },
          "204": {
            "description": "Every check passed and nothing was written (`validate_only: true`)"
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the body is not valid JSON; `base_id` is not a UUID; a field is missing or of the wrong type (`Invalid Request Body`, the message names the field); `trigger_type` is not webhook, db_query or queue; a webhook `action` is not one cURL command with one http(s) URL on a public host, or a word of it would not be sent; a `db_query` query is blank; `column_names_from_app`, `table`, a column of `columns_to_ignore` or of a condition is not in the sync; `source` names an app the sync does not read changes from on this table; both apps have the same type and an app type instead of an `app_id` was sent; a filter has a wrong structure, an unknown operator, a regular expression that does not compile or a non-number on a numeric column (the message is the error); the trigger could not be stored (`Error creating trigger`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`; a `db_query` `connection_id` is not a connection of the workspace in the sync's region (`Invalid connection_id`), or a `queue` `queue_id` is not a queue of the workspace (`Invalid queue_id`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/triggers/{trigger_id}": {
      "get": {
        "operationId": "get_sync_trigger",
        "summary": "Get a sync trigger",
        "description": "Read one trigger of a sync with its stored action.",
        "tags": [
          "Sync triggers"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "trigger_id",
            "in": "path",
            "required": true,
            "description": "The trigger",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The trigger",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncTriggerResponse"
                },
                "example": {
                  "trigger": {
                    "id": "0d1e2f3a-4b5c-4d6e-9f70-1a2b3c4d5e6f",
                    "name": "Notify on new customer accounts",
                    "trigger_type": "webhook",
                    "table": "Account",
                    "column_names_from_app": "salesforce",
                    "operations": [
                      "created",
                      "updated"
                    ],
                    "source": [
                      "salesforce"
                    ],
                    "columns_to_ignore": [
                      "Website"
                    ],
                    "filters": {
                      "type": "group",
                      "operator": "and",
                      "conditions": [
                        {
                          "type": "condition",
                          "column": "Type",
                          "operator": "eq",
                          "value": "Customer"
                        },
                        {
                          "type": "group",
                          "operator": "or",
                          "conditions": [
                            {
                              "type": "condition",
                              "column": "Rating",
                              "operator": "eq",
                              "value": "Hot"
                            },
                            {
                              "type": "condition",
                              "column": "Website",
                              "operator": "has_ch",
                              "value": ""
                            }
                          ]
                        }
                      ]
                    },
                    "is_paused": false,
                    "action": {
                      "body": "{\"url\": \"https://hooks.example.com/accounts\", \"method\": \"POST\", \"headers\": [\"Content-Type: application/json\"], \"data\": {\"record\": \"<<data>>\", \"changes\": \"<<changes>>\"}}",
                      "task_type": "http_request",
                      "options": {
                        "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                        "trigger_id": "0d1e2f3a-4b5c-4d6e-9f70-1a2b3c4d5e6f"
                      },
                      "created_time": "Thu, 01 Oct 2026 09:12:44 GMT",
                      "task_name": null,
                      "workspace_id": 2790,
                      "base_name": "Salesforce accounts to Postgres",
                      "task_metadata_id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e"
                    }
                  },
                  "msg": "Trigger retrieved successfully"
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the stored action could not be read (`Error getting query details`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No trigger of the sync has this id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerNotFound"
                },
                "example": {
                  "msg": "Trigger not found"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "update_sync_trigger",
        "summary": "Update a sync trigger",
        "description": "Replace a trigger of a sync with the whole trigger you send; the trigger keeps its id. Send `validate_only: true` to run every check without storing.",
        "tags": [
          "Sync triggers"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "trigger_id",
            "in": "path",
            "required": true,
            "description": "The trigger to update",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The whole trigger after the change. The example's host hooks.example.com is a placeholder: replace it with your own HTTPS endpoint; it must resolve publicly.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncTriggerInput"
              },
              "example": {
                "name": "Notify on new customer accounts",
                "trigger_type": "webhook",
                "table": "Account",
                "column_names_from_app": "salesforce",
                "operations": [
                  "created"
                ],
                "source": [
                  "salesforce"
                ],
                "columns_to_ignore": [
                  "Website"
                ],
                "filters": {
                  "type": "group",
                  "operator": "and",
                  "conditions": [
                    {
                      "type": "condition",
                      "column": "Type",
                      "operator": "eq",
                      "value": "Customer"
                    },
                    {
                      "type": "group",
                      "operator": "or",
                      "conditions": [
                        {
                          "type": "condition",
                          "column": "Rating",
                          "operator": "eq",
                          "value": "Hot"
                        },
                        {
                          "type": "condition",
                          "column": "Website",
                          "operator": "has_ch",
                          "value": ""
                        }
                      ]
                    }
                  ]
                },
                "action": "curl -X POST https://hooks.example.com/accounts -H 'Content-Type: application/json' -d '{\"record\": <<data>>, \"changes\": <<changes>>}'"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The trigger updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncTriggerMessage"
                },
                "example": {
                  "msg": "Trigger updated successfully"
                }
              }
            }
          },
          "204": {
            "description": "Every check passed and nothing was written (`validate_only: true`)"
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the body is not valid JSON; `base_id` is not a UUID; a field is missing or of the wrong type (`Invalid Request Body`, the message names the field); `trigger_type` is not webhook, db_query or queue; a webhook `action` is not one cURL command with one http(s) URL on a public host, or a word of it would not be sent; a `db_query` query is blank; `column_names_from_app`, `table`, a column of `columns_to_ignore` or of a condition is not in the sync; `source` names an app the sync does not read changes from on this table; both apps have the same type and an app type instead of an `app_id` was sent; a filter has a wrong structure, an unknown operator, a regular expression that does not compile or a non-number on a numeric column (the message is the error); the trigger could not be stored (`Error updating trigger`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`; a `db_query` `connection_id` is not a connection of the workspace in the sync's region (`Invalid connection_id`), or a `queue` `queue_id` is not a queue of the workspace (`Invalid queue_id`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No trigger of the sync has this id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerNotFound"
                },
                "example": {
                  "msg": "Trigger not found"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_sync_trigger",
        "summary": "Delete a sync trigger",
        "description": "Remove a trigger from a sync, with its stored action.",
        "tags": [
          "Sync triggers"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "trigger_id",
            "in": "path",
            "required": true,
            "description": "The trigger to delete",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The trigger deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncTriggerMessage"
                },
                "example": {
                  "msg": "Trigger deleted successfully"
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the trigger could not be deleted (`Error deleting trigger`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No trigger of the sync has this id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerNotFound"
                },
                "example": {
                  "msg": "Trigger not found"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/bases/{base_id}/triggers/{trigger_id}/update-status": {
      "post": {
        "operationId": "update_sync_trigger_status",
        "summary": "Pause or resume a sync trigger",
        "description": "Pause a trigger so it stops running, or resume it. A paused trigger keeps its definition.",
        "tags": [
          "Sync triggers"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "base_id",
            "in": "path",
            "required": true,
            "description": "The sync (a sync is called a base in these paths)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "trigger_id",
            "in": "path",
            "required": true,
            "description": "The trigger",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the sync",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Pause or resume",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSyncTriggerStatusBody"
              },
              "example": {
                "action": "pause"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The trigger paused or resumed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncTriggerMessage"
                },
                "example": {
                  "msg": "Trigger status updated successfully"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON; `action` is missing or not `pause` or `unpause` (`Invalid action`); The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the trigger could not be read or changed (`An error occurred while fetching the trigger`, `Error pausing trigger`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "No trigger of the sync has this id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerNotFound"
                },
                "example": {
                  "msg": "Trigger not found"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/issues": {
      "get": {
        "operationId": "list_sync_issues",
        "summary": "List sync issues",
        "description": "List the record changes the syncs of the workspace could not write, newest first, one page at a time. Filter by sync, destination app, table or one issue id.",
        "tags": [
          "Sync issues"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the syncs",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          },
          {
            "name": "base_id",
            "in": "query",
            "required": false,
            "description": "Only the issues of this sync",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sync_id",
            "in": "query",
            "required": false,
            "description": "Same as `base_id`; `base_id` wins when both are sent",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "app_id",
            "in": "query",
            "required": false,
            "description": "Only the issues whose destination is this app of the sync (filtered on the page read, so a page can come back shorter)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table_id",
            "in": "query",
            "required": false,
            "description": "Only the issues of this table pair (its `table_mapping_id`)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "issue_id",
            "in": "query",
            "required": false,
            "description": "Only this issue",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "ordering_property",
            "in": "query",
            "required": false,
            "description": "The time the issues are ordered by",
            "schema": {
              "type": "string",
              "enum": [
                "created_time",
                "last_modified_time"
              ],
              "default": "last_modified_time"
            }
          },
          {
            "name": "ordering_direction",
            "in": "query",
            "required": false,
            "description": "The order",
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ],
              "default": "DESC"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "required": false,
            "description": "The page to read, counted from 0",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Issues per page, 1 to 1000",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of issues",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncIssueListResponse"
                },
                "example": {
                  "data": [
                    {
                      "issue_id": "4c5d6e7f-8a9b-4c0d-9e1f-2a3b4c5d6e7f",
                      "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                      "destination_app_id": "b71d04e5",
                      "destination_app_type": "postgres",
                      "destination_table_id": "accounts",
                      "destination_table_name": "accounts",
                      "action": "update",
                      "issue_message": "value too long for type character varying(80)",
                      "changed_columns": {
                        "website": "https://www.example.com/a-very-long-path-that-does-not-fit-the-column"
                      },
                      "source_record_id": "001Hs00001ZXkQ9IAL",
                      "destination_record_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
                      "created_time": "2026-10-01T09:12:44",
                      "last_modified_time": "2026-10-01T09:12:44"
                    }
                  ],
                  "pagination": {
                    "current_page": 0,
                    "total_pages": 0
                  },
                  "total_number_of_issues": 1
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `issue_id` or `base_id` is not a UUID, `page_number` is not an integer of 0 or more, `page_size` is not an integer of 1 to 1000, `ordering_property` or `ordering_direction` is not one of its values (`Invalid Request Params`); the issues could not be read (`Failed to get issues`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/issues/action": {
      "post": {
        "operationId": "resolve_sync_issues",
        "summary": "Resolve sync issues",
        "description": "Retry, revert or ignore issues: the ones listed by id, or with `all_issues: true` every issue of a sync or of one of its tables. Retrying writes the change again; reverting restores the record from the destination app; ignoring closes the issue.",
        "tags": [
          "Sync issues"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the syncs",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The issues and the action",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveSyncIssuesBody"
              },
              "examples": {
                "listed_issues": {
                  "summary": "Act on the issues listed by id",
                  "value": {
                    "ids": [
                      "4c5d6e7f-8a9b-4c0d-9e1f-2a3b4c5d6e7f"
                    ],
                    "action": "retry"
                  }
                },
                "all_issues_of_a_sync": {
                  "summary": "Act on every issue of a sync (ids must not be sent)",
                  "value": {
                    "all_issues": true,
                    "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
                    "action": "retry"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the action did",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolvedSyncIssuesResponse"
                },
                "example": {
                  "data": {
                    "ids": [
                      "4c5d6e7f-8a9b-4c0d-9e1f-2a3b4c5d6e7f"
                    ],
                    "success_issue_count": 1,
                    "failed_issue_count": 0,
                    "error_list": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; the body is not valid JSON; `ids` is missing, empty or holds a non-UUID, `action` is not retry, ignore or revert, `all_issues` is sent with `ids` or without a UUID `base_id` (`Invalid Request Body`); an id names no issue of the workspace (`Invalid error ids.`, the message lists them); the issues of the sync could not be read (`Error retrieving issues`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "404": {
            "description": "The workspace has no sync with issues to act on (`issues not found`), or `base_id` of `all_issues` is not a sync of the workspace in this region (`Base not found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/api-proxy/{api_proxy_id}/regenerate-token": {
      "post": {
        "operationId": "regenerate_api_proxy_token",
        "summary": "Regenerate an API proxy token",
        "description": "Issue a new token for an API proxy and answer it once. The previous token stops working within a minute. No request body.",
        "tags": [
          "API proxies"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "The workspace the resources belong to",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "api_proxy_id",
            "in": "path",
            "required": true,
            "description": "The API proxy; it must be yours or shared with the workspace",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "Data region of the API proxy",
            "schema": {
              "type": "string",
              "enum": [
                "besg",
                "usnv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The API proxy with its new token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProxyToken"
                },
                "example": {
                  "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",
                  "api_proxy_id": "5d6e7f80-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
                  "api_proxy_name": "Salesforce proxy",
                  "app_type": "salesforce",
                  "created_by": 1042,
                  "created_time": "Thu, 01 Oct 2026 09:12:44 GMT",
                  "last_modified_by": 1042,
                  "last_modified_time": "Thu, 01 Oct 2026 09:12:44 GMT",
                  "api_proxy_token": "Sal14vJofWyng01XMObTm6lO6rDljwaLjMo-CSiS0xAphug-Kz4tgkP3nZjrv0UQORt0A"
                }
              }
            }
          },
          "400": {
            "description": "The `region` is missing or not one of besg, usnv; `api_proxy_id` is not a UUID; no API proxy with this id exists in the workspace and region, or it is not visible to the user of the API key (`Error Getting API Proxy Services`, answered with 400); the token could not be stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentedError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UpdateWorkflowOptionsBody": {
        "additionalProperties": false,
        "properties": {
          "version": {
            "description": "The version whose options change; a deployed version gets a new draft",
            "title": "Version",
            "type": "string"
          },
          "options": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "description": "The builder's canvas settings, merged over the stored ones",
            "title": "Options",
            "type": "object"
          }
        },
        "required": [
          "version",
          "options"
        ],
        "title": "UpdateWorkflowOptionsBody",
        "type": "object"
      },
      "ApiProxyList": {
        "properties": {
          "api_proxy_services": {
            "items": {
              "$ref": "#/components/schemas/ApiProxy"
            },
            "title": "Api Proxy Services",
            "type": "array"
          }
        },
        "required": [
          "api_proxy_services"
        ],
        "title": "ApiProxyList",
        "type": "object"
      },
      "Error": {
        "additionalProperties": false,
        "description": "The body of every error answer of a public route (also the error model of the generated OpenAPI spec)",
        "properties": {
          "error": {
            "title": "Error",
            "type": "string"
          },
          "msg": {
            "title": "Msg",
            "type": "string"
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Field"
          }
        },
        "required": [
          "error",
          "msg"
        ],
        "title": "Error",
        "type": "object"
      },
      "ApiProxy": {
        "properties": {
          "connection_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Id"
          },
          "api_proxy_id": {
            "title": "Api Proxy Id",
            "type": "string"
          },
          "api_proxy_name": {
            "title": "Api Proxy Name",
            "type": "string"
          },
          "api_proxy_resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Answered by GET /api-proxy/<api_proxy_id>; null in the list, whose core does not select it",
            "title": "Api Proxy Resource Id"
          },
          "app_type": {
            "title": "App Type",
            "type": "string"
          },
          "connection_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Name"
          },
          "is_shared_with_workspace": {
            "description": "Every workspace member may use the proxy, not only its creator",
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "max_objects_per_request": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The workspace plan's limit of objects per proxied request; null in the list",
            "title": "Max Objects Per Request"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder of the proxy; null at the root, and in the list",
            "title": "Parent Folder Id"
          },
          "created_by": {
            "title": "Created By",
            "type": "integer"
          },
          "created_time": {
            "description": "HTTP date (RFC 9110), UTC",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_by": {
            "title": "Last Modified By",
            "type": "integer"
          },
          "last_modified_time": {
            "description": "HTTP date (RFC 9110), UTC",
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "connection_id",
          "api_proxy_id",
          "api_proxy_name",
          "api_proxy_resource_id",
          "app_type",
          "connection_name",
          "is_shared_with_workspace",
          "max_objects_per_request",
          "parent_folder_id",
          "created_by",
          "created_time",
          "last_modified_by",
          "last_modified_time",
          "region"
        ],
        "title": "ApiProxy",
        "type": "object"
      },
      "CreateApiProxyBody": {
        "examples": [
          {
            "api_proxy_name": "Salesforce Proxy",
            "connection_id": "6f1c2a9e-4b7d-4e3a-9c5f-2d8b1e7a4c60"
          }
        ],
        "properties": {
          "connection_id": {
            "description": "The connection the proxy calls the app with; its app is the proxy's app",
            "format": "uuid4",
            "title": "Connection Id",
            "type": "string"
          },
          "api_proxy_name": {
            "anyOf": [
              {
                "maxLength": 63,
                "minLength": 3,
                "pattern": "^[A-Za-z][A-Za-z0-9_\\- ]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "3 to 63 characters: a letter first, then letters, digits, spaces, _ and -; unique among the API proxies of the workspace in the region; generated when absent",
            "title": "Api Proxy Name"
          },
          "is_shared_with_workspace": {
            "default": false,
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "api_proxy_resource_id": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9_]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Api Proxy Resource Id"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The folder to create the proxy in, the root when absent",
            "title": "Parent Folder Id"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "connection_id"
        ],
        "title": "CreateApiProxyBody",
        "type": "object"
      },
      "CreatedApiProxy": {
        "properties": {
          "connection_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Id"
          },
          "api_proxy_id": {
            "title": "Api Proxy Id",
            "type": "string"
          },
          "api_proxy_name": {
            "title": "Api Proxy Name",
            "type": "string"
          },
          "api_proxy_resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Answered by GET /api-proxy/<api_proxy_id>; null in the list, whose core does not select it",
            "title": "Api Proxy Resource Id"
          },
          "app_type": {
            "title": "App Type",
            "type": "string"
          },
          "connection_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Name"
          },
          "is_shared_with_workspace": {
            "description": "Every workspace member may use the proxy, not only its creator",
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "max_objects_per_request": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The workspace plan's limit of objects per proxied request; null in the list",
            "title": "Max Objects Per Request"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder of the proxy; null at the root, and in the list",
            "title": "Parent Folder Id"
          },
          "created_by": {
            "title": "Created By",
            "type": "integer"
          },
          "created_time": {
            "description": "HTTP date (RFC 9110), UTC",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_by": {
            "title": "Last Modified By",
            "type": "integer"
          },
          "last_modified_time": {
            "description": "HTTP date (RFC 9110), UTC",
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "api_proxy_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "is_secret": true,
            "title": "Api Proxy Token"
          }
        },
        "required": [
          "connection_id",
          "api_proxy_id",
          "api_proxy_name",
          "api_proxy_resource_id",
          "app_type",
          "connection_name",
          "is_shared_with_workspace",
          "max_objects_per_request",
          "parent_folder_id",
          "created_by",
          "created_time",
          "last_modified_by",
          "last_modified_time",
          "region",
          "api_proxy_token"
        ],
        "title": "CreatedApiProxy",
        "type": "object"
      },
      "UpdateApiProxyBody": {
        "examples": [
          {
            "api_proxy_name": "Salesforce Proxy"
          }
        ],
        "properties": {
          "api_proxy_name": {
            "anyOf": [
              {
                "maxLength": 63,
                "minLength": 3,
                "pattern": "^[A-Za-z][A-Za-z0-9_\\- ]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "3 to 63 characters: a letter first, then letters, digits, spaces, _ and -; unique among the API proxies of the workspace in the region",
            "title": "Api Proxy Name"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "connection_id": {
            "anyOf": [
              {
                "format": "uuid4",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Switch the proxy to another connection of the same app",
            "title": "Connection Id"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "UpdateApiProxyBody",
        "type": "object"
      },
      "DeletedApiProxy": {
        "properties": {
          "api_proxy_id": {
            "title": "Api Proxy Id",
            "type": "string"
          }
        },
        "required": [
          "api_proxy_id"
        ],
        "title": "DeletedApiProxy",
        "type": "object"
      },
      "ConnectionListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Connection"
            },
            "title": "Data",
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "ConnectionListResponse",
        "type": "object"
      },
      "ConnectionWithUsageResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ConnectionWithUsage"
          }
        },
        "required": [
          "data"
        ],
        "title": "ConnectionWithUsageResponse",
        "type": "object"
      },
      "UpdateConnectionBody": {
        "examples": [
          {
            "connection_name": "Production Postgres"
          }
        ],
        "properties": {
          "connection_name": {
            "anyOf": [
              {
                "maxLength": 63,
                "minLength": 3,
                "pattern": "^[A-Za-z0-9_\\- ]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The new name: letters, numbers, dashes, underscores and spaces, 3 to 63 characters",
            "title": "Connection Name"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "True to share the connection with every member of the workspace",
            "title": "Is Shared With Workspace"
          },
          "credentials": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The new credentials of the app",
            "title": "Credentials"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "UpdateConnectionBody",
        "type": "object"
      },
      "ConnectionResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Connection"
          }
        },
        "required": [
          "data"
        ],
        "title": "ConnectionResponse",
        "type": "object"
      },
      "DeletedConnectionResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DeletedConnection"
          }
        },
        "required": [
          "data"
        ],
        "title": "DeletedConnectionResponse",
        "type": "object"
      },
      "FileList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceFile"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more files may follow this page: request the next one with cursor = next_cursor",
            "title": "Has More",
            "type": "boolean"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass as cursor to get the next page; null on the last page",
            "title": "Next Cursor"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "title": "FileList",
        "type": "object"
      },
      "WorkspaceFile": {
        "description": "A file stored in the workspace (a knowledge base document, a genie attachment, an upload)",
        "properties": {
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "mime_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mime Type"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "source_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Id of the resource the file belongs to, null when it belongs to none",
            "title": "Source Ref"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "region": {
            "title": "Region",
            "type": "string"
          }
        },
        "required": [
          "file_id",
          "name",
          "mime_type",
          "size_bytes",
          "tags",
          "source",
          "source_ref",
          "created_at",
          "region"
        ],
        "title": "WorkspaceFile",
        "type": "object"
      },
      "FolderTree": {
        "description": "Every folder of the workspace in one region, nested under its parent",
        "properties": {
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "folders": {
            "description": "The folders at the root, each with its sub-folders",
            "items": {
              "$ref": "#/components/schemas/FolderTreeNode"
            },
            "title": "Folders",
            "type": "array"
          }
        },
        "required": [
          "region",
          "folders"
        ],
        "title": "FolderTree",
        "type": "object"
      },
      "Folder": {
        "description": "A folder of the workspace",
        "properties": {
          "folder_id": {
            "title": "Folder Id",
            "type": "string"
          },
          "folder_name": {
            "title": "Folder Name",
            "type": "string"
          },
          "folder_resource_id": {
            "title": "Folder Resource Id",
            "type": "string"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder it is in; None at the root",
            "title": "Parent Folder Id"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "folder_id",
          "folder_name",
          "folder_resource_id",
          "parent_folder_id",
          "region"
        ],
        "title": "Folder",
        "type": "object"
      },
      "FolderResourceList": {
        "description": "The resources of a folder, page by page: `limit` and `offset` apply to each resource type, as the web app pages each\nsection of a folder; `has_more` tells whether any type has more",
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/FolderResource"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total_count": {
            "description": "How many resources of the requested types the folder holds (the matches of a search), across every page",
            "title": "Total Count",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset",
          "total_count"
        ],
        "title": "FolderResourceList",
        "type": "object"
      },
      "CreateFolderBody": {
        "additionalProperties": false,
        "properties": {
          "folder_name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Folder Name",
            "type": "string"
          },
          "folder_resource_id": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9_]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A unique, readable id of the folder in the region of the workspace (lowercase letters, digits and _); derived from the name when absent",
            "title": "Folder Resource Id"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The folder to create it in; the root when absent",
            "title": "Parent Folder Id"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "folder_name"
        ],
        "title": "CreateFolderBody",
        "type": "object"
      },
      "CreatedFolder": {
        "properties": {
          "folder_id": {
            "title": "Folder Id",
            "type": "string"
          },
          "folder_name": {
            "title": "Folder Name",
            "type": "string"
          },
          "folder_resource_id": {
            "title": "Folder Resource Id",
            "type": "string"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder it is in; None at the root",
            "title": "Parent Folder Id"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "folder_id",
          "folder_name",
          "folder_resource_id",
          "parent_folder_id",
          "region"
        ],
        "title": "CreatedFolder",
        "type": "object"
      },
      "UpdateFolderBody": {
        "additionalProperties": false,
        "properties": {
          "folder_name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Folder Name",
            "type": "string"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "folder_name"
        ],
        "title": "UpdateFolderBody",
        "type": "object"
      },
      "MoveResourcesBody": {
        "additionalProperties": false,
        "properties": {
          "resources": {
            "items": {
              "$ref": "#/components/schemas/ResourceToMove"
            },
            "maxItems": 200,
            "minItems": 1,
            "title": "Resources",
            "type": "array"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the move and answer what would move and what would not, with why, without moving anything: a refused request answers the error the move would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "resources"
        ],
        "title": "MoveResourcesBody",
        "type": "object"
      },
      "MovedResources": {
        "description": "The outcome of a move: each resource is moved on its own, so some can fail while others move",
        "properties": {
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The destination folder; None for the root",
            "title": "Folder Id"
          },
          "moved": {
            "items": {
              "$ref": "#/components/schemas/MovedResource"
            },
            "title": "Moved",
            "type": "array"
          },
          "failed": {
            "items": {
              "$ref": "#/components/schemas/ResourceNotMoved"
            },
            "title": "Failed",
            "type": "array"
          }
        },
        "required": [
          "folder_id",
          "moved",
          "failed"
        ],
        "title": "MovedResources",
        "type": "object"
      },
      "GenieList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/GenieSummary"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset"
        ],
        "title": "GenieList",
        "type": "object"
      },
      "Genie": {
        "description": "A genie, as a create or an update takes it back",
        "properties": {
          "genie_id": {
            "title": "Genie Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Folder Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "public_access_rights": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Public Access Rights"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "has_api_key": {
            "description": "Whether an LLM API key of yours is stored (the key itself is never returned)",
            "title": "Has Api Key",
            "type": "boolean"
          },
          "genie_config": {
            "$ref": "#/components/schemas/GenieConfigDocument"
          },
          "knowledge_bases": {
            "items": {
              "$ref": "#/components/schemas/GenieKnowledgeBaseDocument"
            },
            "title": "Knowledge Bases",
            "type": "array"
          },
          "created_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Created Time"
          },
          "last_modified_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Last Modified Time"
          }
        },
        "required": [
          "genie_id",
          "name",
          "region",
          "has_api_key",
          "genie_config",
          "knowledge_bases"
        ],
        "title": "Genie",
        "type": "object"
      },
      "CreateGenieBody": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "Unique among the workspace's genies of the region",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "folder_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The folder to create it in; the root when absent",
            "title": "Folder Id"
          },
          "is_shared_with_workspace": {
            "default": true,
            "description": "Whether every member of the workspace sees it",
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "genie_config": {
            "$ref": "#/components/schemas/GenieConfigInput"
          },
          "knowledge_bases": {
            "items": {
              "$ref": "#/components/schemas/GenieKnowledgeBaseDocument"
            },
            "title": "Knowledge Bases",
            "type": "array"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateGenieBody",
        "type": "object"
      },
      "CreatedGenie": {
        "properties": {
          "genie_id": {
            "title": "Genie Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Folder Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "public_access_rights": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Public Access Rights"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "has_api_key": {
            "description": "Whether an LLM API key of yours is stored (the key itself is never returned)",
            "title": "Has Api Key",
            "type": "boolean"
          },
          "genie_config": {
            "$ref": "#/components/schemas/GenieConfigDocument"
          },
          "knowledge_bases": {
            "items": {
              "$ref": "#/components/schemas/GenieKnowledgeBaseDocument"
            },
            "title": "Knowledge Bases",
            "type": "array"
          },
          "created_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Created Time"
          },
          "last_modified_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Last Modified Time"
          }
        },
        "required": [
          "genie_id",
          "name",
          "region",
          "has_api_key",
          "genie_config",
          "knowledge_bases"
        ],
        "title": "CreatedGenie",
        "type": "object"
      },
      "UpdateGenieBody": {
        "additionalProperties": false,
        "examples": [
          {
            "name": "Support Genie"
          }
        ],
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "genie_config": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenieConfigChanges"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "knowledge_bases": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GenieKnowledgeBaseDocument"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Replaces the list",
            "title": "Knowledge Bases"
          },
          "public_access_rights": {
            "anyOf": [
              {
                "enum": [
                  "allow_without_authorization",
                  "allow_with_authorization",
                  "allow_selected_users_and_groups"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Who may use the genie",
            "title": "Public Access Rights"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "active",
                  "inactive"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "active or inactive",
            "title": "Status"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "UpdateGenieBody",
        "type": "object"
      },
      "DeletedGenie": {
        "properties": {
          "deleted_genie_id": {
            "title": "Deleted Genie Id",
            "type": "string"
          }
        },
        "required": [
          "deleted_genie_id"
        ],
        "title": "DeletedGenie",
        "type": "object"
      },
      "SetGenieAccessGrantBody": {
        "additionalProperties": false,
        "properties": {
          "principal": {
            "$ref": "#/components/schemas/GenieAccessPrincipal"
          },
          "role": {
            "anyOf": [
              {
                "enum": [
                  "operator",
                  "editor",
                  "owner"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The role to give; null removes the principal",
            "title": "Role"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "principal",
          "role"
        ],
        "title": "SetGenieAccessGrantBody",
        "type": "object"
      },
      "GenieAccessGrant": {
        "properties": {
          "genie_id": {
            "title": "Genie Id",
            "type": "string"
          },
          "principal": {
            "$ref": "#/components/schemas/GenieAccessPrincipal"
          },
          "role": {
            "anyOf": [
              {
                "enum": [
                  "operator",
                  "editor",
                  "owner"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "required": [
          "genie_id",
          "principal",
          "role"
        ],
        "title": "GenieAccessGrant",
        "type": "object"
      },
      "GenieAccessGrantList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/GenieAccessGrantSummary"
            },
            "title": "Data",
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "GenieAccessGrantList",
        "type": "object"
      },
      "GenieEmailAliasAvailability": {
        "properties": {
          "alias": {
            "title": "Alias",
            "type": "string"
          },
          "is_available": {
            "title": "Is Available",
            "type": "boolean"
          },
          "address": {
            "title": "Address",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Why the alias cannot be used, or with whom it is shared; null when it is free",
            "title": "Reason"
          }
        },
        "required": [
          "alias",
          "is_available",
          "address"
        ],
        "title": "GenieEmailAliasAvailability",
        "type": "object"
      },
      "GenieTaskList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/GenieTask"
            },
            "title": "Data",
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "GenieTaskList",
        "type": "object"
      },
      "GenieTask": {
        "description": "A task a genie runs once (run_at) or on a cron schedule",
        "properties": {
          "task_id": {
            "title": "Task Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "instruction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "What the genie is asked each time",
            "title": "Instruction"
          },
          "cron_expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Cron Expression"
          },
          "run_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "For a one-time task: when it runs, ISO 8601",
            "title": "Run At"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "For a scheduled task: when the schedule starts",
            "title": "Start Time"
          },
          "next_run_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Next Run Time"
          },
          "is_paused": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Paused"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Created Time"
          }
        },
        "required": [
          "task_id"
        ],
        "title": "GenieTask",
        "type": "object"
      },
      "CreateGenieTaskBody": {
        "additionalProperties": false,
        "examples": [
          {
            "cron_expression": "0 8 * * 1-5",
            "instruction": "Summarize the deals that changed stage yesterday",
            "name": "Weekday sales summary"
          }
        ],
        "properties": {
          "name": {
            "description": "Unique among the workspace's cron tasks of the region",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "instruction": {
            "description": "What the genie is asked each time the task runs",
            "minLength": 1,
            "title": "Instruction",
            "type": "string"
          },
          "cron_expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Run on this cron schedule (UTC), e.g. '0 8 * * 1-5'; or run_at",
            "title": "Cron Expression"
          },
          "run_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Run once at this time (future), ISO 8601; or cron_expression",
            "title": "Run At"
          },
          "start_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "With cron_expression: the schedule starts after this time",
            "title": "Start Time"
          },
          "is_shared_with_workspace": {
            "default": true,
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "instruction"
        ],
        "title": "CreateGenieTaskBody",
        "type": "object"
      },
      "CreatedGenieTask": {
        "properties": {
          "task_id": {
            "title": "Task Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "instruction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "What the genie is asked each time",
            "title": "Instruction"
          },
          "cron_expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Cron Expression"
          },
          "run_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "For a one-time task: when it runs, ISO 8601",
            "title": "Run At"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "For a scheduled task: when the schedule starts",
            "title": "Start Time"
          },
          "next_run_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Next Run Time"
          },
          "is_paused": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Paused"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Created Time"
          }
        },
        "required": [
          "task_id"
        ],
        "title": "CreatedGenieTask",
        "type": "object"
      },
      "UpdateGenieTaskBody": {
        "additionalProperties": false,
        "examples": [
          {
            "cron_expression": "0 9 * * 1-5"
          }
        ],
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "instruction": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Instruction"
          },
          "cron_expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Cron Expression"
          },
          "run_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Run At"
          },
          "start_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Start Time"
          },
          "is_paused": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Paused"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "UpdateGenieTaskBody",
        "type": "object"
      },
      "DeletedGenieTask": {
        "properties": {
          "deleted_task_id": {
            "title": "Deleted Task Id",
            "type": "string"
          }
        },
        "required": [
          "deleted_task_id"
        ],
        "title": "DeletedGenieTask",
        "type": "object"
      },
      "GenieConversationList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/GenieConversationSummary"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Pass it as cursor for the next page",
            "title": "Next Cursor"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "title": "GenieConversationList",
        "type": "object"
      },
      "GenieConversation": {
        "properties": {
          "conversation_id": {
            "title": "Conversation Id",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/GenieMessage"
            },
            "title": "Messages",
            "type": "array"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/GenieStep"
            },
            "title": "Steps",
            "type": "array"
          }
        },
        "required": [
          "conversation_id",
          "region",
          "messages",
          "steps"
        ],
        "title": "GenieConversation",
        "type": "object"
      },
      "GenieToolExecution": {
        "description": "One tool run of a conversation: how the tool was called and what came back",
        "properties": {
          "execution_log_id": {
            "title": "Execution Log Id",
            "type": "string"
          },
          "execution_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Execution Type"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Finished At"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Duration Ms"
          },
          "request": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "response": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "module_runs": {
            "items": {
              "$ref": "#/components/schemas/GenieModuleRun"
            },
            "title": "Module Runs",
            "type": "array"
          }
        },
        "required": [
          "execution_log_id"
        ],
        "title": "GenieToolExecution",
        "type": "object"
      },
      "GenieBrowserSession": {
        "properties": {
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "live_view_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Absent once the live browser has expired",
            "title": "Live View Url"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Expires At"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "GenieBrowserSession",
        "type": "object"
      },
      "GenieLogs": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/GenieLogConversation"
            },
            "title": "Data",
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "GenieLogs",
        "type": "object"
      },
      "KnowledgeBaseList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeBase"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset"
        ],
        "title": "KnowledgeBaseList",
        "type": "object"
      },
      "KnowledgeBase": {
        "description": "A knowledge base, which genies answer from",
        "properties": {
          "knowledge_base_id": {
            "title": "Knowledge Base Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "region": {
            "title": "Region",
            "type": "string"
          },
          "is_shared_with_workspace": {
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Folder Id"
          },
          "created_time": {
            "format": "date-time",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "format": "date-time",
            "title": "Last Modified Time",
            "type": "string"
          }
        },
        "required": [
          "knowledge_base_id",
          "name",
          "resource_id",
          "region",
          "is_shared_with_workspace",
          "folder_id",
          "created_time",
          "last_modified_time"
        ],
        "title": "KnowledgeBase",
        "type": "object"
      },
      "CreateKnowledgeBaseBody": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "Name, unique among the workspace's knowledge bases of the region",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "resource_id": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9_]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The id genies reference it by, unique in the region; derived from the name when absent (a renamed knowledge base keeps its own, so its old name needs another one)",
            "title": "Resource Id"
          },
          "folder_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Folder to list it in; the root when absent",
            "title": "Folder Id"
          },
          "is_shared_with_workspace": {
            "default": false,
            "description": "true lets every member of the workspace use it",
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateKnowledgeBaseBody",
        "type": "object"
      },
      "UpdateKnowledgeBaseBody": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "New name",
            "title": "Name"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "true lets every member of the workspace use it",
            "title": "Is Shared With Workspace"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "UpdateKnowledgeBaseBody",
        "type": "object"
      },
      "DeletedKnowledgeBase": {
        "properties": {
          "deleted_knowledge_base_id": {
            "title": "Deleted Knowledge Base Id",
            "type": "string"
          }
        },
        "required": [
          "deleted_knowledge_base_id"
        ],
        "title": "DeletedKnowledgeBase",
        "type": "object"
      },
      "KnowledgeBaseDocumentList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeBaseDocument"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset"
        ],
        "title": "KnowledgeBaseDocumentList",
        "type": "object"
      },
      "KnowledgeBaseDocument": {
        "description": "A document of a knowledge base, and how far its processing got",
        "properties": {
          "document_id": {
            "title": "Document Id",
            "type": "string"
          },
          "knowledge_base_id": {
            "title": "Knowledge Base Id",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "mime_type": {
            "title": "Mime Type",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "processing_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Processing Status"
          },
          "processing_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Processing Error"
          },
          "chunk_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chunk Count"
          },
          "created_time": {
            "format": "date-time",
            "title": "Created Time",
            "type": "string"
          }
        },
        "required": [
          "document_id",
          "knowledge_base_id",
          "title",
          "mime_type",
          "file_id",
          "processing_status",
          "processing_error",
          "chunk_count",
          "created_time"
        ],
        "title": "KnowledgeBaseDocument",
        "type": "object"
      },
      "AddKnowledgeBaseDocumentBody": {
        "additionalProperties": false,
        "properties": {
          "file_id": {
            "description": "Id of a file of the workspace (GET /files), added as the document",
            "format": "uuid",
            "title": "File Id",
            "type": "string"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "file_id"
        ],
        "title": "AddKnowledgeBaseDocumentBody",
        "type": "object"
      },
      "RemovedKnowledgeBaseDocument": {
        "properties": {
          "knowledge_base_id": {
            "title": "Knowledge Base Id",
            "type": "string"
          },
          "removed_document_id": {
            "title": "Removed Document Id",
            "type": "string"
          }
        },
        "required": [
          "knowledge_base_id",
          "removed_document_id"
        ],
        "title": "RemovedKnowledgeBaseDocument",
        "type": "object"
      },
      "QueueList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Queue"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset"
        ],
        "title": "QueueList",
        "type": "object"
      },
      "QueueDetails": {
        "properties": {
          "queue_id": {
            "title": "Queue Id",
            "type": "string"
          },
          "queue_name": {
            "title": "Queue Name",
            "type": "string"
          },
          "queue_resource_id": {
            "title": "Queue Resource Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/QueueStatus"
          },
          "consumer_workflow_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The workflow that receives the flushed records, if any",
            "title": "Consumer Workflow Id"
          },
          "flush_batch_size": {
            "description": "Records sent to the consumer workflow per flush",
            "title": "Flush Batch Size",
            "type": "integer"
          },
          "flush_record_max_age": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Seconds a record may wait before the queue flushes",
            "title": "Flush Record Max Age"
          },
          "flush_rate_limit_max_flush_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum flushes per rate limit window",
            "title": "Flush Rate Limit Max Flush Count"
          },
          "flush_rate_limit_time_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The rate limit window, in seconds",
            "title": "Flush Rate Limit Time Window"
          },
          "flush_strategy": {
            "$ref": "#/components/schemas/AppQueueFlushStrategy",
            "description": "fifo sends the oldest records first, lifo the newest"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Folder Id"
          },
          "created_time": {
            "format": "date-time",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "format": "date-time",
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "producers": {
            "items": {
              "$ref": "#/components/schemas/QueueResourceReference"
            },
            "title": "Producers",
            "type": "array"
          },
          "consumers": {
            "items": {
              "$ref": "#/components/schemas/QueueResourceReference"
            },
            "title": "Consumers",
            "type": "array"
          }
        },
        "required": [
          "queue_id",
          "queue_name",
          "queue_resource_id",
          "status",
          "consumer_workflow_id",
          "flush_batch_size",
          "flush_record_max_age",
          "flush_rate_limit_max_flush_count",
          "flush_rate_limit_time_window",
          "flush_strategy",
          "parent_folder_id",
          "created_time",
          "last_modified_time",
          "region",
          "producers",
          "consumers"
        ],
        "title": "QueueDetails",
        "type": "object"
      },
      "CreateQueueBody": {
        "additionalProperties": false,
        "properties": {
          "queue_name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Queue Name",
            "type": "string"
          },
          "queue_resource_id": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9_]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The id workflow steps name the queue by; generated from the name when absent",
            "title": "Queue Resource Id"
          },
          "flush_batch_size": {
            "maximum": 10000,
            "minimum": 1,
            "title": "Flush Batch Size",
            "type": "integer"
          },
          "flush_record_max_age": {
            "maximum": 86400,
            "minimum": 1,
            "title": "Flush Record Max Age",
            "type": "integer"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The folder to create the queue in, the root when absent",
            "title": "Parent Folder Id"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QueueStatus"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "running when absent"
          },
          "flush_rate_limit_max_flush_count": {
            "anyOf": [
              {
                "maximum": 2147483647,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "10 when absent",
            "title": "Flush Rate Limit Max Flush Count"
          },
          "flush_rate_limit_time_window": {
            "anyOf": [
              {
                "maximum": 2147483647,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "1 second when absent",
            "title": "Flush Rate Limit Time Window"
          },
          "flush_strategy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppQueueFlushStrategy"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "fifo when absent"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "queue_name",
          "flush_batch_size",
          "flush_record_max_age"
        ],
        "title": "CreateQueueBody",
        "type": "object"
      },
      "CreatedQueue": {
        "properties": {
          "queue_id": {
            "title": "Queue Id",
            "type": "string"
          },
          "queue_name": {
            "title": "Queue Name",
            "type": "string"
          },
          "queue_resource_id": {
            "title": "Queue Resource Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/QueueStatus"
          },
          "consumer_workflow_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The workflow that receives the flushed records, if any",
            "title": "Consumer Workflow Id"
          },
          "flush_batch_size": {
            "description": "Records sent to the consumer workflow per flush",
            "title": "Flush Batch Size",
            "type": "integer"
          },
          "flush_record_max_age": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Seconds a record may wait before the queue flushes",
            "title": "Flush Record Max Age"
          },
          "flush_rate_limit_max_flush_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum flushes per rate limit window",
            "title": "Flush Rate Limit Max Flush Count"
          },
          "flush_rate_limit_time_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The rate limit window, in seconds",
            "title": "Flush Rate Limit Time Window"
          },
          "flush_strategy": {
            "$ref": "#/components/schemas/AppQueueFlushStrategy",
            "description": "fifo sends the oldest records first, lifo the newest"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Folder Id"
          },
          "created_time": {
            "format": "date-time",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "format": "date-time",
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "queue_id",
          "queue_name",
          "queue_resource_id",
          "status",
          "consumer_workflow_id",
          "flush_batch_size",
          "flush_record_max_age",
          "flush_rate_limit_max_flush_count",
          "flush_rate_limit_time_window",
          "flush_strategy",
          "parent_folder_id",
          "created_time",
          "last_modified_time",
          "region"
        ],
        "title": "CreatedQueue",
        "type": "object"
      },
      "UpdateQueueBody": {
        "additionalProperties": false,
        "properties": {
          "queue_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Queue Name"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QueueStatus"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "flush_batch_size": {
            "anyOf": [
              {
                "maximum": 10000,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Flush Batch Size"
          },
          "flush_record_max_age": {
            "anyOf": [
              {
                "maximum": 86400,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Flush Record Max Age"
          },
          "flush_rate_limit_max_flush_count": {
            "anyOf": [
              {
                "maximum": 2147483647,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Flush Rate Limit Max Flush Count"
          },
          "flush_rate_limit_time_window": {
            "anyOf": [
              {
                "maximum": 2147483647,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Flush Rate Limit Time Window"
          },
          "flush_strategy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppQueueFlushStrategy"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "UpdateQueueBody",
        "type": "object"
      },
      "Queue": {
        "properties": {
          "queue_id": {
            "title": "Queue Id",
            "type": "string"
          },
          "queue_name": {
            "title": "Queue Name",
            "type": "string"
          },
          "queue_resource_id": {
            "title": "Queue Resource Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/QueueStatus"
          },
          "consumer_workflow_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The workflow that receives the flushed records, if any",
            "title": "Consumer Workflow Id"
          },
          "flush_batch_size": {
            "description": "Records sent to the consumer workflow per flush",
            "title": "Flush Batch Size",
            "type": "integer"
          },
          "flush_record_max_age": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Seconds a record may wait before the queue flushes",
            "title": "Flush Record Max Age"
          },
          "flush_rate_limit_max_flush_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum flushes per rate limit window",
            "title": "Flush Rate Limit Max Flush Count"
          },
          "flush_rate_limit_time_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The rate limit window, in seconds",
            "title": "Flush Rate Limit Time Window"
          },
          "flush_strategy": {
            "$ref": "#/components/schemas/AppQueueFlushStrategy",
            "description": "fifo sends the oldest records first, lifo the newest"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Folder Id"
          },
          "created_time": {
            "format": "date-time",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "format": "date-time",
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "queue_id",
          "queue_name",
          "queue_resource_id",
          "status",
          "consumer_workflow_id",
          "flush_batch_size",
          "flush_record_max_age",
          "flush_rate_limit_max_flush_count",
          "flush_rate_limit_time_window",
          "flush_strategy",
          "parent_folder_id",
          "created_time",
          "last_modified_time",
          "region"
        ],
        "title": "Queue",
        "type": "object"
      },
      "FlushQueueBody": {
        "additionalProperties": false,
        "properties": {
          "record_count": {
            "description": "Waiting records to send to the consumer now",
            "maximum": 10000,
            "minimum": 1,
            "title": "Record Count",
            "type": "integer"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "record_count"
        ],
        "title": "FlushQueueBody",
        "type": "object"
      },
      "QueueFlushRequested": {
        "properties": {
          "queue_id": {
            "title": "Queue Id",
            "type": "string"
          },
          "queue_name": {
            "title": "Queue Name",
            "type": "string"
          },
          "queue_resource_id": {
            "title": "Queue Resource Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/QueueStatus"
          },
          "consumer_workflow_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The workflow that receives the flushed records, if any",
            "title": "Consumer Workflow Id"
          },
          "flush_batch_size": {
            "description": "Records sent to the consumer workflow per flush",
            "title": "Flush Batch Size",
            "type": "integer"
          },
          "flush_record_max_age": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Seconds a record may wait before the queue flushes",
            "title": "Flush Record Max Age"
          },
          "flush_rate_limit_max_flush_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum flushes per rate limit window",
            "title": "Flush Rate Limit Max Flush Count"
          },
          "flush_rate_limit_time_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The rate limit window, in seconds",
            "title": "Flush Rate Limit Time Window"
          },
          "flush_strategy": {
            "$ref": "#/components/schemas/AppQueueFlushStrategy",
            "description": "fifo sends the oldest records first, lifo the newest"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Folder Id"
          },
          "created_time": {
            "format": "date-time",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "format": "date-time",
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "flush_requested_record_count": {
            "title": "Flush Requested Record Count",
            "type": "integer"
          }
        },
        "required": [
          "queue_id",
          "queue_name",
          "queue_resource_id",
          "status",
          "consumer_workflow_id",
          "flush_batch_size",
          "flush_record_max_age",
          "flush_rate_limit_max_flush_count",
          "flush_rate_limit_time_window",
          "flush_strategy",
          "parent_folder_id",
          "created_time",
          "last_modified_time",
          "region",
          "flush_requested_record_count"
        ],
        "title": "QueueFlushRequested",
        "type": "object"
      },
      "DeletedQueue": {
        "properties": {
          "queue_id": {
            "title": "Queue Id",
            "type": "string"
          },
          "queue_name": {
            "title": "Queue Name",
            "type": "string"
          }
        },
        "required": [
          "queue_id",
          "queue_name"
        ],
        "title": "DeletedQueue",
        "type": "object"
      },
      "QueueRecordList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/QueueRecord"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "waiting_record_count": {
            "description": "Every record waiting in the queue, not only this page",
            "title": "Waiting Record Count",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset",
          "waiting_record_count"
        ],
        "title": "QueueRecordList",
        "type": "object"
      },
      "ClearedQueueRecords": {
        "properties": {
          "queue_id": {
            "title": "Queue Id",
            "type": "string"
          }
        },
        "required": [
          "queue_id"
        ],
        "title": "ClearedQueueRecords",
        "type": "object"
      },
      "BaseMetrics": {
        "description": "GET /bases/<base_id>/metrics: the sync page's Statistics tab",
        "properties": {
          "base_id": {
            "title": "Base Id",
            "type": "string"
          },
          "apps": {
            "items": {
              "$ref": "#/components/schemas/BaseAppMetrics"
            },
            "title": "Apps",
            "type": "array"
          }
        },
        "required": [
          "base_id",
          "apps"
        ],
        "title": "BaseMetrics",
        "type": "object"
      },
      "BaseDiagnostics": {
        "description": "GET /bases/<base_id>/diagnostics",
        "properties": {
          "base_id": {
            "title": "Base Id",
            "type": "string"
          },
          "stuck_threshold_in_seconds": {
            "title": "Stuck Threshold In Seconds",
            "type": "integer"
          },
          "apps": {
            "items": {
              "$ref": "#/components/schemas/BaseAppDiagnostics"
            },
            "title": "Apps",
            "type": "array"
          }
        },
        "required": [
          "base_id",
          "stuck_threshold_in_seconds",
          "apps"
        ],
        "title": "BaseDiagnostics",
        "type": "object"
      },
      "UpdateBaseSettingsBody": {
        "additionalProperties": false,
        "properties": {
          "max_records_sync_delay_in_seconds": {
            "description": "The longest a change may wait before it is synced, in seconds; 0 syncs in real time",
            "minimum": 0,
            "title": "Max Records Sync Delay In Seconds",
            "type": "integer"
          }
        },
        "required": [
          "max_records_sync_delay_in_seconds"
        ],
        "title": "UpdateBaseSettingsBody",
        "type": "object"
      },
      "BaseSettings": {
        "description": "PATCH /bases/<base_id>/settings",
        "properties": {
          "base_id": {
            "title": "Base Id",
            "type": "string"
          },
          "settings": {
            "$ref": "#/components/schemas/PublicBaseSettings"
          }
        },
        "required": [
          "base_id",
          "settings"
        ],
        "title": "BaseSettings",
        "type": "object"
      },
      "ToggleBulkApiAccessBody": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "$ref": "#/components/schemas/SwitchAction",
            "description": "ON to read and write the Salesforce app through its Bulk API, OFF for its REST API"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "action"
        ],
        "title": "ToggleBulkApiAccessBody",
        "type": "object"
      },
      "AppBulkApiAccess": {
        "description": "POST /bases/<base_id>/apps/<app_id>/bulk-api-access",
        "properties": {
          "app_id": {
            "title": "App Id",
            "type": "string"
          },
          "bulk_api_access": {
            "title": "Bulk Api Access",
            "type": "boolean"
          }
        },
        "required": [
          "app_id",
          "bulk_api_access"
        ],
        "title": "AppBulkApiAccess",
        "type": "object"
      },
      "UpdateCDCMethodBody": {
        "additionalProperties": false,
        "properties": {
          "cdc_method": {
            "$ref": "#/components/schemas/CDCMethod",
            "description": "triggers, or logical_replication when the database allows it"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "cdc_method"
        ],
        "title": "UpdateCDCMethodBody",
        "type": "object"
      },
      "AppCDCMethod": {
        "description": "POST /bases/<base_id>/apps/<app_id>/cdc-method",
        "properties": {
          "app_id": {
            "title": "App Id",
            "type": "string"
          },
          "cdc_method": {
            "$ref": "#/components/schemas/CDCMethod"
          }
        },
        "required": [
          "app_id",
          "cdc_method"
        ],
        "title": "AppCDCMethod",
        "type": "object"
      },
      "VariableList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Variable"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset"
        ],
        "title": "VariableList",
        "type": "object"
      },
      "Variable": {
        "properties": {
          "variable_id": {
            "title": "Variable Id",
            "type": "string"
          },
          "variable_name": {
            "title": "Variable Name",
            "type": "string"
          },
          "variable_resource_id": {
            "title": "Variable Resource Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_secret": {
            "description": "A secret's value is encrypted and never answered",
            "title": "Is Secret",
            "type": "boolean"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The value as text (JSON text for object, array and json); null for a secret",
            "title": "Value"
          },
          "value_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowVariableDataValueType"
              },
              {
                "type": "null"
              }
            ],
            "description": "How workflow steps read the value; for a secret, answered by GET /variables/<id> (stored encrypted with its value, not read by the list)"
          },
          "reference": {
            "description": "What a workflow step writes to read the variable",
            "title": "Reference",
            "type": "string"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Folder Id"
          },
          "created_time": {
            "format": "date-time",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "format": "date-time",
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "variable_id",
          "variable_name",
          "variable_resource_id",
          "description",
          "is_secret",
          "value",
          "value_type",
          "reference",
          "parent_folder_id",
          "created_time",
          "last_modified_time",
          "region"
        ],
        "title": "Variable",
        "type": "object"
      },
      "CreateVariableBody": {
        "additionalProperties": false,
        "properties": {
          "variable_name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Variable Name",
            "type": "string"
          },
          "value": {
            "default": "",
            "description": "The value as text; for object, array and json the JSON text",
            "title": "Value",
            "type": "string"
          },
          "value_type": {
            "$ref": "#/components/schemas/WorkflowVariableDataValueType",
            "default": "string"
          },
          "is_secret": {
            "default": false,
            "description": "A secret's value is encrypted and never answered; cannot be undone",
            "title": "Is Secret",
            "type": "boolean"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Description"
          },
          "variable_resource_id": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9_]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The id workflow steps read the variable by; generated from the name when absent",
            "title": "Variable Resource Id"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The folder to create the variable in, the root when absent",
            "title": "Parent Folder Id"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "variable_name"
        ],
        "title": "CreateVariableBody",
        "type": "object"
      },
      "CreatedVariable": {
        "properties": {
          "variable_id": {
            "title": "Variable Id",
            "type": "string"
          },
          "variable_name": {
            "title": "Variable Name",
            "type": "string"
          },
          "variable_resource_id": {
            "title": "Variable Resource Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_secret": {
            "description": "A secret's value is encrypted and never answered",
            "title": "Is Secret",
            "type": "boolean"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The value as text (JSON text for object, array and json); null for a secret",
            "title": "Value"
          },
          "value_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowVariableDataValueType"
              },
              {
                "type": "null"
              }
            ],
            "description": "How workflow steps read the value; for a secret, answered by GET /variables/<id> (stored encrypted with its value, not read by the list)"
          },
          "reference": {
            "description": "What a workflow step writes to read the variable",
            "title": "Reference",
            "type": "string"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Folder Id"
          },
          "created_time": {
            "format": "date-time",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "format": "date-time",
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "variable_id",
          "variable_name",
          "variable_resource_id",
          "description",
          "is_secret",
          "value",
          "value_type",
          "reference",
          "parent_folder_id",
          "created_time",
          "last_modified_time",
          "region"
        ],
        "title": "CreatedVariable",
        "type": "object"
      },
      "UpdateVariableBody": {
        "additionalProperties": false,
        "properties": {
          "variable_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Variable Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Description"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "For a secret, send the value with its value_type",
            "title": "Value"
          },
          "value_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowVariableDataValueType"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "is_secret": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "true turns the variable into a secret, for good",
            "title": "Is Secret"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "UpdateVariableBody",
        "type": "object"
      },
      "DeletedVariable": {
        "properties": {
          "variable_id": {
            "title": "Variable Id",
            "type": "string"
          },
          "variable_name": {
            "title": "Variable Name",
            "type": "string"
          }
        },
        "required": [
          "variable_id",
          "variable_name"
        ],
        "title": "DeletedVariable",
        "type": "object"
      },
      "WorkflowModuleAppList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WorkflowModuleApp"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset"
        ],
        "title": "WorkflowModuleAppList",
        "type": "object"
      },
      "WorkflowModuleAppDetail": {
        "properties": {
          "app_type": {
            "title": "App Type",
            "type": "string"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/WorkflowModuleSummary"
            },
            "title": "Actions",
            "type": "array"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/WorkflowModuleSummary"
            },
            "title": "Triggers",
            "type": "array"
          }
        },
        "required": [
          "app_type",
          "actions",
          "triggers"
        ],
        "title": "WorkflowModuleAppDetail",
        "type": "object"
      },
      "GetModuleFormBody": {
        "additionalProperties": false,
        "properties": {
          "module_id": {
            "description": "The module, from GET .../workflows/modules/apps/<app_type>",
            "minLength": 1,
            "title": "Module Id",
            "type": "string"
          },
          "module_version": {
            "description": "The module version, from the same answer",
            "minLength": 1,
            "title": "Module Version",
            "type": "string"
          },
          "connection_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The connection the step uses, from GET .../connections (same region); None before one is chosen",
            "title": "Connection Id"
          },
          "values": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The form values chosen so far: the form can change with them",
            "title": "Values"
          },
          "dropdown_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The dropdowns whose options to load, from dropdown_ids of a previous answer",
            "title": "Dropdown Ids"
          }
        },
        "required": [
          "module_id",
          "module_version"
        ],
        "title": "GetModuleFormBody",
        "type": "object"
      },
      "ModuleForm": {
        "properties": {
          "input_schema": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The JSON schema of the step's values; a field whose options come from the app names them in dropdown_ids",
            "title": "Input Schema"
          },
          "connection_requirement": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectionRequirement"
              },
              {
                "type": "null"
              }
            ]
          },
          "dropdown_ids": {
            "description": "Every dropdown the form declares",
            "items": {
              "type": "string"
            },
            "title": "Dropdown Ids",
            "type": "array"
          },
          "dropdowns": {
            "description": "The options of the dropdowns asked for",
            "items": {
              "$ref": "#/components/schemas/Dropdown"
            },
            "title": "Dropdowns",
            "type": "array"
          }
        },
        "required": [
          "input_schema",
          "connection_requirement",
          "dropdown_ids",
          "dropdowns"
        ],
        "title": "ModuleForm",
        "type": "object"
      },
      "RunModuleBody": {
        "additionalProperties": false,
        "properties": {
          "module_id": {
            "description": "The action, from the actions of GET .../workflows/modules/apps/<app_type> (its current version)",
            "minLength": 1,
            "title": "Module Id",
            "type": "string"
          },
          "module_version": {
            "description": "The action's version, from the same answer",
            "minLength": 1,
            "title": "Module Version",
            "type": "string"
          },
          "connection_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The connection the action uses, from GET .../connections (same region); None for an action that takes none",
            "title": "Connection Id"
          },
          "values": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "description": "The action's form values, as the module form describes them (POST .../workflows/modules/forms)",
            "title": "Values",
            "type": "object"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the run (action, role, connection, values against the app's live form) and answer what would run, with whether it only reads, without running it: a refused request answers the error the run would",
            "title": "Validate Only",
            "type": "boolean"
          },
          "validate_only_for_writes": {
            "default": false,
            "description": "true runs a read action at once and only validates a write action (as validate_only would); false runs any action",
            "title": "Validate Only For Writes",
            "type": "boolean"
          }
        },
        "required": [
          "module_id",
          "module_version"
        ],
        "title": "RunModuleBody",
        "type": "object"
      },
      "ModuleRun": {
        "properties": {
          "module_id": {
            "title": "Module Id",
            "type": "string"
          },
          "module_version": {
            "title": "Module Version",
            "type": "string"
          },
          "module_name": {
            "title": "Module Name",
            "type": "string"
          },
          "app_type": {
            "title": "App Type",
            "type": "string"
          },
          "connection_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Id"
          },
          "connection_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name of the connection the action used, None for none",
            "title": "Connection Name"
          },
          "is_read_action": {
            "description": "True for an action that only reads from the app (a viewer may run it); any other action can change data and needs an editor",
            "title": "Is Read Action",
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/ModuleRunStatus"
          },
          "data": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null,
            "description": "What the action answered, as the next step of a workflow would receive it; None unless it succeeded",
            "is_secret": true
          },
          "is_data_truncated": {
            "default": false,
            "description": "True when data was too large to answer: data is then the start of it as JSON text; narrow the action's filters to get it whole",
            "title": "Is Data Truncated",
            "type": "boolean"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Why the action failed, or why its outcome is unknown",
            "title": "Error Message"
          }
        },
        "required": [
          "module_id",
          "module_version",
          "module_name",
          "app_type",
          "connection_id",
          "connection_name",
          "is_read_action",
          "status"
        ],
        "title": "ModuleRun",
        "type": "object"
      },
      "WorkflowList": {
        "description": "The documented list answer, one page of each region asked for",
        "properties": {
          "workflows": {
            "items": {
              "$ref": "#/components/schemas/WorkflowListItem"
            },
            "title": "Workflows",
            "type": "array"
          }
        },
        "required": [
          "workflows"
        ],
        "title": "WorkflowList",
        "type": "object"
      },
      "DocumentedError": {
        "type": "object",
        "title": "DocumentedError",
        "description": "The error body of a route documented before the v1 conventions: `error` holds the message, other keys stay as the route always sent them",
        "properties": {
          "error": {
            "title": "Error",
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": true
      },
      "WorkflowVersionWithRegion": {
        "properties": {
          "workflow": {
            "$ref": "#/components/schemas/WorkflowVersion"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "workflow",
          "region"
        ],
        "title": "WorkflowVersionWithRegion",
        "type": "object"
      },
      "WorkflowVersionList": {
        "description": "The documented versions answer: a JSON array, newest first",
        "items": {
          "$ref": "#/components/schemas/WorkflowVersion"
        },
        "title": "WorkflowVersionList",
        "type": "array"
      },
      "Workflow": {
        "description": "A workflow, as the documented \"Get workflow info\" answers it",
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "workflow_name": {
            "title": "Workflow Name",
            "type": "string"
          },
          "workflow_resource_id": {
            "title": "Workflow Resource Id",
            "type": "string"
          },
          "workflow_status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "workspace_id": {
            "title": "Workspace Id",
            "type": "integer"
          },
          "is_shared_with_workspace": {
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "module_app_type_display_list": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Module App Type Display List"
          },
          "parent_folders": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ParentFolderModel"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Parent Folders"
          },
          "created_by": {
            "title": "Created By",
            "type": "integer"
          },
          "created_time": {
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_by": {
            "title": "Last Modified By",
            "type": "integer"
          },
          "last_modified_time": {
            "title": "Last Modified Time",
            "type": "string"
          }
        },
        "required": [
          "workflow_id",
          "workflow_name",
          "workflow_resource_id",
          "workflow_status",
          "workspace_id",
          "is_shared_with_workspace",
          "created_by",
          "created_time",
          "last_modified_by",
          "last_modified_time"
        ],
        "title": "Workflow",
        "type": "object"
      },
      "CreateWorkflowBody": {
        "additionalProperties": false,
        "properties": {
          "workflow_name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Workflow Name",
            "type": "string"
          },
          "workflow_resource_id": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9_]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A human-readable id, unique in the workspace (lowercase letters, digits and _, at most 60); derived from the name when absent",
            "title": "Workflow Resource Id"
          },
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The folder to create it in; the root when absent",
            "title": "Folder Id"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "document": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowSchemaModel"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The first draft's document, holding only the Input step; an empty draft when absent"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "workflow_name"
        ],
        "title": "CreateWorkflowBody",
        "type": "object"
      },
      "CreatedWorkflow": {
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "workflow_name": {
            "title": "Workflow Name",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "version": {
            "$ref": "#/components/schemas/WorkflowVersionSummary"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/StepTrigger"
            },
            "title": "Triggers",
            "type": "array"
          }
        },
        "required": [
          "workflow_id",
          "workflow_name",
          "region",
          "version",
          "triggers"
        ],
        "title": "CreatedWorkflow",
        "type": "object"
      },
      "UpdateWorkflowBody": {
        "additionalProperties": false,
        "properties": {
          "workflow_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Workflow Name"
          },
          "workflow_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowStatus"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "running switches the workflow on, paused off"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "UpdateWorkflowBody",
        "type": "object"
      },
      "WorkflowWithRegion": {
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "workflow_name": {
            "title": "Workflow Name",
            "type": "string"
          },
          "workflow_resource_id": {
            "title": "Workflow Resource Id",
            "type": "string"
          },
          "workflow_status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "workspace_id": {
            "title": "Workspace Id",
            "type": "integer"
          },
          "is_shared_with_workspace": {
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "module_app_type_display_list": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Module App Type Display List"
          },
          "parent_folders": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ParentFolderModel"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Parent Folders"
          },
          "created_by": {
            "title": "Created By",
            "type": "integer"
          },
          "created_time": {
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_by": {
            "title": "Last Modified By",
            "type": "integer"
          },
          "last_modified_time": {
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "workflow_id",
          "workflow_name",
          "workflow_resource_id",
          "workflow_status",
          "workspace_id",
          "is_shared_with_workspace",
          "created_by",
          "created_time",
          "last_modified_by",
          "last_modified_time",
          "region"
        ],
        "title": "WorkflowWithRegion",
        "type": "object"
      },
      "DuplicateWorkflowBody": {
        "additionalProperties": false,
        "properties": {
          "workflow_name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Workflow Name",
            "type": "string"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The version copied; the latest when absent",
            "title": "Version"
          },
          "copy_region": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Regions"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The region of the copy; the workflow's region when absent"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "workflow_name"
        ],
        "title": "DuplicateWorkflowBody",
        "type": "object"
      },
      "SaveWorkflowDraftBody": {
        "additionalProperties": false,
        "examples": [
          {
            "document": {
              "edges": [
                {
                  "edge_id": "input-wait_5_seconds",
                  "source": {
                    "workflow_module_instance_id": "input"
                  },
                  "target": {
                    "workflow_module_instance_id": "wait_5_seconds"
                  }
                }
              ],
              "modules": [
                {
                  "module_id": "system-input-1",
                  "name": "Input",
                  "properties": {},
                  "workflow_module_instance_id": "input"
                },
                {
                  "module_id": "system-wait-1",
                  "name": "Wait 5 seconds",
                  "properties": {
                    "wait_for": 5
                  },
                  "workflow_module_instance_id": "wait_5_seconds"
                }
              ]
            }
          }
        ],
        "properties": {
          "document": {
            "$ref": "#/components/schemas/WorkflowSchemaModel"
          },
          "expected_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The draft version you read; refused with 409 when the draft is another one",
            "title": "Expected Version"
          },
          "expected_last_modified_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The last_modified_time of the draft you read; refused with 409 when it changed",
            "title": "Expected Last Modified Time"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "required": [
          "document"
        ],
        "title": "SaveWorkflowDraftBody",
        "type": "object"
      },
      "WorkflowDraft": {
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "version": {
            "$ref": "#/components/schemas/WorkflowVersionSummary"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/StepTrigger"
            },
            "title": "Triggers",
            "type": "array"
          }
        },
        "required": [
          "workflow_id",
          "region",
          "version",
          "triggers"
        ],
        "title": "WorkflowDraft",
        "type": "object"
      },
      "CreateWorkflowDraftBody": {
        "additionalProperties": false,
        "properties": {
          "from_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The version copied into the new draft; the latest when absent",
            "title": "From Version"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "CreateWorkflowDraftBody",
        "type": "object"
      },
      "CreatedWorkflowDraft": {
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "version": {
            "$ref": "#/components/schemas/WorkflowVersionSummary"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/StepTrigger"
            },
            "title": "Triggers",
            "type": "array"
          }
        },
        "required": [
          "workflow_id",
          "region",
          "version",
          "triggers"
        ],
        "title": "CreatedWorkflowDraft",
        "type": "object"
      },
      "DeployWorkflowBody": {
        "additionalProperties": false,
        "properties": {
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The version deployed; the latest when absent",
            "title": "Version"
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "DeployWorkflowBody",
        "type": "object"
      },
      "DeployedWorkflowVersion": {
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "version": {
            "$ref": "#/components/schemas/WorkflowVersionSummary"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/StepTrigger"
            },
            "title": "Triggers",
            "type": "array"
          }
        },
        "required": [
          "workflow_id",
          "region",
          "version",
          "triggers"
        ],
        "title": "DeployedWorkflowVersion",
        "type": "object"
      },
      "WorkflowVersion": {
        "description": "A version of a workflow, as the documented \"Get workflow\" answers it; workflow_schema is the workflow document",
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "workflow_version": {
            "title": "Workflow Version",
            "type": "string"
          },
          "workflow_status": {
            "title": "Workflow Status",
            "type": "string"
          },
          "is_draft": {
            "title": "Is Draft",
            "type": "boolean"
          },
          "is_deployed": {
            "title": "Is Deployed",
            "type": "boolean"
          },
          "workflow_schema": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowSchemaModel"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "options": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Options"
          },
          "created_by": {
            "title": "Created By",
            "type": "integer"
          },
          "created_time": {
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_by": {
            "title": "Last Modified By",
            "type": "integer"
          },
          "last_modified_time": {
            "title": "Last Modified Time",
            "type": "string"
          }
        },
        "required": [
          "workflow_id",
          "workflow_version",
          "workflow_status",
          "is_draft",
          "is_deployed",
          "created_by",
          "created_time",
          "last_modified_by",
          "last_modified_time"
        ],
        "title": "WorkflowVersion",
        "type": "object"
      },
      "RunWorkflowBody": {
        "additionalProperties": false,
        "examples": [
          {
            "mode": "run"
          }
        ],
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/RunMode",
            "default": "run",
            "description": "run: a new run from the input step's test data; the replay modes need from_run_id"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The version run; the latest when absent",
            "title": "Version"
          },
          "from_run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The finished run whose data is replayed",
            "title": "From Run Id"
          },
          "step_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The step of the until_step, step_only and from_step modes",
            "title": "Step Id"
          }
        },
        "title": "RunWorkflowBody",
        "type": "object"
      },
      "QueuedRun": {
        "properties": {
          "run_id": {
            "title": "Run Id",
            "type": "string"
          },
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "workflow_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Workflow Version"
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Created Time"
          }
        },
        "required": [
          "run_id",
          "workflow_id"
        ],
        "title": "QueuedRun",
        "type": "object"
      },
      "EmailAliasAvailability": {
        "properties": {
          "alias": {
            "title": "Alias",
            "type": "string"
          },
          "email_address": {
            "title": "Email Address",
            "type": "string"
          },
          "is_available": {
            "title": "Is Available",
            "type": "boolean"
          }
        },
        "required": [
          "alias",
          "email_address",
          "is_available"
        ],
        "title": "EmailAliasAvailability",
        "type": "object"
      },
      "ListExecutionLogsBody": {
        "description": "The documented list-logs body; validated by the log explorer itself, with its documented 400s",
        "examples": [
          {
            "options": {
              "limit": 50,
              "query": "workflow.execution_status = 'ERROR'",
              "sort": "desc",
              "time_range": [
                "2026-10-01T00:00:00Z",
                "2026-10-02T00:00:00Z"
              ]
            }
          }
        ],
        "properties": {
          "options": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "extra_columns": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          }
        },
        "title": "ListExecutionLogsBody",
        "type": "object"
      },
      "ExecutionLogs": {
        "description": "The documented list-logs answer: the rows of the sections asked for, and the cursors of the listing mode",
        "properties": {
          "data": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": {
                    "$ref": "#/components/schemas/JsonValue"
                  },
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Meta"
          },
          "keys": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Keys"
          },
          "total_executions": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Total Executions"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "prev_cursor": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "newest_cursor": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "oldest_cursor": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "has_more": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Has More"
          }
        },
        "title": "ExecutionLogs",
        "type": "object"
      },
      "RunLogList": {
        "description": "The documented answer: a JSON array ordered by created_time",
        "items": {
          "$ref": "#/components/schemas/RunLog"
        },
        "title": "RunLogList",
        "type": "array"
      },
      "ExportCapabilities": {
        "properties": {
          "plaintext_logs_enabled": {
            "title": "Plaintext Logs Enabled",
            "type": "boolean"
          },
          "max_rows": {
            "title": "Max Rows",
            "type": "integer"
          },
          "max_executions_with_logs": {
            "title": "Max Executions With Logs",
            "type": "integer"
          }
        },
        "required": [
          "plaintext_logs_enabled",
          "max_rows",
          "max_executions_with_logs"
        ],
        "title": "ExportCapabilities",
        "type": "object"
      },
      "ReplayRunsBody": {
        "description": "The documented batch-create body (the query and legacy search_options forms are still accepted)",
        "examples": [
          {
            "workflow_execution_ids": [
              "8d4f2a6c-1e3b-4c7a-9f05-6b2d8e1a3c47"
            ]
          }
        ],
        "properties": {
          "workflow_execution_ids": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "query": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "query_string": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "search_options": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "metadata": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "workflow_version": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "workflow_trigger_module_id": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "ReplayRunsBody",
        "type": "object"
      },
      "ReplayedRuns": {
        "properties": {
          "total_requested": {
            "title": "Total Requested",
            "type": "integer"
          },
          "total_succeeded": {
            "title": "Total Succeeded",
            "type": "integer"
          },
          "total_failed": {
            "title": "Total Failed",
            "type": "integer"
          },
          "errors": {
            "items": {
              "$ref": "#/components/schemas/ReplayError"
            },
            "title": "Errors",
            "type": "array"
          },
          "run_ids": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Run Ids",
            "type": "array"
          },
          "resolved_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Resolved Count"
          },
          "replay_batch_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Replay Batch Id"
          }
        },
        "required": [
          "total_requested",
          "total_succeeded",
          "total_failed",
          "errors"
        ],
        "title": "ReplayedRuns",
        "type": "object"
      },
      "ReplayRunsByFilterBody": {
        "examples": [
          {
            "options": {
              "query": "workflow.execution_status = 'ERROR'",
              "time_range": [
                "2026-10-01T00:00:00Z",
                "2026-10-02T00:00:00Z"
              ]
            }
          }
        ],
        "properties": {
          "options": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "metadata": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "workflow_version": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "workflow_trigger_module_id": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "ReplayRunsByFilterBody",
        "type": "object"
      },
      "ResolveRunsByFilterBody": {
        "examples": [
          {
            "options": {
              "query": "workflow.execution_status = 'ERROR'",
              "time_range": [
                "2026-10-01T00:00:00Z",
                "2026-10-02T00:00:00Z"
              ]
            }
          }
        ],
        "properties": {
          "options": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "validate_only": {
            "default": false,
            "description": "Run every check of the write and answer 204 without writing: a refused write answers the error the write would",
            "title": "Validate Only",
            "type": "boolean"
          }
        },
        "title": "ResolveRunsByFilterBody",
        "type": "object"
      },
      "ResolvedRuns": {
        "properties": {
          "resolved_count": {
            "title": "Resolved Count",
            "type": "integer"
          },
          "total_matched": {
            "title": "Total Matched",
            "type": "integer"
          },
          "updated_execution_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Updated Execution Count"
          },
          "query_used": {
            "title": "Query Used",
            "type": "string"
          },
          "region": {
            "title": "Region",
            "type": "string"
          }
        },
        "required": [
          "resolved_count",
          "total_matched",
          "query_used",
          "region"
        ],
        "title": "ResolvedRuns",
        "type": "object"
      },
      "WorkspaceList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Workspace"
            },
            "title": "Data",
            "type": "array"
          },
          "has_more": {
            "description": "Whether more items follow this page: request the next one with offset + limit",
            "title": "Has More",
            "type": "boolean"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "has_more",
          "limit",
          "offset"
        ],
        "title": "WorkspaceList",
        "type": "object"
      },
      "Workspace": {
        "description": "A workspace the caller can act in",
        "properties": {
          "workspace_id": {
            "title": "Workspace Id",
            "type": "integer"
          },
          "workspace_name": {
            "title": "Workspace Name",
            "type": "string"
          },
          "role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkspaceRole"
              },
              {
                "type": "null"
              }
            ],
            "description": "The caller's role in the workspace: viewer, editor or owner (a workspace API key acts as an editor)"
          },
          "default_region": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Regions"
              },
              {
                "type": "null"
              }
            ],
            "description": "The region the web app opens on and new resources go to by default"
          }
        },
        "required": [
          "workspace_id",
          "workspace_name",
          "role",
          "default_region"
        ],
        "title": "Workspace",
        "type": "object"
      },
      "WorkspaceMembers": {
        "properties": {
          "users": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceMember"
            },
            "title": "Users",
            "type": "array"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceGroup"
            },
            "title": "Groups",
            "type": "array"
          }
        },
        "required": [
          "users",
          "groups"
        ],
        "title": "WorkspaceMembers",
        "type": "object"
      },
      "RegionList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Region"
            },
            "title": "Data",
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "RegionList",
        "type": "object"
      },
      "Regions": {
        "enum": [
          "besg",
          "usnv"
        ],
        "title": "Regions",
        "type": "string"
      },
      "AppQueueFlushStrategy": {
        "enum": [
          "fifo",
          "lifo"
        ],
        "title": "AppQueueFlushStrategy",
        "type": "string"
      },
      "ParentFolderModel": {
        "properties": {
          "parent_folder_id": {
            "format": "uuid4",
            "title": "Parent Folder Id",
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ParentFolderType"
          }
        },
        "required": [
          "parent_folder_id",
          "type"
        ],
        "title": "ParentFolderModel",
        "type": "object"
      },
      "ParentFolderType": {
        "enum": [
          "primary",
          "shortcut"
        ],
        "title": "ParentFolderType",
        "type": "string"
      },
      "WorkflowModuleConditionComparatorModel": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "type": {
            "const": "comparator",
            "default": "comparator",
            "title": "Type",
            "type": "string"
          },
          "value": {
            "default": "",
            "title": "Value",
            "type": "string"
          },
          "operator": {
            "$ref": "#/components/schemas/WorkflowModuleConditionComparatorType",
            "default": "and"
          }
        },
        "required": [
          "id"
        ],
        "title": "WorkflowModuleConditionComparatorModel",
        "type": "object"
      },
      "WorkflowModuleConditionComparatorType": {
        "enum": [
          "and",
          "or",
          "not"
        ],
        "title": "WorkflowModuleConditionComparatorType",
        "type": "string"
      },
      "WorkflowModuleConditionGroupModel": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "type": {
            "const": "group",
            "default": "group",
            "title": "Type",
            "type": "string"
          },
          "value": {
            "default": [],
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WorkflowModuleConditionValueModel"
                },
                {
                  "$ref": "#/components/schemas/WorkflowModuleConditionComparatorModel"
                },
                {
                  "$ref": "#/components/schemas/WorkflowModuleConditionGroupModel"
                }
              ]
            },
            "title": "Value",
            "type": "array"
          }
        },
        "required": [
          "id"
        ],
        "title": "WorkflowModuleConditionGroupModel",
        "type": "object"
      },
      "WorkflowModuleConditionOperatorType": {
        "enum": [
          "is equal to",
          "is not equal to",
          "is greater than",
          "is less than",
          "is greater than or equal to",
          "is less than or equal to",
          "contains",
          "does not contain",
          "is in",
          "is not in",
          "regex",
          "is null",
          "is not null",
          "is empty",
          "is not empty"
        ],
        "title": "WorkflowModuleConditionOperatorType",
        "type": "string"
      },
      "WorkflowModuleConditionValueModel": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "type": {
            "const": "value",
            "default": "value",
            "title": "Type",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          },
          "operator": {
            "$ref": "#/components/schemas/WorkflowModuleConditionOperatorType",
            "default": "is not null"
          },
          "target_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Target Value"
          }
        },
        "required": [
          "id",
          "value"
        ],
        "title": "WorkflowModuleConditionValueModel",
        "type": "object"
      },
      "WorkflowModuleConnectionManagedModelByName": {
        "properties": {
          "connection_app_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Connection App Type"
          },
          "connection_management_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "managed",
            "title": "Connection Management Type"
          },
          "connection_name": {
            "title": "Connection Name",
            "type": "string"
          }
        },
        "required": [
          "connection_name"
        ],
        "title": "WorkflowModuleConnectionManagedModelByName",
        "type": "object"
      },
      "WorkflowModuleConnectionManagedModelByResourceId": {
        "properties": {
          "connection_app_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Connection App Type"
          },
          "connection_management_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "managed",
            "title": "Connection Management Type"
          },
          "connection_resource_id": {
            "title": "Connection Resource Id",
            "type": "string"
          }
        },
        "required": [
          "connection_resource_id"
        ],
        "title": "WorkflowModuleConnectionManagedModelByResourceId",
        "type": "object"
      },
      "WorkflowModuleConnectionUserDataModel": {
        "properties": {
          "connection_data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowModuleConnectionUserDataValueModel"
              },
              {
                "type": "null"
              }
            ],
            "default": {
              "value": null
            }
          },
          "connection_management_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "user_data",
            "title": "Connection Management Type"
          }
        },
        "title": "WorkflowModuleConnectionUserDataModel",
        "type": "object"
      },
      "WorkflowModuleConnectionUserDataValueModel": {
        "properties": {
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          }
        },
        "required": [
          "value"
        ],
        "title": "WorkflowModuleConnectionUserDataValueModel",
        "type": "object"
      },
      "WorkflowModuleErrorStrategyConditionActionModel": {
        "properties": {
          "retry_count": {
            "default": 0,
            "title": "Retry Count",
            "type": "integer"
          },
          "retry_interval": {
            "default": 0,
            "title": "Retry Interval",
            "type": "integer"
          }
        },
        "title": "WorkflowModuleErrorStrategyConditionActionModel",
        "type": "object"
      },
      "WorkflowModuleErrorStrategyConditionModel": {
        "properties": {
          "condition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowModuleConditionGroupModel"
              },
              {
                "$ref": "#/components/schemas/WorkflowModuleConditionValueModel"
              },
              {
                "$ref": "#/components/schemas/WorkflowModuleConditionComparatorModel"
              }
            ],
            "title": "Condition"
          },
          "retry_policy": {
            "$ref": "#/components/schemas/WorkflowModuleErrorStrategyConditionActionModel"
          }
        },
        "required": [
          "condition",
          "retry_policy"
        ],
        "title": "WorkflowModuleErrorStrategyConditionModel",
        "type": "object"
      },
      "WorkflowModuleErrorStrategyModel": {
        "properties": {
          "conditions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/WorkflowModuleErrorStrategyConditionModel"
            },
            "title": "Conditions",
            "type": "array"
          },
          "else_condition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowModuleErrorStrategyConditionActionModel"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "title": "WorkflowModuleErrorStrategyModel",
        "type": "object"
      },
      "WorkflowSchemaEdgeHandleModel": {
        "properties": {
          "handle_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Handle Id"
          },
          "workflow_module_instance_id": {
            "title": "Workflow Module Instance Id",
            "type": "string"
          }
        },
        "required": [
          "workflow_module_instance_id"
        ],
        "title": "WorkflowSchemaEdgeHandleModel",
        "type": "object"
      },
      "WorkflowSchemaEdgeModel": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/WorkflowSchemaEdgeHandleModel"
          },
          "target": {
            "$ref": "#/components/schemas/WorkflowSchemaEdgeHandleModel"
          },
          "edge_id": {
            "title": "Edge Id",
            "type": "string"
          }
        },
        "required": [
          "source",
          "target",
          "edge_id"
        ],
        "title": "WorkflowSchemaEdgeModel",
        "type": "object"
      },
      "WorkflowSchemaModel": {
        "properties": {
          "workflow_execution_timeout": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 300,
            "title": "Workflow Execution Timeout"
          },
          "workflow_module_execution_timeout": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 300,
            "title": "Workflow Module Execution Timeout"
          },
          "return_workflow_module_instance_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Return Workflow Module Instance Ids"
          },
          "modules": {
            "items": {
              "$ref": "#/components/schemas/WorkflowSchemaModuleModel"
            },
            "title": "Modules",
            "type": "array"
          },
          "edges": {
            "items": {
              "$ref": "#/components/schemas/WorkflowSchemaEdgeModel"
            },
            "title": "Edges",
            "type": "array"
          }
        },
        "required": [
          "modules",
          "edges"
        ],
        "title": "WorkflowSchemaModel",
        "type": "object"
      },
      "WorkflowSchemaModuleModel": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "workflow_module_instance_id": {
            "title": "Workflow Module Instance Id",
            "type": "string"
          },
          "module_id": {
            "title": "Module Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Description"
          },
          "properties": {
            "type": "object",
            "additionalProperties": true,
            "title": "Properties"
          },
          "connections": {
            "default": [],
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WorkflowModuleConnectionManagedModelByResourceId"
                },
                {
                  "$ref": "#/components/schemas/WorkflowModuleConnectionManagedModelByName"
                },
                {
                  "$ref": "#/components/schemas/WorkflowModuleConnectionUserDataModel"
                }
              ]
            },
            "title": "Connections",
            "type": "array"
          },
          "module_options": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowSchemaModuleOptionsModel"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "error_handling_strategy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowModuleErrorStrategyModel"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "name",
          "workflow_module_instance_id",
          "module_id",
          "properties"
        ],
        "title": "WorkflowSchemaModuleModel",
        "type": "object"
      },
      "WorkflowSchemaModuleOptionsLayoutModel": {
        "properties": {
          "group_module_instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Group Module Instance Id"
          }
        },
        "title": "WorkflowSchemaModuleOptionsLayoutModel",
        "type": "object"
      },
      "WorkflowSchemaModuleOptionsModel": {
        "properties": {
          "patches": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Patches"
          },
          "layout": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowSchemaModuleOptionsLayoutModel"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "enable_error_handling": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Enable Error Handling"
          },
          "workflow_module_execution_timeout": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Workflow Module Execution Timeout"
          }
        },
        "title": "WorkflowSchemaModuleOptionsModel",
        "type": "object"
      },
      "WorkflowStatus": {
        "enum": [
          "running",
          "paused",
          "deleted"
        ],
        "title": "WorkflowStatus",
        "type": "string"
      },
      "JsonValue": {},
      "WorkflowVariableDataValueType": {
        "enum": [
          "string",
          "number",
          "boolean",
          "object",
          "array",
          "json"
        ],
        "title": "WorkflowVariableDataValueType",
        "type": "string"
      },
      "Connection": {
        "properties": {
          "connection_id": {
            "title": "Connection Id",
            "type": "string"
          },
          "connection_name": {
            "title": "Connection Name",
            "type": "string"
          },
          "app_type": {
            "description": "The type shown in Stacksync",
            "title": "App Type",
            "type": "string"
          },
          "is_shared_with_workspace": {
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "created_time": {
            "description": "UTC, YYYY-MM-DD HH:MM:SS",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "description": "UTC, YYYY-MM-DD HH:MM:SS",
            "title": "Last Modified Time",
            "type": "string"
          },
          "credentials_options": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "boolean"
                }
              ]
            },
            "description": "The identifiers of the connection (instance_id, instance_url, shop_name, sub_domain...), never a secret",
            "title": "Credentials Options",
            "type": "object"
          },
          "connection_resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name workflow steps reference the connection by",
            "title": "Connection Resource Id"
          },
          "region": {
            "title": "Region",
            "type": "string"
          },
          "needs_reauthorization": {
            "description": "True when Stacksync marked the credentials invalid (the app refused to refresh them): reauthorize it in Stacksync. Credentials the app refuses on a read are reported by that read",
            "title": "Needs Reauthorization",
            "type": "boolean"
          }
        },
        "required": [
          "connection_id",
          "connection_name",
          "app_type",
          "is_shared_with_workspace",
          "created_time",
          "last_modified_time",
          "credentials_options",
          "connection_resource_id",
          "region",
          "needs_reauthorization"
        ],
        "title": "Connection",
        "type": "object"
      },
      "ConnectionApiProxy": {
        "properties": {
          "api_proxy_id": {
            "title": "Api Proxy Id",
            "type": "string"
          },
          "api_proxy_name": {
            "title": "Api Proxy Name",
            "type": "string"
          }
        },
        "required": [
          "api_proxy_id",
          "api_proxy_name"
        ],
        "title": "ConnectionApiProxy",
        "type": "object"
      },
      "ConnectionSync": {
        "properties": {
          "sync_id": {
            "title": "Sync Id",
            "type": "string"
          },
          "sync_name": {
            "title": "Sync Name",
            "type": "string"
          }
        },
        "required": [
          "sync_id",
          "sync_name"
        ],
        "title": "ConnectionSync",
        "type": "object"
      },
      "ConnectionTask": {
        "properties": {
          "task_id": {
            "title": "Task Id",
            "type": "string"
          },
          "task_name": {
            "title": "Task Name",
            "type": "string"
          },
          "sync_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The sync of the trigger this task runs, null for a scheduled task",
            "title": "Sync Id"
          },
          "trigger_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The sync trigger this task runs, null for a scheduled task",
            "title": "Trigger Id"
          }
        },
        "required": [
          "task_id",
          "task_name"
        ],
        "title": "ConnectionTask",
        "type": "object"
      },
      "ConnectionWithUsage": {
        "properties": {
          "connection_id": {
            "title": "Connection Id",
            "type": "string"
          },
          "connection_name": {
            "title": "Connection Name",
            "type": "string"
          },
          "app_type": {
            "description": "The type shown in Stacksync",
            "title": "App Type",
            "type": "string"
          },
          "is_shared_with_workspace": {
            "title": "Is Shared With Workspace",
            "type": "boolean"
          },
          "created_time": {
            "description": "UTC, YYYY-MM-DD HH:MM:SS",
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_time": {
            "description": "UTC, YYYY-MM-DD HH:MM:SS",
            "title": "Last Modified Time",
            "type": "string"
          },
          "credentials_options": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "boolean"
                }
              ]
            },
            "description": "The identifiers of the connection (instance_id, instance_url, shop_name, sub_domain...), never a secret",
            "title": "Credentials Options",
            "type": "object"
          },
          "connection_resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name workflow steps reference the connection by",
            "title": "Connection Resource Id"
          },
          "region": {
            "title": "Region",
            "type": "string"
          },
          "needs_reauthorization": {
            "description": "True when Stacksync marked the credentials invalid (the app refused to refresh them): reauthorize it in Stacksync. Credentials the app refuses on a read are reported by that read",
            "title": "Needs Reauthorization",
            "type": "boolean"
          },
          "used_in_syncs": {
            "items": {
              "$ref": "#/components/schemas/ConnectionSync"
            },
            "title": "Used In Syncs",
            "type": "array"
          },
          "used_in_workflows": {
            "items": {
              "$ref": "#/components/schemas/ConnectionWorkflow"
            },
            "title": "Used In Workflows",
            "type": "array"
          },
          "used_in_api_proxies": {
            "items": {
              "$ref": "#/components/schemas/ConnectionApiProxy"
            },
            "title": "Used In Api Proxies",
            "type": "array"
          },
          "used_in_tasks": {
            "items": {
              "$ref": "#/components/schemas/ConnectionTask"
            },
            "title": "Used In Tasks",
            "type": "array"
          },
          "can_delete": {
            "description": "False while a sync, workflow, API proxy or task uses the connection",
            "title": "Can Delete",
            "type": "boolean"
          }
        },
        "required": [
          "connection_id",
          "connection_name",
          "app_type",
          "is_shared_with_workspace",
          "created_time",
          "last_modified_time",
          "credentials_options",
          "connection_resource_id",
          "region",
          "needs_reauthorization",
          "used_in_syncs",
          "used_in_workflows",
          "used_in_api_proxies",
          "used_in_tasks",
          "can_delete"
        ],
        "title": "ConnectionWithUsage",
        "type": "object"
      },
      "ConnectionWorkflow": {
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "workflow_name": {
            "title": "Workflow Name",
            "type": "string"
          }
        },
        "required": [
          "workflow_id",
          "workflow_name"
        ],
        "title": "ConnectionWorkflow",
        "type": "object"
      },
      "DeletedConnection": {
        "properties": {
          "connection_id": {
            "title": "Connection Id",
            "type": "string"
          }
        },
        "required": [
          "connection_id"
        ],
        "title": "DeletedConnection",
        "type": "object"
      },
      "FolderTreeNode": {
        "properties": {
          "folder_id": {
            "title": "Folder Id",
            "type": "string"
          },
          "folder_name": {
            "title": "Folder Name",
            "type": "string"
          },
          "folders": {
            "items": {
              "$ref": "#/components/schemas/FolderTreeNode"
            },
            "title": "Folders",
            "type": "array"
          }
        },
        "required": [
          "folder_id",
          "folder_name",
          "folders"
        ],
        "title": "FolderTreeNode",
        "type": "object"
      },
      "ResourceType": {
        "enum": [
          "connection",
          "folder",
          "workflow",
          "workspace_variable",
          "sync",
          "api_proxy",
          "app_queue",
          "genie",
          "knowledge_base"
        ],
        "title": "ResourceType",
        "type": "string"
      },
      "FolderResource": {
        "description": "A resource filed in a folder: a workflow, sync, connection, genie, knowledge base, queue, variable, API proxy or sub-folder",
        "properties": {
          "resource_type": {
            "$ref": "#/components/schemas/ResourceType"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "resource_name": {
            "title": "Resource Name",
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "apps": {
            "description": "The apps the resource connects, as the web app shows them; empty when none",
            "items": {
              "type": "string"
            },
            "title": "Apps",
            "type": "array"
          },
          "parent_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Folder Id"
          },
          "last_modified_time": {
            "format": "date-time",
            "title": "Last Modified Time",
            "type": "string"
          }
        },
        "required": [
          "resource_type",
          "resource_id",
          "resource_name",
          "status",
          "region",
          "apps",
          "parent_folder_id",
          "last_modified_time"
        ],
        "title": "FolderResource",
        "type": "object"
      },
      "ResourceToMove": {
        "additionalProperties": false,
        "description": "A resource to file under a folder, as GET .../resources lists it",
        "properties": {
          "resource_type": {
            "$ref": "#/components/schemas/ResourceType"
          },
          "resource_id": {
            "description": "Id of the resource",
            "format": "uuid",
            "title": "Resource Id",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "resource_type",
          "resource_id",
          "region"
        ],
        "title": "ResourceToMove",
        "type": "object"
      },
      "MovedResource": {
        "properties": {
          "resource_type": {
            "$ref": "#/components/schemas/ResourceType"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "resource_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The name of the resource; None when it was not found",
            "title": "Resource Name"
          },
          "source_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The folder it was in before the move; None at the root or when it was not found",
            "title": "Source Folder Id"
          }
        },
        "required": [
          "resource_type",
          "resource_id",
          "region"
        ],
        "title": "MovedResource",
        "type": "object"
      },
      "ResourceNotMoved": {
        "properties": {
          "resource_type": {
            "$ref": "#/components/schemas/ResourceType"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "resource_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The name of the resource; None when it was not found",
            "title": "Resource Name"
          },
          "source_folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The folder it was in before the move; None at the root or when it was not found",
            "title": "Source Folder Id"
          },
          "msg": {
            "description": "Why this resource was not moved",
            "title": "Msg",
            "type": "string"
          }
        },
        "required": [
          "resource_type",
          "resource_id",
          "region",
          "msg"
        ],
        "title": "ResourceNotMoved",
        "type": "object"
      },
      "GenieSummary": {
        "properties": {
          "genie_id": {
            "title": "Genie Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "apps": {
            "description": "The apps its skills act in",
            "items": {
              "type": "string"
            },
            "title": "Apps",
            "type": "array"
          },
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Folder Id"
          },
          "last_modified_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Last Modified Time"
          }
        },
        "required": [
          "genie_id",
          "name",
          "region"
        ],
        "title": "GenieSummary",
        "type": "object"
      },
      "GenieConfigDocument": {
        "additionalProperties": false,
        "description": "What the genie does and how: its instructions, channels, skills, resources and tools",
        "properties": {
          "master_prompt": {
            "default": "",
            "description": "The genie's instructions",
            "title": "Master Prompt",
            "type": "string"
          },
          "description": {
            "default": "",
            "description": "Leave empty: Stacksync writes it from the instructions",
            "title": "Description",
            "type": "string"
          },
          "model": {
            "default": "",
            "description": "The LLM the genie runs on; empty for Stacksync's default",
            "title": "Model",
            "type": "string"
          },
          "interfaces": {
            "items": {
              "$ref": "#/components/schemas/GenieInterfaceDocument"
            },
            "title": "Interfaces",
            "type": "array"
          },
          "skills": {
            "items": {
              "$ref": "#/components/schemas/GenieSkillDocument"
            },
            "title": "Skills",
            "type": "array"
          },
          "app_descriptions": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per skill app type: when and how the genie uses that app",
            "title": "App Descriptions",
            "type": "object"
          },
          "resources": {
            "items": {
              "$ref": "#/components/schemas/GenieResourceDocument"
            },
            "title": "Resources",
            "type": "array"
          },
          "teams": {
            "items": {
              "$ref": "#/components/schemas/GenieTeamDocument"
            },
            "title": "Teams",
            "type": "array"
          },
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/GenieContactDocument"
            },
            "title": "Contacts",
            "type": "array"
          },
          "tools": {
            "$ref": "#/components/schemas/GenieToolsDocument"
          }
        },
        "title": "GenieConfigDocument",
        "type": "object"
      },
      "GenieContactDocument": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "email"
        ],
        "title": "GenieContactDocument",
        "type": "object"
      },
      "GenieInterfaceDocument": {
        "additionalProperties": false,
        "description": "A channel the genie listens on: a Slack or Microsoft Teams connection, or an email address",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "type": {
            "description": "slack, teams or email",
            "title": "Type",
            "type": "string"
          },
          "details": {
            "description": "For email: the address '<alias>@stacksync.email'",
            "title": "Details",
            "type": "string"
          },
          "connection_id": {
            "default": "",
            "description": "The Slack or Teams connection of the workspace; empty for email",
            "title": "Connection Id",
            "type": "string"
          },
          "connection_resource_id": {
            "default": "",
            "description": "The resource id of that connection; empty for email",
            "title": "Connection Resource Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "details"
        ],
        "title": "GenieInterfaceDocument",
        "type": "object"
      },
      "GenieKnowledgeBaseDocument": {
        "additionalProperties": false,
        "description": "A knowledge base of the workspace the genie consults, and when",
        "properties": {
          "knowledge_base_id": {
            "description": "As answered by the knowledge base routes",
            "format": "uuid",
            "title": "Knowledge Base Id",
            "type": "string"
          },
          "instructions": {
            "default": "",
            "title": "Instructions",
            "type": "string"
          }
        },
        "required": [
          "knowledge_base_id"
        ],
        "title": "GenieKnowledgeBaseDocument",
        "type": "object"
      },
      "GenieResourceDocument": {
        "additionalProperties": false,
        "description": "A connection, variable or secret of the workspace the genie may use, with instructions on when",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "type": {
            "enum": [
              "connection",
              "variable",
              "secret"
            ],
            "title": "Type",
            "type": "string"
          },
          "value": {
            "description": "The connection id or the variable id",
            "title": "Value",
            "type": "string"
          },
          "instructions": {
            "default": "",
            "title": "Instructions",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "value"
        ],
        "title": "GenieResourceDocument",
        "type": "object"
      },
      "GenieSkillDocument": {
        "additionalProperties": false,
        "description": "One app action the genie may take (a module of the module catalog), and the connection it acts with",
        "properties": {
          "id": {
            "description": "The module id",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "description": {
            "default": "",
            "title": "Description",
            "type": "string"
          },
          "type": {
            "const": "Module",
            "default": "Module",
            "title": "Type",
            "type": "string"
          },
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "connection": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The connection id the action runs with",
            "title": "Connection"
          },
          "connection_resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The resource id of that connection",
            "title": "Connection Resource Id"
          },
          "approval_policy": {
            "default": "always_allow",
            "description": "approval_required pauses the genie until a person approves the action",
            "enum": [
              "always_allow",
              "approval_required"
            ],
            "title": "Approval Policy",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "GenieSkillDocument",
        "type": "object"
      },
      "GenieTeamDocument": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "GenieTeamDocument",
        "type": "object"
      },
      "GenieToolsDocument": {
        "additionalProperties": false,
        "description": "The built-in tools the genie may use; all on by default, as in the web app",
        "properties": {
          "web_search": {
            "default": true,
            "title": "Web Search",
            "type": "boolean"
          },
          "execute_browser": {
            "default": true,
            "title": "Execute Browser",
            "type": "boolean"
          },
          "api_call": {
            "default": true,
            "title": "Api Call",
            "type": "boolean"
          },
          "code_execution": {
            "default": true,
            "title": "Code Execution",
            "type": "boolean"
          },
          "stacksync_ocr": {
            "default": true,
            "title": "Stacksync Ocr",
            "type": "boolean"
          },
          "modify_scheduled_task": {
            "default": true,
            "title": "Modify Scheduled Task",
            "type": "boolean"
          }
        },
        "title": "GenieToolsDocument",
        "type": "object"
      },
      "GenieConfigInput": {
        "additionalProperties": false,
        "properties": {
          "master_prompt": {
            "default": "",
            "description": "The genie's instructions",
            "title": "Master Prompt",
            "type": "string"
          },
          "description": {
            "default": "",
            "description": "Leave empty: Stacksync writes it from the instructions",
            "title": "Description",
            "type": "string"
          },
          "model": {
            "default": "",
            "description": "The LLM the genie runs on; empty for Stacksync's default",
            "title": "Model",
            "type": "string"
          },
          "interfaces": {
            "items": {
              "$ref": "#/components/schemas/GenieInterfaceDocument"
            },
            "title": "Interfaces",
            "type": "array"
          },
          "skills": {
            "items": {
              "$ref": "#/components/schemas/GenieSkillDocument"
            },
            "title": "Skills",
            "type": "array"
          },
          "app_descriptions": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per skill app type: when and how the genie uses that app",
            "title": "App Descriptions",
            "type": "object"
          },
          "resources": {
            "items": {
              "$ref": "#/components/schemas/GenieResourceDocument"
            },
            "title": "Resources",
            "type": "array"
          },
          "teams": {
            "items": {
              "$ref": "#/components/schemas/GenieTeamDocument"
            },
            "title": "Teams",
            "type": "array"
          },
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/GenieContactDocument"
            },
            "title": "Contacts",
            "type": "array"
          },
          "tools": {
            "$ref": "#/components/schemas/GenieToolsDocument"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Your own LLM API key for the model; never returned",
            "is_secret": true,
            "title": "Api Key"
          }
        },
        "title": "GenieConfigInput",
        "type": "object"
      },
      "GenieConfigChanges": {
        "additionalProperties": false,
        "description": "A partial configuration: the keys sent replace the stored ones, the others are kept (tools merge key by key)",
        "properties": {
          "master_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Master Prompt"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Description"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Model"
          },
          "interfaces": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GenieInterfaceDocument"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Interfaces"
          },
          "skills": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GenieSkillDocument"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Skills"
          },
          "app_descriptions": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "App Descriptions"
          },
          "resources": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GenieResourceDocument"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Resources"
          },
          "teams": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GenieTeamDocument"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Teams"
          },
          "contacts": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GenieContactDocument"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Contacts"
          },
          "tools": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "boolean"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Only the tools to switch, e.g. {\"web_search\": false}",
            "title": "Tools"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Your own LLM API key for the model; never returned",
            "is_secret": true,
            "title": "Api Key"
          }
        },
        "title": "GenieConfigChanges",
        "type": "object"
      },
      "GenieAccessPrincipal": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "enum": [
              "user",
              "group"
            ],
            "title": "Type",
            "type": "string"
          },
          "id": {
            "description": "The user id or the group id",
            "maxLength": 64,
            "minLength": 1,
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "GenieAccessPrincipal",
        "type": "object"
      },
      "GenieAccessGrantSummary": {
        "properties": {
          "principal": {
            "$ref": "#/components/schemas/GenieAccessPrincipal"
          },
          "role": {
            "description": "operator, editor or owner, or the custom_role_id of a custom role",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "principal",
          "role"
        ],
        "title": "GenieAccessGrantSummary",
        "type": "object"
      },
      "GenieConversationSummary": {
        "properties": {
          "conversation_id": {
            "title": "Conversation Id",
            "type": "string"
          },
          "genie_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Genie Id"
          },
          "genie_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Genie Name"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "status_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status Label"
          },
          "last_activity_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Last Activity Time"
          },
          "message_count": {
            "default": 0,
            "title": "Message Count",
            "type": "integer"
          },
          "step_count": {
            "default": 0,
            "title": "Step Count",
            "type": "integer"
          }
        },
        "required": [
          "conversation_id"
        ],
        "title": "GenieConversationSummary",
        "type": "object"
      },
      "GenieApproval": {
        "properties": {
          "approval_id": {
            "title": "Approval Id",
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "module_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Module Id"
          },
          "module_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Module Name"
          },
          "channel_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Channel Type"
          },
          "target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Target"
          },
          "instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Instructions"
          },
          "requested_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Requested At"
          },
          "decision_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Decision At"
          },
          "approver_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Approver Name"
          }
        },
        "required": [
          "approval_id"
        ],
        "title": "GenieApproval",
        "type": "object"
      },
      "GenieMessage": {
        "properties": {
          "message_id": {
            "title": "Message Id",
            "type": "string"
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Created Time"
          },
          "channel": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Channel"
          },
          "sender_role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "customer or genie",
            "title": "Sender Role"
          },
          "sender_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Sender Name"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Body"
          },
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/GenieMessageAttachment"
            },
            "title": "Attachments",
            "type": "array"
          },
          "approval": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenieApproval"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "message_id"
        ],
        "title": "GenieMessage",
        "type": "object"
      },
      "GenieMessageAttachment": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "mime_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Mime Type"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Size Bytes"
          },
          "file_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The workspace file, once stored",
            "title": "File Id"
          }
        },
        "required": [
          "name"
        ],
        "title": "GenieMessageAttachment",
        "type": "object"
      },
      "GenieStep": {
        "description": "One customer-visible step the genie took: an app action, a search, a decision",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Description"
          },
          "execution_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Execution Status"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Error Message"
          },
          "log_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Log Type"
          },
          "execution_log_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Open the tool run with the tool-executions route",
            "title": "Execution Log Id"
          },
          "started_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Started Time"
          },
          "finished_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Finished Time"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Duration Ms"
          }
        },
        "title": "GenieStep",
        "type": "object"
      },
      "GenieModuleRun": {
        "properties": {
          "execution_log_id": {
            "title": "Execution Log Id",
            "type": "string"
          },
          "execution_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Execution Type"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Finished At"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Duration Ms"
          },
          "request": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "response": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          }
        },
        "required": [
          "execution_log_id"
        ],
        "title": "GenieModuleRun",
        "type": "object"
      },
      "GenieLogConversation": {
        "properties": {
          "conversation_id": {
            "title": "Conversation Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Status"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Updated At"
          },
          "tool_costs": {
            "default": 0.0,
            "title": "Tool Costs",
            "type": "number"
          },
          "token_costs": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenieTokenCosts"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/GenieLogMessage"
            },
            "title": "Messages",
            "type": "array"
          }
        },
        "required": [
          "conversation_id",
          "messages"
        ],
        "title": "GenieLogConversation",
        "type": "object"
      },
      "GenieLogMessage": {
        "properties": {
          "message_id": {
            "title": "Message Id",
            "type": "string"
          },
          "prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "What the genie was asked",
            "title": "Prompt"
          },
          "response": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "What it answered",
            "title": "Response"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Finished At"
          },
          "llm_call_count": {
            "default": 0,
            "title": "Llm Call Count",
            "type": "integer"
          },
          "tool_calls": {
            "default": 0,
            "title": "Tool Calls",
            "type": "integer"
          },
          "tools_called": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "title": "Tools Called",
            "type": "array"
          },
          "tool_costs": {
            "default": 0.0,
            "title": "Tool Costs",
            "type": "number"
          },
          "token_costs": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenieTokenCosts"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "message_id"
        ],
        "title": "GenieLogMessage",
        "type": "object"
      },
      "GenieTokenCosts": {
        "properties": {
          "tokens_in": {
            "default": 0,
            "title": "Tokens In",
            "type": "integer"
          },
          "tokens_in_cached": {
            "default": 0,
            "title": "Tokens In Cached",
            "type": "integer"
          },
          "tokens_out": {
            "default": 0,
            "title": "Tokens Out",
            "type": "integer"
          },
          "tokens_thoughts": {
            "default": 0,
            "title": "Tokens Thoughts",
            "type": "integer"
          },
          "cost": {
            "default": 0.0,
            "title": "Cost",
            "type": "number"
          }
        },
        "title": "GenieTokenCosts",
        "type": "object"
      },
      "QueueStatus": {
        "enum": [
          "running",
          "paused"
        ],
        "title": "QueueStatus",
        "type": "string"
      },
      "QueueResourceReference": {
        "properties": {
          "resource_type": {
            "description": "workflow or sync",
            "title": "Resource Type",
            "type": "string"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "resource_name": {
            "title": "Resource Name",
            "type": "string"
          },
          "is_deployed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "For a workflow: a version using the queue is deployed",
            "title": "Is Deployed"
          },
          "is_trigger_paused": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "For a sync: its queue trigger is paused",
            "title": "Is Trigger Paused"
          },
          "is_sync_paused": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "For a sync: the sync itself is paused",
            "title": "Is Sync Paused"
          }
        },
        "required": [
          "resource_type",
          "resource_id",
          "resource_name"
        ],
        "title": "QueueResourceReference",
        "type": "object"
      },
      "QueueRecordOrder": {
        "enum": [
          "oldest",
          "newest"
        ],
        "title": "QueueRecordOrder",
        "type": "string"
      },
      "QueueRecord": {
        "properties": {
          "record_id": {
            "title": "Record Id",
            "type": "string"
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created Time"
          },
          "process_start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a flush started sending the record, null while it waits",
            "title": "Process Start Time"
          },
          "is_to_retry": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "The record failed in a flush and is sent again",
            "title": "Is To Retry"
          },
          "data": {
            "description": "The record's payload, at most 10,000 characters",
            "title": "Data",
            "type": "string"
          }
        },
        "required": [
          "record_id",
          "created_time",
          "process_start_time",
          "is_to_retry",
          "data"
        ],
        "title": "QueueRecord",
        "type": "object"
      },
      "BaseAppMetrics": {
        "properties": {
          "app_id": {
            "title": "App Id",
            "type": "string"
          },
          "processing_records": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Processing Records"
          },
          "tables": {
            "items": {
              "$ref": "#/components/schemas/BaseTableMetrics"
            },
            "title": "Tables",
            "type": "array"
          }
        },
        "required": [
          "app_id",
          "tables"
        ],
        "title": "BaseAppMetrics",
        "type": "object"
      },
      "BaseTableMetrics": {
        "description": "The counts of one table of one app of a sync; null when the platform has not recorded it (unknown, not zero)",
        "properties": {
          "table_mapping_id": {
            "title": "Table Mapping Id",
            "type": "string"
          },
          "table_name": {
            "title": "Table Name",
            "type": "string"
          },
          "records": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Records"
          },
          "delete_protected_records": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Delete Protected Records"
          },
          "issues": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issues"
          },
          "issues_created": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issues Created"
          },
          "issues_updated": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issues Updated"
          },
          "issues_deleted": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issues Deleted"
          },
          "changes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Changes"
          },
          "changes_created": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Changes Created"
          },
          "changes_updated": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Changes Updated"
          },
          "changes_deleted": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Changes Deleted"
          },
          "issues_ignored": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issues Ignored"
          },
          "issues_ignored_created": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issues Ignored Created"
          },
          "issues_ignored_updated": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issues Ignored Updated"
          },
          "issues_ignored_deleted": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issues Ignored Deleted"
          }
        },
        "required": [
          "table_mapping_id",
          "table_name"
        ],
        "title": "BaseTableMetrics",
        "type": "object"
      },
      "BaseAppDiagnostics": {
        "properties": {
          "app_id": {
            "title": "App Id",
            "type": "string"
          },
          "tables": {
            "items": {
              "$ref": "#/components/schemas/BaseTableDiagnostics"
            },
            "title": "Tables",
            "type": "array"
          }
        },
        "required": [
          "app_id",
          "tables"
        ],
        "title": "BaseAppDiagnostics",
        "type": "object"
      },
      "BaseTableDiagnostics": {
        "description": "The work queued and in flight for one table of one app of a sync, and how much of it is stuck",
        "properties": {
          "table_mapping_id": {
            "title": "Table Mapping Id",
            "type": "string"
          },
          "table_name": {
            "title": "Table Name",
            "type": "string"
          },
          "change_queue_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Change Queue Count"
          },
          "change_queue_future_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Change Queue Future Count"
          },
          "change_queue_stuck_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Change Queue Stuck Count"
          },
          "ongoing_write_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Ongoing Write Count"
          },
          "ongoing_write_stuck_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Ongoing Write Stuck Count"
          },
          "record_locks_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Record Locks Count"
          },
          "record_locks_stuck_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Record Locks Stuck Count"
          },
          "rescrape_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Rescrape Count"
          },
          "rescrape_stuck_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Rescrape Stuck Count"
          }
        },
        "required": [
          "table_mapping_id",
          "table_name"
        ],
        "title": "BaseTableDiagnostics",
        "type": "object"
      },
      "PublicBaseSettings": {
        "properties": {
          "max_records_sync_delay_in_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The longest a change may wait before it is synced, in seconds; 0 syncs in real time",
            "title": "Max Records Sync Delay In Seconds"
          }
        },
        "title": "PublicBaseSettings",
        "type": "object"
      },
      "SwitchAction": {
        "enum": [
          "ON",
          "OFF"
        ],
        "title": "SwitchAction",
        "type": "string"
      },
      "CDCMethod": {
        "enum": [
          "triggers",
          "logical_replication"
        ],
        "title": "CDCMethod",
        "type": "string"
      },
      "WorkflowModuleApp": {
        "properties": {
          "app_type": {
            "description": "The app, as GET .../workflows/modules/apps/<app_type> takes it",
            "title": "App Type",
            "type": "string"
          },
          "action_count": {
            "title": "Action Count",
            "type": "integer"
          },
          "trigger_count": {
            "title": "Trigger Count",
            "type": "integer"
          },
          "is_connection_required": {
            "description": "Whether a module of the app needs a connection to the app",
            "title": "Is Connection Required",
            "type": "boolean"
          }
        },
        "required": [
          "app_type",
          "action_count",
          "trigger_count",
          "is_connection_required"
        ],
        "title": "WorkflowModuleApp",
        "type": "object"
      },
      "WorkflowModuleSummary": {
        "properties": {
          "module_id": {
            "title": "Module Id",
            "type": "string"
          },
          "module_version": {
            "title": "Module Version",
            "type": "string"
          },
          "module_name": {
            "title": "Module Name",
            "type": "string"
          },
          "module_description": {
            "title": "Module Description",
            "type": "string"
          },
          "is_connection_required": {
            "title": "Is Connection Required",
            "type": "boolean"
          },
          "connection_app_types": {
            "description": "The app types of the connections the module accepts",
            "items": {
              "type": "string"
            },
            "title": "Connection App Types",
            "type": "array"
          },
          "is_read_action": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "For an action, True when it only reads from the app (a viewer may run it), False when it can change data; None for a trigger",
            "title": "Is Read Action"
          }
        },
        "required": [
          "module_id",
          "module_version",
          "module_name",
          "module_description",
          "is_connection_required",
          "connection_app_types",
          "is_read_action"
        ],
        "title": "WorkflowModuleSummary",
        "type": "object"
      },
      "ConnectionRequirement": {
        "properties": {
          "is_required": {
            "title": "Is Required",
            "type": "boolean"
          },
          "app_types": {
            "items": {
              "type": "string"
            },
            "title": "App Types",
            "type": "array"
          }
        },
        "required": [
          "is_required",
          "app_types"
        ],
        "title": "ConnectionRequirement",
        "type": "object"
      },
      "Dropdown": {
        "properties": {
          "dropdown_id": {
            "title": "Dropdown Id",
            "type": "string"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/DropdownOption"
            },
            "title": "Options",
            "type": "array"
          },
          "has_more_options": {
            "title": "Has More Options",
            "type": "boolean"
          }
        },
        "required": [
          "dropdown_id",
          "options",
          "has_more_options"
        ],
        "title": "Dropdown",
        "type": "object"
      },
      "DropdownOption": {
        "properties": {
          "value": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "label": {
            "$ref": "#/components/schemas/JsonValue"
          }
        },
        "required": [
          "value",
          "label"
        ],
        "title": "DropdownOption",
        "type": "object"
      },
      "ModuleRunStatus": {
        "description": "How a run ended",
        "enum": [
          "validated",
          "succeeded",
          "failed",
          "outcome_unknown"
        ],
        "title": "ModuleRunStatus",
        "type": "string"
      },
      "WorkflowListItem": {
        "properties": {
          "workflow_id": {
            "title": "Workflow Id",
            "type": "string"
          },
          "workflow_name": {
            "title": "Workflow Name",
            "type": "string"
          },
          "workflow_resource_id": {
            "title": "Workflow Resource Id",
            "type": "string"
          },
          "workflow_status": {
            "$ref": "#/components/schemas/WorkflowStatus"
          },
          "workspace_id": {
            "title": "Workspace Id",
            "type": "integer"
          },
          "is_shared_with_workspace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Shared With Workspace"
          },
          "module_app_type_display_list": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Module App Type Display List"
          },
          "parent_folders": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ParentFolderModel"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Parent Folders"
          },
          "created_by": {
            "title": "Created By",
            "type": "integer"
          },
          "created_time": {
            "title": "Created Time",
            "type": "string"
          },
          "last_modified_by": {
            "title": "Last Modified By",
            "type": "integer"
          },
          "last_modified_time": {
            "title": "Last Modified Time",
            "type": "string"
          },
          "region": {
            "$ref": "#/components/schemas/Regions"
          }
        },
        "required": [
          "workflow_id",
          "workflow_name",
          "workflow_resource_id",
          "workflow_status",
          "workspace_id",
          "created_by",
          "created_time",
          "last_modified_by",
          "last_modified_time",
          "region"
        ],
        "title": "WorkflowListItem",
        "type": "object"
      },
      "StepTrigger": {
        "description": "What a step runs alongside the workflow, after a save, a new draft or a deploy",
        "properties": {
          "step_id": {
            "title": "Step Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TriggerSetupStatus"
          },
          "msg": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Msg"
          }
        },
        "required": [
          "step_id",
          "status"
        ],
        "title": "StepTrigger",
        "type": "object"
      },
      "TriggerSetupStatus": {
        "description": "Whether what a step runs alongside the workflow (schedule, email route, Gmail watch, queue consumer...) is set up",
        "enum": [
          "succeeded",
          "failed"
        ],
        "title": "TriggerSetupStatus",
        "type": "string"
      },
      "WorkflowVersionSummary": {
        "description": "A version without its document; step_ids lists its steps (workflow_module_instance_id)",
        "properties": {
          "workflow_version": {
            "title": "Workflow Version",
            "type": "string"
          },
          "is_draft": {
            "title": "Is Draft",
            "type": "boolean"
          },
          "is_deployed": {
            "title": "Is Deployed",
            "type": "boolean"
          },
          "last_modified_time": {
            "title": "Last Modified Time",
            "type": "string"
          },
          "step_ids": {
            "items": {
              "type": "string"
            },
            "title": "Step Ids",
            "type": "array"
          }
        },
        "required": [
          "workflow_version",
          "is_draft",
          "is_deployed",
          "last_modified_time",
          "step_ids"
        ],
        "title": "WorkflowVersionSummary",
        "type": "object"
      },
      "RunMode": {
        "description": "How a run starts: the web app's Run, Replay and Run module buttons",
        "enum": [
          "run",
          "replay_all",
          "replay_failed",
          "replay_failed_and_dependents",
          "until_step",
          "step_only",
          "from_step"
        ],
        "title": "RunMode",
        "type": "string"
      },
      "RunLog": {
        "description": "One documented log entry of a run (workflow_start, one per step, workflow_end)",
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Id"
          },
          "created_time": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "workflow_execution_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Workflow Execution Id"
          },
          "workflow_module_instance_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Workflow Module Instance Id"
          },
          "workflow_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Workflow Version"
          },
          "log_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Log Type"
          },
          "execution_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Execution Status"
          },
          "execution_duration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Execution Duration"
          },
          "metadata": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          },
          "data": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null
          }
        },
        "title": "RunLog",
        "type": "object"
      },
      "ReplayError": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Error"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Message"
          }
        },
        "title": "ReplayError",
        "type": "object"
      },
      "WorkspaceRole": {
        "enum": [
          "viewer",
          "editor",
          "owner"
        ],
        "title": "WorkspaceRole",
        "type": "string"
      },
      "WorkspaceGroup": {
        "description": "A group of people of the workspace: its group_id is the principal id an access grant takes",
        "properties": {
          "group_id": {
            "format": "uuid",
            "title": "Group Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "member_user_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Member User Ids",
            "type": "array"
          }
        },
        "required": [
          "group_id",
          "name",
          "description",
          "member_user_ids"
        ],
        "title": "WorkspaceGroup",
        "type": "object"
      },
      "WorkspaceMember": {
        "description": "A person of the workspace: their user_id is the principal id an access grant takes",
        "properties": {
          "user_id": {
            "title": "User Id",
            "type": "integer"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "firstname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Firstname"
          },
          "lastname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lastname"
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole",
            "description": "The person's role in the workspace: viewer, editor or owner"
          }
        },
        "required": [
          "user_id",
          "email",
          "firstname",
          "lastname",
          "role"
        ],
        "title": "WorkspaceMember",
        "type": "object"
      },
      "Region": {
        "description": "A region a resource can live in: its data is stored and processed there",
        "properties": {
          "region": {
            "$ref": "#/components/schemas/Regions"
          },
          "location": {
            "title": "Location",
            "type": "string"
          }
        },
        "required": [
          "region",
          "location"
        ],
        "title": "Region",
        "type": "object"
      },
      "TriggerNotFound": {
        "type": "object",
        "title": "TriggerNotFound",
        "description": "The answer to a trigger id that names no trigger of the sync: a message only, no `error` key",
        "properties": {
          "msg": {
            "type": "string",
            "description": "`Trigger not found`"
          }
        },
        "required": [
          "msg"
        ]
      },
      "ConnectionDetails": {
        "type": "object",
        "title": "ConnectionDetails",
        "description": "A connection as the connection routes answer it",
        "properties": {
          "connection_id": {
            "type": "string",
            "description": "The connection",
            "format": "uuid"
          },
          "connection_name": {
            "type": "string",
            "description": "The name of the connection, unique in the workspace"
          },
          "app_type": {
            "type": "string",
            "description": "The app the connection is for, as shown in Stacksync (for example `postgres`, `salesforce`, `supabase`)"
          },
          "is_shared_with_workspace": {
            "type": "boolean",
            "description": "Whether every editor of the workspace can use the connection, or only the user who created it"
          },
          "created_time": {
            "type": "string",
            "description": "When the connection was created. Local server time as `YYYY-MM-DD HH:MM:SS` (UTC)"
          },
          "last_modified_time": {
            "type": "string",
            "description": "When the connection was last changed. Local server time as `YYYY-MM-DD HH:MM:SS` (UTC)"
          },
          "credentials_options": {
            "type": "object",
            "description": "The non-secret settings of the connection. A database connection carries `uses_ssh_tunnel` (boolean) and `connection_mode` (`direct` or `ssh_tunnel`); a Salesforce connection carries `organization_id` and `instance_url`; a HubSpot connection carries its portal settings. Secrets are never answered.",
            "additionalProperties": true
          }
        },
        "required": [
          "connection_id",
          "connection_name",
          "app_type",
          "is_shared_with_workspace",
          "created_time",
          "last_modified_time",
          "credentials_options"
        ]
      },
      "ConnectionDetailsResponse": {
        "type": "object",
        "title": "ConnectionDetailsResponse",
        "description": "The connection written",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ConnectionDetails"
          }
        },
        "required": [
          "data"
        ]
      },
      "CreateConnectionBody": {
        "type": "object",
        "title": "CreateConnectionBody",
        "description": "The connection to create",
        "properties": {
          "connection_name": {
            "type": "string",
            "description": "The name of the connection, unique in the workspace"
          },
          "is_shared_with_workspace": {
            "type": "boolean",
            "description": "True to let every editor of the workspace use the connection, false to keep it to the user of the API key"
          },
          "app_type": {
            "type": "string",
            "description": "The app to connect, as shown in Stacksync",
            "enum": [
              "postgres",
              "postgres_heroku",
              "salesforce",
              "hubspot",
              "bigquery",
              "amazon_lightsail",
              "amazon_rds",
              "supabase",
              "supabase_oauth",
              "scaleway_postgres",
              "cockroachdb",
              "render_postgres",
              "google_alloydb",
              "snowflake",
              "dynamodb",
              "mongodb",
              "sap",
              "zendesk",
              "zoho_crm",
              "microsoft_dynamics",
              "dynamics365_crm",
              "dynamics365_finance",
              "dynamics365_business_central",
              "pipedrive",
              "marketo",
              "odoo",
              "airtable",
              "attio_crm",
              "motherduck",
              "shopify",
              "oracledb",
              "mysql",
              "mariadb",
              "sqlserver",
              "suiteanalytics",
              "twilio",
              "bamboohr",
              "sendgrid",
              "twenty_crm",
              "monday",
              "acumatica",
              "extensiv"
            ]
          },
          "credentials": {
            "type": "object",
            "description": "The credentials of the app, checked per app type before the connection is tested: `postgres`, `postgres_heroku`: `connection_string`, `schema`; `mongodb`: `connection_string`, `database`; `hubspot`, `monday`: `code` (the OAuth authorization code); `salesforce`: `code`, `account_type` (`standard` or `sandbox`); `sendgrid`, `twenty_crm`: `api_key`; `twilio`: `account_sid`, `auth_token`; `bamboohr`: `company_domain`, `api_key`; `snowflake`: `account`, `username`, `warehouse`; `suiteanalytics`: `account_id`, `consumer_key`, `consumer_secret`, `token_id`, `token_secret`, `role_id`; `bigquery`: `service_account_credentials` (the service account JSON: `type`, `project_id`, `private_key_id`, `private_key`, `client_email`, `client_id`, `auth_uri`, `token_uri`, `auth_provider_x509_cert_url`, `client_x509_cert_url`); `acumatica`: `instance_url`, `client_id`, `client_secret`, `code`, `redirect_uri`; `extensiv`: `client_id`, `client_secret`, optional `user_login_id` and `is_sandbox` (boolean). Other app types take the fields their connection form asks for; they are checked when the connection is tested.",
            "additionalProperties": true
          }
        },
        "required": [
          "connection_name",
          "is_shared_with_workspace",
          "app_type",
          "credentials"
        ]
      },
      "ReauthorizeConnectionBody": {
        "type": "object",
        "title": "ReauthorizeConnectionBody",
        "description": "The new credentials of a connection, tested against the app of a sync that uses it",
        "properties": {
          "base_id": {
            "type": "string",
            "description": "The sync whose app uses the connection",
            "format": "uuid"
          },
          "app_id": {
            "type": "string",
            "description": "The app of the sync that uses the connection (its `app_id` in the sync)"
          },
          "credentials": {
            "type": "object",
            "description": "The new credentials, in the shape the connection's app type takes (see the create connection body). `connection_id`, when sent, must be the connection of the path.",
            "additionalProperties": true
          }
        },
        "required": [
          "base_id",
          "app_id",
          "credentials"
        ]
      },
      "AppSchemaPrimaryKey": {
        "type": "object",
        "title": "AppSchemaPrimaryKey",
        "description": "The primary key of a table",
        "properties": {
          "column_name": {
            "type": "string",
            "description": "The name of the primary key column"
          },
          "column_type": {
            "type": "string",
            "description": "The Stacksync type of the column (for example `string`, `int`, `uuid`, `datetime`)"
          }
        }
      },
      "AppSchemaColumn": {
        "type": "object",
        "title": "AppSchemaColumn",
        "description": "A column of a table of the app",
        "properties": {
          "column_name": {
            "type": "string",
            "description": "The name of the column in the app: the value to send as `column_name` when creating a sync"
          },
          "column_type": {
            "type": "string",
            "description": "The Stacksync type of the column (for example `string`, `int`, `number`, `boolean`, `datetime`, `uuid`, `json`)"
          },
          "writable": {
            "type": "boolean",
            "description": "Whether a sync can write to the column; absent when the app does not say"
          }
        },
        "required": [
          "column_name",
          "column_type"
        ]
      },
      "AppSchemaTableOptions": {
        "type": "object",
        "title": "AppSchemaTableOptions",
        "description": "The options of a table of the app",
        "properties": {
          "primary_key": {
            "$ref": "#/components/schemas/AppSchemaPrimaryKey"
          }
        }
      },
      "AppSchemaTable": {
        "type": "object",
        "title": "AppSchemaTable",
        "description": "A table (object) of the app",
        "properties": {
          "table_name": {
            "type": "string",
            "description": "The name of the table in the app: the value to send as `table_name` when creating a sync (its id is accepted too)"
          },
          "table_id": {
            "type": "string",
            "description": "The id of the table in the app, when the app has one apart from the name (BigQuery: `project.dataset.table`)"
          },
          "table_options": {
            "$ref": "#/components/schemas/AppSchemaTableOptions"
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppSchemaColumn"
            },
            "description": "The columns of the table; only filled for the tables named in `table_names`, empty for the others"
          }
        },
        "required": [
          "table_name",
          "table_id",
          "table_options",
          "columns"
        ]
      },
      "AppSchema": {
        "type": "object",
        "title": "AppSchema",
        "description": "The tables and columns Stacksync can read through a connection",
        "properties": {
          "app_type": {
            "type": "string",
            "description": "The app of the connection, as shown in Stacksync"
          },
          "can_create_tables": {
            "type": "boolean",
            "description": "Whether a sync may create a new table in this app (`table_options.create_new_table: true`)"
          },
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppSchemaTable"
            },
            "description": "Every table of the app"
          }
        },
        "required": [
          "app_type",
          "can_create_tables",
          "tables"
        ]
      },
      "GenerateAppSchemaBody": {
        "type": "object",
        "title": "GenerateAppSchemaBody",
        "description": "The connection to read, and the tables to read the columns of",
        "properties": {
          "connection_id": {
            "type": "string",
            "description": "The connection to read the schema through",
            "format": "uuid"
          },
          "table_names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The tables to read the columns of, by `table_name` or `table_id` exactly as the schema lists them; the answer lists every table but fills `columns` for these only",
            "default": []
          }
        },
        "required": [
          "connection_id"
        ]
      },
      "SyncRateLimit": {
        "type": "object",
        "title": "SyncRateLimit",
        "description": "The most requests Stacksync makes to the app in a period",
        "properties": {
          "rate": {
            "type": "integer",
            "description": "The number of requests allowed per period, 1 to 2147483647",
            "minimum": 1,
            "maximum": 2147483647
          },
          "frequency": {
            "type": "integer",
            "description": "The period of the rate in seconds: 1 (per second), 60 (per minute), 3600 (per hour) or 86400 (per day)",
            "enum": [
              1,
              60,
              3600,
              86400
            ]
          }
        },
        "required": [
          "rate",
          "frequency"
        ]
      },
      "SyncSettings": {
        "type": "object",
        "title": "SyncSettings",
        "description": "The settings of the sync",
        "properties": {
          "max_records_sync_delay_in_seconds": {
            "type": "integer",
            "description": "The longest a change may wait before it is synced, in seconds; 0 syncs in real time"
          }
        }
      },
      "SyncColumn": {
        "type": "object",
        "title": "SyncColumn",
        "description": "A synced column; columns are paired across the two apps by `column_mapping_id`",
        "properties": {
          "column_name": {
            "type": "string",
            "description": "The name of the column in the app"
          },
          "column_mapping_id": {
            "type": "string",
            "description": "The id shared by the two columns of a pair"
          },
          "column_sync_direction": {
            "type": "string",
            "description": "The direction of this column when it differs from the table's: `bidirectional`, `incoming` or `outgoing`; null for the table's",
            "enum": [
              "bidirectional",
              "incoming",
              "outgoing",
              null
            ]
          }
        },
        "additionalProperties": true,
        "required": [
          "column_name",
          "column_mapping_id"
        ]
      },
      "SyncTable": {
        "type": "object",
        "title": "SyncTable",
        "description": "A synced table of an app; tables are paired across the two apps by `table_mapping_id`",
        "properties": {
          "table_name": {
            "type": "string",
            "description": "The name of the table in the app"
          },
          "table_mapping_id": {
            "type": "string",
            "description": "The id shared by the two tables of a pair"
          },
          "sync_direction": {
            "type": "string",
            "description": "`bidirectional` (read and written), `incoming` (only written into) or `outgoing` (only read from)",
            "enum": [
              "bidirectional",
              "incoming",
              "outgoing"
            ]
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncColumn"
            },
            "description": "The synced columns of the table"
          }
        },
        "additionalProperties": true,
        "required": [
          "table_name",
          "table_mapping_id",
          "columns"
        ]
      },
      "SyncApp": {
        "type": "object",
        "title": "SyncApp",
        "description": "One of the two apps of a sync",
        "properties": {
          "app_id": {
            "type": "string",
            "description": "The id of the app inside the sync, used by the app routes (delete protection, rate limit) and by triggers"
          },
          "app_type": {
            "type": "string",
            "description": "The app, as shown in Stacksync"
          },
          "connection_id": {
            "type": "string",
            "description": "The connection the app uses",
            "format": "uuid"
          },
          "connection_name": {
            "type": "string",
            "description": "The name of that connection"
          },
          "rate_limit": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SyncRateLimit"
              },
              {
                "type": "null"
              }
            ],
            "description": "The rate limit of the app, null when Stacksync's default applies"
          },
          "delete_protection": {
            "type": "boolean",
            "description": "Whether deletes are kept from reaching this app"
          },
          "bulk_api_access": {
            "type": "boolean",
            "description": "Whether the Salesforce Bulk API is used for this app"
          },
          "cdc_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "How changes are captured from this app (for example `triggers`, `logical_replication`, `webhook`); null when not applicable"
          },
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncTable"
            },
            "description": "The synced tables of the app"
          }
        },
        "additionalProperties": true,
        "required": [
          "app_id",
          "app_type",
          "delete_protection",
          "bulk_api_access",
          "tables"
        ]
      },
      "Sync": {
        "type": "object",
        "title": "Sync",
        "description": "A sync between two apps, as the read routes answer it",
        "properties": {
          "base_id": {
            "type": "string",
            "description": "The sync",
            "format": "uuid"
          },
          "base_name": {
            "type": "string",
            "description": "The name of the sync"
          },
          "base_status": {
            "type": "string",
            "description": "The state of the sync: `running` (switched on), `paused` (switched off), `processing` (a switch is in progress) or an error state set by the platform"
          },
          "base_region": {
            "type": "string",
            "description": "The data region the sync runs in",
            "enum": [
              "besg",
              "usnv"
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/SyncSettings"
          },
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncApp"
            },
            "description": "The two apps of the sync",
            "minItems": 2,
            "maxItems": 2
          }
        },
        "required": [
          "base_id",
          "base_name",
          "base_status",
          "base_region",
          "settings",
          "apps"
        ]
      },
      "SyncResponse": {
        "type": "object",
        "title": "SyncResponse",
        "description": "One sync",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Sync"
          }
        },
        "required": [
          "data"
        ]
      },
      "SyncListResponse": {
        "type": "object",
        "title": "SyncListResponse",
        "description": "The syncs of the workspace, newest first",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Sync"
            },
            "description": "The syncs, across both regions"
          }
        },
        "required": [
          "data"
        ]
      },
      "SyncColumnInput": {
        "type": "object",
        "title": "SyncColumnInput",
        "description": "A column to sync; the column with the same `column_mapping_id` in the other app's table is its pair",
        "properties": {
          "column_name": {
            "type": "string",
            "description": "The name of the column in the app (its read id is accepted too). For a table being created it is the name of the new column"
          },
          "column_mapping_id": {
            "type": "string",
            "description": "A UUID you choose, the same for the two columns of a pair and different from every other mapping id",
            "format": "uuid"
          }
        },
        "required": [
          "column_name",
          "column_mapping_id"
        ]
      },
      "SyncPrimaryKeyInput": {
        "type": "object",
        "title": "SyncPrimaryKeyInput",
        "description": "The primary key column of a table being created, instead of the default `stacksync_record_id_` of type uuid (Postgres apps only)",
        "properties": {
          "column_name": {
            "type": "string",
            "description": "The name of the primary key column: letters, numbers and underscores, at most 63 characters, not a synced column's name"
          },
          "data_type": {
            "type": "string",
            "description": "The type of the column",
            "enum": [
              "uuid",
              "text",
              "varchar"
            ],
            "default": "uuid"
          }
        },
        "required": [
          "column_name"
        ]
      },
      "SyncTableOptionsInput": {
        "type": "object",
        "title": "SyncTableOptionsInput",
        "description": "The options of a table in the sync",
        "properties": {
          "create_new_table": {
            "type": "boolean",
            "description": "True to have Stacksync create this table in the app from the other app's table; the table must then not exist yet and the app must support it (`can_create_tables` of the app schema). At most one table of a pair is created"
          },
          "primary_key": {
            "$ref": "#/components/schemas/SyncPrimaryKeyInput"
          }
        },
        "required": [
          "create_new_table"
        ]
      },
      "SyncTableInput": {
        "type": "object",
        "title": "SyncTableInput",
        "description": "A table to sync, as a create takes it",
        "properties": {
          "table_name": {
            "type": "string",
            "description": "The name of the table in the app (its id is accepted too, BigQuery: `project.dataset.table`). For a table being created: the name of the new table, letters, numbers and underscores, at most 63 characters for database apps"
          },
          "table_mapping_id": {
            "type": "string",
            "description": "A UUID you choose, the same for the two tables of a pair and different from every other mapping id",
            "format": "uuid"
          },
          "sync_direction": {
            "type": "string",
            "description": "`bidirectional` (paired with `bidirectional`), `incoming` (only written into, paired with `outgoing`) or `outgoing` (only read from, paired with `incoming`)",
            "enum": [
              "bidirectional",
              "incoming",
              "outgoing"
            ]
          },
          "table_options": {
            "$ref": "#/components/schemas/SyncTableOptionsInput"
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncColumnInput"
            },
            "description": "The columns to sync. Left out on both tables of a pair: every column of the table is synced (and created, for a new table). When sent on both tables they must hold the same `column_mapping_id`s"
          }
        },
        "required": [
          "table_name",
          "table_mapping_id",
          "sync_direction",
          "table_options"
        ]
      },
      "SyncTableEditInput": {
        "type": "object",
        "title": "SyncTableEditInput",
        "description": "A table to sync, as an edit takes it (`table_options` only for a table to create)",
        "properties": {
          "table_name": {
            "type": "string",
            "description": "The name of the table in the app (its id is accepted too, BigQuery: `project.dataset.table`). For a table being created: the name of the new table, letters, numbers and underscores, at most 63 characters for database apps"
          },
          "table_mapping_id": {
            "type": "string",
            "description": "A UUID you choose, the same for the two tables of a pair and different from every other mapping id",
            "format": "uuid"
          },
          "sync_direction": {
            "type": "string",
            "description": "`bidirectional` (paired with `bidirectional`), `incoming` (only written into, paired with `outgoing`) or `outgoing` (only read from, paired with `incoming`)",
            "enum": [
              "bidirectional",
              "incoming",
              "outgoing"
            ]
          },
          "table_options": {
            "$ref": "#/components/schemas/SyncTableOptionsInput"
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncColumnInput"
            },
            "description": "The columns to sync. Left out on both tables of a pair: every column of the table is synced (and created, for a new table). When sent on both tables they must hold the same `column_mapping_id`s"
          }
        },
        "required": [
          "table_name",
          "table_mapping_id",
          "sync_direction"
        ]
      },
      "SyncAppOptionsInput": {
        "type": "object",
        "title": "SyncAppOptionsInput",
        "description": "The options of an app in the sync",
        "properties": {
          "delete_protection": {
            "type": "boolean",
            "description": "True to keep deletes from reaching this app (set on every table of the app)",
            "default": false
          }
        }
      },
      "SyncAppInput": {
        "type": "object",
        "title": "SyncAppInput",
        "description": "One of the two apps of the sync to create",
        "properties": {
          "connection_id": {
            "type": "string",
            "description": "The connection of the app; the user of the API key must have created it or it must be shared with the workspace",
            "format": "uuid"
          },
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncTableInput"
            },
            "description": "The tables to sync, one per table pair; both apps list the same number of tables and the same `table_mapping_id`s",
            "minItems": 1
          },
          "rate_limit": {
            "$ref": "#/components/schemas/SyncRateLimit"
          },
          "app_options": {
            "$ref": "#/components/schemas/SyncAppOptionsInput"
          }
        },
        "required": [
          "connection_id",
          "tables"
        ]
      },
      "SyncAppEditInput": {
        "type": "object",
        "title": "SyncAppEditInput",
        "description": "One of the two apps of the sync to edit",
        "properties": {
          "app_id": {
            "type": "string",
            "description": "The app's id in the sync (read it from the sync); an id the sync does not hold is refused"
          },
          "connection_id": {
            "type": "string",
            "description": "The connection of the app; the user of the API key must have created it or it must be shared with the workspace",
            "format": "uuid"
          },
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncTableEditInput"
            },
            "description": "The tables to sync after the edit: a table left out of both apps is removed, a new pair is added, a changed `sync_direction` or column list is applied",
            "minItems": 1
          },
          "rate_limit": {
            "$ref": "#/components/schemas/SyncRateLimit"
          },
          "app_options": {
            "$ref": "#/components/schemas/SyncAppOptionsInput"
          }
        },
        "required": [
          "app_id",
          "connection_id",
          "tables"
        ]
      },
      "CreateSyncBody": {
        "type": "object",
        "title": "CreateSyncBody",
        "description": "The sync to create: two apps whose tables and columns are paired by the mapping ids you choose",
        "properties": {
          "base_name": {
            "type": "string",
            "description": "The name of the sync. 3 to 63 characters: unaccented letters (A-Z, a-z), numbers, underscores, dashes and spaces only; unique in the workspace"
          },
          "base_region": {
            "type": "string",
            "description": "The data region the sync runs in; the connections must be in it",
            "enum": [
              "besg",
              "usnv"
            ]
          },
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncAppInput"
            },
            "description": "Exactly two apps",
            "minItems": 2,
            "maxItems": 2
          },
          "base_resource_id": {
            "type": "string",
            "description": "A stable id of your choosing, 1 to 60 letters, digits or underscores, unique in the workspace; derived from the name when left out",
            "pattern": "^[A-Za-z0-9_]{1,60}$"
          },
          "base_status": {
            "type": "string",
            "description": "Accepted and stored as given; leave it out so Stacksync sets the state of the new sync itself"
          },
          "folder_id": {
            "type": "string",
            "description": "The folder of the workspace, in `base_region`, to file the sync under; the root when left out",
            "format": "uuid"
          },
          "validate_only": {
            "type": "boolean",
            "description": "Run every check of the create, including reading the apps, and answer the sync as it would be stored (its column names after renames, no `base_id`) without creating it",
            "default": false
          }
        },
        "required": [
          "base_name",
          "base_region",
          "apps"
        ]
      },
      "EditSyncBody": {
        "type": "object",
        "title": "EditSyncBody",
        "description": "The whole sync after the edit: read the sync, change it, send it back (the sync is paused and restarted by the edit)",
        "properties": {
          "base_id": {
            "type": "string",
            "description": "The sync; must equal the `base_id` of the path",
            "format": "uuid"
          },
          "base_name": {
            "type": "string",
            "description": "The name of the sync"
          },
          "base_region": {
            "type": "string",
            "description": "The data region of the sync",
            "enum": [
              "besg",
              "usnv"
            ]
          },
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncAppEditInput"
            },
            "description": "Exactly two apps, with their `app_id`",
            "minItems": 2,
            "maxItems": 2
          },
          "base_resource_id": {
            "type": "string",
            "description": "The stable id of the sync",
            "pattern": "^[A-Za-z0-9_]{1,60}$"
          },
          "base_status": {
            "type": "string",
            "description": "Accepted and stored as given; leave it out"
          },
          "validate_only": {
            "type": "boolean",
            "description": "Run every check of the edit, including reading the apps, and answer the sync as it would be stored without changing it",
            "default": false
          }
        },
        "required": [
          "base_id",
          "base_name",
          "base_region",
          "apps"
        ]
      },
      "SyncSchemaColumn": {
        "type": "object",
        "title": "SyncSchemaColumn",
        "description": "A synced column",
        "properties": {
          "column_name": {
            "type": "string",
            "description": "The name of the column in the app, after renames"
          },
          "column_mapping_id": {
            "type": "string",
            "description": "The id shared by the two columns of a pair"
          }
        },
        "required": [
          "column_name",
          "column_mapping_id"
        ]
      },
      "SyncSchemaTable": {
        "type": "object",
        "title": "SyncSchemaTable",
        "description": "A synced table",
        "properties": {
          "table_name": {
            "type": "string",
            "description": "The name of the table in the app"
          },
          "table_mapping_id": {
            "type": "string",
            "description": "The id shared by the two tables of a pair"
          },
          "sync_direction": {
            "type": "string",
            "description": "The direction of the table",
            "enum": [
              "bidirectional",
              "incoming",
              "outgoing"
            ]
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncSchemaColumn"
            },
            "description": "The synced columns"
          }
        },
        "required": [
          "table_name",
          "table_mapping_id",
          "sync_direction",
          "columns"
        ]
      },
      "SyncSchemaApp": {
        "type": "object",
        "title": "SyncSchemaApp",
        "description": "One of the two apps of the written sync",
        "properties": {
          "app_id": {
            "type": "string",
            "description": "The id of the app inside the sync"
          },
          "connection_id": {
            "type": "string",
            "description": "The connection of the app",
            "format": "uuid"
          },
          "rate_limit": {
            "$ref": "#/components/schemas/SyncRateLimit"
          },
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncSchemaTable"
            },
            "description": "The synced tables"
          }
        },
        "required": [
          "app_id",
          "connection_id",
          "tables"
        ]
      },
      "SyncSchema": {
        "type": "object",
        "title": "SyncSchema",
        "description": "A sync as a create or an edit answers it (the mapping, not the settings: read the sync for those)",
        "properties": {
          "base_id": {
            "type": "string",
            "description": "The sync; absent from a `validate_only` create, which creates none",
            "format": "uuid"
          },
          "base_name": {
            "type": "string",
            "description": "The name of the sync"
          },
          "base_region": {
            "type": "string",
            "description": "The data region of the sync",
            "enum": [
              "besg",
              "usnv"
            ]
          },
          "base_resource_id": {
            "type": "string",
            "description": "The stable id of the sync"
          },
          "base_status": {
            "type": "string",
            "description": "The state of the sync when it was sent"
          },
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncSchemaApp"
            },
            "description": "The two apps",
            "minItems": 2,
            "maxItems": 2
          }
        },
        "additionalProperties": true,
        "required": [
          "base_name",
          "base_region",
          "apps"
        ]
      },
      "SyncSchemaResponse": {
        "type": "object",
        "title": "SyncSchemaResponse",
        "description": "The written sync",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SyncSchema"
          }
        },
        "required": [
          "data"
        ]
      },
      "RenameSyncBody": {
        "type": "object",
        "title": "RenameSyncBody",
        "description": "The new name of the sync",
        "properties": {
          "base_name": {
            "type": "string",
            "description": "The new name. 3 to 63 characters: unaccented letters (A-Z, a-z), numbers, underscores, dashes and spaces only; unique in the workspace"
          },
          "validate_only": {
            "type": "boolean",
            "description": "Run every check of the write and answer without writing: a refused write answers the error it would answer",
            "default": false
          }
        },
        "required": [
          "base_name"
        ]
      },
      "RenamedSync": {
        "type": "object",
        "title": "RenamedSync",
        "description": "The renamed sync",
        "properties": {
          "message": {
            "type": "string",
            "description": "`Base name updated successfully`"
          },
          "base_id": {
            "type": "string",
            "description": "The sync",
            "format": "uuid"
          }
        },
        "required": [
          "message",
          "base_id"
        ]
      },
      "DeletedSync": {
        "type": "object",
        "title": "DeletedSync",
        "description": "The deleted sync",
        "properties": {
          "base_id": {
            "type": "string",
            "description": "The sync",
            "format": "uuid"
          }
        },
        "required": [
          "base_id"
        ]
      },
      "DeletedSyncResponse": {
        "type": "object",
        "title": "DeletedSyncResponse",
        "description": "The deleted sync",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DeletedSync"
          }
        },
        "required": [
          "data"
        ]
      },
      "SyncStatus": {
        "type": "object",
        "title": "SyncStatus",
        "description": "The state of a sync",
        "properties": {
          "base_id": {
            "type": "string",
            "description": "The sync",
            "format": "uuid"
          },
          "base_status": {
            "type": "string",
            "description": "The state of the sync: `running`, `paused`, `processing` or an error state set by the platform"
          },
          "backfill_in_progress": {
            "type": "boolean",
            "description": "Whether an initial full read (backfill) of a table is still running"
          }
        },
        "required": [
          "base_id",
          "base_status",
          "backfill_in_progress"
        ]
      },
      "SyncStatusResponse": {
        "type": "object",
        "title": "SyncStatusResponse",
        "description": "The state of the sync",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SyncStatus"
          }
        },
        "required": [
          "data"
        ]
      },
      "SwitchSyncBody": {
        "type": "object",
        "title": "SwitchSyncBody",
        "description": "Switch the sync on or off",
        "properties": {
          "switch_mode": {
            "type": "string",
            "description": "`ON` to start syncing, `OFF` to pause",
            "enum": [
              "ON",
              "OFF"
            ]
          }
        },
        "required": [
          "switch_mode"
        ]
      },
      "SwitchedSync": {
        "type": "object",
        "title": "SwitchedSync",
        "description": "The sync after the switch",
        "properties": {
          "base_id": {
            "type": "string",
            "description": "The sync",
            "format": "uuid"
          },
          "switch_mode": {
            "type": "string",
            "description": "The switch applied",
            "enum": [
              "ON",
              "OFF"
            ]
          },
          "base_status": {
            "type": "string",
            "description": "The state of the sync right after the switch (`processing` while it starts or stops)"
          }
        },
        "required": [
          "base_id",
          "switch_mode",
          "base_status"
        ]
      },
      "SwitchedSyncResponse": {
        "type": "object",
        "title": "SwitchedSyncResponse",
        "description": "The sync after the switch",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SwitchedSync"
          }
        },
        "required": [
          "data"
        ]
      },
      "SetDeleteProtectionBody": {
        "type": "object",
        "title": "SetDeleteProtectionBody",
        "description": "Turn delete protection on or off for an app",
        "properties": {
          "action": {
            "type": "string",
            "description": "`ON` keeps deletes from reaching the app, `OFF` lets them through again",
            "enum": [
              "ON",
              "OFF"
            ]
          }
        },
        "required": [
          "action"
        ]
      },
      "DeleteProtectionResult": {
        "type": "object",
        "title": "DeleteProtectionResult",
        "description": "The app whose delete protection was set",
        "properties": {
          "msg": {
            "type": "string",
            "description": "`Successfully Toggled Delete Protection for app`"
          },
          "app_id": {
            "type": "string",
            "description": "The app"
          }
        },
        "required": [
          "msg",
          "app_id"
        ]
      },
      "SetRateLimitBody": {
        "type": "object",
        "title": "SetRateLimitBody",
        "description": "The rate limit of an app; the sync may stay on",
        "properties": {
          "rate": {
            "type": "integer",
            "description": "The number of requests allowed per period, 1 to 2147483647",
            "minimum": 1,
            "maximum": 2147483647
          },
          "frequency": {
            "type": "integer",
            "description": "The period of the rate in seconds: 1 (per second), 60, 3600 or 86400; per second when left out",
            "enum": [
              1,
              60,
              3600,
              86400
            ],
            "default": 1
          }
        },
        "required": [
          "rate"
        ]
      },
      "RateLimitResponse": {
        "type": "object",
        "title": "RateLimitResponse",
        "description": "The rate limit stored",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SyncRateLimit"
          }
        },
        "required": [
          "data"
        ]
      },
      "SyncWebhookInput": {
        "type": "object",
        "title": "SyncWebhookInput",
        "description": "A webhook of the sync: where one type of notification is posted. A sync holds at most one webhook per notification type and URL",
        "properties": {
          "url": {
            "type": "string",
            "description": "The https URL Stacksync posts the notification to: a public internet host that answers an OPTIONS request within 2 seconds, with none of the characters space < > # % { } | \\ ^ ~ [ ] `",
            "format": "uri"
          },
          "notification_type": {
            "type": "string",
            "description": "`base_activity` (the sync was switched, edited or failed), `real_time_issue_notification` (records failed to sync) or `backfill` (an initial full read finished)",
            "enum": [
              "base_activity",
              "real_time_issue_notification",
              "backfill"
            ]
          },
          "api_key": {
            "type": "string",
            "description": "Sent as `Authorization: Bearer <api_key>` with every notification, so your endpoint can check the caller"
          },
          "validate_only": {
            "type": "boolean",
            "description": "Run every check of the write and answer without writing: a refused write answers the error it would answer",
            "default": false
          }
        },
        "required": [
          "url",
          "notification_type",
          "api_key"
        ]
      },
      "SyncWebhook": {
        "type": "object",
        "title": "SyncWebhook",
        "description": "A webhook of the sync",
        "properties": {
          "webhook_id": {
            "type": "string",
            "description": "The webhook",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "description": "The https URL Stacksync posts the notification to: a public internet host that answers an OPTIONS request within 2 seconds, with none of the characters space < > # % { } | \\ ^ ~ [ ] `",
            "format": "uri"
          },
          "notification_type": {
            "type": "string",
            "description": "`base_activity` (the sync was switched, edited or failed), `real_time_issue_notification` (records failed to sync) or `backfill` (an initial full read finished)",
            "enum": [
              "base_activity",
              "real_time_issue_notification",
              "backfill"
            ]
          },
          "api_key": {
            "type": "string",
            "description": "Sent as `Authorization: Bearer <api_key>` with every notification, so your endpoint can check the caller"
          }
        },
        "required": [
          "webhook_id",
          "url",
          "notification_type",
          "api_key"
        ]
      },
      "SyncWebhookResponse": {
        "type": "object",
        "title": "SyncWebhookResponse",
        "description": "One webhook",
        "properties": {
          "msg": {
            "type": "string",
            "description": "What was done"
          },
          "webhook": {
            "$ref": "#/components/schemas/SyncWebhook"
          }
        },
        "required": [
          "msg",
          "webhook"
        ]
      },
      "SyncWebhookListResponse": {
        "type": "object",
        "title": "SyncWebhookListResponse",
        "description": "The webhooks of the sync",
        "properties": {
          "msg": {
            "type": "string",
            "description": "`Successfully retrieved webhooks`"
          },
          "webhooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncWebhook"
            },
            "description": "The webhooks, in creation order"
          }
        },
        "required": [
          "msg",
          "webhooks"
        ]
      },
      "DeletedSyncWebhook": {
        "type": "object",
        "title": "DeletedSyncWebhook",
        "description": "The deleted webhook",
        "properties": {
          "msg": {
            "type": "string",
            "description": "`Successfully deleted webhook`"
          },
          "webhook_id": {
            "type": "string",
            "description": "The webhook",
            "format": "uuid"
          }
        },
        "required": [
          "msg",
          "webhook_id"
        ]
      },
      "TriggerFilterCondition": {
        "type": "object",
        "title": "TriggerFilterCondition",
        "description": "One condition on a column of the changed record",
        "properties": {
          "type": {
            "type": "string",
            "description": "`condition`",
            "enum": [
              "condition"
            ]
          },
          "column": {
            "type": "string",
            "description": "The column of the trigger's table the condition reads (case sensitive)"
          },
          "operator": {
            "type": "string",
            "description": "`eq` equals, `neq` does not equal, `lt` is larger than (not less than), `leq` is larger than or equal, `st` is smaller than, `seq` is smaller than or equal (these four take a number on a numeric column; the sync compares the two values as text, character by character, so compare values with the same number of digits), `in` is in, `nin` is not in, `nu` is null, `nnu` is not null, `cont` contains, `ncont` does not contain, `mreg` matches the regular expression, `nmreg` does not match it, `has_ch` the column changed. `mregex` and `nmregex` are accepted and stored as `mreg` and `nmreg`",
            "enum": [
              "eq",
              "neq",
              "lt",
              "leq",
              "st",
              "seq",
              "in",
              "nin",
              "nu",
              "nnu",
              "cont",
              "ncont",
              "mreg",
              "nmreg",
              "has_ch"
            ]
          },
          "value": {
            "description": "The value compared with the column: a string, number, boolean, null or, for `in` and `nin`, a list"
          }
        },
        "required": [
          "type",
          "column",
          "operator",
          "value"
        ]
      },
      "TriggerFilterGroup": {
        "type": "object",
        "title": "TriggerFilterGroup",
        "description": "Conditions combined with `and` or `or`; a group may hold other groups. An empty `and` group matches every change",
        "properties": {
          "type": {
            "type": "string",
            "description": "`group`",
            "enum": [
              "group"
            ]
          },
          "operator": {
            "type": "string",
            "description": "How the conditions combine",
            "enum": [
              "and",
              "or"
            ]
          },
          "conditions": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/TriggerFilterCondition"
                },
                {
                  "$ref": "#/components/schemas/TriggerFilterGroup"
                }
              ]
            },
            "description": "A list (never a single object): each entry is a condition (TriggerFilterCondition) or a nested group (TriggerFilterGroup)"
          }
        },
        "required": [
          "type",
          "operator",
          "conditions"
        ]
      },
      "TriggerDbQueryAction": {
        "type": "object",
        "title": "TriggerDbQueryAction",
        "description": "The query a `db_query` trigger runs on one of the workspace's database connections",
        "properties": {
          "query": {
            "type": "string",
            "description": "The SQL to run, not blank; `<<data>>` and `<<changes>>` are replaced with the record and its changes"
          },
          "connection_id": {
            "type": "string",
            "description": "A database connection of the workspace in the sync's region (yours or shared)",
            "format": "uuid"
          },
          "app_type": {
            "type": "string",
            "description": "The database of the connection",
            "enum": [
              "postgres",
              "postgres_heroku",
              "bigquery",
              "snowflake",
              "sqlserver"
            ]
          }
        },
        "required": [
          "query",
          "connection_id",
          "app_type"
        ]
      },
      "TriggerQueueAction": {
        "type": "object",
        "title": "TriggerQueueAction",
        "description": "The message a `queue` trigger adds to one of the workspace's queues",
        "properties": {
          "queue_id": {
            "type": "string",
            "description": "A queue of the workspace in the sync's region"
          },
          "queue_data": {
            "type": "string",
            "description": "The message to queue; `<<data>>` and `<<changes>>` are replaced with the record and its changes"
          }
        },
        "required": [
          "queue_id",
          "queue_data"
        ]
      },
      "SyncTriggerInput": {
        "type": "object",
        "title": "SyncTriggerInput",
        "description": "A trigger of the sync: when a change of the chosen table passes the filters, the action runs",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the trigger"
          },
          "trigger_type": {
            "type": "string",
            "description": "`webhook` calls a URL, `db_query` runs SQL on a database connection, `queue` adds a message to a queue",
            "enum": [
              "webhook",
              "db_query",
              "queue"
            ]
          },
          "table": {
            "type": "string",
            "description": "The table whose changes fire the trigger, by its name in the `column_names_from_app` app (its id is accepted)"
          },
          "column_names_from_app": {
            "type": "string",
            "description": "The app whose column names the trigger uses: its app type as shown in Stacksync, or its `app_id` when both apps have the same type"
          },
          "operations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The changes that fire the trigger, each once: `created`, `updated`, `deleted`",
            "uniqueItems": true
          },
          "source": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The app or apps whose changes fire the trigger, by app type (or `app_id` when both apps have the same type); the sync must read changes from that app's table",
            "minItems": 1,
            "maxItems": 2
          },
          "columns_to_ignore": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Columns of the table left out of the record data the action receives (case sensitive, must exist in the table)"
          },
          "filters": {
            "$ref": "#/components/schemas/TriggerFilterGroup"
          },
          "action": {
            "oneOf": [
              {
                "type": "string",
                "description": "`webhook`: one cURL command with one http(s) URL on a public host; only its method (-X), headers (-H), body (-d) and URL are sent, for example `curl -X POST https://example.com/hook -H 'Content-Type: application/json' -d '{\"record\": <<data>>}'`"
              },
              {
                "$ref": "#/components/schemas/TriggerDbQueryAction"
              },
              {
                "$ref": "#/components/schemas/TriggerQueueAction"
              }
            ],
            "description": "What runs: a cURL command (`webhook`), a query (`db_query`) or a queue message (`queue`)"
          },
          "is_paused": {
            "type": "boolean",
            "description": "True stores the trigger paused; false (the default) runs it",
            "default": false
          },
          "validate_only": {
            "type": "boolean",
            "description": "Run every check of the write and answer without writing: a refused write answers the error it would answer",
            "default": false
          }
        },
        "required": [
          "name",
          "trigger_type",
          "table",
          "column_names_from_app",
          "operations",
          "source",
          "columns_to_ignore",
          "filters",
          "action"
        ]
      },
      "TriggerStoredConnection": {
        "type": "object",
        "title": "TriggerStoredConnection",
        "description": "The connection a `db_query` trigger runs on",
        "properties": {
          "connection_id": {
            "type": "string",
            "description": "The connection",
            "format": "uuid"
          },
          "connection_name": {
            "type": "string",
            "description": "Its name"
          },
          "app_type": {
            "type": "string",
            "description": "Its app, as shown in Stacksync"
          }
        },
        "required": [
          "connection_id",
          "connection_name",
          "app_type"
        ]
      },
      "TriggerStoredAction": {
        "type": "object",
        "title": "TriggerStoredAction",
        "description": "The stored action of a trigger, as the platform runs it",
        "properties": {
          "body": {
            "type": "string",
            "description": "`webhook`: the cURL parsed as JSON text (`url`, `method`, `headers`, `data`); `db_query`: the SQL; `queue`: the message"
          },
          "task_type": {
            "type": "string",
            "description": "`http_request` (webhook), `db_query` or `queue`",
            "enum": [
              "http_request",
              "db_query",
              "queue"
            ]
          },
          "options": {
            "type": "object",
            "description": "The stored options of the action: `base_id`, `trigger_id`, and for `db_query` the connection and `app_type`, for `queue` the `workflow_app_queue_id`",
            "additionalProperties": true
          },
          "created_time": {
            "type": "string",
            "description": "When the action was stored"
          },
          "task_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The stored name of the action, when set"
          },
          "workspace_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The workspace, when stored"
          },
          "base_name": {
            "type": "string",
            "description": "The name of the sync"
          },
          "connection": {
            "$ref": "#/components/schemas/TriggerStoredConnection"
          },
          "queue_id": {
            "type": "string",
            "description": "`queue` triggers: the queue, when the stored action carries it"
          },
          "task_metadata_id": {
            "type": "string",
            "description": "The id of the stored action; answered by the single read only",
            "format": "uuid"
          }
        },
        "additionalProperties": true,
        "required": [
          "body",
          "task_type"
        ]
      },
      "SyncTrigger": {
        "type": "object",
        "title": "SyncTrigger",
        "description": "A trigger of the sync as the read routes answer it",
        "properties": {
          "id": {
            "type": "string",
            "description": "The trigger",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The name of the trigger"
          },
          "trigger_type": {
            "type": "string",
            "description": "`webhook` calls a URL, `db_query` runs SQL on a database connection, `queue` adds a message to a queue",
            "enum": [
              "webhook",
              "db_query",
              "queue"
            ]
          },
          "table": {
            "type": "string",
            "description": "The table whose changes fire the trigger, by its name in the `column_names_from_app` app (its id is accepted)"
          },
          "column_names_from_app": {
            "type": "string",
            "description": "The app whose column names the trigger uses: its app type as shown in Stacksync, or its `app_id` when both apps have the same type"
          },
          "operations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The changes that fire the trigger, each once: `created`, `updated`, `deleted`",
            "uniqueItems": true
          },
          "source": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The app or apps whose changes fire the trigger, by app type (or `app_id` when both apps have the same type); the sync must read changes from that app's table",
            "minItems": 1,
            "maxItems": 2
          },
          "columns_to_ignore": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Columns of the table left out of the record data the action receives (case sensitive, must exist in the table)"
          },
          "filters": {
            "$ref": "#/components/schemas/TriggerFilterGroup"
          },
          "is_paused": {
            "type": "boolean",
            "description": "Whether the trigger is paused (a paused trigger never runs)"
          },
          "action": {
            "$ref": "#/components/schemas/TriggerStoredAction"
          }
        },
        "additionalProperties": true,
        "required": [
          "id",
          "name",
          "trigger_type",
          "table",
          "column_names_from_app",
          "operations",
          "source",
          "columns_to_ignore",
          "filters",
          "is_paused",
          "action"
        ]
      },
      "CreatedSyncTrigger": {
        "type": "object",
        "title": "CreatedSyncTrigger",
        "description": "The created trigger",
        "properties": {
          "id": {
            "type": "string",
            "description": "The new trigger",
            "format": "uuid"
          },
          "msg": {
            "type": "string",
            "description": "`Trigger created successfully`"
          }
        },
        "required": [
          "id",
          "msg"
        ]
      },
      "SyncTriggerMessage": {
        "type": "object",
        "title": "SyncTriggerMessage",
        "description": "What was done",
        "properties": {
          "msg": {
            "type": "string",
            "description": "What was done"
          }
        },
        "required": [
          "msg"
        ]
      },
      "SyncTriggerResponse": {
        "type": "object",
        "title": "SyncTriggerResponse",
        "description": "One trigger",
        "properties": {
          "trigger": {
            "$ref": "#/components/schemas/SyncTrigger"
          },
          "msg": {
            "type": "string",
            "description": "`Trigger retrieved successfully`"
          }
        },
        "required": [
          "trigger",
          "msg"
        ]
      },
      "SyncTriggerListResponse": {
        "type": "object",
        "title": "SyncTriggerListResponse",
        "description": "The triggers of the sync",
        "properties": {
          "triggers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncTrigger"
            },
            "description": "The triggers whose action still exists"
          },
          "msg": {
            "type": "string",
            "description": "`Triggers retrieved successfully`"
          }
        },
        "required": [
          "triggers",
          "msg"
        ]
      },
      "UpdateSyncTriggerStatusBody": {
        "type": "object",
        "title": "UpdateSyncTriggerStatusBody",
        "description": "Pause or resume the trigger",
        "properties": {
          "action": {
            "type": "string",
            "description": "`pause` stops the trigger from running, `unpause` resumes it",
            "enum": [
              "pause",
              "unpause"
            ]
          }
        },
        "required": [
          "action"
        ]
      },
      "SyncIssue": {
        "type": "object",
        "title": "SyncIssue",
        "description": "A record change the sync could not write to its destination app",
        "properties": {
          "issue_id": {
            "type": "string",
            "description": "The issue",
            "format": "uuid"
          },
          "base_id": {
            "type": "string",
            "description": "The sync",
            "format": "uuid"
          },
          "destination_app_id": {
            "type": "string",
            "description": "The app the change could not be written to"
          },
          "destination_app_type": {
            "type": "string",
            "description": "That app, as shown in Stacksync"
          },
          "destination_table_id": {
            "type": "string",
            "description": "The id of the table in that app"
          },
          "destination_table_name": {
            "type": "string",
            "description": "The name of the table in that app"
          },
          "action": {
            "type": "string",
            "description": "What the sync tried: `insert`, `update` or `delete`"
          },
          "issue_message": {
            "type": "string",
            "description": "Why the write failed, as the app answered"
          },
          "changed_columns": {
            "type": [
              "object",
              "null"
            ],
            "description": "The columns that changed, by name, with the value that could not be written",
            "additionalProperties": true
          },
          "source_record_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The id of the record in the app the change came from"
          },
          "destination_record_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The id of the record in the destination app, null for a record not created yet"
          },
          "created_time": {
            "type": "string",
            "description": "When the issue first happened, ISO 8601 UTC"
          },
          "last_modified_time": {
            "type": "string",
            "description": "When the issue last happened, ISO 8601 UTC"
          }
        },
        "additionalProperties": true,
        "required": [
          "issue_id",
          "base_id",
          "destination_app_id",
          "destination_app_type",
          "action",
          "issue_message",
          "created_time",
          "last_modified_time"
        ]
      },
      "SyncIssuePagination": {
        "type": "object",
        "title": "SyncIssuePagination",
        "description": "The page answered",
        "properties": {
          "current_page": {
            "type": "integer",
            "description": "The page answered, counted from 0"
          },
          "next_page": {
            "type": "integer",
            "description": "The next page, absent on the last page"
          },
          "total_pages": {
            "type": "integer",
            "description": "The number of full pages (total issues divided by page size, rounded down); absent when the page is empty"
          }
        },
        "required": [
          "current_page"
        ]
      },
      "SyncIssueListResponse": {
        "type": "object",
        "title": "SyncIssueListResponse",
        "description": "A page of issues",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncIssue"
            },
            "description": "The issues of the page"
          },
          "pagination": {
            "$ref": "#/components/schemas/SyncIssuePagination"
          },
          "total_number_of_issues": {
            "type": "integer",
            "description": "The number of issues matching the filters"
          }
        },
        "required": [
          "data",
          "pagination",
          "total_number_of_issues"
        ]
      },
      "ResolveListedSyncIssuesBody": {
        "type": "object",
        "title": "ResolveListedSyncIssuesBody",
        "description": "Act on the issues listed by id",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The issues, every id must exist in the workspace",
            "minItems": 1
          },
          "action": {
            "type": "string",
            "description": "`retry` writes the change again, `revert` restores the record from the destination app, `ignore` closes the issue",
            "enum": [
              "retry",
              "ignore",
              "revert"
            ]
          }
        },
        "required": [
          "ids",
          "action"
        ],
        "examples": [
          {
            "ids": [
              "4c5d6e7f-8a9b-4c0d-9e1f-2a3b4c5d6e7f"
            ],
            "action": "retry"
          }
        ]
      },
      "ResolveAllSyncIssuesBody": {
        "type": "object",
        "title": "ResolveAllSyncIssuesBody",
        "description": "Act on every issue of a sync, or of one of its tables (`ids` must not be sent)",
        "properties": {
          "all_issues": {
            "type": "boolean",
            "description": "True",
            "enum": [
              true
            ]
          },
          "base_id": {
            "type": "string",
            "description": "The sync, in the region of the request",
            "format": "uuid"
          },
          "table_id": {
            "type": "string",
            "description": "Only the issues of this table pair (its `table_mapping_id`); every table when left out"
          },
          "action": {
            "type": "string",
            "description": "`retry` writes the change again, `revert` restores the record from the destination app, `ignore` closes the issue",
            "enum": [
              "retry",
              "ignore",
              "revert"
            ]
          }
        },
        "required": [
          "all_issues",
          "base_id",
          "action"
        ],
        "examples": [
          {
            "all_issues": true,
            "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",
            "action": "retry"
          }
        ]
      },
      "ResolveSyncIssuesBody": {
        "title": "ResolveSyncIssuesBody",
        "description": "The issues to act on: listed by id, or all the issues of a sync",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ResolveListedSyncIssuesBody"
          },
          {
            "$ref": "#/components/schemas/ResolveAllSyncIssuesBody"
          }
        ]
      },
      "ResolvedSyncIssues": {
        "type": "object",
        "title": "ResolvedSyncIssues",
        "description": "What the action did",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The issues acted on; empty for `all_issues`"
          },
          "success_issue_count": {
            "type": "integer",
            "description": "Issues resolved"
          },
          "failed_issue_count": {
            "type": "integer",
            "description": "Issues that could not be resolved"
          },
          "error_list": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Why each failed issue failed"
          }
        },
        "required": [
          "ids",
          "success_issue_count",
          "failed_issue_count",
          "error_list"
        ]
      },
      "ResolvedSyncIssuesResponse": {
        "type": "object",
        "title": "ResolvedSyncIssuesResponse",
        "description": "What the action did",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ResolvedSyncIssues"
          }
        },
        "required": [
          "data"
        ]
      },
      "ApiProxyToken": {
        "type": "object",
        "title": "ApiProxyToken",
        "description": "The API proxy with its new token",
        "properties": {
          "connection_id": {
            "type": "string",
            "description": "The connection the proxy forwards to",
            "format": "uuid"
          },
          "api_proxy_id": {
            "type": "string",
            "description": "The API proxy",
            "format": "uuid"
          },
          "api_proxy_name": {
            "type": "string",
            "description": "The name of the API proxy"
          },
          "app_type": {
            "type": "string",
            "description": "The app the proxy fronts"
          },
          "created_by": {
            "type": "integer",
            "description": "The user who created the proxy"
          },
          "created_time": {
            "type": "string",
            "description": "When the proxy was created"
          },
          "last_modified_by": {
            "type": "integer",
            "description": "The user who last changed it"
          },
          "last_modified_time": {
            "type": "string",
            "description": "When it was last changed"
          },
          "api_proxy_token": {
            "type": "string",
            "description": "The new token, shown once. It replaces the previous token."
          }
        },
        "required": [
          "connection_id",
          "api_proxy_id",
          "api_proxy_name",
          "app_type",
          "created_by",
          "created_time",
          "last_modified_by",
          "last_modified_time",
          "api_proxy_token"
        ]
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "`Authorization: Bearer <key>`. A workspace API key (workspace_…, created by a workspace owner under Workspace settings > Stacksync API) acts with editor rights on that workspace only; a user API key (user_…, created under Profile > Stacksync API) acts as that user in every workspace they belong to. POST, PUT and PATCH requests must send Content-Type: application/json. Every authentication failure answers 403.",
        "scheme": "bearer",
        "bearerFormat": "workspace_… or user_… API key"
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "The id of this request. Quote it when you contact support.",
        "schema": {
          "type": "string"
        }
      },
      "Idempotent-Replayed": {
        "description": "Present and `true` when the answer replays the result of an earlier request with the same Idempotency-Key.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    }
  },
  "security": [],
  "servers": [
    {
      "url": "https://api.stacksync.com"
    }
  ]
}
