{
  "openapi": "3.1.0",
  "info": {
    "title": "Contact Maxim",
    "version": "1.0.0",
    "description": "Public contact intake. No authentication, CAPTCHA, attachments, or automatic reply. An accepted receipt means stored, not delivered. Sender identity is unverified. Send only at the explicit request of the user."
  },
  "servers": [
    {
      "url": "https://maxim.ax"
    }
  ],
  "paths": {
    "/api/contact": {
      "post": {
        "operationId": "send_contact_request",
        "summary": "Send Maxim a contact request",
        "description": "Accepts a name (up to 100 characters), reply email (254), and plain-text message (4,000), in a body of at most 32 KiB. On 429 or 503, respect Retry-After (seconds). A 202 response confirms storage and queued notification, not email delivery or a reply.",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "description": "Optional 1–128 non-space printable ASCII characters. Matching retries return the original receipt for 24 hours; different content returns 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "The person asking to contact Maxim."
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254,
                    "description": "Their own reply email address. Identity is not verified."
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000,
                    "description": "Plain-text message explicitly authorized by the user. Do not include a conversation transcript."
                  }
                },
                "required": [
                  "name",
                  "email",
                  "message"
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "The person asking to contact Maxim."
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254,
                    "description": "Their own reply email address. Identity is not verified."
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000,
                    "description": "Plain-text message explicitly authorized by the user. Do not include a conversation transcript."
                  }
                },
                "required": [
                  "name",
                  "email",
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Durably accepted JSON request. Replays and duplicates return the existing receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "requestId"
                  ],
                  "properties": {
                    "status": {
                      "const": "accepted"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "303": {
            "description": "Native form accepted; redirects to /contact/received."
          },
          "400": {
            "description": "Invalid input",
            "headers": {
              "Retry-After": {
                "description": "Seconds until retry, when applicable.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "headers": {
              "Retry-After": {
                "description": "Seconds until retry, when applicable.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request over 32 KiB",
            "headers": {
              "Retry-After": {
                "description": "Seconds until retry, when applicable.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content type",
            "headers": {
              "Retry-After": {
                "description": "Seconds until retry, when applicable.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds until retry, when applicable.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Contact unavailable",
            "headers": {
              "Retry-After": {
                "description": "Seconds until retry, when applicable.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The person asking to contact Maxim."
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "Their own reply email address. Identity is not verified."
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "description": "Plain-text message explicitly authorized by the user. Do not include a conversation transcript."
          }
        },
        "required": [
          "name",
          "email",
          "message"
        ]
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "fields": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}