{
  "openapi": "3.1.0",
  "info": {
    "title": "CaChink API",
    "version": "1.0.0",
    "description": "Read-only JSON API for the CaChink guitar app: the tab library (playable ASCII guitar tabs with tunings, chord fingerings, sections, and gear notes) and the lesson decks. No auth required."
  },
  "servers": [
    {
      "url": "https://cachink.producthacker.ai"
    }
  ],
  "paths": {
    "/api/tabs": {
      "get": {
        "operationId": "listTabs",
        "summary": "List all tabs in the library",
        "responses": {
          "200": {
            "description": "Tab summaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "tabs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TabSummary"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tabs/{slug}": {
      "get": {
        "operationId": "getTab",
        "summary": "Get one tab with full sections, chord fingerings, and gear notes",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full tab object",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/lessons": {
      "get": {
        "operationId": "listLessons",
        "summary": "List all lesson decks",
        "responses": {
          "200": {
            "description": "Lesson summaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "lessons": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LessonSummary"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/lessons/{slug}": {
      "get": {
        "operationId": "getLesson",
        "summary": "Get one lesson deck with all cards",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full lesson object",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TabSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "artist": {
            "type": "string"
          },
          "tuning": {
            "type": "string"
          },
          "capo": {
            "type": [
              "string",
              "null"
            ]
          },
          "key": {
            "type": [
              "string",
              "null"
            ]
          },
          "difficulty": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "page": {
            "type": "string",
            "format": "uri"
          },
          "api": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "LessonSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "cards": {
            "type": "integer"
          },
          "blurb": {
            "type": "string"
          },
          "page": {
            "type": "string",
            "format": "uri"
          },
          "api": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}