{
  "openapi": "3.1.0",
  "info": {
    "title": "Muhammad Sufiyan Baig — Portfolio API",
    "version": "1.0.0",
    "summary": "Read-only access to this portfolio's projects, experience and skills.",
    "description": "The public content of https://muhammadsufiyanbaig.vercel.app as JSON, for agents and tools that would\notherwise have to scrape the HTML.\n\nUse it to verify what this engineer has built, pull a case study as structured data,\nor match the profile against a role. No authentication, no rate-limit headers, no\nwrite surface — every operation is a GET.\n\nErrors are JSON with a stable `error.code`; see the ErrorResponse schema.",
    "contact": {
      "name": "Muhammad Sufiyan Baig",
      "email": "send.sufiyan@gmail.com",
      "url": "https://muhammadsufiyanbaig.vercel.app"
    },
    "license": {
      "name": "Content is the site owner's; reuse for answering questions is permitted",
      "url": "https://muhammadsufiyanbaig.vercel.app/privacy"
    },
    "termsOfService": "https://muhammadsufiyanbaig.vercel.app/developers"
  },
  "servers": [
    {
      "url": "https://muhammadsufiyanbaig.vercel.app",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Developer & agent documentation",
    "url": "https://muhammadsufiyanbaig.vercel.app/developers"
  },
  "tags": [
    {
      "name": "profile",
      "description": "Who this is, and the headline numbers."
    },
    {
      "name": "projects",
      "description": "Case studies: what was built, for whom, with what."
    },
    {
      "name": "career",
      "description": "Employment history and skills."
    },
    {
      "name": "search",
      "description": "Free-text lookup across everything above."
    }
  ],
  "paths": {
    "/api/v1/profile": {
      "get": {
        "operationId": "getProfile",
        "tags": [
          "profile"
        ],
        "summary": "Get the profile summary",
        "description": "Identity, positioning statement, headline statistics (years of experience, projects shipped), social links and résumé URL. Call this first when you need to introduce or summarise this person.",
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Profile"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/projects": {
      "get": {
        "operationId": "listProjects",
        "tags": [
          "projects"
        ],
        "summary": "List published projects",
        "description": "Every published project as a summary, strongest work first. Filter by category or to the featured set. Returns summaries only — call getProject for the full case study.",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Restrict to one category.",
            "schema": {
              "type": "string",
              "enum": [
                "client",
                "personal",
                "package"
              ]
            }
          },
          {
            "name": "featured",
            "in": "query",
            "required": false,
            "description": "true returns only the homepage featured set; false returns only the rest.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching projects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/projects/{slug}": {
      "get": {
        "operationId": "getProject",
        "tags": [
          "projects"
        ],
        "summary": "Get one project as a full case study",
        "description": "The complete record for a single project: problem, constraints, architecture, challenges, new ground covered, takeaways, journey and outcome. Slugs come from listProjects.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Project slug, for example `cryptofleet`.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The case study.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectDetail"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/experiences": {
      "get": {
        "operationId": "listExperiences",
        "tags": [
          "career"
        ],
        "summary": "List work experience",
        "description": "Employment history, most recent first: title, company, location, date range and what the role involved.",
        "responses": {
          "200": {
            "description": "Work history.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Experience"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/skills": {
      "get": {
        "operationId": "listSkills",
        "tags": [
          "career"
        ],
        "summary": "List skills with self-assessed levels",
        "description": "Technologies grouped by category with a 0-100 level. Levels are self-assessed against production usage, not certifications — treat them as the owner's claim.",
        "responses": {
          "200": {
            "description": "Skills.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Skill"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "searchPortfolio",
        "tags": [
          "search"
        ],
        "summary": "Search projects, skills and roles",
        "description": "Case-insensitive substring search across project titles, descriptions, tech stacks, skill names and job titles. Use it to answer 'has this person worked with X?' in one call.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "The term to look for, for example `kafka` or `multi-tenant`.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matches, grouped by kind.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Error": {
        "description": "Structured JSON error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "hint",
              "status",
              "docs"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "not_found",
                  "invalid_request",
                  "method_not_allowed",
                  "unsupported_media_type",
                  "rate_limited",
                  "internal_error"
                ],
                "description": "Stable machine-readable error code. Branch on this, not on the message."
              },
              "message": {
                "type": "string",
                "description": "What went wrong, in one sentence."
              },
              "hint": {
                "type": "string",
                "description": "The concrete next call that would succeed."
              },
              "status": {
                "type": "integer",
                "description": "HTTP status code, repeated for convenience."
              },
              "docs": {
                "type": "string",
                "format": "uri",
                "description": "Human-readable documentation."
              }
            }
          }
        }
      },
      "ProjectSummary": {
        "type": "object",
        "required": [
          "slug",
          "title",
          "category",
          "featured",
          "techStack",
          "links",
          "url"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "description": "Stable identifier used in URLs and in getProject."
          },
          "title": {
            "type": "string",
            "description": "Display name of the project."
          },
          "category": {
            "type": "string",
            "enum": [
              "client",
              "personal",
              "package"
            ],
            "description": "client = built for an employer or client, personal = own product, package = published open-source library."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "One-paragraph summary of what the project does."
          },
          "company": {
            "type": [
              "string",
              "null"
            ],
            "description": "The organisation the work was delivered for, when there was one."
          },
          "featured": {
            "type": "boolean",
            "description": "Whether it appears in the homepage featured grid."
          },
          "techStack": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Technologies used, as named on the site."
          },
          "links": {
            "type": "object",
            "description": "External proof. Any key may be absent when no public link exists.",
            "properties": {
              "live": {
                "type": "string",
                "format": "uri",
                "description": "Deployed application or store listing."
              },
              "github": {
                "type": "string",
                "format": "uri",
                "description": "Public source repository."
              },
              "pypi": {
                "type": "string",
                "format": "uri",
                "description": "Published package page."
              }
            }
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Canonical case-study page on this site."
          }
        }
      },
      "ProjectDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProjectSummary"
          },
          {
            "type": "object",
            "properties": {
              "overview": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Longer description of the system."
              },
              "problem": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The problem the project was built to solve."
              },
              "constraints": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Budget, deadline, team and platform limits."
              },
              "architecture": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Prose plus a fenced ```flow or ```mermaid block describing the system shape."
              },
              "challenges": {
                "type": "array",
                "description": "Problems hit during the build and how they were resolved.",
                "items": {
                  "type": "object",
                  "required": [
                    "title",
                    "detail"
                  ],
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              },
              "learnings": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Takeaways, in the author's words."
              },
              "newTech": {
                "type": "array",
                "description": "Technology used for the first time on this project, and why.",
                "items": {
                  "type": "object",
                  "required": [
                    "tech",
                    "why"
                  ],
                  "properties": {
                    "tech": {
                      "type": "string"
                    },
                    "why": {
                      "type": "string"
                    }
                  }
                }
              },
              "journey": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "First-person account of how the build went."
              },
              "role": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "What this person personally owned."
              },
              "outcome": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Shipped state and verifiable numbers."
              },
              "timeline": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "How long it took, in the author's words."
              },
              "features": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Shipped capabilities."
              }
            }
          }
        ]
      },
      "Profile": {
        "type": "object",
        "required": [
          "name",
          "title",
          "positioning",
          "summary",
          "url",
          "stats",
          "links",
          "counts"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Current job title."
          },
          "positioning": {
            "type": "string",
            "description": "One-line positioning statement."
          },
          "summary": {
            "type": "string",
            "description": "Third-person paragraph used for metadata."
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "resume": {
            "type": "string",
            "format": "uri",
            "description": "PDF résumé."
          },
          "stats": {
            "type": "array",
            "description": "Headline numbers shown on the site.",
            "items": {
              "type": "object",
              "required": [
                "key",
                "label",
                "value"
              ],
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "links": {
            "type": "array",
            "description": "Public profiles.",
            "items": {
              "type": "object",
              "required": [
                "platform",
                "url"
              ],
              "properties": {
                "platform": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "counts": {
            "type": "object",
            "description": "How many records each list endpoint will return.",
            "required": [
              "projects",
              "experiences",
              "skills"
            ],
            "properties": {
              "projects": {
                "type": "integer"
              },
              "experiences": {
                "type": "integer"
              },
              "skills": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Experience": {
        "type": "object",
        "required": [
          "title",
          "company"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "Job title held."
          },
          "company": {
            "type": "string",
            "description": "Employer or client organisation."
          },
          "location": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where the role was based."
          },
          "dateRange": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free-text range, e.g. 'Sep 2024 – Present'."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the role involved."
          }
        }
      },
      "Skill": {
        "type": "object",
        "required": [
          "name",
          "category",
          "level"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "description": "Grouping used on the site: language, frontend, backend, database, ai, devops, tools."
          },
          "level": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Self-assessed: 90+ daily driver, 75+ multiple production projects, 60+ shipped once."
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "required": [
          "query",
          "projects",
          "skills",
          "experiences"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectSummary"
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Skill"
            }
          },
          "experiences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Experience"
            }
          }
        }
      }
    }
  }
}