{
  "openapi": "3.1.0",
  "info": {
    "title": "Responsible AI Australia Verification API",
    "description": "Free, public API for verifying Responsible AI Australia certification. Built for AI agents, search engines and procurement systems. Certifications are assessed against the Australian AI Ethics Principles and carry a machine-verifiable Australian AI Trust Credential (AATC).",
    "version": "1.0.0",
    "contact": {
      "name": "Responsible AI Australia",
      "url": "https://www.responsibleaiaustralia.com.au/contact"
    }
  },
  "servers": [{ "url": "https://www.responsibleaiaustralia.com.au" }],
  "paths": {
    "/api/v1/verify": {
      "get": {
        "operationId": "verifyCertification",
        "summary": "Verify a business's responsible AI certification",
        "description": "Query by ABN, website domain, certification ID or business name. Returns certification status, tier and validity. No authentication required.",
        "parameters": [
          { "name": "abn", "in": "query", "schema": { "type": "string" }, "description": "Australian Business Number, digits only or formatted" },
          { "name": "domain", "in": "query", "schema": { "type": "string" }, "description": "Business website domain, e.g. example.com.au" },
          { "name": "certId", "in": "query", "schema": { "type": "string" }, "description": "Certification ID, e.g. RAIA-2026-0009" },
          { "name": "name", "in": "query", "schema": { "type": "string" }, "description": "Business name, partial match" }
        ],
        "responses": {
          "200": {
            "description": "Verification result",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/VerificationResult" }
              }
            }
          },
          "400": { "description": "No query parameter provided" }
        }
      }
    },
    "/api/v1/businesses": {
      "get": {
        "operationId": "listCertifiedBusinesses",
        "summary": "List every certified business on the public register",
        "responses": {
          "200": {
            "description": "The full register",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": { "type": "integer" },
                    "businesses": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/VerificationResult" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/credentials/{certId}": {
      "get": {
        "operationId": "getCredential",
        "summary": "Fetch the signed Australian AI Trust Credential (AATC) for a certification",
        "description": "Returns a W3C Verifiable Credential as a VC-JWT signed with Ed25519 by did:web:www.responsibleaiaustralia.com.au, plus its decoded payload and current status.",
        "parameters": [
          { "name": "certId", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "The signed credential" },
          "404": { "description": "Unknown certification ID" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "VerificationResult": {
        "type": "object",
        "properties": {
          "certified": { "type": "boolean" },
          "status": { "type": "string", "enum": ["active", "expired", "revoked", "not_found"] },
          "certId": { "type": "string" },
          "businessName": { "type": "string" },
          "abn": { "type": "string" },
          "domain": { "type": "string", "nullable": true },
          "tier": { "type": "string", "enum": ["Commit", "Embed", "Govern"], "nullable": true },
          "tierDescription": { "type": "string", "nullable": true },
          "issuedAt": { "type": "string", "format": "date-time" },
          "expiresAt": { "type": "string", "format": "date-time", "nullable": true },
          "registerUrl": { "type": "string", "format": "uri" },
          "credentialUrl": { "type": "string", "format": "uri" },
          "issuer": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "did": { "type": "string" },
              "register": { "type": "string", "format": "uri" }
            }
          }
        }
      }
    }
  }
}
