{
  "openapi": "3.1.0",
  "info": {
    "title": "Mile High Locksmith ® service requests",
    "version": "1.0.0",
    "description": "Mobile lockouts, car key replacement, rekeying and lock repair in Denver and surrounding Colorado communities. Quotes receive a reply within minutes during office hours, daily 6 AM–10 PM Mountain Time. Requests work using ordinary HTML forms or HTTP with JSON; no JavaScript is required."
  },
  "servers": [
    {
      "url": "https://milehighlocksmith.com"
    }
  ],
  "paths": {
    "/api/service-requests/token": {
      "get": {
        "operationId": "getRequestToken",
        "summary": "Start one quote or service request",
        "responses": {
          "200": {
            "description": "Token for one request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "token"
                  ],
                  "properties": {
                    "token": {
                      "type": "string",
                      "description": "Use the token returned for this request. Reuse it to check delivery or retry the same request."
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Online requests are unavailable."
          }
        }
      }
    },
    "/api/service-requests": {
      "post": {
        "operationId": "submitLocksmithRequest",
        "summary": "Send the customer’s quote or service request to the office",
        "description": "Use the same site origin as the token. Success confirms the request was sent to the office. Pricing and technician arrival are confirmed separately.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "intent",
                  "service",
                  "name",
                  "location",
                  "contact"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Use the token returned for this request. Reuse it to check delivery or retry the same request."
                  },
                  "intent": {
                    "type": "string",
                    "enum": [
                      "quote",
                      "service-with-quote",
                      "service-now"
                    ],
                    "description": "quote requests pricing only. service-with-quote requests service subject to price approval. service-now requests a technician at the service address."
                  },
                  "priceTiming": {
                    "type": "string",
                    "enum": [
                      "before-travel",
                      "on-site"
                    ],
                    "description": "For service-with-quote, before-travel means wait for price approval before leaving; on-site means visit and wait for approval before work."
                  },
                  "service": {
                    "type": "string",
                    "enum": [
                      "locked-out",
                      "car-key-replacement",
                      "rekey-change-locks",
                      "lock-repair",
                      "general"
                    ],
                    "description": "Type of locksmith service. Use general when the exact category is unknown."
                  },
                  "name": {
                    "type": "string",
                    "description": "Customer name.",
                    "maxLength": 80,
                    "minLength": 2
                  },
                  "location": {
                    "type": "string",
                    "description": "City or ZIP code where service is needed.",
                    "maxLength": 100,
                    "minLength": 2
                  },
                  "contact": {
                    "type": "string",
                    "enum": [
                      "phone",
                      "text",
                      "email"
                    ],
                    "description": "Preferred reply channel. Selecting phone for a quote requests a technician callback."
                  },
                  "phone": {
                    "type": "string",
                    "description": "US phone number with area code for a call or text.",
                    "maxLength": 40
                  },
                  "email": {
                    "type": "string",
                    "description": "Address for an email reply.",
                    "maxLength": 160,
                    "format": "email"
                  },
                  "address": {
                    "type": "string",
                    "description": "Service address, intersection, or landmark where the technician can find the customer.",
                    "maxLength": 240,
                    "minLength": 1
                  },
                  "property": {
                    "type": "string",
                    "description": "Property or service details.",
                    "maxLength": 80
                  },
                  "year": {
                    "type": "string",
                    "description": "Vehicle year.",
                    "maxLength": 10
                  },
                  "make": {
                    "type": "string",
                    "description": "Vehicle make.",
                    "maxLength": 60
                  },
                  "model": {
                    "type": "string",
                    "description": "Vehicle model.",
                    "maxLength": 60
                  },
                  "details": {
                    "type": "string",
                    "description": "Additional customer instructions.",
                    "maxLength": 800
                  },
                  "timing": {
                    "type": "string",
                    "description": "Preferred service time.",
                    "maxLength": 80
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "contact": {
                          "const": "email"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "email"
                      ]
                    },
                    "else": {
                      "required": [
                        "phone"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "intent": {
                          "const": "service-with-quote"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "priceTiming"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "intent": {
                          "const": "service-now"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "address"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "intent": {
                          "const": "service-with-quote"
                        },
                        "priceTiming": {
                          "const": "on-site"
                        }
                      },
                      "required": [
                        "priceTiming"
                      ]
                    },
                    "then": {
                      "required": [
                        "address"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request sent. Save the request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Invalid origin.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Check the indicated field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Delivery unavailable or uncertain. If a request ID is returned, check status with the original token before taking further action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/service-requests/status": {
      "post": {
        "operationId": "checkRequestDelivery",
        "summary": "Check the original request without sending it again",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Use the token returned for this request. Reuse it to check delivery or retry the same request."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Invalid origin.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Delivery is unavailable or unconfirmed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-html-forms": [
    {
      "intent": "quote",
      "label": "Get a Quote",
      "description": "Get a price by phone, text, or email. A technician calls if you choose phone.",
      "url": "https://milehighlocksmith.com/get-estimate-or-service?intent=quote#request"
    },
    {
      "intent": "service-with-quote",
      "label": "Request Service With a Quote",
      "description": "Approve the price before the technician leaves or at your address before work begins.",
      "url": "https://milehighlocksmith.com/get-estimate-or-service?intent=service-with-quote#request"
    },
    {
      "intent": "service-now",
      "label": "Request Service Now",
      "description": "Send your service address and contact details to request a technician now.",
      "url": "https://milehighlocksmith.com/get-estimate-or-service?intent=service-now#request"
    }
  ]
}