{
  "openapi": "3.1.0",
  "info": {
    "title": "Check-In International Services API",
    "description": "Public API for Check-In International Services — a senior-led digital marketing agency in Alexandria, Virginia. This spec covers public endpoints only. Admin endpoints require authentication.",
    "version": "1.0.0",
    "contact": {
      "name": "Check-In International Services",
      "email": "hello@checkinis.com",
      "url": "https://www.checkinis.com/contact"
    }
  },
  "servers": [
    {
      "url": "https://www.checkinis.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "healthCheck",
        "summary": "Health check",
        "description": "Returns server health status including database connectivity. No authentication required.",
        "tags": ["System"],
        "responses": {
          "200": {
            "description": "Server is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "version": { "type": "string", "nullable": true }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Server or database is unhealthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean", "enum": [false] }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/blog": {
      "get": {
        "operationId": "listPublishedBlogPosts",
        "summary": "List published blog posts",
        "description": "Returns published blog posts. Public, rate-limited.",
        "tags": ["Content"],
        "responses": {
          "200": {
            "description": "List of published blog posts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "posts": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/BlogPost" }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/blog/{slug}": {
      "get": {
        "operationId": "getPublishedBlogPost",
        "summary": "Get a published blog post by slug",
        "description": "Returns a single published blog post. Public, rate-limited.",
        "tags": ["Content"],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "description": "The blog post slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Blog post details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/BlogPost" }
              }
            }
          },
          "404": {
            "description": "Blog post not found",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/portfolio": {
      "get": {
        "operationId": "listPortfolioProjects",
        "summary": "List public portfolio projects",
        "description": "Returns projects published to the portfolio. Public, rate-limited.",
        "tags": ["Content"],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": { "type": "integer", "minimum": 1, "maximum": 50 },
            "description": "Max number of projects to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Portfolio projects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projects": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/PortfolioProject" }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/pricing": {
      "get": {
        "operationId": "getPricing",
        "summary": "Get pricing configuration",
        "description": "Returns current pricing plans and packages. Public, rate-limited.",
        "tags": ["Business"],
        "responses": {
          "200": {
            "description": "Pricing configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "plans": {
                      "type": "array",
                      "items": { "type": "object" }
                    },
                    "packages": {
                      "type": "array",
                      "items": { "type": "object" }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/careers": {
      "get": {
        "operationId": "getCareers",
        "summary": "Get careers/job listings",
        "description": "Returns available career positions. Public, rate-limited.",
        "tags": ["Business"],
        "responses": {
          "200": {
            "description": "Career listings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "careers": {
                      "type": "array",
                      "items": { "type": "object" }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/resources": {
      "get": {
        "operationId": "listResources",
        "summary": "List downloadable resources",
        "description": "Returns available free resources (guides, templates, etc). Public, rate-limited.",
        "tags": ["Content"],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "schema": { "type": "string" },
            "description": "Filter by resource category"
          }
        ],
        "responses": {
          "200": {
            "description": "List of resources",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "resources": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/Resource" }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/resources/{slug}/download": {
      "get": {
        "operationId": "downloadResource",
        "summary": "Download a resource file",
        "description": "Downloads the file associated with a resource slug. Public, rate-limited.",
        "tags": ["Content"],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "description": "The resource slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Resource file download",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "downloadUrl": { "type": "string", "format": "uri" },
                    "filename": { "type": "string" },
                    "contentType": { "type": "string" }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "submitContact",
        "summary": "Submit a contact form",
        "description": "Send a contact message. Public, rate-limited.",
        "tags": ["Business"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContactSubmission" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contact form submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "message": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/tools/audit-request": {
      "post": {
        "operationId": "requestSeoAudit",
        "summary": "Request a free SEO audit",
        "description": "Submit a URL for a free SEO audit. Public, rate-limited.",
        "tags": ["Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/AuditRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit request submitted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "message": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/tools/quote-request": {
      "post": {
        "operationId": "requestQuote",
        "summary": "Request a custom quote",
        "description": "Submit details for a custom quote. Public, rate-limited.",
        "tags": ["Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/QuoteRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quote request submitted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "message": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/newsletter/subscribe": {
      "post": {
        "operationId": "subscribeNewsletter",
        "summary": "Subscribe to the newsletter",
        "description": "Subscribe an email address to the newsletter. Public, rate-limited.",
        "tags": ["Business"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email"],
                "properties": {
                  "email": { "type": "string", "format": "email" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subscribed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "message": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid email",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": { "type": "string", "description": "Error category" },
          "message": { "type": "string", "description": "Human-readable error description" },
          "hint": { "type": "string", "description": "Suggested resolution" }
        }
      },
      "BlogPost": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "slug": { "type": "string" },
          "title": { "type": "string" },
          "excerpt": { "type": "string" },
          "body": { "type": "string" },
          "category": { "type": "string" },
          "coverImage": { "type": "string", "nullable": true },
          "status": { "type": "string", "enum": ["draft", "published"] },
          "seoTitle": { "type": "string" },
          "seoDescription": { "type": "string" },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" },
          "author": {
            "type": "object",
            "properties": {
              "fullName": { "type": "string" }
            }
          }
        }
      },
      "PortfolioProject": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "slug": { "type": "string" },
          "client": { "type": "string" },
          "title": { "type": "string" },
          "category": { "type": "string" },
          "image": { "type": "string", "nullable": true },
          "summary": { "type": "string" },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "metric": { "type": "string" },
                "label": { "type": "string" }
              }
            }
          }
        }
      },
      "Resource": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "slug": { "type": "string" },
          "title": { "type": "string" },
          "description": { "type": "string" },
          "category": { "type": "string" },
          "coverImage": { "type": "string", "nullable": true }
        }
      },
      "ContactSubmission": {
        "type": "object",
        "required": ["name", "email", "message"],
        "properties": {
          "name": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "phone": { "type": "string" },
          "company": { "type": "string" },
          "service": { "type": "string" },
          "budget": { "type": "string" },
          "message": { "type": "string" }
        }
      },
      "AuditRequest": {
        "type": "object",
        "required": ["url"],
        "properties": {
          "url": { "type": "string", "format": "uri" },
          "email": { "type": "string", "format": "email" }
        }
      },
      "QuoteRequest": {
        "type": "object",
        "required": ["name", "email", "service"],
        "properties": {
          "name": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "phone": { "type": "string" },
          "company": { "type": "string" },
          "service": { "type": "string" },
          "budget": { "type": "string" },
          "message": { "type": "string" }
        }
      }
    }
  }
}
