{
  "openapi": "3.1.0",
  "info": {
    "title": "Sigil Verification API",
    "version": "1.1.0"
  },
  "servers": [
    {
      "url": "https://www.sigilid.space"
    }
  ],
  "paths": {
    "/api/v1/digital-ids/{id}": {
      "get": {
        "operationId": "verifyDigitalId",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Active signed record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "expires_at",
                    "credential"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{32}$"
                    },
                    "status": {
                      "const": "active"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "credential": {
                      "type": "string",
                      "description": "Compact, signed RS256 JWT"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Record is no longer active",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "const": "record_inactive"
                    },
                    "status": {
                      "enum": [
                        "expired",
                        "withdrawn"
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown or private record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "const": "record_not_found"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Verification temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "const": "verification_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attestations/{id}": {
      "get": {
        "operationId": "verifyAttestation",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Active signed record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "expires_at",
                    "credential"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{32}$"
                    },
                    "status": {
                      "const": "active"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "credential": {
                      "type": "string",
                      "description": "Compact, signed RS256 JWT"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Record is no longer active",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "const": "record_inactive"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown or private record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "const": "record_not_found"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Verification temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "const": "verification_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
