{
  "openapi": "3.1.0",
  "info": {
    "title": "Agent Casefile API",
    "version": "1.0.0",
    "description": "Read-only, static JSON exports of the Agent Casefile dataset. License: CC BY 4.0.",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://agentcasefile.com"
    }
  ],
  "paths": {
    "/api/cases.json": {
      "get": {
        "summary": "All cases (alias of /api/v1/cases.json)",
        "responses": {
          "200": {
            "description": "Dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cases.json": {
      "get": {
        "summary": "All cases",
        "responses": {
          "200": {
            "description": "Dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cases.csv": {
      "get": {
        "summary": "All cases as CSV",
        "responses": {
          "200": {
            "description": "CSV",
            "content": {
              "text/csv": {}
            }
          }
        }
      }
    },
    "/api/v1/cases/{slug}.json": {
      "get": {
        "summary": "One case",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Case",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Case"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/taxonomy.json": {
      "get": {
        "summary": "Controlled vocabularies",
        "responses": {
          "200": {
            "description": "Taxonomy"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Dataset": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "generated": {
            "type": "string",
            "format": "date"
          },
          "license": {
            "type": "string"
          },
          "cases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Case"
            }
          }
        }
      },
      "Case": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "title",
          "answer",
          "industry",
          "evidence_grade",
          "sources"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "industry": {
            "type": "string"
          },
          "sub_industry": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tasks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "agent_pattern": {
            "type": "string",
            "enum": [
              "copilot",
              "workflow-agent",
              "autonomous-agent",
              "multi-agent",
              "voice-agent"
            ]
          },
          "autonomy_level": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4
          },
          "deployment_status": {
            "type": "string",
            "enum": [
              "production",
              "pilot",
              "launch",
              "announced"
            ]
          },
          "evidence_grade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D"
            ]
          },
          "organization": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "named": {
                "type": "boolean"
              }
            }
          },
          "outcomes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "metric": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "source_ref": {
                  "type": "integer"
                },
                "self_reported": {
                  "type": "boolean"
                }
              }
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ref": {
                  "type": "integer"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "publisher": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "published": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date"
                },
                "type": {
                  "type": "string"
                },
                "quote": {
                  "type": "string"
                },
                "independent": {
                  "type": "boolean"
                },
                "accessed": {
                  "type": "string",
                  "format": "date"
                }
              }
            }
          },
          "first_seen": {
            "type": "string",
            "format": "date"
          },
          "last_verified": {
            "type": "string",
            "format": "date"
          },
          "sponsored": {
            "type": "boolean"
          }
        }
      }
    }
  }
}