{
  "openapi": "3.1.0",
  "info": {
    "title": "Tappet API",
    "description": "REST API of the Tappet workflow engine. Errors use the envelope {\"error\":{\"code\",\"message\"}}. Each operation lists its required permission in x-tappet-permission.",
    "license": {
      "name": "Apache-2.0"
    },
    "version": "0.1.0"
  },
  "paths": {
    "/api/v1/api-keys": {
      "get": {
        "tags": [
          "api-keys"
        ],
        "summary": "List your API keys",
        "operationId": "get_api_keys",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      },
      "post": {
        "tags": [
          "api-keys"
        ],
        "summary": "Create an API key (the secret is shown once)",
        "operationId": "post_api_keys",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedApiKey"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/api-keys/{id}": {
      "delete": {
        "tags": [
          "api-keys"
        ],
        "summary": "Revoke one of your API keys",
        "operationId": "delete_api_keys_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/audit": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Audit log, newest first",
        "operationId": "get_audit",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditPage"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "audit:read"
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Sign in with email and password",
        "operationId": "post_auth_login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-tappet-permission": "public"
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Sign out of the current session",
        "operationId": "post_auth_logout",
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Current user, CSRF token and project roles",
        "operationId": "get_auth_me",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/auth/password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Change your own password",
        "operationId": "post_auth_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/auth/setup": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Whether first-run owner setup is pending",
        "operationId": "get_auth_setup",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupStatus"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-tappet-permission": "public"
      },
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Create the first owner account and sign in",
        "operationId": "post_auth_setup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-tappet-permission": "public"
      }
    },
    "/api/v1/connectors": {
      "get": {
        "tags": [
          "connectors"
        ],
        "summary": "List connectors",
        "operationId": "get_connectors",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/connectors/{id}": {
      "get": {
        "tags": [
          "connectors"
        ],
        "summary": "Get a connector definition",
        "operationId": "get_connectors_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/connectors/{id}/lookups/{lookup}": {
      "post": {
        "tags": [
          "connectors"
        ],
        "summary": "Run a connector lookup for dropdowns and resource locators",
        "operationId": "post_connectors_id_lookups_lookup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lookup",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "credential:use"
      }
    },
    "/api/v1/credential-kinds": {
      "get": {
        "tags": [
          "credentials"
        ],
        "summary": "Available credential kinds and the OAuth redirect URI",
        "operationId": "get_credential_kinds",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialKinds"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/credentials": {
      "get": {
        "tags": [
          "credentials"
        ],
        "summary": "List credentials (metadata only)",
        "operationId": "get_credentials",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "credential:read"
      },
      "post": {
        "tags": [
          "credentials"
        ],
        "summary": "Create a credential",
        "operationId": "post_credentials",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCredentialRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "credential:write"
      }
    },
    "/api/v1/credentials/{id}": {
      "get": {
        "tags": [
          "credentials"
        ],
        "summary": "Get a credential with masked secrets",
        "operationId": "get_credentials_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "credential:read"
      },
      "delete": {
        "tags": [
          "credentials"
        ],
        "summary": "Delete a credential",
        "operationId": "delete_credentials_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "credential:write"
      },
      "patch": {
        "tags": [
          "credentials"
        ],
        "summary": "Update a credential",
        "operationId": "patch_credentials_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCredentialRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "credential:write"
      }
    },
    "/api/v1/credentials/{id}/oauth2/start": {
      "post": {
        "tags": [
          "credentials"
        ],
        "summary": "Begin the OAuth2 authorization flow",
        "operationId": "post_credentials_id_oauth2_start",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthStartResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "credential:write"
      }
    },
    "/api/v1/credentials/{id}/test": {
      "post": {
        "tags": [
          "credentials"
        ],
        "summary": "Test a credential against the service",
        "operationId": "post_credentials_id_test",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialTestResult"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "credential:use"
      }
    },
    "/api/v1/executions": {
      "get": {
        "tags": [
          "executions"
        ],
        "summary": "List executions, newest first",
        "operationId": "get_executions",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionPage"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "execution:read"
      }
    },
    "/api/v1/executions/{id}": {
      "get": {
        "tags": [
          "executions"
        ],
        "summary": "Get an execution, optionally with run data",
        "operationId": "get_executions_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionDetail"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "execution:read"
      },
      "delete": {
        "tags": [
          "executions"
        ],
        "summary": "Delete a finished execution",
        "operationId": "delete_executions_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "execution:delete"
      }
    },
    "/api/v1/executions/{id}/cancel": {
      "post": {
        "tags": [
          "executions"
        ],
        "summary": "Cancel a queued, running or waiting execution",
        "operationId": "post_executions_id_cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "execution:manage"
      }
    },
    "/api/v1/executions/{id}/nodes": {
      "get": {
        "tags": [
          "executions"
        ],
        "summary": "Per-node run summaries",
        "operationId": "get_executions_id_nodes",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeRunSummary"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "execution:read"
      }
    },
    "/api/v1/executions/{id}/nodes/{node}": {
      "get": {
        "tags": [
          "executions"
        ],
        "summary": "Full run data of one node",
        "operationId": "get_executions_id_nodes_node",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "node",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeRunEntry"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "execution:read"
      }
    },
    "/api/v1/executions/{id}/retry": {
      "post": {
        "tags": [
          "executions"
        ],
        "summary": "Retry a failed execution from the failed node",
        "operationId": "post_executions_id_retry",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "execution:manage"
      }
    },
    "/api/v1/health": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Readiness check including the store",
        "operationId": "get_health",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthReport"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-tappet-permission": "public"
      }
    },
    "/api/v1/node-types": {
      "get": {
        "tags": [
          "connectors"
        ],
        "summary": "List node type descriptors",
        "operationId": "get_node_types",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/node-types/{type}": {
      "get": {
        "tags": [
          "connectors"
        ],
        "summary": "Get one node type descriptor",
        "operationId": "get_node_types_type",
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      }
    },
    "/api/v1/oauth2/callback": {
      "get": {
        "tags": [
          "credentials"
        ],
        "summary": "OAuth2 redirect target (authenticated by the signed state parameter)",
        "operationId": "get_oauth2_callback",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-tappet-permission": "public"
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "This OpenAPI document",
        "operationId": "get_openapi_json",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-tappet-permission": "public"
      }
    },
    "/api/v1/projects": {
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "Projects you belong to",
        "operationId": "get_projects",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectWithRole"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "authenticated"
      },
      "post": {
        "tags": [
          "projects"
        ],
        "summary": "Create a project",
        "operationId": "post_projects",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectWithRole"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "project:create"
      }
    },
    "/api/v1/projects/{id}": {
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "Get a project",
        "operationId": "get_projects_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectWithRole"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "project:read"
      }
    },
    "/api/v1/projects/{id}/members": {
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "List project members",
        "operationId": "get_projects_id_members",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Member"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "project:read"
      }
    },
    "/api/v1/projects/{id}/members/{user_id}": {
      "put": {
        "tags": [
          "projects"
        ],
        "summary": "Add a member or change their role",
        "operationId": "put_projects_id_members_user_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Member"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "project:manage"
      },
      "delete": {
        "tags": [
          "projects"
        ],
        "summary": "Remove a member",
        "operationId": "delete_projects_id_members_user_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "project:manage"
      }
    },
    "/api/v1/projects/{id}/variables": {
      "get": {
        "tags": [
          "variables"
        ],
        "summary": "List project variables",
        "operationId": "get_projects_id_variables",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "variable:read"
      }
    },
    "/api/v1/projects/{id}/variables/{key}": {
      "put": {
        "tags": [
          "variables"
        ],
        "summary": "Create or update a variable",
        "operationId": "put_projects_id_variables_key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetVariableRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "variable:write"
      },
      "delete": {
        "tags": [
          "variables"
        ],
        "summary": "Delete a variable",
        "operationId": "delete_projects_id_variables_key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "variable:write"
      }
    },
    "/api/v1/settings": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Public instance settings for the UI",
        "operationId": "get_settings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSettings"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-tappet-permission": "public"
      }
    },
    "/api/v1/users": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "List users",
        "operationId": "get_users",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "user:read"
      },
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Create a user",
        "operationId": "post_users",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "user:manage"
      }
    },
    "/api/v1/users/{id}": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Get a user",
        "operationId": "get_users_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "user:read"
      },
      "patch": {
        "tags": [
          "users"
        ],
        "summary": "Update a user's role, status, name or password",
        "operationId": "patch_users_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "user:manage"
      }
    },
    "/api/v1/version": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Server version",
        "operationId": "get_version",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionInfo"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-tappet-permission": "public"
      }
    },
    "/api/v1/workflows": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "List workflows you can read",
        "operationId": "get_workflows",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkflowSummary"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:read"
      },
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Create a workflow",
        "operationId": "post_workflows",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkflowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:write"
      }
    },
    "/api/v1/workflows/import/n8n": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Import an n8n workflow export and return the diagnostics report",
        "operationId": "post_workflows_import_n8n",
        "responses": {
          "201": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:write"
      }
    },
    "/api/v1/workflows/{id}": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "Get a workflow with its current definition",
        "operationId": "get_workflows_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:read"
      },
      "put": {
        "tags": [
          "workflows"
        ],
        "summary": "Save a new version of a workflow",
        "operationId": "put_workflows_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:write"
      },
      "delete": {
        "tags": [
          "workflows"
        ],
        "summary": "Delete a workflow",
        "operationId": "delete_workflows_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:write"
      }
    },
    "/api/v1/workflows/{id}/activate": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Activate triggers and webhooks",
        "operationId": "post_workflows_id_activate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivationResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:activate"
      }
    },
    "/api/v1/workflows/{id}/deactivate": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Deactivate triggers and webhooks",
        "operationId": "post_workflows_id_deactivate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivationResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:activate"
      }
    },
    "/api/v1/workflows/{id}/export": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "Export the Tappet definition",
        "operationId": "get_workflows_id_export",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:read"
      }
    },
    "/api/v1/workflows/{id}/export/n8n": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "Export in n8n workflow format",
        "operationId": "get_workflows_id_export_n8n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:read"
      }
    },
    "/api/v1/workflows/{id}/rollback": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Create a new version copying an older one",
        "operationId": "post_workflows_id_rollback",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RollbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:write"
      }
    },
    "/api/v1/workflows/{id}/run": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Run manually, optionally with pin data or as a partial execution",
        "operationId": "post_workflows_id_run",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunWorkflowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:execute"
      }
    },
    "/api/v1/workflows/{id}/test-webhook": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Listen on test webhook URLs for one editor run",
        "operationId": "post_workflows_id_test_webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TestWebhookRegistration"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:execute"
      }
    },
    "/api/v1/workflows/{id}/versions": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "List workflow versions",
        "operationId": "get_workflows_id_versions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VersionSummary"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:read"
      }
    },
    "/api/v1/workflows/{id}/versions/{version}": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "Get one workflow version",
        "operationId": "get_workflows_id_versions_version",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "api_key": []
          }
        ],
        "x-tappet-permission": "workflow:read"
      }
    }
  },
  "components": {
    "schemas": {
      "ActivationResponse": {
        "type": "object",
        "required": [
          "id",
          "active"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "AuditPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "next_before": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CancelResponse": {
        "type": "object",
        "required": [
          "id",
          "canceled"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "canceled": {
            "type": "boolean"
          }
        }
      },
      "ChangePasswordRequest": {
        "type": "object",
        "required": [
          "current_password",
          "new_password"
        ],
        "properties": {
          "current_password": {
            "type": "string"
          },
          "new_password": {
            "type": "string"
          }
        }
      },
      "CreateApiKeyRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Permission scopes (`workflow:read`, `workflow:*`, `*`). Default `[\"*\"]`."
          },
          "expires_in_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Lifetime in days; omit for a key that does not expire.",
            "minimum": 0
          }
        }
      },
      "CreateCredentialRequest": {
        "type": "object",
        "required": [
          "name",
          "kind"
        ],
        "properties": {
          "project_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "`<connector>/<auth_id>` or a core kind such as `http.bearer`."
          },
          "data": {
            "type": "object"
          }
        }
      },
      "CreateProjectRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "CreateUserRequest": {
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "password": {
            "type": "string"
          },
          "instance_role": {
            "type": [
              "string",
              "null"
            ],
            "description": "owner | admin | member (default member)"
          }
        }
      },
      "CreateWorkflowRequest": {
        "type": "object",
        "required": [
          "workflow"
        ],
        "properties": {
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Target project. Optional when the caller can write to exactly one project."
          },
          "workflow": {
            "type": "object",
            "description": "Workflow definition (Tappet IR)."
          }
        }
      },
      "CreatedApiKey": {
        "type": "object",
        "required": [
          "key",
          "secret"
        ],
        "properties": {
          "key": {
            "type": "object"
          },
          "secret": {
            "type": "string",
            "description": "The full key. Shown only once; store it securely."
          }
        }
      },
      "CredentialKinds": {
        "type": "object",
        "required": [
          "kinds"
        ],
        "properties": {
          "oauth_redirect_uri": {
            "type": [
              "string",
              "null"
            ],
            "description": "Redirect URI for OAuth2 apps (requires TAPPET_PUBLIC_URL)."
          },
          "kinds": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CredentialTestResult": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ErrorBody": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        }
      },
      "ErrorDetail": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable machine-readable code, e.g. `not_found`."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation. Never contains secret values."
          }
        }
      },
      "ExecutionDetail": {
        "type": "object",
        "required": [
          "execution"
        ],
        "properties": {
          "execution": {
            "type": "object"
          },
          "run_data": {
            "type": [
              "object",
              "null"
            ],
            "description": "node name -> runs ordered by run index; present with `include_data=true`."
          }
        }
      },
      "ExecutionPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HealthReport": {
        "type": "object",
        "required": [
          "status",
          "store",
          "uptime_secs"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "ok | degraded"
          },
          "store": {
            "type": "string",
            "description": "ok | error"
          },
          "queue_depth": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "uptime_secs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "LookupRequest": {
        "type": "object",
        "required": [
          "project_id"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "credential_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Credential to call the vendor API with (must belong to `project_id`)."
          },
          "params": {
            "type": "object",
            "description": "Current node parameters (lookups may depend on earlier choices)."
          },
          "search": {
            "type": [
              "string",
              "null"
            ]
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LookupResponse": {
        "type": "object",
        "required": [
          "options"
        ],
        "properties": {
          "options": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MeResponse": {
        "type": "object",
        "required": [
          "user",
          "auth",
          "projects"
        ],
        "properties": {
          "user": {
            "type": "object"
          },
          "auth": {
            "type": "string",
            "description": "`session` or `api_key`."
          },
          "csrf_token": {
            "type": [
              "string",
              "null"
            ]
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectWithRole"
            }
          }
        }
      },
      "Member": {
        "type": "object",
        "required": [
          "user_id",
          "email",
          "role"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string"
          }
        }
      },
      "NodeRunEntry": {
        "type": "object",
        "required": [
          "run_index",
          "run"
        ],
        "properties": {
          "run_index": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "run": {
            "type": "object"
          }
        }
      },
      "NodeRunSummary": {
        "type": "object",
        "required": [
          "node",
          "run_index",
          "status",
          "started_at",
          "duration_ms",
          "item_counts"
        ],
        "properties": {
          "node": {
            "type": "string"
          },
          "run_index": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "status": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "item_counts": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Items per output port."
          },
          "error": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "OAuthStartResponse": {
        "type": "object",
        "required": [
          "authorize_url"
        ],
        "properties": {
          "authorize_url": {
            "type": "string"
          },
          "redirect_uri": {
            "type": [
              "string",
              "null"
            ],
            "description": "The redirect URI to register with the provider."
          }
        }
      },
      "ProjectWithRole": {
        "type": "object",
        "required": [
          "project"
        ],
        "properties": {
          "project": {
            "type": "object"
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "The caller's role; `null` for instance admins who are not members."
          }
        }
      },
      "PublicSettings": {
        "type": "object",
        "required": [
          "version",
          "needs_setup",
          "multi_tenant",
          "allow_exec",
          "oidc_enabled",
          "ui_embedded"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "needs_setup": {
            "type": "boolean"
          },
          "public_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "oauth_redirect_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "multi_tenant": {
            "type": "boolean"
          },
          "allow_exec": {
            "type": "boolean"
          },
          "oidc_enabled": {
            "type": "boolean"
          },
          "ui_embedded": {
            "type": "boolean",
            "description": "Whether the web UI is embedded in this binary."
          }
        }
      },
      "RollbackRequest": {
        "type": "object",
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RunWorkflowRequest": {
        "type": "object",
        "properties": {
          "pin_data": {
            "type": [
              "object",
              "null"
            ],
            "description": "Extra pinned outputs (`{ \"<node>\": [ {...json...} ] }`), merged over the saved pin data."
          },
          "destination": {
            "type": [
              "string",
              "null"
            ],
            "description": "Partial execution: stop after this node."
          },
          "from_node": {
            "type": [
              "string",
              "null"
            ],
            "description": "Re-run this node and its descendants, reusing earlier run data for ancestors."
          },
          "workflow": {
            "type": [
              "object",
              "null"
            ],
            "description": "Unsaved definition from the editor; defaults to the saved current version."
          },
          "wait": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Wait for completion (default true). When false the execution is queued."
          }
        }
      },
      "SessionResponse": {
        "type": "object",
        "required": [
          "user"
        ],
        "properties": {
          "user": {
            "type": "object"
          },
          "csrf_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send as `X-CSRF-Token` on every non-GET request made with the session cookie."
          }
        }
      },
      "SetMemberRequest": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string",
            "description": "viewer | operator | editor | admin"
          }
        }
      },
      "SetVariableRequest": {
        "type": "object",
        "required": [
          "value"
        ],
        "properties": {
          "value": {
            "type": "string"
          }
        }
      },
      "SetupRequest": {
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "project_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the first project (default \"Default\")."
          }
        }
      },
      "SetupStatus": {
        "type": "object",
        "required": [
          "needs_setup"
        ],
        "properties": {
          "needs_setup": {
            "type": "boolean",
            "description": "True until the first (owner) account exists."
          }
        }
      },
      "TestWebhookRegistration": {
        "type": "object",
        "required": [
          "method",
          "path",
          "node"
        ],
        "properties": {
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "node": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Absolute URL when TAPPET_PUBLIC_URL is configured."
          }
        }
      },
      "TestWebhookRequest": {
        "type": "object",
        "properties": {
          "workflow": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "UpdateCredentialRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "data": {
            "type": [
              "object",
              "null"
            ],
            "description": "Field values; masked values returned by GET mean \"keep the stored value\"."
          }
        }
      },
      "UpdateUserRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "instance_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "disabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "password": {
            "type": [
              "string",
              "null"
            ],
            "description": "Administrative password reset."
          }
        }
      },
      "VersionInfo": {
        "type": "object",
        "required": [
          "name",
          "version"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "commit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Git revision when built with TAPPET_GIT_SHA set."
          }
        }
      },
      "VersionSummary": {
        "type": "object",
        "required": [
          "version",
          "source",
          "created_at"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "source": {
            "type": "string"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkflowSummary": {
        "type": "object",
        "required": [
          "id",
          "project_id",
          "name",
          "active",
          "tags",
          "current_version",
          "node_count",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "current_version": {
            "type": "integer",
            "format": "int64"
          },
          "node_count": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "tp_<prefix>_<secret>"
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "tappet_session",
        "description": "Session cookie (`__Host-tappet_session` over HTTPS). Unsafe methods also need the X-CSRF-Token header."
      }
    }
  }
}
