{
  "openapi": "3.0.0",
  "info": {
    "title": "Ramp.com API",
    "version": "1.0.0",
    "description": "OpenAPI specification for the public ramp.com API."
  },
  "servers": [
    {
      "url": "https://ramp.com/api/ramplify",
      "description": "Production server"
    }
  ],
  "paths": {
    "/high-intent-prequal": {
      "post": {
        "operationId": "high-intent-prequal",
        "summary": "High-intent prequal email submission",
        "description": "Submit a high-intent email and start the prequal flow. Please send the referrer header with the pathname of the page that made the request.",
        "tags": ["Email submit actions"],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HighIntentPrequalParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HighIntentPrequalResponse"
                }
              }
            }
          },
          "303": {
            "$ref": "#/components/responses/303"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    },
    "/low-intent-no-prequal": {
      "post": {
        "operationId": "low-intent-no-prequal",
        "summary": "Low-intent email submission without prequal",
        "description": "Create a low-intent HubSpot contact without starting the prequal flow. Please send the referrer header with the pathname of the page that made the request.",
        "tags": ["Email submit actions"],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LowIntentNoPrequalParams"
              }
            }
          },
          "description": "Requires ramplify_app_id and a discovery_method from the enum."
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LowIntentNoPrequalResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Email submit actions"
    }
  ],
  "components": {
    "schemas": {
      "HighIntentPrequalParams": {
        "type": "object",
        "properties": {
          "email": {
            "$ref": "#/components/schemas/validBusinessEmailSchema"
          },
          "ramplify_app_id": {
            "type": "string"
          }
        },
        "required": ["email", "ramplify_app_id"]
      },
      "HighIntentPrequalResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "redirectUrl": {
            "type": "string"
          }
        },
        "required": ["success", "message"]
      },
      "HubspotDiscoveryMethod": {
        "type": "string",
        "enum": [
          "lead_gen_tools",
          "gated_content",
          "contact_sales",
          "prequal_flow",
          "partner_cpm",
          "linkedin_bookademo_whoop",
          "linkedin_bookademo_walkingpad",
          "linkedin_bookademo_oura",
          "linkedin_bookademo_airpods",
          "enterprise_landing_page"
        ]
      },
      "LowIntentNoPrequalParams": {
        "type": "object",
        "properties": {
          "email": {
            "$ref": "#/components/schemas/validBusinessEmailSchema"
          },
          "ramplify_app_id": {
            "type": "string"
          },
          "discovery_method": {
            "allOf": [
              {
                "$ref": "#/components/schemas/HubspotDiscoveryMethod"
              }
            ],
            "description": "Required discovery method passed to HubSpot contact creation."
          },
          "discovery_method_details": {
            "type": "string",
            "description": "Optional details for the discovery method."
          }
        },
        "required": ["email", "ramplify_app_id", "discovery_method"]
      },
      "LowIntentNoPrequalResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["success", "message"]
      },
      "validBusinessEmailSchema": {
        "type": "string",
        "format": "email"
      }
    },
    "responses": {
      "303": {
        "description": "See Other",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Redirecting to the qualification flow"
                },
                "code": {
                  "type": "string",
                  "example": "303"
                }
              }
            }
          }
        }
      },
      "400": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Invalid request parameters"
                },
                "code": {
                  "type": "string",
                  "example": "400"
                }
              }
            }
          }
        }
      },
      "401": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Authentication required"
                },
                "code": {
                  "type": "string",
                  "example": "401"
                }
              }
            }
          }
        }
      },
      "403": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Access denied"
                },
                "code": {
                  "type": "string",
                  "example": "403"
                }
              }
            }
          }
        }
      },
      "404": {
        "description": "Not Found",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Resource not found"
                },
                "code": {
                  "type": "string",
                  "example": "404"
                }
              }
            }
          }
        }
      },
      "409": {
        "description": "Conflict",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Resource already exists"
                },
                "code": {
                  "type": "string",
                  "example": "409"
                }
              }
            }
          }
        }
      },
      "429": {
        "description": "Too Many Requests",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "You've made too many requests. Please try again in a moment."
                },
                "code": {
                  "type": "string",
                  "example": "429"
                }
              }
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "An unexpected error occurred"
                },
                "code": {
                  "type": "string",
                  "example": "500"
                }
              }
            }
          }
        }
      }
    }
  }
}
