{
  "openapi": "3.0.1",
  "info": {
    "title": "Stampa Public API",
    "description": "Stampa public API v1 is a stable, additive API for creating signing envelopes, tracking progress, receiving signed webhooks, and downloading final artifacts.\n\nAuthentication uses OAuth2 client credentials. Call `POST /oauth/token`, then send `Authorization: Bearer <access_token>` to `/api/v1` routes. Access tokens are opaque bearer tokens and expire after one hour by default.\n\nSupported scopes are `organization.read`, `usage.read`, `templates.read`, `files.write`, `envelopes.read`, `envelopes.write`, and `webhooks.manage`.\n\nUse `X-Request-Id` for diagnostics. Use `Idempotency-Key` on supported mutations for duplicate prevention. Idempotency records are organization-scoped and retained for 24 hours.\n\nStampa supports exactly one source document or template per envelope. Multi-document business processes should create one envelope per document and group them in the integrating system with `externalReference`, `externalSystem`, or `externalMetadataJson`.",
    "version": "v1"
  },
  "paths": {
    "/api/health": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "operationId": "Health",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/summary": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/reports/summary": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/plans": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/integrations/diagnostics": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Issue OAuth access token",
        "description": "Issues an OAuth2 client-credentials token.\n\nSupported client authentication:\n- HTTP Basic authentication with `client_id` as username and `client_secret` as password.\n- Form body credentials: `client_id` and `client_secret`.\n\nRequired form fields:\n- `grant_type=client_credentials`\n- Optional `scope`, space-separated. Requested scopes must be allowed on the OAuth client.\n\nSuccess returns `access_token`, `token_type=Bearer`, `expires_in`, `scope`, and `expires_at`. Error responses use `{ \"error\": { \"code\", \"message\", \"details\", \"request_id\" } }`.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/{token}/document": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/dashboard": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/organizations": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/organizations/{id}": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackofficeUpdateOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/organizations/{id}/integrations": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/organizations/{id}/credits": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddCreditsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/secure-signatures/readiness": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/organizations/{id}/secure-signature-policy": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBackofficeSecureSignaturePolicyConfigurationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/platform-admins": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlatformAdministratorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/platform-admins/otp": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestPlatformAdminOtpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/platform-admins/{id}": {
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/platform-admins/security-policy": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/platform-admins/ip-allowlist": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertPlatformAdminIpAllowlistEntryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/platform-admins/ip-allowlist/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertPlatformAdminIpAllowlistEntryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/platform-admins/allowed-domains": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertPlatformAdminAllowedDomainRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/platform-admins/allowed-domains/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertPlatformAdminAllowedDomainRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/smtp": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSmtpSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/smtp/test": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestSmtpSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/sms": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSmsSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/sms/test": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestSmsSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/whatsapp": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWhatsAppSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/whatsapp/test": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestWhatsAppSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/backoffice/notification-templates": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNotificationTemplatesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/register": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/verify-email": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/resend-verification": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestEmailVerificationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/forgot-password": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestPasswordResetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/reset-password/claim": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimPasswordResetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/reset-password": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/accept-invite/claim": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/accept-invite": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/me": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/me/preferences": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserPreferencesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/me/stamps": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserStampRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/me/stamps/{id}/versions": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserStampVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/me/stamps/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserStampRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/me/stamps/{id}/image": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/organization/settings": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/organization/secure-signature-policy": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBackofficeSecureSignaturePolicyConfigurationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/roles": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/roles/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/teams": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTeamRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/teams/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTeamRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/users": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/users/invite": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/users/{id}/resend-invitation": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/users/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/contacts": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertContactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/contacts/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertContactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/api-keys": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/api-keys/diagnostics": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/api-keys/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/api-keys/{id}/secrets/rotate": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/api-keys/{id}/secrets/{secretId}": {
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "secretId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/webhooks": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/webhooks/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/webhooks/{id}/secret/rotate": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/webhooks/deliveries": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "endpointId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/webhooks/deliveries/{id}/replay": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/organization": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Get organization profile",
        "description": "Requires `organization.read`. Returns the organization/user context for the OAuth client.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/usage": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Get usage summary",
        "description": "Requires `usage.read`. Returns current organization usage, quota, and plan data.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSummaryDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/diagnostics": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Get API diagnostics",
        "description": "Requires `usage.read`. Returns recent request, rate-limit, OAuth-client, and webhook diagnostic counters.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDiagnosticsDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/templates": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "List templates",
        "description": "Requires `templates.read`. Use template roles and fields from this response to create envelopes from templates.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/templates/{id}": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Get template",
        "description": "Requires `templates.read`. Returns template roles and field definitions needed for recipient mapping and prefill.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files/upload": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Upload file",
        "description": "Requires `files.write`. Upload one source document for a later envelope. Heavy upload rate limits are lower than ordinary API calls.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files/{id}": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Create envelope",
        "description": "Requires `envelopes.write`.\n\nCreates an envelope from exactly one template or file. Stampa does not support multi-document envelopes. If the CRM needs multiple agreements/documents, create one envelope per document and group those envelopes with `externalReference`, `externalSystem`, or `externalMetadataJson`.\n\nTemplate role mapping is done through the recipients supplied in the request. Prefill values should reference the field names defined on the selected template. Common allowed values: workflow `Sequential` or `Parallel`; recipient type `Signer`, `Approver`, or `Cc`; delivery channel `Email`, `Sms`, or `WhatsApp` when enabled; authentication method `SecureLink`, `EmailOtp`, `SmsOtp`, or `WhatsAppOtp` when enabled; language `en`, `he`, or the configured organization languages.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvelopeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/from-template": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Create envelope from template",
        "description": "Requires `envelopes.write`.\n\nCreates an envelope from exactly one template or file. Stampa does not support multi-document envelopes. If the CRM needs multiple agreements/documents, create one envelope per document and group those envelopes with `externalReference`, `externalSystem`, or `externalMetadataJson`.\n\nTemplate role mapping is done through the recipients supplied in the request. Prefill values should reference the field names defined on the selected template. Common allowed values: workflow `Sequential` or `Parallel`; recipient type `Signer`, `Approver`, or `Cc`; delivery channel `Email`, `Sms`, or `WhatsApp` when enabled; authentication method `SecureLink`, `EmailOtp`, `SmsOtp`, or `WhatsAppOtp` when enabled; language `en`, `he`, or the configured organization languages.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvelopeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/by-external-reference/{externalReference}": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Find envelope by external reference",
        "description": "Requires `envelopes.read`. Use this after a timeout or retry to recover an envelope by your CRM/agreement identifier and avoid duplicate signing requests.",
        "parameters": [
          {
            "name": "externalReference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/{id}": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Get envelope",
        "description": "Requires `envelopes.read`. Returns envelope status, timestamps, recipients, file/artifact IDs, and external correlation fields.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/{id}/send": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Send envelope",
        "description": "Requires `envelopes.write`. Sends invitations for the existing envelope according to its workflow and recipients.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/{id}/cancel": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Cancel envelope",
        "description": "Requires `envelopes.write`. Cancels a pending envelope and emits the cancellation lifecycle event.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/{id}/remind": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Send reminder",
        "description": "Requires `envelopes.write`. Sends a reminder for recipients that can still act on the envelope.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/{id}/extend": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Extend envelope expiry",
        "description": "Requires `envelopes.write`. Updates the expiry timestamp for a pending envelope.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendEnvelopeExpirationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandbox/envelopes/{id}/{status}": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Simulate sandbox envelope lifecycle",
        "description": "Requires `envelopes.write` and a sandbox-enabled client request (`X-Stampa-Sandbox: true`). Simulates lifecycle states without contacting real recipients, charging production usage, or creating production signing records.\n\nAllowed sandbox statuses are `Completed`, `Declined`, `Expired`, and `Cancelled`. Sandbox final PDF and audit-trail download endpoints return deterministic sample PDF bytes.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Stampa-Sandbox",
            "in": "header",
            "description": "Set to `true` for sandbox behavior.",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/{id}/recipients": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "List envelope recipients",
        "description": "Requires `envelopes.read`. Returns recipient status for tracking partial completion, refusal, expiry, cancellation, and completion.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RecipientDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/{id}/documents/final-pdf": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/envelopes/{id}/documents/audit-trail": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "List webhook endpoints",
        "description": "Requires `webhooks.manage`.\n\nSupported event names: `envelope.created`, `envelope.sent`, `recipient.opened`, `recipient.authentication_verified`, `recipient.authentication_failed`, `recipient.completed`, `recipient.declined`, `envelope.completed`, `envelope.cancelled`, `envelope.expired`, `envelope.delivery_failed`, `document.final_pdf_ready`.\n\nDelivery headers:\n- `X-Stampa-Delivery`: unique delivery ID.\n- `X-Stampa-Event`: event name.\n- `X-Stampa-Timestamp`: Unix timestamp in seconds.\n- `X-Stampa-Signature`: `sha256=<lowercase-hex-hmac>`.\n\nSignature construction: compute HMAC-SHA256 using the webhook secret as UTF-8 bytes over the exact string `<X-Stampa-Timestamp>.<raw request body>`. Compare the lowercase hex digest in constant time and reject stale timestamps, for example outside a 5 minute replay window.\n\nPayload shape: `{ \"id\", \"type\", \"created_at\", \"data\" }`. The `data` object includes envelope/recipient/template identifiers, statuses, timestamps, external correlation values, and authenticated API document URLs when final artifacts are available. Payloads never include secrets or document content.\n\nAcknowledgement is any 2xx status. Failed responses retry up to 5 attempts with exponential backoff and jitter. Delivery is at-least-once and may arrive out of order; deduplicate by `X-Stampa-Delivery` or the payload `id`.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpointDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Create webhook endpoint",
        "description": "Requires `webhooks.manage`.\n\nSupported event names: `envelope.created`, `envelope.sent`, `recipient.opened`, `recipient.authentication_verified`, `recipient.authentication_failed`, `recipient.completed`, `recipient.declined`, `envelope.completed`, `envelope.cancelled`, `envelope.expired`, `envelope.delivery_failed`, `document.final_pdf_ready`.\n\nDelivery headers:\n- `X-Stampa-Delivery`: unique delivery ID.\n- `X-Stampa-Event`: event name.\n- `X-Stampa-Timestamp`: Unix timestamp in seconds.\n- `X-Stampa-Signature`: `sha256=<lowercase-hex-hmac>`.\n\nSignature construction: compute HMAC-SHA256 using the webhook secret as UTF-8 bytes over the exact string `<X-Stampa-Timestamp>.<raw request body>`. Compare the lowercase hex digest in constant time and reject stale timestamps, for example outside a 5 minute replay window.\n\nPayload shape: `{ \"id\", \"type\", \"created_at\", \"data\" }`. The `data` object includes envelope/recipient/template identifiers, statuses, timestamps, external correlation values, and authenticated API document URLs when final artifacts are available. Payloads never include secrets or document content.\n\nAcknowledgement is any 2xx status. Failed responses retry up to 5 attempts with exponential backoff and jitter. Delivery is at-least-once and may arrive out of order; deduplicate by `X-Stampa-Delivery` or the payload `id`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/{id}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Update webhook endpoint",
        "description": "Requires `webhooks.manage`.\n\nSupported event names: `envelope.created`, `envelope.sent`, `recipient.opened`, `recipient.authentication_verified`, `recipient.authentication_failed`, `recipient.completed`, `recipient.declined`, `envelope.completed`, `envelope.cancelled`, `envelope.expired`, `envelope.delivery_failed`, `document.final_pdf_ready`.\n\nDelivery headers:\n- `X-Stampa-Delivery`: unique delivery ID.\n- `X-Stampa-Event`: event name.\n- `X-Stampa-Timestamp`: Unix timestamp in seconds.\n- `X-Stampa-Signature`: `sha256=<lowercase-hex-hmac>`.\n\nSignature construction: compute HMAC-SHA256 using the webhook secret as UTF-8 bytes over the exact string `<X-Stampa-Timestamp>.<raw request body>`. Compare the lowercase hex digest in constant time and reject stale timestamps, for example outside a 5 minute replay window.\n\nPayload shape: `{ \"id\", \"type\", \"created_at\", \"data\" }`. The `data` object includes envelope/recipient/template identifiers, statuses, timestamps, external correlation values, and authenticated API document URLs when final artifacts are available. Payloads never include secrets or document content.\n\nAcknowledgement is any 2xx status. Failed responses retry up to 5 attempts with exponential backoff and jitter. Delivery is at-least-once and may arrive out of order; deduplicate by `X-Stampa-Delivery` or the payload `id`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Delete webhook endpoint",
        "description": "Requires `webhooks.manage`.\n\nSupported event names: `envelope.created`, `envelope.sent`, `recipient.opened`, `recipient.authentication_verified`, `recipient.authentication_failed`, `recipient.completed`, `recipient.declined`, `envelope.completed`, `envelope.cancelled`, `envelope.expired`, `envelope.delivery_failed`, `document.final_pdf_ready`.\n\nDelivery headers:\n- `X-Stampa-Delivery`: unique delivery ID.\n- `X-Stampa-Event`: event name.\n- `X-Stampa-Timestamp`: Unix timestamp in seconds.\n- `X-Stampa-Signature`: `sha256=<lowercase-hex-hmac>`.\n\nSignature construction: compute HMAC-SHA256 using the webhook secret as UTF-8 bytes over the exact string `<X-Stampa-Timestamp>.<raw request body>`. Compare the lowercase hex digest in constant time and reject stale timestamps, for example outside a 5 minute replay window.\n\nPayload shape: `{ \"id\", \"type\", \"created_at\", \"data\" }`. The `data` object includes envelope/recipient/template identifiers, statuses, timestamps, external correlation values, and authenticated API document URLs when final artifacts are available. Payloads never include secrets or document content.\n\nAcknowledgement is any 2xx status. Failed responses retry up to 5 attempts with exponential backoff and jitter. Delivery is at-least-once and may arrive out of order; deduplicate by `X-Stampa-Delivery` or the payload `id`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/{id}/secret/rotate": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Rotate webhook secret",
        "description": "Requires `webhooks.manage`.\n\nSupported event names: `envelope.created`, `envelope.sent`, `recipient.opened`, `recipient.authentication_verified`, `recipient.authentication_failed`, `recipient.completed`, `recipient.declined`, `envelope.completed`, `envelope.cancelled`, `envelope.expired`, `envelope.delivery_failed`, `document.final_pdf_ready`.\n\nDelivery headers:\n- `X-Stampa-Delivery`: unique delivery ID.\n- `X-Stampa-Event`: event name.\n- `X-Stampa-Timestamp`: Unix timestamp in seconds.\n- `X-Stampa-Signature`: `sha256=<lowercase-hex-hmac>`.\n\nSignature construction: compute HMAC-SHA256 using the webhook secret as UTF-8 bytes over the exact string `<X-Stampa-Timestamp>.<raw request body>`. Compare the lowercase hex digest in constant time and reject stale timestamps, for example outside a 5 minute replay window.\n\nPayload shape: `{ \"id\", \"type\", \"created_at\", \"data\" }`. The `data` object includes envelope/recipient/template identifiers, statuses, timestamps, external correlation values, and authenticated API document URLs when final artifacts are available. Payloads never include secrets or document content.\n\nAcknowledgement is any 2xx status. Failed responses retry up to 5 attempts with exponential backoff and jitter. Delivery is at-least-once and may arrive out of order; deduplicate by `X-Stampa-Delivery` or the payload `id`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateWebhookSecretResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Test webhook endpoint",
        "description": "Requires `webhooks.manage`.\n\nSupported event names: `envelope.created`, `envelope.sent`, `recipient.opened`, `recipient.authentication_verified`, `recipient.authentication_failed`, `recipient.completed`, `recipient.declined`, `envelope.completed`, `envelope.cancelled`, `envelope.expired`, `envelope.delivery_failed`, `document.final_pdf_ready`.\n\nDelivery headers:\n- `X-Stampa-Delivery`: unique delivery ID.\n- `X-Stampa-Event`: event name.\n- `X-Stampa-Timestamp`: Unix timestamp in seconds.\n- `X-Stampa-Signature`: `sha256=<lowercase-hex-hmac>`.\n\nSignature construction: compute HMAC-SHA256 using the webhook secret as UTF-8 bytes over the exact string `<X-Stampa-Timestamp>.<raw request body>`. Compare the lowercase hex digest in constant time and reject stale timestamps, for example outside a 5 minute replay window.\n\nPayload shape: `{ \"id\", \"type\", \"created_at\", \"data\" }`. The `data` object includes envelope/recipient/template identifiers, statuses, timestamps, external correlation values, and authenticated API document URLs when final artifacts are available. Payloads never include secrets or document content.\n\nAcknowledgement is any 2xx status. Failed responses retry up to 5 attempts with exponential backoff and jitter. Delivery is at-least-once and may arrive out of order; deduplicate by `X-Stampa-Delivery` or the payload `id`.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/deliveries": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "List webhook deliveries",
        "description": "Requires `webhooks.manage`.\n\nSupported event names: `envelope.created`, `envelope.sent`, `recipient.opened`, `recipient.authentication_verified`, `recipient.authentication_failed`, `recipient.completed`, `recipient.declined`, `envelope.completed`, `envelope.cancelled`, `envelope.expired`, `envelope.delivery_failed`, `document.final_pdf_ready`.\n\nDelivery headers:\n- `X-Stampa-Delivery`: unique delivery ID.\n- `X-Stampa-Event`: event name.\n- `X-Stampa-Timestamp`: Unix timestamp in seconds.\n- `X-Stampa-Signature`: `sha256=<lowercase-hex-hmac>`.\n\nSignature construction: compute HMAC-SHA256 using the webhook secret as UTF-8 bytes over the exact string `<X-Stampa-Timestamp>.<raw request body>`. Compare the lowercase hex digest in constant time and reject stale timestamps, for example outside a 5 minute replay window.\n\nPayload shape: `{ \"id\", \"type\", \"created_at\", \"data\" }`. The `data` object includes envelope/recipient/template identifiers, statuses, timestamps, external correlation values, and authenticated API document URLs when final artifacts are available. Payloads never include secrets or document content.\n\nAcknowledgement is any 2xx status. Failed responses retry up to 5 attempts with exponential backoff and jitter. Delivery is at-least-once and may arrive out of order; deduplicate by `X-Stampa-Delivery` or the payload `id`.",
        "parameters": [
          {
            "name": "endpointId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookDeliveryDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/deliveries/{id}/replay": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "summary": "Replay webhook delivery",
        "description": "Requires `webhooks.manage`.\n\nSupported event names: `envelope.created`, `envelope.sent`, `recipient.opened`, `recipient.authentication_verified`, `recipient.authentication_failed`, `recipient.completed`, `recipient.declined`, `envelope.completed`, `envelope.cancelled`, `envelope.expired`, `envelope.delivery_failed`, `document.final_pdf_ready`.\n\nDelivery headers:\n- `X-Stampa-Delivery`: unique delivery ID.\n- `X-Stampa-Event`: event name.\n- `X-Stampa-Timestamp`: Unix timestamp in seconds.\n- `X-Stampa-Signature`: `sha256=<lowercase-hex-hmac>`.\n\nSignature construction: compute HMAC-SHA256 using the webhook secret as UTF-8 bytes over the exact string `<X-Stampa-Timestamp>.<raw request body>`. Compare the lowercase hex digest in constant time and reject stale timestamps, for example outside a 5 minute replay window.\n\nPayload shape: `{ \"id\", \"type\", \"created_at\", \"data\" }`. The `data` object includes envelope/recipient/template identifiers, statuses, timestamps, external correlation values, and authenticated API document URLs when final artifacts are available. Payloads never include secrets or document content.\n\nAcknowledgement is any 2xx status. Failed responses retry up to 5 attempts with exponential backoff and jitter. Delivery is at-least-once and may arrive out of order; deduplicate by `X-Stampa-Delivery` or the payload `id`.\n\nDuplicate prevention: send `Idempotency-Key` on supported mutations. The key is scoped to the organization. Reusing the same key with the same normalized request body returns the stored response. Reusing the same key with a different body returns `409 Conflict`. Current retention is 24 hours.\n\n`X-Request-Id` is separate and used only for diagnostics/tracing; it does not enforce idempotency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Duplicate-prevention key. Organization-scoped; retained for 24 hours; same key plus same body replays the stored response, different body returns 409."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/files/upload": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "file": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/files/{id}/download": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/templates": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/templates/{id}": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/templates/{id}/roles": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/templates/{id}/fields": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldDefinitionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/templates/{id}/fields/{fieldId}": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fieldId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldDefinitionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fieldId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/templates/{id}/publish": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/templates/{id}/unpublish": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvelopeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/send": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/cancel": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/remind": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/extend": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendEnvelopeExpirationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/notes": {
      "put": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEnvelopeNotesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/archive": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/unarchive": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/recipients/{recipientId}/replace": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "recipientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceRecipientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/recipients/{recipientId}/resend": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "recipientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/envelopes/{id}/evidence-package": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/document": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/request-otp": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestOtpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/verify-otp": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyOtpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/decline": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclineSigningRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/draft": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveSigningDraftRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/complete": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteSigningRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/secure-signature/session": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSecureSignatureSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/secure-signature/session/{sessionId}/complete": {
      "post": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteSecureSignatureSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/signing/{token}/secure-signature/validations": {
      "get": {
        "tags": [
          "Stampa.Api"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptInviteRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AddCreditsRequest": {
        "type": "object",
        "properties": {
          "smsCredits": {
            "type": "integer",
            "format": "int32"
          },
          "otpCredits": {
            "type": "integer",
            "format": "int32"
          },
          "reason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ApiClientUsageDto": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "lastUsedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "requestsLastMinute": {
            "type": "integer",
            "format": "int32"
          },
          "requestsLastHour": {
            "type": "integer",
            "format": "int32"
          },
          "rateLimitHitsLastHour": {
            "type": "integer",
            "format": "int32"
          },
          "ipAllowlist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ApiDiagnosticsDto": {
        "type": "object",
        "properties": {
          "requestsLastMinute": {
            "type": "integer",
            "format": "int32"
          },
          "requestsLastHour": {
            "type": "integer",
            "format": "int32"
          },
          "rateLimitHitsLastHour": {
            "type": "integer",
            "format": "int32"
          },
          "webhookFailures": {
            "type": "integer",
            "format": "int32"
          },
          "webhookQueueBacklog": {
            "type": "integer",
            "format": "int32"
          },
          "clients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiClientUsageDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BackofficeUpdateOrganizationRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "nullable": true
          },
          "planId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "legalName": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "businessNumber": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "primaryContactName": {
            "type": "string",
            "nullable": true
          },
          "primaryContactEmail": {
            "type": "string",
            "nullable": true
          },
          "primaryContactPhone": {
            "type": "string",
            "nullable": true
          },
          "onboardingCompleted": {
            "type": "boolean",
            "nullable": true
          },
          "primaryContactUserId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "apiIntegrationsEnabled": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BillingSummaryDto": {
        "type": "object",
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/PlanDto"
          },
          "subscriptionStatus": {
            "type": "string",
            "nullable": true
          },
          "billingMode": {
            "type": "string",
            "nullable": true
          },
          "trialEndsAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "currentPeriodEndsAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "smsCredits": {
            "type": "integer",
            "format": "int32"
          },
          "otpCredits": {
            "type": "integer",
            "format": "int32"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageSummaryDto"
          }
        },
        "additionalProperties": false
      },
      "ClaimInviteRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ClaimPasswordResetRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CompleteSecureSignatureSessionRequest": {
        "type": "object",
        "properties": {
          "signatureValue": {
            "type": "string",
            "nullable": true
          },
          "certificateFingerprintSha256": {
            "type": "string",
            "nullable": true
          },
          "certificateSubject": {
            "type": "string",
            "nullable": true
          },
          "certificateIssuer": {
            "type": "string",
            "nullable": true
          },
          "certificateSerialNumber": {
            "type": "string",
            "nullable": true
          },
          "certificateChainPem": {
            "type": "string",
            "nullable": true
          },
          "providerProofJson": {
            "type": "string",
            "nullable": true
          },
          "providerAuthorizationCode": {
            "type": "string",
            "nullable": true
          },
          "providerSessionId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CompleteSigningRequest": {
        "type": "object",
        "properties": {
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignerFieldValueRequest"
            },
            "nullable": true
          },
          "consentText": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateApiKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "ipAllowlist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateEnvelopeDocumentRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "fileId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateEnvelopeRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true
          },
          "workflowType": {
            "type": "string",
            "nullable": true
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "fileId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientRequest"
            },
            "nullable": true
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldDefinitionRequest"
            },
            "nullable": true
          },
          "signingIntroMessage": {
            "type": "string",
            "nullable": true
          },
          "initialValues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignerFieldValueRequest"
            },
            "nullable": true
          },
          "correspondenceLanguage": {
            "type": "string",
            "nullable": true
          },
          "requireRecipientAuthentication": {
            "type": "boolean"
          },
          "externalReference": {
            "type": "string",
            "nullable": true
          },
          "externalSystem": {
            "type": "string",
            "nullable": true
          },
          "externalMetadataJson": {
            "type": "string",
            "nullable": true
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateEnvelopeDocumentRequest"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreatePlatformAdministratorRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "userId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "organizationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "otpChallengeId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "otpCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateRoleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateSecureSignatureSessionRequest": {
        "type": "object",
        "properties": {
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignerFieldValueRequest"
            },
            "nullable": true
          },
          "consentText": {
            "type": "string",
            "nullable": true
          },
          "keySource": {
            "type": "string",
            "nullable": true
          },
          "certificateFingerprintSha256": {
            "type": "string",
            "nullable": true
          },
          "certificateSubject": {
            "type": "string",
            "nullable": true
          },
          "certificateIssuer": {
            "type": "string",
            "nullable": true
          },
          "certificateSerialNumber": {
            "type": "string",
            "nullable": true
          },
          "certificateChainPem": {
            "type": "string",
            "nullable": true
          },
          "signatureAlgorithmName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateTeamRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "managerUserId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "baseFileId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateRoleRequest"
            },
            "nullable": true
          },
          "defaultSigningIntroMessage": {
            "type": "string",
            "nullable": true
          },
          "templateType": {
            "type": "string",
            "nullable": true
          },
          "rtfContentHtml": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateUserStampRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "imageDataUrl": {
            "type": "string",
            "nullable": true
          },
          "sourceType": {
            "type": "string",
            "nullable": true
          },
          "sourceJson": {
            "type": "string",
            "nullable": true
          },
          "makeDefault": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CreateUserStampVersionRequest": {
        "type": "object",
        "properties": {
          "imageDataUrl": {
            "type": "string",
            "nullable": true
          },
          "sourceType": {
            "type": "string",
            "nullable": true
          },
          "sourceJson": {
            "type": "string",
            "nullable": true
          },
          "makeDefault": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CreateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateWebhookEndpointResponse": {
        "type": "object",
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/WebhookEndpointDto"
          },
          "plainSecret": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DeclineSigningRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EnvelopeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "workflowType": {
            "type": "string",
            "nullable": true
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "originalFileId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "finalPdfFileId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "auditTrailFileId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "finalPdfHashSha256": {
            "type": "string",
            "nullable": true
          },
          "sentAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientDto"
            },
            "nullable": true
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldDefinitionDto"
            },
            "nullable": true
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldValueDto"
            },
            "nullable": true
          },
          "signingIntroMessage": {
            "type": "string",
            "nullable": true
          },
          "internalNotes": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "externalReference": {
            "type": "string",
            "nullable": true
          },
          "externalSystem": {
            "type": "string",
            "nullable": true
          },
          "externalMetadataJson": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ExtendEnvelopeExpirationRequest": {
        "type": "object",
        "properties": {
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "FieldDefinitionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "fieldType": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "recipientRoleName": {
            "type": "string",
            "nullable": true
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "x": {
            "type": "number",
            "format": "double"
          },
          "y": {
            "type": "number",
            "format": "double"
          },
          "width": {
            "type": "number",
            "format": "double"
          },
          "height": {
            "type": "number",
            "format": "double"
          },
          "required": {
            "type": "boolean"
          },
          "defaultValue": {
            "type": "string",
            "nullable": true
          },
          "propertiesJson": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FieldDefinitionRequest": {
        "type": "object",
        "properties": {
          "fieldType": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "recipientRoleName": {
            "type": "string",
            "nullable": true
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "x": {
            "type": "number",
            "format": "double"
          },
          "y": {
            "type": "number",
            "format": "double"
          },
          "width": {
            "type": "number",
            "format": "double"
          },
          "height": {
            "type": "number",
            "format": "double"
          },
          "required": {
            "type": "boolean"
          },
          "defaultValue": {
            "type": "string",
            "nullable": true
          },
          "validationRulesJson": {
            "type": "string",
            "nullable": true
          },
          "propertiesJson": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FieldValueDto": {
        "type": "object",
        "properties": {
          "fieldDefinitionId": {
            "type": "string",
            "format": "uuid"
          },
          "recipientId": {
            "type": "string",
            "format": "uuid"
          },
          "valueText": {
            "type": "string",
            "nullable": true
          },
          "valueJson": {
            "type": "string",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "previewImageDataUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FileDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "originalFilename": {
            "type": "string",
            "nullable": true
          },
          "mimeType": {
            "type": "string",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "hashSha256": {
            "type": "string",
            "nullable": true
          },
          "pageCount": {
            "type": "integer",
            "format": "int32"
          },
          "processingStatus": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "InviteUserRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "format": "uuid"
          },
          "teamIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "companyVatNumber": {
            "type": "string",
            "nullable": true
          },
          "jobTitle": {
            "type": "string",
            "nullable": true
          },
          "addressStreet": {
            "type": "string",
            "nullable": true
          },
          "addressNumber": {
            "type": "string",
            "nullable": true
          },
          "addressCity": {
            "type": "string",
            "nullable": true
          },
          "addressCountry": {
            "type": "string",
            "nullable": true
          },
          "addressZip": {
            "type": "string",
            "nullable": true
          },
          "idNumber": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LoginRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MeResponse": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "fullName": {
            "type": "string",
            "nullable": true
          },
          "roleName": {
            "type": "string",
            "nullable": true
          },
          "organizationName": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "plan": {
            "$ref": "#/components/schemas/PlanDto"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "isPlatformAdmin": {
            "type": "boolean"
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "companyVatNumber": {
            "type": "string",
            "nullable": true
          },
          "addressStreet": {
            "type": "string",
            "nullable": true
          },
          "addressNumber": {
            "type": "string",
            "nullable": true
          },
          "addressCity": {
            "type": "string",
            "nullable": true
          },
          "addressCountry": {
            "type": "string",
            "nullable": true
          },
          "addressZip": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "OAuthTokenResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "nullable": true
          },
          "token_type": {
            "type": "string",
            "nullable": true
          },
          "expires_in": {
            "type": "integer",
            "format": "int32"
          },
          "scope": {
            "type": "string",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "PlanDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "monthlyEnvelopeLimit": {
            "type": "integer",
            "format": "int32"
          },
          "activeTemplateLimit": {
            "type": "integer",
            "format": "int32"
          },
          "userLimit": {
            "type": "integer",
            "format": "int32"
          },
          "teamLimit": {
            "type": "integer",
            "format": "int32"
          },
          "smsCreditIncluded": {
            "type": "integer",
            "format": "int32"
          },
          "otpCreditIncluded": {
            "type": "integer",
            "format": "int32"
          },
          "whatsAppAccess": {
            "type": "boolean"
          },
          "apiAccess": {
            "type": "boolean"
          },
          "webhookAccess": {
            "type": "boolean"
          },
          "whiteLabel": {
            "type": "boolean"
          },
          "sso": {
            "type": "boolean"
          },
          "advancedAuditLogs": {
            "type": "boolean"
          },
          "digitalSignature": {
            "type": "boolean"
          },
          "retentionDays": {
            "type": "integer",
            "format": "int32"
          },
          "storageLimitBytes": {
            "type": "integer",
            "format": "int64"
          },
          "supportLevel": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PublicApiError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "nullable": true
          },
          "request_id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PublicApiErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/PublicApiError"
          }
        },
        "additionalProperties": false
      },
      "RecipientDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "roleName": {
            "type": "string",
            "nullable": true
          },
          "contactId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "fullName": {
            "type": "string",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "companyVatNumber": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "addressStreet": {
            "type": "string",
            "nullable": true
          },
          "addressNumber": {
            "type": "string",
            "nullable": true
          },
          "addressCity": {
            "type": "string",
            "nullable": true
          },
          "addressCountry": {
            "type": "string",
            "nullable": true
          },
          "addressZip": {
            "type": "string",
            "nullable": true
          },
          "signingOrder": {
            "type": "integer",
            "format": "int32"
          },
          "deliveryChannel": {
            "type": "string",
            "nullable": true
          },
          "authenticationMethod": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "openedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "authenticatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "otpAttempts": {
            "type": "integer",
            "format": "int32"
          },
          "otpAttemptsRemaining": {
            "type": "integer",
            "format": "int32"
          },
          "otpLocked": {
            "type": "boolean"
          },
          "otpExpiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "otpRequestedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RecipientRequest": {
        "type": "object",
        "properties": {
          "roleName": {
            "type": "string",
            "nullable": true
          },
          "fullName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "signingOrder": {
            "type": "integer",
            "format": "int32"
          },
          "deliveryChannel": {
            "type": "string",
            "nullable": true
          },
          "authenticationMethod": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "contactId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "companyVatNumber": {
            "type": "string",
            "nullable": true
          },
          "addressStreet": {
            "type": "string",
            "nullable": true
          },
          "addressNumber": {
            "type": "string",
            "nullable": true
          },
          "addressCity": {
            "type": "string",
            "nullable": true
          },
          "addressCountry": {
            "type": "string",
            "nullable": true
          },
          "addressZip": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RegisterRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "organizationName": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          },
          "acceptTerms": {
            "type": "boolean"
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "businessNumber": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ReplaceRecipientRequest": {
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "deliveryChannel": {
            "type": "string",
            "nullable": true
          },
          "authenticationMethod": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RequestEmailVerificationRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RequestOtpRequest": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RequestPasswordResetRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RequestPlatformAdminOtpRequest": {
        "type": "object",
        "properties": {
          "targetEmail": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ResetPasswordRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RotateWebhookSecretResponse": {
        "type": "object",
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/WebhookEndpointDto"
          },
          "plainSecret": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SaveSigningDraftRequest": {
        "type": "object",
        "properties": {
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignerFieldValueRequest"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SignerFieldValueRequest": {
        "type": "object",
        "properties": {
          "fieldDefinitionId": {
            "type": "string",
            "format": "uuid"
          },
          "valueText": {
            "type": "string",
            "nullable": true
          },
          "valueJson": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TemplateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "templateType": {
            "type": "string",
            "nullable": true
          },
          "baseFileId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "versionNumber": {
            "type": "integer",
            "format": "int32"
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateRoleDto"
            },
            "nullable": true
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldDefinitionDto"
            },
            "nullable": true
          },
          "defaultSigningIntroMessage": {
            "type": "string",
            "nullable": true
          },
          "rtfContentHtml": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "TemplateRoleDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "signingOrder": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "deliveryChannel": {
            "type": "string",
            "nullable": true
          },
          "authenticationMethod": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TemplateRoleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "signingOrder": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "deliveryChannel": {
            "type": "string",
            "nullable": true
          },
          "authenticationMethod": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TestSmsSettingsRequest": {
        "type": "object",
        "properties": {
          "recipientPhone": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TestSmtpSettingsRequest": {
        "type": "object",
        "properties": {
          "recipientEmail": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TestWhatsAppSettingsRequest": {
        "type": "object",
        "properties": {
          "recipientPhone": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateApiKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "ipAllowlist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateBackofficeSecureSignaturePolicyConfigurationRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "assuranceLevel": {
            "type": "string",
            "nullable": true
          },
          "allowedKeySources": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "defaultKeySource": {
            "type": "string",
            "nullable": true
          },
          "testModeEnabled": {
            "type": "boolean"
          },
          "clientToken": {
            "$ref": "#/components/schemas/UpdateSecureSignatureClientTokenSettingsRequest"
          },
          "customerCaGateway": {
            "$ref": "#/components/schemas/UpdateSecureSignatureCustomerCaGatewaySettingsRequest"
          }
        },
        "additionalProperties": false
      },
      "UpdateEnvelopeNotesRequest": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateNotificationTemplateDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "channel": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string",
            "nullable": true
          },
          "isHtml": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UpdateNotificationTemplatesRequest": {
        "type": "object",
        "properties": {
          "emailTemplates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateNotificationTemplateDto"
            },
            "nullable": true
          },
          "smsTemplates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateNotificationTemplateDto"
            },
            "nullable": true
          },
          "whatsAppTemplates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateNotificationTemplateDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateOrganizationSettingsRequest": {
        "type": "object",
        "properties": {
          "primaryColor": {
            "type": "string",
            "nullable": true
          },
          "senderDisplayName": {
            "type": "string",
            "nullable": true
          },
          "emailReplyTo": {
            "type": "string",
            "nullable": true
          },
          "emailFooter": {
            "type": "string",
            "nullable": true
          },
          "requireMfa": {
            "type": "boolean",
            "nullable": true
          },
          "sessionTimeoutMinutes": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "defaultOtpRequired": {
            "type": "boolean",
            "nullable": true
          },
          "defaultEnvelopeExpirationDays": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "consentTextHe": {
            "type": "string",
            "nullable": true
          },
          "consentTextEn": {
            "type": "string",
            "nullable": true
          },
          "privacyNoticeHe": {
            "type": "string",
            "nullable": true
          },
          "privacyNoticeEn": {
            "type": "string",
            "nullable": true
          },
          "defaultSigningIntroMessage": {
            "type": "string",
            "nullable": true
          },
          "originalRetentionDays": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "signedRetentionDays": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "auditRetentionDays": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "retentionAutoDeleteEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "legalName": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "businessNumber": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "dateFormat": {
            "type": "string",
            "nullable": true
          },
          "dateTimeFormat": {
            "type": "string",
            "nullable": true
          },
          "primaryContactName": {
            "type": "string",
            "nullable": true
          },
          "primaryContactEmail": {
            "type": "string",
            "nullable": true
          },
          "primaryContactPhone": {
            "type": "string",
            "nullable": true
          },
          "onboardingCompleted": {
            "type": "boolean",
            "nullable": true
          },
          "primaryContactUserId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "defaultCorrespondenceLanguage": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateRoleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateSecureSignatureClientTokenSettingsRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "providerName": {
            "type": "string",
            "nullable": true
          },
          "bridgeProtocol": {
            "type": "string",
            "nullable": true
          },
          "bridgeUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateSecureSignatureCustomerCaGatewaySettingsRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "gatewayUrl": {
            "type": "string",
            "nullable": true
          },
          "credentialId": {
            "type": "string",
            "nullable": true
          },
          "certificateEndpoint": {
            "type": "string",
            "nullable": true
          },
          "signEndpoint": {
            "type": "string",
            "nullable": true
          },
          "authMode": {
            "type": "string",
            "nullable": true
          },
          "bearerToken": {
            "type": "string",
            "nullable": true
          },
          "clearBearerToken": {
            "type": "boolean"
          },
          "apiKey": {
            "type": "string",
            "nullable": true
          },
          "clearApiKey": {
            "type": "boolean"
          },
          "hmacSecret": {
            "type": "string",
            "nullable": true
          },
          "clearHmacSecret": {
            "type": "boolean"
          },
          "trustAnchorPem": {
            "type": "string",
            "nullable": true
          },
          "allowedIssuerFingerprints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "ocspUrl": {
            "type": "string",
            "nullable": true
          },
          "crlUrl": {
            "type": "string",
            "nullable": true
          },
          "verified": {
            "type": "boolean"
          },
          "boardApproved": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UpdateSmsSettingsRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "provider": {
            "type": "string",
            "nullable": true
          },
          "webhookUrl": {
            "type": "string",
            "nullable": true
          },
          "webhookBearerToken": {
            "type": "string",
            "nullable": true
          },
          "clearWebhookBearerToken": {
            "type": "boolean"
          },
          "twilioAccountSid": {
            "type": "string",
            "nullable": true
          },
          "twilioAuthToken": {
            "type": "string",
            "nullable": true
          },
          "clearTwilioAuthToken": {
            "type": "boolean"
          },
          "twilioFromPhoneNumber": {
            "type": "string",
            "nullable": true
          },
          "twilioMessagingServiceSid": {
            "type": "string",
            "nullable": true
          },
          "twilioStatusCallbackUrl": {
            "type": "string",
            "nullable": true
          },
          "timeoutMilliseconds": {
            "type": "integer",
            "format": "int32"
          },
          "cellactEndpointUrl": {
            "type": "string",
            "nullable": true
          },
          "cellactCompany": {
            "type": "string",
            "nullable": true
          },
          "cellactUsername": {
            "type": "string",
            "nullable": true
          },
          "cellactPassword": {
            "type": "string",
            "nullable": true
          },
          "clearCellactPassword": {
            "type": "boolean"
          },
          "cellactSender": {
            "type": "string",
            "nullable": true
          },
          "cellactOtpSender": {
            "type": "string",
            "nullable": true
          },
          "cellactTimeToSend": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cellactTimeToLive": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "mobileDeviceServerUrl": {
            "type": "string",
            "nullable": true
          },
          "mobileDeviceServerToken": {
            "type": "string",
            "nullable": true
          },
          "clearMobileDeviceServerToken": {
            "type": "boolean"
          },
          "mobileDeviceServerMsisdn": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateSmtpSettingsRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "host": {
            "type": "string",
            "nullable": true
          },
          "port": {
            "type": "integer",
            "format": "int32"
          },
          "enableSsl": {
            "type": "boolean"
          },
          "useDefaultCredentials": {
            "type": "boolean"
          },
          "username": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          },
          "clearPassword": {
            "type": "boolean"
          },
          "domain": {
            "type": "string",
            "nullable": true
          },
          "senderName": {
            "type": "string",
            "nullable": true
          },
          "senderEmail": {
            "type": "string",
            "nullable": true
          },
          "timeoutMilliseconds": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "UpdateTeamRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "managerUserId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "baseFileId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateRoleRequest"
            },
            "nullable": true
          },
          "defaultSigningIntroMessage": {
            "type": "string",
            "nullable": true
          },
          "templateType": {
            "type": "string",
            "nullable": true
          },
          "rtfContentHtml": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateUserPreferencesRequest": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateUserRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "teamIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "companyVatNumber": {
            "type": "string",
            "nullable": true
          },
          "jobTitle": {
            "type": "string",
            "nullable": true
          },
          "addressStreet": {
            "type": "string",
            "nullable": true
          },
          "addressNumber": {
            "type": "string",
            "nullable": true
          },
          "addressCity": {
            "type": "string",
            "nullable": true
          },
          "addressCountry": {
            "type": "string",
            "nullable": true
          },
          "addressZip": {
            "type": "string",
            "nullable": true
          },
          "idNumber": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateUserStampRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "rotateSecret": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UpdateWhatsAppSettingsRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "provider": {
            "type": "string",
            "nullable": true
          },
          "wahaBaseUrl": {
            "type": "string",
            "nullable": true
          },
          "wahaSession": {
            "type": "string",
            "nullable": true
          },
          "wahaApiKey": {
            "type": "string",
            "nullable": true
          },
          "clearWahaApiKey": {
            "type": "boolean"
          },
          "wahaLinkPreview": {
            "type": "boolean"
          },
          "wahaLinkPreviewHighQuality": {
            "type": "boolean"
          },
          "timeoutMilliseconds": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "UpsertContactRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "companyVatNumber": {
            "type": "string",
            "nullable": true
          },
          "jobTitle": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "addressStreet": {
            "type": "string",
            "nullable": true
          },
          "addressNumber": {
            "type": "string",
            "nullable": true
          },
          "addressCity": {
            "type": "string",
            "nullable": true
          },
          "addressCountry": {
            "type": "string",
            "nullable": true
          },
          "addressZip": {
            "type": "string",
            "nullable": true
          },
          "idNumber": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpsertPlatformAdminAllowedDomainRequest": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UpsertPlatformAdminIpAllowlistEntryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "cidr": {
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean"
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UsageSummaryDto": {
        "type": "object",
        "properties": {
          "periodKey": {
            "type": "string",
            "nullable": true
          },
          "envelopesCreated": {
            "type": "integer",
            "format": "int32"
          },
          "envelopesSent": {
            "type": "integer",
            "format": "int32"
          },
          "envelopesCompleted": {
            "type": "integer",
            "format": "int32"
          },
          "emailMessagesSent": {
            "type": "integer",
            "format": "int32"
          },
          "smsMessagesSent": {
            "type": "integer",
            "format": "int32"
          },
          "otpMessagesSent": {
            "type": "integer",
            "format": "int32"
          },
          "apiCalls": {
            "type": "integer",
            "format": "int32"
          },
          "webhookDeliveries": {
            "type": "integer",
            "format": "int32"
          },
          "storageUsedBytes": {
            "type": "integer",
            "format": "int64"
          },
          "activeTemplates": {
            "type": "integer",
            "format": "int32"
          },
          "activeUsers": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "VerifyEmailRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "VerifyOtpRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WebhookDeliveryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "webhookEndpointId": {
            "type": "string",
            "format": "uuid"
          },
          "eventType": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "attemptCount": {
            "type": "integer",
            "format": "int32"
          },
          "lastStatusCode": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastError": {
            "type": "string",
            "nullable": true
          },
          "nextAttemptAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "requestId": {
            "type": "string",
            "nullable": true
          },
          "eventId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WebhookEndpointDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "lastSuccessAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastFailureAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "OAuth2 client-credentials access token. Send as: Authorization: Bearer <access_token>.",
        "scheme": "bearer",
        "bearerFormat": "opaque"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}