{
  "openapi": "3.1.0",
  "info": {
    "title": "Asendar Gap Numbers API",
    "version": "1.0.0",
    "summary": "Read-only, cited facts about the time between therapy sessions.",
    "description": "Every fact is already published on a page of The Gap Between at https://www.asendar.com/gap, with one peer-reviewed study and its DOI. Free, no key, CORS open. Education only, not medical advice. Also available as a read-only MCP server at https://www.asendar.com/mcp.",
    "contact": {
      "name": "Ignite Synergy",
      "url": "https://www.asendar.com/contact.html"
    },
    "license": {
      "name": "Cite the page URL",
      "url": "https://www.asendar.com/developers"
    }
  },
  "servers": [
    {
      "url": "https://www.asendar.com"
    }
  ],
  "paths": {
    "/api/gap/facts": {
      "get": {
        "operationId": "listGapFacts",
        "summary": "List or search Gap Numbers",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Words to match in the question, answer or finding."
          },
          {
            "name": "pillar",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "intention",
                "immersion",
                "integration",
                "the-wait",
                "maintenance"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching facts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "facts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Fact"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/gap/facts/{id}": {
      "get": {
        "operationId": "getGapFact",
        "summary": "Get one Gap Number by page slug",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The fact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fact"
                }
              }
            }
          },
          "400": {
            "description": "Invalid id",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No fact with that id",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/gap/facts.json": {
      "get": {
        "operationId": "getFactSheet",
        "summary": "The whole fact sheet as one static file",
        "responses": {
          "200": {
            "description": "Fact sheet",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Fact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "pillar": {
            "type": "string"
          },
          "page": {
            "type": "string"
          },
          "markdown": {
            "type": "string"
          },
          "published": {
            "type": "string"
          },
          "gapNumber": {
            "type": "string"
          },
          "shortAnswer": {
            "type": "string"
          },
          "keyFinding": {
            "type": "string"
          },
          "study": {
            "type": "object",
            "properties": {
              "authors": {
                "type": "string"
              },
              "year": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "journal": {
                "type": "string"
              },
              "citation": {
                "type": "string"
              },
              "doi": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "docs": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          }
        }
      }
    }
  }
}
