{
  "openapi": "3.0.0",
  "paths": {
    "/v1/auth/dev-login": {
      "post": {
        "description": "404 unless AUTH_DEV_LOGIN_ENABLED; never available in production.",
        "operationId": "authDevLogin",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Session cookie set"
          },
          "404": {
            "description": "Dev login disabled"
          }
        },
        "summary": "Dev-only login (mints a session without Google/Clerk)",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/logout": {
      "post": {
        "operationId": "authLogout",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Session revoked"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "cookie": []
          }
        ],
        "summary": "Revoke the current web session and clear the cookie",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/me": {
      "get": {
        "operationId": "authMe",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Me payload"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "cookie": []
          }
        ],
        "summary": "Current principal + user + memberships (account switcher)",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/clerk/sync": {
      "post": {
        "description": "Provisioning (user + personal account + owner membership) happens on first authenticated request; this endpoint exists so the web app can force it after sign-up.",
        "operationId": "authClerkSync",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Me payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Ensure Clerk-user provisioning ran; returns the me payload",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/oauth/authorize": {
      "get": {
        "description": "Requires an authenticated interactive principal (Clerk bearer or docuflex_session cookie). Consent is auto-approved; responds 302 to redirect_uri?code=…&state=….",
        "operationId": "oauthAuthorize",
        "parameters": [],
        "responses": {
          "302": {
            "description": "Redirect with authorization code"
          },
          "401": {
            "description": "Interactive login required"
          }
        },
        "summary": "OAuth2 authorization endpoint (authorization_code + PKCE S256)",
        "tags": [
          "oauth"
        ]
      }
    },
    "/v1/oauth/token": {
      "post": {
        "description": "Grants: authorization_code (+PKCE), refresh_token (rotating), and urn:ietf:params:oauth:grant-type:jwt-bearer (RS256 assertion against the client JWKS). Errors use the RFC 6749 {error, error_description} format on this endpoint only.",
        "operationId": "oauthToken",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Token issued"
          },
          "400": {
            "description": "{error: invalid_grant | invalid_request, …}"
          },
          "401": {
            "description": "{error: invalid_client, …}"
          }
        },
        "summary": "OAuth2 token endpoint",
        "tags": [
          "oauth"
        ]
      }
    },
    "/v1/oauth/revoke": {
      "post": {
        "description": "Always answers 200, even for unknown tokens (no information oracle).",
        "operationId": "oauthRevoke",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Revoked (or no-op)"
          }
        },
        "summary": "Revoke a refresh token or API key (RFC 7009)",
        "tags": [
          "oauth"
        ]
      }
    },
    "/v1/accounts/{accountId}/oauth-clients": {
      "post": {
        "description": "The client secret is returned ONCE in this response and never again.",
        "operationId": "createOauthClient",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Client created (includes one-time clientSecret)"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Register an OAuth client",
        "tags": [
          "oauth-clients"
        ]
      },
      "get": {
        "operationId": "listOauthClients",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated clients (no secrets)"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List OAuth clients",
        "tags": [
          "oauth-clients"
        ]
      }
    },
    "/v1/accounts/{accountId}/oauth-clients/{clientId}": {
      "get": {
        "operationId": "getOauthClient",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "required": true,
            "in": "path",
            "description": "Internal client row id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Client (no secret)"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get one OAuth client",
        "tags": [
          "oauth-clients"
        ]
      },
      "patch": {
        "operationId": "updateOauthClient",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "required": true,
            "in": "path",
            "description": "Internal client row id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated client"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Update an OAuth client (name, redirect URIs, scopes, grants, JWKS)",
        "tags": [
          "oauth-clients"
        ]
      },
      "delete": {
        "operationId": "revokeOauthClient",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "required": true,
            "in": "path",
            "description": "Internal client row id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Revoke an OAuth client",
        "tags": [
          "oauth-clients"
        ]
      }
    },
    "/v1/accounts/{accountId}/api-keys": {
      "post": {
        "description": "The raw key (dfx_live_…) is returned ONCE in this response and never again.",
        "operationId": "createApiKey",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Key created (includes one-time raw key)"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Create an API key",
        "tags": [
          "api-keys"
        ]
      },
      "get": {
        "operationId": "listApiKeys",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated API keys"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List API keys (prefix, name, lastUsed, scopes — never the secret)",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/v1/accounts/{accountId}/api-keys/{keyId}": {
      "delete": {
        "operationId": "revokeApiKey",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "required": true,
            "in": "path",
            "description": "API key row id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked (idempotent)"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Revoke an API key",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/v1/accounts/{accountId}": {
      "get": {
        "operationId": "getAccount",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get account settings, branding and plan",
        "tags": [
          "accounts"
        ]
      },
      "patch": {
        "operationId": "updateAccount",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated account"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Update account name, settings, branding, dataResidency",
        "tags": [
          "accounts"
        ]
      }
    },
    "/v1/accounts/{accountId}/members": {
      "get": {
        "operationId": "listAccountMembers",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Members"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List account members",
        "tags": [
          "accounts"
        ]
      },
      "post": {
        "description": "Creates a stub user when the email is unknown; the invite email is pending a core EmailJobKind addition ('member_invite').",
        "operationId": "inviteAccountMember",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Membership created"
          },
          "409": {
            "description": "Already a member"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Invite a member",
        "tags": [
          "accounts"
        ]
      }
    },
    "/v1/accounts/{accountId}/members/{membershipId}": {
      "patch": {
        "operationId": "updateAccountMemberRole",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipId",
            "required": true,
            "in": "path",
            "description": "Membership row id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Role updated"
          },
          "409": {
            "description": "Would leave the account without an owner"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Change a member role (last owner cannot be demoted)",
        "tags": [
          "accounts"
        ]
      },
      "delete": {
        "operationId": "removeAccountMember",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipId",
            "required": true,
            "in": "path",
            "description": "Membership row id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removed"
          },
          "409": {
            "description": "Would leave the account without an owner"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Remove a member (last owner cannot be removed)",
        "tags": [
          "accounts"
        ]
      }
    },
    "/v1/users/me/profile": {
      "get": {
        "operationId": "getUserProfile",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Profile"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get the current user profile",
        "tags": [
          "users"
        ]
      },
      "patch": {
        "operationId": "updateUserProfile",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Updated profile"
          }
        },
        "security": [
          {
            "cookie": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Update the current user profile (name, avatar)",
        "tags": [
          "users"
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "healthLive",
        "parameters": [],
        "responses": {
          "200": {
            "description": "{ ok: true, uptime }"
          }
        },
        "summary": "Liveness probe",
        "tags": [
          "health"
        ]
      }
    },
    "/health/ready": {
      "get": {
        "description": "HTTP 503 with the same report body when any dependency is unhealthy.",
        "operationId": "healthReady",
        "parameters": [],
        "responses": {
          "200": {
            "description": "All dependencies healthy"
          },
          "503": {
            "description": "One or more dependencies unhealthy"
          }
        },
        "summary": "Readiness probe (DB, Redis, queues, storage, migrations)",
        "tags": [
          "health"
        ]
      }
    },
    "/metrics": {
      "get": {
        "operationId": "getMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Prometheus text exposition format"
          }
        },
        "summary": "Prometheus metrics (default process metrics + HTTP histogram)",
        "tags": [
          "metrics"
        ]
      }
    },
    "/v1/local-files": {
      "get": {
        "operationId": "getLocalFile",
        "parameters": [],
        "responses": {
          "200": {
            "description": "File bytes"
          },
          "401": {
            "description": "Bad or expired signature"
          },
          "404": {
            "description": "Unknown key, or the API runs on the s3 driver"
          }
        },
        "summary": "Download a locally stored object via an HMAC-signed URL (fs driver only)",
        "tags": [
          "local-files"
        ]
      }
    },
    "/v1/accounts/{accountId}/uploads": {
      "post": {
        "description": "Multipart upload (field \"file\", application/pdf, ≤25MB). Returns an uploadId to reference from POST /envelopes. Unconsumed uploads are garbage-collected.",
        "operationId": "createUpload",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Upload staged",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "uploadId": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string"
                    },
                    "pageCount": {
                      "type": "integer"
                    },
                    "sizeBytes": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Stage a PDF upload",
        "tags": [
          "uploads"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes": {
      "post": {
        "description": "Creates the envelope with documents (staged uploadId or inline base64), recipients, and tabs. status:\"sent\" sends in the same call. Response mirrors DocuSign: { envelopeId, status, uri }.",
        "operationId": "createEnvelope",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "{ envelopeId, status, uri }"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Create an envelope (draft or send immediately)",
        "tags": [
          "envelopes"
        ]
      },
      "get": {
        "description": "Offset mode (default): ?page=&pageSize=, returns { items, page, pageSize, totalCount }. Cursor mode (opt-in): pass ?cursor=<lastId>&limit= for keyset pagination, returns { items, nextCursor, hasMore }. ?order=asc|desc flips the sort direction.",
        "operationId": "listEnvelopes",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated envelope summaries with recipient status"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List envelopes (filter by status/search/date/recipientEmail)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}": {
      "get": {
        "operationId": "getEnvelope",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Envelope detail (documents, recipients, tabs, certificate ref)",
        "tags": [
          "envelopes"
        ]
      },
      "put": {
        "operationId": "updateEnvelope",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Envelope actions: send ({status:\"sent\"}), void ({status:\"voided\", voidedReason}), or draft edits",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/recipients": {
      "get": {
        "operationId": "listEnvelopeRecipients",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List envelope recipients",
        "tags": [
          "envelopes"
        ]
      },
      "post": {
        "operationId": "addEnvelopeRecipient",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Add a recipient (draft only)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}": {
      "put": {
        "operationId": "updateEnvelopeRecipient",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recipientId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Update a recipient (draft only)",
        "tags": [
          "envelopes"
        ]
      },
      "delete": {
        "operationId": "removeEnvelopeRecipient",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recipientId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Remove a recipient and their tabs (draft only)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/resend": {
      "post": {
        "operationId": "resendEnvelopeRecipient",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recipientId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Re-notify a current-tier recipient with a fresh signing link",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/tabs": {
      "get": {
        "operationId": "listEnvelopeTabs",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List envelope tabs",
        "tags": [
          "envelopes"
        ]
      },
      "post": {
        "operationId": "addEnvelopeTab",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Add a tab (draft only)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/tabs/{tabId}": {
      "put": {
        "operationId": "updateEnvelopeTab",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tabId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Update a tab (draft only)",
        "tags": [
          "envelopes"
        ]
      },
      "delete": {
        "operationId": "removeEnvelopeTab",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tabId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Delete a tab (draft only)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/documents": {
      "get": {
        "operationId": "listEnvelopeDocuments",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List envelope documents with hashes",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/documents/combined": {
      "get": {
        "operationId": "getEnvelopeCombinedDocuments",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Presigned URLs for every document (sealed versions once completed)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/documents/certificate": {
      "get": {
        "operationId": "getEnvelopeCertificate",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Presigned certificate-of-completion URL (404 until sealed)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}": {
      "get": {
        "operationId": "getEnvelopeDocument",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Presigned download URL (original, or sealed when completed)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/audit_events": {
      "get": {
        "description": "Supports offset (?page=&pageSize=) and cursor (?cursor=&limit=) pagination; events are always returned oldest-first (chain order).",
        "operationId": "listEnvelopeAuditEvents",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Hash-chained audit trail (+ chainVerified flag)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient": {
      "post": {
        "operationId": "createEnvelopeRecipientView",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Embedded-signing URL for a current-tier recipient (short TTL)",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/accounts/{accountId}/envelopes/{envelopeId}/views/sender": {
      "post": {
        "operationId": "createEnvelopeSenderView",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Sender prepare-view URL",
        "tags": [
          "envelopes"
        ]
      }
    },
    "/v1/signing/{token}": {
      "get": {
        "description": "Envelope summary, presigned documents, the recipient's tabs, consent + auth state. Documents/tabs stay locked until all required auth challenges pass.",
        "operationId": "getSigningBundle",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Ceremony bundle",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/auth/access-code": {
      "post": {
        "operationId": "verifySigningAccessCode",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Verify the sender-shared access code (5 attempts, then revoked)",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/auth/sms-otp/request": {
      "post": {
        "operationId": "requestSigningOtp",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Send a one-time code (email transport in dev; SMS adapter later)",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/auth/sms-otp/verify": {
      "post": {
        "operationId": "verifySigningOtp",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Verify the one-time code (5 attempts, then revoked)",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/auth/kba": {
      "post": {
        "operationId": "verifySigningKba",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ status: \"stub_passed\" }"
          }
        },
        "summary": "[STUB] Knowledge-based authentication — auto-passes with an audited stub note",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/auth/id-verification": {
      "post": {
        "operationId": "verifySigningIdentity",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ status: \"stub_passed\" }"
          }
        },
        "summary": "[STUB] ID verification — auto-passes with an audited stub note",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/consent": {
      "post": {
        "operationId": "recordSigningConsent",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Record ESIGN/UETA consent (required before any signing mutation)",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/signature": {
      "post": {
        "operationId": "adoptSigningSignature",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Adopt a signature (+optional initials) as PNG data URLs (≤1MB each)",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/tabs": {
      "put": {
        "operationId": "fillSigningTabs",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Fill tab values (signature tabs take an adopted SignatureAsset id)",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/complete": {
      "post": {
        "operationId": "completeSigning",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Finish signing: validates required tabs, stamps auto tabs, advances routing",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/signing/{token}/decline": {
      "post": {
        "operationId": "declineSigning",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Opaque signing-session token from the email link / embedded view",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Decline to sign (declines the whole envelope, revokes open links)",
        "tags": [
          "signing"
        ]
      }
    },
    "/v1/verify/{envelopeId}": {
      "get": {
        "description": "Status, sealed-document hashes, certificate hash, and audit-chain verification. Never returns document content.",
        "operationId": "getVerifySummary",
        "parameters": [
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "description": "Envelope id from the certificate",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "VerifySummary"
          }
        },
        "summary": "Envelope integrity summary",
        "tags": [
          "verify"
        ]
      }
    },
    "/v1/verify/{envelopeId}/hash": {
      "post": {
        "description": "Lets anyone holding a PDF confirm it is byte-identical to what was sealed.",
        "operationId": "verifyEnvelopeHash",
        "parameters": [
          {
            "name": "envelopeId",
            "required": true,
            "in": "path",
            "description": "Envelope id from the certificate",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Check a sha256 against the sealed documents + certificate",
        "tags": [
          "verify"
        ]
      }
    },
    "/v1/accounts/{accountId}/templates": {
      "get": {
        "operationId": "listTemplates",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List templates",
        "tags": [
          "templates"
        ]
      },
      "post": {
        "operationId": "createTemplate",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/accounts/{accountId}/templates/{templateId}": {
      "get": {
        "operationId": "getTemplate",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a template with its documents",
        "tags": [
          "templates"
        ]
      },
      "put": {
        "operationId": "updateTemplate",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replace a template (bumps version)",
        "tags": [
          "templates"
        ]
      },
      "delete": {
        "operationId": "deleteTemplate",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Soft-delete a template",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/accounts/{accountId}/templates/{templateId}/documents": {
      "post": {
        "operationId": "addTemplateDocument",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Attach a staged upload as a template document",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/accounts/{accountId}/templates/{templateId}/documents/{documentId}": {
      "delete": {
        "operationId": "removeTemplateDocument",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a template document",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/accounts/{accountId}/templates/{templateId}/envelopes": {
      "post": {
        "operationId": "createEnvelopeFromTemplate",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Instantiate an envelope from this template (draft or sent)",
        "tags": [
          "templates"
        ]
      }
    },
    "/v1/accounts/{accountId}/bulk_send_lists": {
      "post": {
        "operationId": "createBulkSendList",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a bulk send list",
        "tags": [
          "bulk-send"
        ]
      },
      "get": {
        "operationId": "listBulkSendLists",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List bulk send lists",
        "tags": [
          "bulk-send"
        ]
      }
    },
    "/v1/accounts/{accountId}/bulk_send_lists/{listId}": {
      "get": {
        "operationId": "getBulkSendList",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "listId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a bulk send list with rows",
        "tags": [
          "bulk-send"
        ]
      },
      "put": {
        "operationId": "updateBulkSendList",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "listId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a bulk send list",
        "tags": [
          "bulk-send"
        ]
      },
      "delete": {
        "operationId": "deleteBulkSendList",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "listId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Soft-delete a bulk send list",
        "tags": [
          "bulk-send"
        ]
      }
    },
    "/v1/accounts/{accountId}/bulk_send_lists/{listId}/send": {
      "post": {
        "operationId": "sendBulkSendList",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "listId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start a bulk send batch (worker fans out one envelope per row)",
        "tags": [
          "bulk-send"
        ]
      }
    },
    "/v1/accounts/{accountId}/bulk_send_batches": {
      "get": {
        "operationId": "listBulkSendBatches",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List bulk send batches",
        "tags": [
          "bulk-send"
        ]
      }
    },
    "/v1/accounts/{accountId}/bulk_send_batches/{batchId}": {
      "get": {
        "operationId": "getBulkSendBatch",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batchId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get batch status with per-row results",
        "tags": [
          "bulk-send"
        ]
      }
    },
    "/v1/accounts/{accountId}/connect": {
      "post": {
        "operationId": "createConnect",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a Connect (webhook) configuration — the signing secret is returned only here",
        "tags": [
          "connect"
        ]
      },
      "get": {
        "operationId": "listConnect",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Connect configurations",
        "tags": [
          "connect"
        ]
      }
    },
    "/v1/accounts/{accountId}/connect/{connectId}": {
      "get": {
        "operationId": "getConnect",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a Connect configuration",
        "tags": [
          "connect"
        ]
      },
      "put": {
        "operationId": "updateConnect",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a Connect configuration",
        "tags": [
          "connect"
        ]
      },
      "delete": {
        "operationId": "deleteConnect",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a Connect configuration",
        "tags": [
          "connect"
        ]
      }
    },
    "/v1/accounts/{accountId}/connect/{connectId}/deliveries": {
      "get": {
        "operationId": "listConnectDeliveries",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Paginated delivery log",
        "tags": [
          "connect"
        ]
      }
    },
    "/v1/accounts/{accountId}/connect/{connectId}/test": {
      "post": {
        "operationId": "testConnect",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a synthetic test delivery",
        "tags": [
          "connect"
        ]
      }
    },
    "/v1/accounts/{accountId}/connect/{connectId}/deliveries/{deliveryId}/replay": {
      "post": {
        "operationId": "replayConnectDelivery",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deliveryId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replay a past delivery",
        "tags": [
          "connect"
        ]
      }
    },
    "/v1/accounts/{accountId}/library": {
      "get": {
        "operationId": "listLibrary",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List active jurisdiction documents (filter by category/jurisdiction)",
        "tags": [
          "library"
        ]
      }
    },
    "/v1/accounts/{accountId}/library/legality": {
      "get": {
        "operationId": "getLibraryLegality",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Jurisdiction e-signature legality reference (informational banner data)",
        "tags": [
          "library"
        ]
      }
    },
    "/v1/accounts/{accountId}/library/{docId}": {
      "get": {
        "operationId": "getLibraryDocument",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "docId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Library document detail incl. bodyMd, defaults, and my acknowledgment status",
        "tags": [
          "library"
        ]
      }
    },
    "/v1/accounts/{accountId}/library/{docId}/acknowledge": {
      "post": {
        "operationId": "acknowledgeLibraryDisclaimer",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "docId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Acknowledge the counsel-review disclaimer for a document",
        "tags": [
          "library"
        ]
      }
    },
    "/v1/accounts/{accountId}/library/{docId}/use": {
      "post": {
        "operationId": "useLibraryDocument",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "docId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an account template from a library document (renders the PDF; 428 until the disclaimer is acknowledged)",
        "tags": [
          "library"
        ]
      }
    },
    "/v1/accounts/{accountId}/library-admin": {
      "post": {
        "operationId": "adminCreateLibraryDocument",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a jurisdiction document (disclaimer is server-forced)",
        "tags": [
          "library"
        ]
      }
    },
    "/v1/accounts/{accountId}/library-admin/{docId}": {
      "put": {
        "operationId": "adminUpdateLibraryDocument",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "docId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update/version a jurisdiction document (bodyMd edits bump version)",
        "tags": [
          "library"
        ]
      }
    },
    "/v1/accounts/{accountId}/admin/usage": {
      "get": {
        "operationId": "getAdminUsage",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Usage dashboard: per-day envelope counts, completion rate, timing, top templates, storage, webhook success",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/accounts/{accountId}/admin/webhook-failures": {
      "get": {
        "operationId": "getAdminWebhookFailures",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Recent failed/exhausted webhook deliveries",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/accounts/{accountId}/admin/envelopes/search": {
      "get": {
        "operationId": "adminSearchEnvelopes",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search envelopes by subject, recipient email, or envelope id",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/accounts/{accountId}/admin/alerts": {
      "patch": {
        "operationId": "patchAdminAlerts",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Configure alert destinations/thresholds",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/platform/health-history": {
      "get": {
        "operationId": "getHealthHistory",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Hourly health-check history + latest status (platform-wide; see multi-tenant caveat)",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/platform/health-runs": {
      "post": {
        "operationId": "recordHealthRun",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Record a health-check run (internal cron only; HMAC-protected)",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/commissions": {
      "post": {
        "operationId": "createNotaryCommission",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Register a notary commission",
        "tags": [
          "notary"
        ]
      },
      "get": {
        "operationId": "listNotaryCommissions",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List commissions of account members",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/commissions/{commissionId}": {
      "get": {
        "operationId": "getNotaryCommission",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "commissionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a commission",
        "tags": [
          "notary"
        ]
      },
      "patch": {
        "operationId": "updateNotaryCommission",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "commissionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a commission (extend expiry / revoke)",
        "tags": [
          "notary"
        ]
      },
      "delete": {
        "operationId": "deleteNotaryCommission",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "commissionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a commission (refused once it has journal entries)",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/commissions/{commissionId}/seal-spec": {
      "get": {
        "operationId": "getNotarySealSpec",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "commissionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview the notary seal block",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/commissions/{commissionId}/journal": {
      "get": {
        "operationId": "getNotaryJournal",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "commissionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Hash-chained journal entries + chain verification result",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/sessions": {
      "post": {
        "operationId": "createNotarySession",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a RON session (envelope must have a notary recipient; jurisdiction must permit RON)",
        "tags": [
          "notary"
        ]
      },
      "get": {
        "operationId": "listNotarySessions",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List notary sessions",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/sessions/{sessionId}": {
      "get": {
        "operationId": "getNotarySession",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a notary session",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/sessions/{sessionId}/start": {
      "post": {
        "operationId": "startNotarySession",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start the audio/video session",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/sessions/{sessionId}/complete": {
      "post": {
        "operationId": "completeNotarySession",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Complete the session and append the hash-chained journal entry",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/notary/sessions/{sessionId}/cancel": {
      "post": {
        "operationId": "cancelNotarySession",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a session",
        "tags": [
          "notary"
        ]
      }
    },
    "/v1/accounts/{accountId}/clickwraps": {
      "post": {
        "operationId": "createClickwrap",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a clickwrap agreement",
        "tags": [
          "clickwrap"
        ]
      },
      "get": {
        "operationId": "listClickwraps",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List clickwrap agreements",
        "tags": [
          "clickwrap"
        ]
      }
    },
    "/v1/accounts/{accountId}/clickwraps/{clickwrapId}": {
      "get": {
        "operationId": "getClickwrap",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clickwrapId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a clickwrap agreement",
        "tags": [
          "clickwrap"
        ]
      },
      "put": {
        "operationId": "updateClickwrap",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clickwrapId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a clickwrap agreement",
        "tags": [
          "clickwrap"
        ]
      },
      "delete": {
        "operationId": "deleteClickwrap",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clickwrapId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Deactivate a clickwrap (acceptances are kept)",
        "tags": [
          "clickwrap"
        ]
      }
    },
    "/v1/accounts/{accountId}/clickwraps/{clickwrapId}/acceptances": {
      "get": {
        "operationId": "listClickwrapAcceptances",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clickwrapId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List acceptances (paginated JSON, or ?format=csv for a full export)",
        "tags": [
          "clickwrap"
        ]
      }
    },
    "/v1/clickwraps/{clickwrapId}/accept": {
      "post": {
        "operationId": "acceptClickwrap",
        "parameters": [
          {
            "name": "clickwrapId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Record a clickwrap acceptance (public; captures ip/user-agent)",
        "tags": [
          "clickwrap"
        ]
      }
    },
    "/v1/accounts/{accountId}/webforms": {
      "post": {
        "operationId": "createWebForm",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a web form",
        "tags": [
          "webforms"
        ]
      },
      "get": {
        "operationId": "listWebForms",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List web forms",
        "tags": [
          "webforms"
        ]
      }
    },
    "/v1/accounts/{accountId}/webforms/{formId}": {
      "get": {
        "operationId": "getWebForm",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a web form",
        "tags": [
          "webforms"
        ]
      },
      "put": {
        "operationId": "updateWebForm",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a web form",
        "tags": [
          "webforms"
        ]
      },
      "delete": {
        "operationId": "deleteWebForm",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Deactivate a web form",
        "tags": [
          "webforms"
        ]
      }
    },
    "/v1/accounts/{accountId}/webforms/{formId}/submissions": {
      "get": {
        "operationId": "listWebFormSubmissions",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List submissions",
        "tags": [
          "webforms"
        ]
      }
    },
    "/v1/webforms/{formId}/definition": {
      "get": {
        "operationId": "getWebFormDefinition",
        "parameters": [
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Public form definition (render the form)",
        "tags": [
          "webforms"
        ]
      }
    },
    "/v1/webforms/{formId}/submissions": {
      "post": {
        "operationId": "submitWebForm",
        "parameters": [
          {
            "name": "formId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Submit a web form (validated against the stored schema)",
        "tags": [
          "webforms"
        ]
      }
    },
    "/v1/accounts/{accountId}/workflows": {
      "post": {
        "operationId": "createWorkflow",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a workflow definition",
        "tags": [
          "workflows"
        ]
      },
      "get": {
        "operationId": "listWorkflows",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List workflow definitions",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/accounts/{accountId}/workflows/{workflowId}": {
      "get": {
        "operationId": "getWorkflow",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a workflow definition",
        "tags": [
          "workflows"
        ]
      },
      "put": {
        "operationId": "updateWorkflow",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a workflow definition",
        "tags": [
          "workflows"
        ]
      },
      "delete": {
        "operationId": "deleteWorkflow",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Deactivate a workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/accounts/{accountId}/workflows/{workflowId}/runs": {
      "post": {
        "operationId": "startWorkflowRun",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start a workflow run (stub executor)",
        "tags": [
          "workflows"
        ]
      },
      "get": {
        "operationId": "listWorkflowRuns",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List workflow runs",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/accounts/{accountId}/workflows/{workflowId}/runs/{runId}": {
      "get": {
        "operationId": "getWorkflowRun",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "runId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a workflow run",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/accounts/{accountId}/extensions": {
      "post": {
        "operationId": "createExtension",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an extension connection",
        "tags": [
          "extensions"
        ]
      },
      "get": {
        "operationId": "listExtensions",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List extension connections",
        "tags": [
          "extensions"
        ]
      }
    },
    "/v1/accounts/{accountId}/extensions/{extensionId}": {
      "get": {
        "operationId": "getExtension",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extensionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an extension connection",
        "tags": [
          "extensions"
        ]
      },
      "put": {
        "operationId": "updateExtension",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extensionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an extension connection",
        "tags": [
          "extensions"
        ]
      },
      "delete": {
        "operationId": "deleteExtension",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extensionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an extension connection",
        "tags": [
          "extensions"
        ]
      }
    },
    "/v1/accounts/{accountId}/extensions/{extensionId}/verify": {
      "post": {
        "operationId": "verifyExtensionField",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Tenant account id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extensionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Run a data-verification check through the connection (mock adapter)",
        "tags": [
          "extensions"
        ]
      }
    }
  },
  "info": {
    "title": "Docuflex API",
    "description": "REST API for the Docuflex e-signature platform.",
    "version": "1.0.0",
    "contact": {}
  },
  "tags": [],
  "servers": [],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      },
      "cookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "docuflex_session"
      }
    },
    "schemas": {}
  }
}