{
  "openapi": "3.1.0",
  "info": {
    "title": "EasyToPaste API",
    "version": "1.0.0",
    "description": "Zero-knowledge secrets API for EasyToPaste. Content is encrypted client-side before it reaches any create endpoint - the server only ever stores ciphertext and non-sensitive envelope metadata. This document covers the publicly supported endpoints only; it is generated from the running application, not maintained by hand."
  },
  "servers": [
    {
      "url": "https://api.easytopaste.com"
    }
  ],
  "paths": {
    "/v1/abuse-report": {
      "post": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Submit Abuse Report",
        "description": "Recipient-side abuse report (anon or session).\n\nTight rate limit: 5/IP/hour per SECURITY_OPERATIONS §2.",
        "operationId": "submit_abuse_report_v1_abuse_report_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "locator": "{{locator}}",
                "reason_code": "other",
                "free_text": "Optional description, max 500 chars."
              }
            }
          }
        }
      }
    },
    "/v1/identity/.well-known/jwks.json": {
      "get": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Jwks",
        "description": "Return the JWKS (public keys) for JWT verification.\n\nCacheable for 1 hour (Cache-Control: max-age=3600).\nM10: ETag header derived from JWKS body sha256.",
        "operationId": "jwks_v1_identity__well_known_jwks_json_get",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/identity/account": {
      "delete": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Delete Account",
        "description": "Schedule account deletion (soft-delete with 30-day grace period).\n\nRequires the literal string \"DELETE\" as confirmation.\nIf MFA is enrolled, the caller must also supply a valid TOTP code\nin the request body (M2: mfaCode field, not X-MFA-Code header).\nB2: Calls revoke_all_refresh_tokens_for_user on deletion.\nM8: Audits repeat (idempotent) delete calls.",
        "operationId": "delete_account_v1_identity_account_delete",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "confirmation": "DELETE"
              }
            }
          }
        }
      }
    },
    "/v1/identity/data-export": {
      "get": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Data Export",
        "description": "Return a data-portability export of the user's account data.\n\nZERO-KNOWLEDGE: never includes secret ciphertext, decryption keys, or\npassphrase values.  Only metadata and profile data are exported.\n\nPhase-1: synchronous export.  Phase-2: async + email delivery (WS-21).",
        "operationId": "data_export_v1_identity_data_export_get",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/identity/login": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Login",
        "description": "Authenticate with email + password (+ optional TOTP code).\n\nB6: Constant-time gap when user not found (runs dummy Argon2id verify).\nH1: Blocks login if email_verified=false.\nB7: Per-account rate limit key added.",
        "operationId": "login_v1_identity_login_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "email": "you@example.com",
                "password": "a-strong-password-12+"
              }
            }
          }
        }
      }
    },
    "/v1/identity/logout": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Logout",
        "description": "Invalidate the current session.\n\nB4: jti guard removed — if jti is missing it's treated as a hard-fail 500\n(this is handled in require_session which already enforces jti presence).\nThe JTI is added to the denylist unconditionally.\nOptionally revokes the refresh token if provided.",
        "operationId": "logout_v1_identity_logout_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "refreshToken": "YOUR_REFRESH_TOKEN"
              }
            }
          }
        }
      }
    },
    "/v1/identity/me": {
      "get": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Get Me",
        "description": "Return the current user's profile.\n\nM4: Rate-limited per IP.",
        "operationId": "get_me_v1_identity_me_get",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/identity/mfa/disenroll": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Mfa Disenroll",
        "description": "Remove MFA from the account.\n\nRequires both current password and a valid TOTP code.",
        "operationId": "mfa_disenroll_v1_identity_mfa_disenroll_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "currentPassword": "a-strong-password-12+",
                "totpCode": "123456"
              }
            }
          }
        }
      }
    },
    "/v1/identity/mfa/enroll": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Mfa Enroll",
        "description": "Begin TOTP enrollment.\n\nB8: If mfa_enrolled is already True → 409 conflict, with the hint\n\"call /mfa/disenroll first\". The error code is `conflict`; there is no\n`mfa_already_enrolled` code.\nReturns otpauth URL + QR code SVG + recovery codes.\nMFA is NOT active until /mfa/verify is called.",
        "operationId": "mfa_enroll_v1_identity_mfa_enroll_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/identity/mfa/recover": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Mfa Recover",
        "description": "Login using a recovery code (bypasses TOTP).\n\nB9: Accepts { email, password, recovery_code }.\nVerifies password (Argon2id), verifies recovery_code, issues full tokens\nwith mfa_verified=true on success.\nRate-limited: 3/hour per account.\nEmits user.mfa_recovery_used audit event.",
        "operationId": "mfa_recover_v1_identity_mfa_recover_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "email": "you@example.com",
                "password": "a-strong-password-12+",
                "recoveryCode": "ONE_OF_YOUR_RECOVERY_CODES"
              }
            }
          }
        }
      }
    },
    "/v1/identity/mfa/verify": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Mfa Verify",
        "description": "Confirm TOTP enrollment by verifying a fresh code.\n\nH3: Accepts current_password in body; verifies before activating MFA.\nActivates MFA on the account.",
        "operationId": "mfa_verify_v1_identity_mfa_verify_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "totpCode": "123456",
                "currentPassword": "a-strong-password-12+"
              }
            }
          }
        }
      }
    },
    "/v1/identity/password-reset/confirm": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Password Reset Confirm",
        "description": "Complete password reset using the one-time token.\n\nB3: Returns { success: true, requireLogin: true } — does NOT issue tokens.\nUser must re-authenticate (with MFA if enrolled).",
        "operationId": "password_reset_confirm_v1_identity_password_reset_confirm_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "resetToken": "PASSWORD_RESET_TOKEN",
                "newPassword": "a-new-strong-password-12+"
              }
            }
          }
        }
      }
    },
    "/v1/identity/password-reset/request": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Password Reset Request",
        "description": "Initiate password reset — always returns 202 (no enumeration).",
        "operationId": "password_reset_request_v1_identity_password_reset_request_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "email": "you@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/identity/refresh": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Refresh Token",
        "description": "Exchange a refresh token for a new access + refresh token pair.\n\nH2: Race fix — revoke_refresh_token uses ConditionExpression to detect\nconcurrent use.  On ConditionalCheckFailedException → revoke-all.\nB2: Check user status before issuing new tokens.\nM3: Propagate mfa_verified from refresh token record to new access token.",
        "operationId": "refresh_token_v1_identity_refresh_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "refreshToken": "YOUR_REFRESH_TOKEN"
              }
            }
          }
        }
      }
    },
    "/v1/identity/signup": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Signup",
        "description": "Create a new email/password account.\n\nFR-32: acknowledgedIrreversibility MUST be true.\nRejects disposable email domains.\nRate-limited: 3/IP/hour.",
        "operationId": "signup_v1_identity_signup_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "email": "you@example.com",
                "password": "a-strong-password-12+",
                "acknowledgedIrreversibility": true,
                "locale": "en"
              }
            }
          }
        }
      }
    },
    "/v1/identity/verify-email": {
      "post": {
        "tags": [
          "identity-v1"
        ],
        "summary": "Verify Email",
        "description": "Confirm email address via the one-time token.",
        "operationId": "verify_email_v1_identity_verify_email_post",
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "token": "EMAIL_VERIFICATION_TOKEN"
              }
            }
          }
        }
      }
    },
    "/v1/secrets": {
      "post": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Create Secret",
        "description": "Create a zero-knowledge secret envelope and assign a locator.",
        "operationId": "create_secret_v1_secrets_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "type": "text",
                "mode": "link",
                "envelopeVersion": 1,
                "sizeBytes": 42,
                "oneTime": false,
                "expiresInDays": 1,
                "requiresRecipientLogin": false,
                "mimeHint": "text/plain",
                "ciphertext": "BASE64URL_ENCRYPTED_PAYLOAD"
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "List Secrets",
        "description": "Return a cursor-paginated list of the caller's own secrets (metadata only).",
        "operationId": "list_secrets_v1_secrets_get",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/secrets/code/{code}/lookup": {
      "post": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Lookup Code",
        "description": "Resolve a 6-char retrieval code to its locator + Argon2id salt/params.\n\nWS-3 — the Code + Passphrase retrieval flow, which is NOT AVAILABLE in the\nproduct today: this endpoint exists, and no shipped client exposes it.\n\nThis docstring is PUBLISHED: work/ops/tools/generate_public_openapi.py\ncopies it into marketing/public/openapi.json, where the claims gates in\nwork/privacy and work/seo sweep it like any other page. Keep it true.\n\nRate-limited: 3/min per IP (tight — brute-force defense).\nPer-code lockout: after 5 failed lookups in 5 minutes, return generic 404\nso the code's existence is not leaked.\n\nOn success: return { locator, saltB64, argonParams } — no ciphertext.\nOn failure (wrong code / locked): return 404 (no oracle on existence).\n\nAudit: emits code.looked_up on success (metadata only — no salt/params/key).",
        "operationId": "lookup_code_v1_secrets_code__code__lookup_post",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Code"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/secrets/uploads": {
      "post": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Init Upload",
        "description": "Mint presigned S3 PUT URLs so ciphertext uploads directly to S3 (§4.6).\n\nReturns one presigned PUT per chunk.  The client uploads each encrypted\nchunk, then commits with POST /v1/secrets carrying the returned uploadIds.\nCounts as a single create slot (abuse boundary) via the create rate-limit\nclass, but does NOT consume the daily quota — that is charged on commit.\n\nZero-knowledge: the server only issues opaque write URLs; it never sees the\nciphertext the client subsequently PUTs.",
        "operationId": "init_upload_v1_secrets_uploads_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "description": "Example body, taken from the published Postman collection.",
          "content": {
            "application/json": {
              "example": {
                "sizeBytes": 5242880,
                "chunkCount": 1
              }
            }
          }
        }
      }
    },
    "/v1/secrets/{locator}": {
      "get": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Retrieve Secret",
        "description": "Return envelope metadata + ciphertext access URL.\n\nDoes NOT commit burn — the separate POST /burn endpoint does that.\nIf the secret has requiresRecipientLogin=True and the caller is anon,\nreturns 403 with error code `recipient_denied` and the hint\n`recipient_auth_required`. The hint is not the code: a client branching on\n`error.code` must match `recipient_denied`.\n\nX2: Also accepts a short-lived recipient bearer token (from /authorize)\nthat satisfies the requires_recipient_login gate.",
        "operationId": "retrieve_secret_v1_secrets__locator__get",
        "parameters": [
          {
            "name": "locator",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Locator"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/secrets/{locator}/authorize": {
      "post": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Authorize Recipient",
        "description": "Obtain a short-lived bearer token for recipient-auth gated secrets.\n\nX2: API_SPEC §4.3.\n- Anon caller → 403, error code `forbidden`, hint\n  `recipient_auth_required`. GET /v1/secrets/{locator} answers the same\n  situation with a DIFFERENT error code, so a client cannot branch on one\n  of them alone; see that endpoint's own description for the code it uses.\n- Authenticated caller → 200 with a 60s bearer token that satisfies\n  the requires_recipient_login gate on GET /v1/secrets/{locator}.\n\nThe short-lived token is a HS256 JWT scoped to this locator and caller.\nIt is verified in retrieve_secret when the caller presents it as\nAuthorization: Bearer <recipient_token>.",
        "operationId": "authorize_recipient_v1_secrets__locator__authorize_post",
        "parameters": [
          {
            "name": "locator",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Locator"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/secrets/{locator}/burn": {
      "post": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Burn Secret",
        "description": "Atomically commit burn-after-read.\n\nExactly one concurrent caller wins (burned=True). The two ways of losing\ndiffer, and a client must branch on both: a caller that loses a genuine\nrace, while the burn is in flight and the record still exists, gets 410\n`already_accessed`; a caller that retries AFTER the burn completed gets 404\n`not_found`, because committing the burn deletes the record and there is no\nstate left to report.\nRetrieval and burn are separate calls, so a client that cannot use the\npayload simply never commits the burn. The server keeps no read receipt\nand no view counter; it sees only that this endpoint was called.\n\nThis docstring is PUBLISHED: work/ops/tools/generate_public_openapi.py\ncopies it into marketing/public/openapi.json, where the claims gates in\nwork/privacy and work/seo sweep it like any other page. Keep it true.",
        "operationId": "burn_secret_v1_secrets__locator__burn_post",
        "parameters": [
          {
            "name": "locator",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Locator"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/secrets/{locator}/chunks": {
      "get": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Retrieve Secret Chunks",
        "description": "Return the ordered chunk manifest with 5-minute presigned S3 URLs.\n\nBL-4: Integrity gate — if the live chunk count does not match Secret.chunk_count,\nreturns 500 (error code `internal`). It also emits an\noperator.manifest_count_mismatch audit event, but only for a secret that\nbelongs to an organisation: audit events are org-scoped, so for a personal\nsecret the mismatch produces a server-side log line and the 500, and no\naudit record.\n\nAuth + recipient gate: same as GET /v1/secrets/{locator}.",
        "operationId": "retrieve_secret_chunks_v1_secrets__locator__chunks_get",
        "parameters": [
          {
            "name": "locator",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Locator"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/secrets/{locator}/revoke": {
      "post": {
        "tags": [
          "secrets-v1"
        ],
        "summary": "Revoke Secret",
        "description": "Owner-initiated revocation before natural expiry.\n\nAuth required.  Only the owner (or an org admin for org-scoped secrets)\nmay revoke.  Returns { revoked: true } on success.",
        "operationId": "revoke_secret_v1_secrets__locator__revoke_post",
        "parameters": [
          {
            "name": "locator",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Locator"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Request-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}
