{
  "openapi": "3.1.2",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "Sirwan Afifi Public Content API",
    "summary": "Read-only metadata and post indexes for sirwan.info.",
    "description": "A public, read-only API for discovering Sirwan Afifi's site and published writing. No authentication or API key is required. The API does not expose write operations, webhooks, or private data.",
    "version": "1.0.0",
    "license": {
      "name": "All rights reserved"
    },
    "contact": {
      "name": "Sirwan Afifi",
      "url": "https://sirwan.info/contact",
      "email": "sir1afifi@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://sirwan.info",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Sirwan Afifi developer portal, versioning policy, and error guidance",
    "url": "https://sirwan.info/developers"
  },
  "tags": [
    {
      "name": "Discovery",
      "description": "Machine-readable information about the site."
    },
    {
      "name": "Content",
      "description": "Indexes of publicly available writing."
    }
  ],
  "paths": {
    "/api/v1/site.json": {
      "get": {
        "operationId": "getSiteMetadataV1",
        "summary": "Get site metadata and discovery links",
        "description": "Returns Sirwan Afifi's public site identity, language coverage, authentication policy, and canonical discovery-resource URLs.",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Site identity, languages, and public resources.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteMetadata"
                }
              }
            }
          },
          "405": {
            "description": "The endpoint received a method other than GET or HEAD.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "The client exceeded the public API quota.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Retry-After": {
                "description": "Seconds the client should wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "The static content origin is temporarily unavailable.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Retry-After": {
                "description": "Seconds the client should wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts.json": {
      "get": {
        "operationId": "listPostsV1",
        "summary": "List published posts",
        "description": "Returns the complete public post index across English, Farsi, and Kurdish, newest first, with canonical HTML and Markdown URLs.",
        "tags": [
          "Content"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "A JSON object containing the post count and typed post summaries.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostIndex"
                }
              }
            }
          },
          "405": {
            "description": "The endpoint received a method other than GET or HEAD.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "The client exceeded the public API quota.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Retry-After": {
                "description": "Seconds the client should wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "The static content origin is temporarily unavailable.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Retry-After": {
                "description": "Seconds the client should wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/site.json": {
      "get": {
        "operationId": "getSiteMetadataLegacy",
        "summary": "Get site metadata through the legacy alias",
        "description": "Deprecated compatibility alias for GET /api/v1/site.json. It returns the same read-only representation and advertises its successor version in response headers.",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Site identity, languages, and public resources.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Deprecation": {
                "description": "RFC 9745 deprecation signal for the unversioned compatibility alias.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 successor-version link to the corresponding /api/v1 endpoint.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteMetadata"
                }
              }
            }
          },
          "405": {
            "description": "The endpoint received a method other than GET or HEAD.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "The client exceeded the public API quota.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Retry-After": {
                "description": "Seconds the client should wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "The static content origin is temporarily unavailable.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Retry-After": {
                "description": "Seconds the client should wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "deprecated": true
      }
    },
    "/api/posts.json": {
      "get": {
        "operationId": "listPostsLegacy",
        "summary": "List published posts through the legacy alias",
        "description": "Deprecated compatibility alias for GET /api/v1/posts.json. It returns the same read-only representation and advertises its successor version in response headers.",
        "tags": [
          "Content"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "A JSON object containing the post count and typed post summaries.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Deprecation": {
                "description": "RFC 9745 deprecation signal for the unversioned compatibility alias.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 successor-version link to the corresponding /api/v1 endpoint.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostIndex"
                }
              }
            }
          },
          "405": {
            "description": "The endpoint received a method other than GET or HEAD.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "The client exceeded the public API quota.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Retry-After": {
                "description": "Seconds the client should wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "The static content origin is temporarily unavailable.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Public API quota policy in the IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the current 60-second window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Retry-After": {
                "description": "Seconds the client should wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "deprecated": true
      }
    }
  },
  "components": {
    "schemas": {
      "SiteMetadata": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "url",
          "description",
          "author",
          "languages",
          "resources",
          "authentication"
        ],
        "properties": {
          "name": {
            "type": "string",
            "examples": [
              "Sirwan Afifi"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          },
          "author": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "role",
              "location"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string"
              },
              "location": {
                "type": "string"
              }
            }
          },
          "languages": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "en",
                "fa",
                "ku"
              ]
            }
          },
          "resources": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "developers",
              "documentation",
              "openapi",
              "llms",
              "siteApi",
              "postsApi",
              "rss",
              "sitemap",
              "contact",
              "privacy"
            ],
            "properties": {
              "developers": {
                "type": "string",
                "format": "uri"
              },
              "documentation": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "llms": {
                "type": "string",
                "format": "uri"
              },
              "siteApi": {
                "type": "string",
                "format": "uri"
              },
              "postsApi": {
                "type": "string",
                "format": "uri"
              },
              "rss": {
                "type": "string",
                "format": "uri"
              },
              "sitemap": {
                "type": "string",
                "format": "uri"
              },
              "contact": {
                "type": "string",
                "format": "uri"
              },
              "privacy": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "authentication": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "required",
              "apiKeysIssued"
            ],
            "properties": {
              "required": {
                "type": "boolean",
                "const": false
              },
              "apiKeysIssued": {
                "type": "boolean",
                "const": false
              }
            }
          }
        }
      },
      "PostSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "description",
          "slug",
          "language",
          "published",
          "updated",
          "tags",
          "url",
          "markdownUrl"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "fa",
              "ku"
            ]
          },
          "published": {
            "type": "string",
            "format": "date"
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "PostIndex": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "posts"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostSummary"
            }
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "resolution"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string",
            "format": "uri-reference"
          },
          "code": {
            "type": "string",
            "enum": [
              "method_not_allowed",
              "rate_limit_exceeded",
              "api_route_not_found",
              "upstream_unavailable"
            ]
          },
          "resolution": {
            "type": "string"
          },
          "documentation_url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  },
  "x-rate-limit-policy": {
    "name": "public-api",
    "quota": 600,
    "window_seconds": 60,
    "partition": "Anonymous network address and endpoint within a Cloudflare location"
  },
  "x-api-lifecycle": {
    "current_major_version": "v1",
    "deprecation_policy_url": "https://sirwan.info/docs#versioning-and-deprecation"
  }
}