{
  "openapi": "3.1.0",
  "info": {
    "title": "Hybrid ID Application Verification Requests",
    "version": "1.0.0",
    "description": "Existing application-bound case-create/case-read contract. Creation needs enabled verification requests, an opted-in active application, and current explicit user authority. Read retains current active-app/token/grant authority and can read saved cases while new requests are paused. Does not deliver documents or approve KYC."
  },
  "servers": [
    {
      "url": "https://auth.hybrid-id.com"
    }
  ],
  "externalDocs": {
    "url": "https://hybrid-id.com/developers/verification#application-requests"
  },
  "paths": {
    "/verification/requests": {
      "post": {
        "operationId": "applicationVerificationRequest",
        "security": [
          {
            "applicationBasic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operation",
                      "access_token",
                      "policy_id",
                      "request_id"
                    ],
                    "properties": {
                      "operation": {
                        "const": "case-create"
                      },
                      "access_token": {
                        "type": "string",
                        "writeOnly": true,
                        "description": "Current user access token for this client with openid and verification:request in the token and grant."
                      },
                      "policy_id": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_:.\\-]{1,180}$"
                      },
                      "request_id": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_:.\\-]{1,180}$",
                        "description": "Durable app-scoped idempotency identifier. Retry the same value after uncertainty. Reuse with another user or policy is rejected."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operation",
                      "access_token",
                      "case_id"
                    ],
                    "properties": {
                      "operation": {
                        "const": "case-read"
                      },
                      "access_token": {
                        "type": "string",
                        "writeOnly": true,
                        "description": "Current user access token for this client with openid and verification:request in the token and grant."
                      },
                      "case_id": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_:.\\-]{1,180}$"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Minimized app/user-bound request metadata. No private result, raw document or global identity.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "case_id",
                    "state",
                    "revision",
                    "policy_id",
                    "policy_digest",
                    "continue_url",
                    "collection_enabled"
                  ],
                  "properties": {
                    "case_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "state": {
                      "enum": [
                        "consent_required",
                        "awaiting_evidence",
                        "cancelled"
                      ]
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "policy_id": {
                      "type": "string"
                    },
                    "policy_digest": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "continue_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Exact Hybrid Verify continuation for this case and application. Opening it does not grant consent."
                    },
                    "collection_enabled": {
                      "type": "boolean",
                      "description": "Provider configuration permits canonical Vault document uploads AND references. Not evidence access, applicant eligibility, successful upload, passed checks, recipient acceptance, or end-to-end availability. Verify enforces its own gates, current consent, protection and native Vault authority."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or changed request, including conflicting idempotency reuse.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid application credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Current app/user authority or explicit scope denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The requested operation is disabled or an authority service is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "applicationBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "Registered confidential application client_id/client_secret. This is not an owner developer automation credential."
      }
    }
  }
}
