{
  "openapi": "3.0.0",
  "info": {
    "title": "Router.so API",
    "version": "1.0.0",
    "description": "API for creating leads with user-specific endpoint ID"
  },
  "servers": [
    {
      "url": "https://app.router.so/api"
    }
  ],
  "paths": {
    "/endpoints/{endpointId}": {
      "post": {
        "summary": "Create a new lead",
        "operationId": "createLead",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "Unique identifier for the user's endpoint",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "LeadRequest": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the lead"
          }
        }
      },
      "LeadResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the created lead"
          },
          "name": {
            "type": "string",
            "description": "Name of the lead"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of when the lead was created"
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}