{
  "openapi": "3.1.0",
  "info": {
    "title": "RaceMaster Public API",
    "version": "1.0.0",
    "summary": "Contact, newsletter and support endpoints of RaceMaster, live team tracking for rally.",
    "description": "Public HTTP API of https://racemaster.ae. Use it to send a contact message, subscribe to the newsletter or open a support ticket. Live tracking data and team management require a signed-in team account and are intentionally not part of this API. All errors are JSON: {error, code, hint, status}. Every response carries RateLimit-* headers; a 429 adds Retry-After. Authentication: none. These three endpoints are public and unscoped (security: []); signed-in team and admin features use browser sessions and are not part of this API.",
    "contact": {
      "name": "RaceMaster",
      "email": "support@racemaster.ae",
      "url": "https://racemaster.ae/contact"
    }
  },
  "servers": [
    {
      "url": "https://racemaster.ae"
    }
  ],
  "paths": {
    "/api/contact": {
      "post": {
        "operationId": "sendContactMessage",
        "summary": "Send a message to the RaceMaster team",
        "description": "Use when someone wants to ask RaceMaster a question or request pricing. Delivered by email to the support inbox.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/newsletter": {
      "post": {
        "operationId": "subscribeNewsletter",
        "summary": "Subscribe an email address to the newsletter",
        "description": "Use when a person asks to receive RaceMaster product news.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewsletterRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/support": {
      "post": {
        "operationId": "createSupportTicket",
        "summary": "Open a support ticket",
        "description": "Use when an existing RaceMaster user reports a problem (crash, tracking, login, GPS, UI). Returns a ticket id. Limited to 5 tickets per 15 minutes and 10 per day per IP. Enum values and messages are in Italian.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "RateLimitLimit": {
        "description": "Requests allowed in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "message"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Sender name."
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "Reply-to address."
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000,
            "description": "The message."
          }
        }
      },
      "NewsletterRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        }
      },
      "SupportRequest": {
        "type": "object",
        "required": [
          "category",
          "priority",
          "subject",
          "description",
          "stepsToReproduce",
          "includeDiagnostics"
        ],
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "Crash",
              "Tracking",
              "Login",
              "GPS",
              "UI",
              "Altro"
            ]
          },
          "priority": {
            "type": "string",
            "enum": [
              "Bassa",
              "Media",
              "Alta",
              "Critica"
            ]
          },
          "subject": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 10,
            "maxLength": 5000
          },
          "stepsToReproduce": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "expectedBehavior": {
            "type": "string",
            "maxLength": 2000
          },
          "actualBehavior": {
            "type": "string",
            "maxLength": 2000
          },
          "contact": {
            "type": "string",
            "maxLength": 255,
            "description": "How to reach the reporter."
          },
          "raceCode": {
            "type": "string",
            "maxLength": 6,
            "pattern": "^[a-zA-Z0-9]*$"
          },
          "buildVersion": {
            "type": "string",
            "maxLength": 50
          },
          "supportEmail": {
            "type": "string",
            "maxLength": 254
          },
          "includeDiagnostics": {
            "type": "boolean"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable message."
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable code, e.g. rate_limited, not_found."
          },
          "hint": {
            "type": "string",
            "description": "How to fix or retry."
          },
          "status": {
            "type": "integer",
            "description": "HTTP status."
          }
        }
      }
    },
    "responses": {
      "Ok": {
        "description": "Accepted.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "ValidationError": {
        "description": "The body failed validation; the message names the field.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many requests.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServerError": {
        "description": "The server could not complete the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "security": []
}
