{
  "openapi": "3.1.0",
  "info": {
    "title": "Zoi ID API",
    "version": "0.1.0",
    "summary": "Identity verification for partners and SDK authors",
    "description": "Partner server API and session-scoped client API. All instants are epoch milliseconds.\n\nKeep partner keys on your server. Client tokens expire after 60 minutes. Send a unique Idempotency-Key for session creation and submit, and reuse it with the same body when retrying (24-hour retention).\n\nCreate a session, open verificationUrl, then trust only a signed webhook or the partner API for the result. Popup and redirect results are navigation hints. For popup completion, create the session with a registered redirectUrl whose origin matches the opener.\n\nEvents are retained for 30 days. Persist nextCursor only after successfully handling the page. Stop on an empty page and keep the previous cursor. Dedupe by eventId and apply increasing sequence per object; never replace a newer object with an older createdAt. Webhooks retry for 72 hours.\n\n## Error codes\n| Code | HTTP status |\n| --- | --- |\n| bad_request | 400 |\n| unauthorized | 401 |\n| token_expired | 401 |\n| forbidden | 403 |\n| not_found | 404 |\n| session_closed | 409 |\n| step_not_allowed | 409 |\n| revision_conflict | 409 |\n| idempotency_conflict | 409 |\n| challenge_expired | 410 |\n| payload_too_large | 413 |\n| unsupported_media_type | 415 |\n| rate_limited | 429 |\n| internal | 500 |\n| dependency_unavailable | 503 |\n\nConditional requirements such as residenceRegion for US residents and address for enhanced verification are enforced by the server. Proof of address: send requirements [\"address\"] (optional addressPolicy); the result is in session.address and identity.address. A follow-up session with reuseIdentity true asks only for the address of an already verified user. Source of funds or wealth: send requirements [\"source_of_funds\"] and/or [\"source_of_wealth\"] (optional fundsPolicy); the user answers a short questionnaire and, when the policy asks, uploads documents. The result (evidence level, answers, document figures and findings; details need the financial_data scope) is in session.funds and identity.funds. It is a summary for your compliance team, never a statement that money is clean. MRZ country normalization is server-side. See the developer guide for capture limits and consent requirements.",
    "license": {
      "name": "Apache-2.0",
      "identifier": "Apache-2.0"
    },
    "contact": {
      "name": "Zoi ID",
      "email": "official@zoi.network",
      "url": "https://kyc.zoi.network/en/developers/"
    }
  },
  "servers": [
    {
      "url": "https://kyc.zoi.network",
      "description": "Zoi ID API"
    }
  ],
  "tags": [
    {
      "name": "Partner",
      "description": "Server-to-server sessions, identities, erasure, fraud reports and event reconciliation."
    },
    {
      "name": "Client",
      "description": "Session-scoped capture API for SDK authors."
    },
    {
      "name": "Webhooks",
      "description": "Verify Zoi-Id-Signature against the exact raw bytes before JSON parsing: HMAC-SHA256(secret, timestamp + '.' + body), hexadecimal. Header t is Unix seconds, unlike payload timestamps (milliseconds). Accept absolute clock skew <= 300 seconds and any matching v1 during rotation. Reject malformed or duplicate timestamps. Dedupe eventId. Return 2xx only after durable handling. Delivery retries for 72 hours, reconcile through the 30-day events feed."
    }
  ],
  "paths": {
    "/v1/partner/sessions": {
      "post": {
        "operationId": "createSession",
        "summary": "Create or resume a verification session",
        "description": "Create or resume a verification session. Server-to-server. Requires a partner key.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique request key, max 200 characters. Reuse for retries with the same body for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "5dd933ca-122b-4e80-81c1-720b1e0319b7"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePartnerSessionResponse"
                },
                "example": {
                  "sessionId": "ses_example",
                  "clientToken": "example_token_do_not_use",
                  "clientTokenExpiresAt": 1793494800000,
                  "status": "created",
                  "apiBaseUrl": "https://kyc.zoi.network",
                  "resumed": false,
                  "verificationUrl": "https://kyc.zoi.network/verify/#token=example_token_do_not_use&lang=en",
                  "createdAt": 1793491200000,
                  "sequence": 0
                }
              }
            }
          },
          "201": {
            "description": "New session created; 200 means an existing session was resumed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePartnerSessionResponse"
                },
                "example": {
                  "sessionId": "ses_example",
                  "clientToken": "example_token_do_not_use",
                  "clientTokenExpiresAt": 1793494800000,
                  "status": "created",
                  "apiBaseUrl": "https://kyc.zoi.network",
                  "resumed": false,
                  "verificationUrl": "https://kyc.zoi.network/verify/#token=example_token_do_not_use&lang=en",
                  "createdAt": 1793491200000,
                  "sequence": 0
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePartnerSessionRequest"
              },
              "example": {
                "externalUserId": "user_123",
                "appId": "com.example.app",
                "level": "standard",
                "locale": "en",
                "redirectUrl": "https://app.example.com/verified",
                "requirements": [
                  "address"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/partner/sessions\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"externalUserId\":\"user_123\",\"appId\":\"com.example.app\",\"level\":\"standard\",\"locale\":\"en\",\"redirectUrl\":\"https://app.example.com/verified\",\"requirements\":[\"address\"]}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/partner/sessions\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"externalUserId\\\":\\\"user_123\\\",\\\"appId\\\":\\\"com.example.app\\\",\\\"level\\\":\\\"standard\\\",\\\"locale\\\":\\\"en\\\",\\\"redirectUrl\\\":\\\"https://app.example.com/verified\\\",\\\"requirements\\\":[\\\"address\\\"]}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/partner/sessions\", strings.NewReader(\"{\\\"externalUserId\\\":\\\"user_123\\\",\\\"appId\\\":\\\"com.example.app\\\",\\\"level\\\":\\\"standard\\\",\\\"locale\\\":\\\"en\\\",\\\"redirectUrl\\\":\\\"https://app.example.com/verified\\\",\\\"requirements\\\":[\\\"address\\\"]}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/partner/sessions\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"externalUserId\\\":\\\"user_123\\\",\\\"appId\\\":\\\"com.example.app\\\",\\\"level\\\":\\\"standard\\\",\\\"locale\\\":\\\"en\\\",\\\"redirectUrl\\\":\\\"https://app.example.com/verified\\\",\\\"requirements\\\":[\\\"address\\\"]}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/partner/sessions\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"externalUserId\\\":\\\"user_123\\\",\\\"appId\\\":\\\"com.example.app\\\",\\\"level\\\":\\\"standard\\\",\\\"locale\\\":\\\"en\\\",\\\"redirectUrl\\\":\\\"https://app.example.com/verified\\\",\\\"requirements\\\":[\\\"address\\\"]}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/partner/sessions\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"externalUserId\\\":\\\"user_123\\\",\\\"appId\\\":\\\"com.example.app\\\",\\\"level\\\":\\\"standard\\\",\\\"locale\\\":\\\"en\\\",\\\"redirectUrl\\\":\\\"https://app.example.com/verified\\\",\\\"requirements\\\":[\\\"address\\\"]}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/partner/sessions/{id}": {
      "get": {
        "operationId": "getSession",
        "summary": "Get a session result",
        "description": "Get a session result. Server-to-server. Requires a partner key.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerSession"
                },
                "example": {
                  "id": "ses_example",
                  "externalUserId": "user_123",
                  "revision": 0,
                  "sequence": 0,
                  "status": "created",
                  "level": "standard",
                  "reasonCodes": [],
                  "manualReview": false,
                  "createdAt": 1793491200000,
                  "submittedAt": null,
                  "decidedAt": null,
                  "identity": null,
                  "requirements": [
                    "address"
                  ],
                  "reusesIdentity": false,
                  "address": null,
                  "funds": null
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/partner/sessions/ses_example\", {\n  method: \"GET\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/partner/sessions/ses_example\", method=\"GET\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"GET\", \"https://kyc.zoi.network/v1/partner/sessions/ses_example\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/partner/sessions/ses_example\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"GET\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/partner/sessions/ses_example\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"GET\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/partner/sessions/ses_example\")\nrequest = Net::HTTP::Get.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/partner/sessions/{id}/cancel": {
      "post": {
        "operationId": "cancelSession",
        "summary": "Cancel a session",
        "description": "Cancel a session. Server-to-server. Requires a partner key.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/cancel\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/cancel\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/partner/sessions/ses_example/cancel\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/cancel\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/cancel\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/cancel\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/partner/sessions/{id}/fraud-reports": {
      "post": {
        "operationId": "reportFraud",
        "summary": "Report fraud on one of your decided sessions",
        "description": "Tells Zoi ID that an approved or rejected session of yours was fraud, or with status cleared that an earlier report was wrong. One call; an empty JSON body reports confirmed fraud of category other. Needs the sessions:write scope. Another partner's session answers 404, an undecided one 409. It changes nothing for the user, the session or the identity: it feeds Zoi ID's measurement of wrong approvals per document type. Sending the same report again returns the earlier one (200). At most 20 reports per session; rate limited per partner. Do not put names, document numbers or other personal data in the note.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique request key, max 200 characters. Reuse for retries with the same body for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "5dd933ca-122b-4e80-81c1-720b1e0319b7"
          }
        ],
        "responses": {
          "200": {
            "description": "The same report was already stored; nothing new was added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerFraudReport"
                },
                "example": {
                  "id": "flb_example",
                  "sessionId": "ses_example",
                  "status": "confirmed_fraud",
                  "category": "forged_document",
                  "noteKept": true,
                  "createdAt": 1793491200000
                }
              }
            }
          },
          "201": {
            "description": "Report stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerFraudReport"
                },
                "example": {
                  "id": "flb_example",
                  "sessionId": "ses_example",
                  "status": "confirmed_fraud",
                  "category": "forged_document",
                  "noteKept": true,
                  "createdAt": 1793491200000
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerFraudReportRequest"
              },
              "example": {
                "status": "confirmed_fraud",
                "category": "forged_document",
                "note": "Chargeback, card holder says the account is not theirs"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/fraud-reports\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"status\":\"confirmed_fraud\",\"category\":\"forged_document\",\"note\":\"Chargeback, card holder says the account is not theirs\"}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/fraud-reports\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"status\\\":\\\"confirmed_fraud\\\",\\\"category\\\":\\\"forged_document\\\",\\\"note\\\":\\\"Chargeback, card holder says the account is not theirs\\\"}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/partner/sessions/ses_example/fraud-reports\", strings.NewReader(\"{\\\"status\\\":\\\"confirmed_fraud\\\",\\\"category\\\":\\\"forged_document\\\",\\\"note\\\":\\\"Chargeback, card holder says the account is not theirs\\\"}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/fraud-reports\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"status\\\":\\\"confirmed_fraud\\\",\\\"category\\\":\\\"forged_document\\\",\\\"note\\\":\\\"Chargeback, card holder says the account is not theirs\\\"}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/fraud-reports\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"status\\\":\\\"confirmed_fraud\\\",\\\"category\\\":\\\"forged_document\\\",\\\"note\\\":\\\"Chargeback, card holder says the account is not theirs\\\"}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/partner/sessions/ses_example/fraud-reports\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"status\\\":\\\"confirmed_fraud\\\",\\\"category\\\":\\\"forged_document\\\",\\\"note\\\":\\\"Chargeback, card holder says the account is not theirs\\\"}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/partner/users/{externalUserId}": {
      "get": {
        "operationId": "getUser",
        "summary": "Get the current identity and latest session",
        "description": "Get the current identity and latest session. Server-to-server. Requires a partner key.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "externalUserId",
            "in": "path",
            "required": true,
            "description": "Your opaque user reference. URL encode this path segment.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/partner/users/user_123\", {\n  method: \"GET\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/partner/users/user_123\", method=\"GET\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"GET\", \"https://kyc.zoi.network/v1/partner/users/user_123\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/partner/users/user_123\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"GET\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/partner/users/user_123\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"GET\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/partner/users/user_123\")\nrequest = Net::HTTP::Get.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      },
      "delete": {
        "operationId": "eraseUser",
        "summary": "Erase a user's personal data",
        "description": "Erases the user's data, retaining only legally required records. A 503 means the erasure is not yet fully confirmed. Retry safely until successful.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "externalUserId",
            "in": "path",
            "required": true,
            "description": "Your opaque user reference. URL encode this path segment.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErasePartnerUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/partner/users/user_123\", {\n  method: \"DELETE\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/partner/users/user_123\", method=\"DELETE\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"DELETE\", \"https://kyc.zoi.network/v1/partner/users/user_123\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/partner/users/user_123\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"DELETE\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/partner/users/user_123\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"DELETE\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/partner/users/user_123\")\nrequest = Net::HTTP::Delete.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/partner/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "Read committed events in feed order",
        "description": "Read committed events in feed order. Server-to-server. Requires a partner key.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "description": "Opaque decimal cursor from nextCursor. Omit on first read. Keep as a string.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum events per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An empty items array ends this poll. Keep the last nonempty nextCursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerEventsResponse"
                },
                "example": {
                  "items": [
                    {
                      "v": 1,
                      "eventId": "evt_example",
                      "type": "session.processing",
                      "createdAt": 1793491200000,
                      "object": "session",
                      "session": {
                        "id": "ses_example",
                        "externalUserId": "user_123",
                        "revision": 0,
                        "sequence": 1,
                        "status": "processing",
                        "level": "standard",
                        "reasonCodes": [],
                        "manualReview": false,
                        "createdAt": 1793491200000,
                        "submittedAt": null,
                        "decidedAt": null,
                        "identity": null,
                        "requirements": [
                          "address"
                        ],
                        "reusesIdentity": false,
                        "address": null,
                        "funds": null
                      }
                    }
                  ],
                  "nextCursor": "42"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/partner/events\", {\n  method: \"GET\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/partner/events\", method=\"GET\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"GET\", \"https://kyc.zoi.network/v1/partner/events\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/partner/events\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"GET\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/partner/events\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"GET\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/partner/events\")\nrequest = Net::HTTP::Get.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/partner/sandbox/scenarios": {
      "get": {
        "operationId": "listSandboxScenarios",
        "summary": "List sandbox scenarios for test keys",
        "description": "Lists the sandbox scenarios, the fake screening list names and the specimen documents. Use a scenario id as sandboxScenario when creating a session with a test key (zid_test_), or end an externalUserId with one of its suffixes. Live keys get 400 when they send sandboxScenario.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxScenariosResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/partner/sandbox/scenarios\", {\n  method: \"GET\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/partner/sandbox/scenarios\", method=\"GET\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"GET\", \"https://kyc.zoi.network/v1/partner/sandbox/scenarios\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/partner/sandbox/scenarios\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"GET\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/partner/sandbox/scenarios\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"GET\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/partner/sandbox/scenarios\")\nrequest = Net::HTTP::Get.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/session": {
      "get": {
        "operationId": "getClientSession",
        "summary": "Get steps, consent notice and evidence revision",
        "description": "Get steps, consent notice and evidence revision. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/session\", {\n  method: \"GET\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/session\", method=\"GET\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"GET\", \"https://kyc.zoi.network/v1/client/session\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/session\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"GET\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/session\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"GET\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/session\")\nrequest = Net::HTTP::Get.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/consent": {
      "post": {
        "operationId": "recordConsent",
        "summary": "Record separate biometric consent and age confirmation",
        "description": "Record separate biometric consent and age confirmation. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentRequest"
              },
              "example": {
                "version": "2026-11-03",
                "locale": "en",
                "biometricConsent": false,
                "ageConfirmed": true,
                "channel": "web"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/consent\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"version\":\"2026-11-03\",\"locale\":\"en\",\"biometricConsent\":false,\"ageConfirmed\":true,\"channel\":\"web\"}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/consent\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"version\\\":\\\"2026-11-03\\\",\\\"locale\\\":\\\"en\\\",\\\"biometricConsent\\\":false,\\\"ageConfirmed\\\":true,\\\"channel\\\":\\\"web\\\"}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/consent\", strings.NewReader(\"{\\\"version\\\":\\\"2026-11-03\\\",\\\"locale\\\":\\\"en\\\",\\\"biometricConsent\\\":false,\\\"ageConfirmed\\\":true,\\\"channel\\\":\\\"web\\\"}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/consent\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"version\\\":\\\"2026-11-03\\\",\\\"locale\\\":\\\"en\\\",\\\"biometricConsent\\\":false,\\\"ageConfirmed\\\":true,\\\"channel\\\":\\\"web\\\"}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/consent\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"version\\\":\\\"2026-11-03\\\",\\\"locale\\\":\\\"en\\\",\\\"biometricConsent\\\":false,\\\"ageConfirmed\\\":true,\\\"channel\\\":\\\"web\\\"}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/consent\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"version\\\":\\\"2026-11-03\\\",\\\"locale\\\":\\\"en\\\",\\\"biometricConsent\\\":false,\\\"ageConfirmed\\\":true,\\\"channel\\\":\\\"web\\\"}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/attestation/challenge": {
      "post": {
        "operationId": "createAttestationChallenge",
        "summary": "Create a platform attestation nonce",
        "description": "Create a platform attestation nonce. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttestationChallengeResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/attestation/challenge\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/attestation/challenge\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/attestation/challenge\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/attestation/challenge\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/attestation/challenge\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/attestation/challenge\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/attestation": {
      "post": {
        "operationId": "submitAttestation",
        "summary": "Submit platform attestation or an unsupported result",
        "description": "Submit platform attestation or an unsupported result. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttestationResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttestationRequest"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/attestation\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/attestation\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/attestation\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/attestation\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/attestation\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/attestation\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/document/chip/challenge": {
      "post": {
        "operationId": "createChipChallenge",
        "summary": "Create an Active Authentication challenge",
        "description": "Create an Active Authentication challenge. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChipChallengeResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/document/chip/challenge\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/document/chip/challenge\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/document/chip/challenge\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/document/chip/challenge\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/document/chip/challenge\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/document/chip/challenge\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/document/chip": {
      "post": {
        "operationId": "uploadChip",
        "summary": "Submit raw chip files for server verification",
        "description": "Submit raw chip files for server verification. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChipUploadRequest"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/document/chip\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/document/chip\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/document/chip\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/document/chip\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/document/chip\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/document/chip\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/liveness/challenge": {
      "post": {
        "operationId": "createLivenessChallenge",
        "summary": "Create a timed head-movement challenge",
        "description": "Create a timed head-movement challenge. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivenessChallengeResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/liveness/challenge\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/liveness/challenge\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/liveness/challenge\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/liveness/challenge\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/liveness/challenge\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/liveness/challenge\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/profile": {
      "post": {
        "operationId": "updateProfile",
        "summary": "Set residence and enhanced address",
        "description": "Set residence and enhanced address. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileRequest"
              },
              "example": {
                "residenceCountry": "ID"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/profile\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"residenceCountry\":\"ID\"}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/profile\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"residenceCountry\\\":\\\"ID\\\"}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/profile\", strings.NewReader(\"{\\\"residenceCountry\\\":\\\"ID\\\"}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/profile\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"residenceCountry\\\":\\\"ID\\\"}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/profile\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"residenceCountry\\\":\\\"ID\\\"}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/profile\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"residenceCountry\\\":\\\"ID\\\"}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/declarations": {
      "post": {
        "operationId": "recordDeclarations",
        "summary": "Record PEP and own-behalf declarations",
        "description": "Record PEP and own-behalf declarations. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclarationsRequest"
              },
              "example": {
                "isPoliticallyExposed": false,
                "actingOnOwnBehalf": true
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/declarations\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"isPoliticallyExposed\":false,\"actingOnOwnBehalf\":true}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/declarations\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"isPoliticallyExposed\\\":false,\\\"actingOnOwnBehalf\\\":true}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/declarations\", strings.NewReader(\"{\\\"isPoliticallyExposed\\\":false,\\\"actingOnOwnBehalf\\\":true}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/declarations\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"isPoliticallyExposed\\\":false,\\\"actingOnOwnBehalf\\\":true}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/declarations\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"isPoliticallyExposed\\\":false,\\\"actingOnOwnBehalf\\\":true}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/declarations\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"isPoliticallyExposed\\\":false,\\\"actingOnOwnBehalf\\\":true}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/submit": {
      "post": {
        "operationId": "submitSession",
        "summary": "Submit the current evidence revision",
        "description": "Submit the current evidence revision. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique request key, max 200 characters. Reuse for retries with the same body for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "5dd933ca-122b-4e80-81c1-720b1e0319b7"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitRequest"
              },
              "example": {
                "revision": 3
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/submit\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"revision\":3}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/submit\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"revision\\\":3}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/submit\", strings.NewReader(\"{\\\"revision\\\":3}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/submit\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"revision\\\":3}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/submit\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"revision\\\":3}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/submit\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"revision\\\":3}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/review-request": {
      "post": {
        "operationId": "requestReview",
        "summary": "Request a human review",
        "description": "Request a human review. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRequest"
              },
              "example": {}
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/review-request\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/review-request\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/review-request\", strings.NewReader(\"{}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/review-request\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/review-request\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/review-request\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/withdraw": {
      "post": {
        "operationId": "withdrawConsent",
        "summary": "Withdraw consent and erase personal evidence",
        "description": "Withdraw consent and erase personal evidence. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/withdraw\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/withdraw\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/withdraw\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/withdraw\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/withdraw\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/withdraw\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/document/mrz-scan": {
      "post": {
        "operationId": "scanMrz",
        "summary": "Scan a data-page MRZ with optional capture video",
        "description": "Scan a data-page MRZ with optional capture video. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MrzScanResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "video": {
                    "type": "string",
                    "format": "binary"
                  },
                  "videoMeta": {
                    "$ref": "#/components/schemas/CaptureVideoMeta"
                  },
                  "captureProof": {
                    "$ref": "#/components/schemas/CaptureProof"
                  },
                  "uploads": {
                    "$ref": "#/components/schemas/UploadRefs"
                  }
                },
                "required": []
              },
              "encoding": {
                "videoMeta": {
                  "contentType": "application/json"
                },
                "captureProof": {
                  "contentType": "application/json"
                },
                "uploads": {
                  "contentType": "application/json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/client/document/photos": {
      "post": {
        "operationId": "uploadDocumentPhotos",
        "summary": "Upload document photos and capture videos",
        "description": "Upload document photos and capture videos. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "front": {
                    "type": "string",
                    "format": "binary"
                  },
                  "back": {
                    "type": "string",
                    "format": "binary"
                  },
                  "fields": {
                    "$ref": "#/components/schemas/DocumentPhotosFields"
                  },
                  "frontVideo": {
                    "type": "string",
                    "format": "binary"
                  },
                  "backVideo": {
                    "type": "string",
                    "format": "binary"
                  },
                  "videoMeta": {
                    "type": "object",
                    "properties": {
                      "front": {
                        "$ref": "#/components/schemas/CaptureVideoMeta"
                      },
                      "back": {
                        "$ref": "#/components/schemas/CaptureVideoMeta"
                      }
                    }
                  },
                  "captureProof": {
                    "$ref": "#/components/schemas/CaptureProof"
                  },
                  "uploads": {
                    "$ref": "#/components/schemas/UploadRefs"
                  }
                },
                "required": [
                  "fields"
                ]
              },
              "encoding": {
                "fields": {
                  "contentType": "application/json"
                },
                "videoMeta": {
                  "contentType": "application/json"
                },
                "captureProof": {
                  "contentType": "application/json"
                },
                "uploads": {
                  "contentType": "application/json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/client/liveness": {
      "post": {
        "operationId": "uploadLiveness",
        "summary": "Upload one continuous liveness video and prompt timing",
        "description": "Upload one continuous liveness video and prompt timing. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivenessUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "video": {
                    "type": "string",
                    "format": "binary"
                  },
                  "meta": {
                    "$ref": "#/components/schemas/LivenessUploadMeta"
                  },
                  "captureProof": {
                    "$ref": "#/components/schemas/CaptureProof"
                  },
                  "uploads": {
                    "$ref": "#/components/schemas/UploadRefs"
                  }
                },
                "required": [
                  "meta"
                ]
              },
              "encoding": {
                "meta": {
                  "contentType": "application/json"
                },
                "captureProof": {
                  "contentType": "application/json"
                },
                "uploads": {
                  "contentType": "application/json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/client/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "Start a resumable upload of one capture file",
        "description": "Resumable chunked upload of a large capture file (image or video) for slow networks. Requires a session-scoped client token. Chunks go in order with PUT; after a drop, GET the offset and continue. Name the finished upload in the uploads part of the step's multipart upload instead of the file part.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Upload started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadState"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUploadRequest"
              },
              "example": {
                "purpose": "liveness",
                "part": "video",
                "contentType": "video/mp4",
                "size": 5242880,
                "sha256": "0000000000000000000000000000000000000000000000000000000000000000",
                "challengeId": "chl_example"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/uploads\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"purpose\":\"liveness\",\"part\":\"video\",\"contentType\":\"video/mp4\",\"size\":5242880,\"sha256\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"challengeId\":\"chl_example\"}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/uploads\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"purpose\\\":\\\"liveness\\\",\\\"part\\\":\\\"video\\\",\\\"contentType\\\":\\\"video/mp4\\\",\\\"size\\\":5242880,\\\"sha256\\\":\\\"0000000000000000000000000000000000000000000000000000000000000000\\\",\\\"challengeId\\\":\\\"chl_example\\\"}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/uploads\", strings.NewReader(\"{\\\"purpose\\\":\\\"liveness\\\",\\\"part\\\":\\\"video\\\",\\\"contentType\\\":\\\"video/mp4\\\",\\\"size\\\":5242880,\\\"sha256\\\":\\\"0000000000000000000000000000000000000000000000000000000000000000\\\",\\\"challengeId\\\":\\\"chl_example\\\"}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/uploads\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"purpose\\\":\\\"liveness\\\",\\\"part\\\":\\\"video\\\",\\\"contentType\\\":\\\"video/mp4\\\",\\\"size\\\":5242880,\\\"sha256\\\":\\\"0000000000000000000000000000000000000000000000000000000000000000\\\",\\\"challengeId\\\":\\\"chl_example\\\"}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/uploads\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"purpose\\\":\\\"liveness\\\",\\\"part\\\":\\\"video\\\",\\\"contentType\\\":\\\"video/mp4\\\",\\\"size\\\":5242880,\\\"sha256\\\":\\\"0000000000000000000000000000000000000000000000000000000000000000\\\",\\\"challengeId\\\":\\\"chl_example\\\"}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/uploads\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"purpose\\\":\\\"liveness\\\",\\\"part\\\":\\\"video\\\",\\\"contentType\\\":\\\"video/mp4\\\",\\\"size\\\":5242880,\\\"sha256\\\":\\\"0000000000000000000000000000000000000000000000000000000000000000\\\",\\\"challengeId\\\":\\\"chl_example\\\"}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/uploads/{uploadId}": {
      "get": {
        "operationId": "getUpload",
        "summary": "Read the offset of a resumable upload",
        "description": "Resumable chunked upload of a large capture file (image or video) for slow networks. Requires a session-scoped client token. Chunks go in order with PUT; after a drop, GET the offset and continue. Name the finished upload in the uploads part of the step's multipart upload instead of the file part. The Upload-Offset header repeats the offset.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "description": "Upload id from createUpload.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadState"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\", {\n  method: \"GET\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\", method=\"GET\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"GET\", \"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"GET\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"GET\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\")\nrequest = Net::HTTP::Get.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      },
      "put": {
        "operationId": "putUploadChunk",
        "summary": "Send one chunk of a resumable upload",
        "description": "Sends the bytes at Upload-Offset (256 KiB to 4 MiB; only the last chunk may be smaller). The same bytes sent again at a stored offset are accepted; other bytes or a gap answer idempotency_conflict. The chunk that ends the file completes the upload when the bytes match the declared SHA-256, else the upload is deleted.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "description": "Upload id from createUpload.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Upload-Offset",
            "in": "header",
            "required": true,
            "description": "Byte offset of this chunk: the upload's current offset.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadState"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/offset+octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteUpload",
        "summary": "Abort a resumable upload",
        "description": "Deletes the upload and its chunks.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "description": "Upload id from createUpload.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\", {\n  method: \"DELETE\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\", method=\"DELETE\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"DELETE\", \"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"DELETE\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"DELETE\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/uploads/upl_00000000000000000000000000000000\")\nrequest = Net::HTTP::Delete.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/address/document": {
      "post": {
        "operationId": "uploadAddressDocument",
        "summary": "Upload a proof of address document and read it",
        "description": "Upload a proof of address document and read it. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "meta": {
                    "$ref": "#/components/schemas/AddressUploadMeta"
                  }
                },
                "required": [
                  "file",
                  "meta"
                ]
              },
              "encoding": {
                "meta": {
                  "contentType": "application/json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/client/address/confirm": {
      "post": {
        "operationId": "confirmAddress",
        "summary": "Confirm the address read from the uploaded document",
        "description": "Confirm the address read from the uploaded document. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressConfirmRequest"
              },
              "example": {
                "uploadId": "adu_example",
                "address": {
                  "line1": "Example Street 1",
                  "city": "Istanbul",
                  "postalCode": "34000",
                  "country": "TR"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/address/confirm\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"uploadId\":\"adu_example\",\"address\":{\"line1\":\"Example Street 1\",\"city\":\"Istanbul\",\"postalCode\":\"34000\",\"country\":\"TR\"}}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/address/confirm\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"uploadId\\\":\\\"adu_example\\\",\\\"address\\\":{\\\"line1\\\":\\\"Example Street 1\\\",\\\"city\\\":\\\"Istanbul\\\",\\\"postalCode\\\":\\\"34000\\\",\\\"country\\\":\\\"TR\\\"}}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/address/confirm\", strings.NewReader(\"{\\\"uploadId\\\":\\\"adu_example\\\",\\\"address\\\":{\\\"line1\\\":\\\"Example Street 1\\\",\\\"city\\\":\\\"Istanbul\\\",\\\"postalCode\\\":\\\"34000\\\",\\\"country\\\":\\\"TR\\\"}}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/address/confirm\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"uploadId\\\":\\\"adu_example\\\",\\\"address\\\":{\\\"line1\\\":\\\"Example Street 1\\\",\\\"city\\\":\\\"Istanbul\\\",\\\"postalCode\\\":\\\"34000\\\",\\\"country\\\":\\\"TR\\\"}}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/address/confirm\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"uploadId\\\":\\\"adu_example\\\",\\\"address\\\":{\\\"line1\\\":\\\"Example Street 1\\\",\\\"city\\\":\\\"Istanbul\\\",\\\"postalCode\\\":\\\"34000\\\",\\\"country\\\":\\\"TR\\\"}}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/address/confirm\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"uploadId\\\":\\\"adu_example\\\",\\\"address\\\":{\\\"line1\\\":\\\"Example Street 1\\\",\\\"city\\\":\\\"Istanbul\\\",\\\"postalCode\\\":\\\"34000\\\",\\\"country\\\":\\\"TR\\\"}}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/funds/answers": {
      "post": {
        "operationId": "saveFundsAnswers",
        "summary": "Save the source of funds answers",
        "description": "Requires a session-scoped client token. Ranges are indexes into clientSession.funds.policy.ranges. With evidence none this completes the funds step; otherwise add documents and call completeFunds. A change after completing reopens the step.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FundsAnswersRequest"
              },
              "example": {
                "employmentStatus": "employed",
                "occupation": "Engineer",
                "employer": "Example Ltd",
                "income": 2,
                "sources": [
                  "salary"
                ],
                "volume": 1
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/funds/answers\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"employmentStatus\":\"employed\",\"occupation\":\"Engineer\",\"employer\":\"Example Ltd\",\"income\":2,\"sources\":[\"salary\"],\"volume\":1}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/funds/answers\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"employmentStatus\\\":\\\"employed\\\",\\\"occupation\\\":\\\"Engineer\\\",\\\"employer\\\":\\\"Example Ltd\\\",\\\"income\\\":2,\\\"sources\\\":[\\\"salary\\\"],\\\"volume\\\":1}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/funds/answers\", strings.NewReader(\"{\\\"employmentStatus\\\":\\\"employed\\\",\\\"occupation\\\":\\\"Engineer\\\",\\\"employer\\\":\\\"Example Ltd\\\",\\\"income\\\":2,\\\"sources\\\":[\\\"salary\\\"],\\\"volume\\\":1}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/funds/answers\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"employmentStatus\\\":\\\"employed\\\",\\\"occupation\\\":\\\"Engineer\\\",\\\"employer\\\":\\\"Example Ltd\\\",\\\"income\\\":2,\\\"sources\\\":[\\\"salary\\\"],\\\"volume\\\":1}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/funds/answers\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"employmentStatus\\\":\\\"employed\\\",\\\"occupation\\\":\\\"Engineer\\\",\\\"employer\\\":\\\"Example Ltd\\\",\\\"income\\\":2,\\\"sources\\\":[\\\"salary\\\"],\\\"volume\\\":1}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/funds/answers\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"employmentStatus\\\":\\\"employed\\\",\\\"occupation\\\":\\\"Engineer\\\",\\\"employer\\\":\\\"Example Ltd\\\",\\\"income\\\":2,\\\"sources\\\":[\\\"salary\\\"],\\\"volume\\\":1}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/funds/document": {
      "post": {
        "operationId": "uploadFundsDocument",
        "summary": "Upload one source of funds document and read it",
        "description": "Upload one source of funds document and read it. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundsUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "meta": {
                    "$ref": "#/components/schemas/FundsUploadMeta"
                  }
                },
                "required": [
                  "file",
                  "meta"
                ]
              },
              "encoding": {
                "meta": {
                  "contentType": "application/json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/client/funds/remove": {
      "post": {
        "operationId": "removeFundsDocument",
        "summary": "Remove one of the current source of funds documents",
        "description": "Remove one of the current source of funds documents. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FundsRemoveRequest"
              },
              "example": {
                "uploadId": "fdu_example"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/funds/remove\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"uploadId\":\"fdu_example\"}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/funds/remove\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"uploadId\\\":\\\"fdu_example\\\"}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/funds/remove\", strings.NewReader(\"{\\\"uploadId\\\":\\\"fdu_example\\\"}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/funds/remove\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"uploadId\\\":\\\"fdu_example\\\"}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/funds/remove\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"uploadId\\\":\\\"fdu_example\\\"}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/funds/remove\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"uploadId\\\":\\\"fdu_example\\\"}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/funds/complete": {
      "post": {
        "operationId": "completeFunds",
        "summary": "Finish the source of funds step",
        "description": "Finish the source of funds step. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/funds/complete\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/funds/complete\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/funds/complete\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/funds/complete\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/funds/complete\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/funds/complete\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/sandbox": {
      "get": {
        "operationId": "getClientSandbox",
        "summary": "List sandbox scenarios for a test session",
        "description": "Test sessions only (livemode false); live sessions get 404. Show a Test mode banner and offer these scenarios in a simulate panel.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSandbox"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/sandbox\", {\n  method: \"GET\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/sandbox\", method=\"GET\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"GET\", \"https://kyc.zoi.network/v1/client/sandbox\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/sandbox\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"GET\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/sandbox\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"GET\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/sandbox\")\nrequest = Net::HTTP::Get.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/sandbox/simulate": {
      "post": {
        "operationId": "simulateSandboxOutcome",
        "summary": "Finish a test session with a sandbox scenario",
        "description": "Test sessions only; live sessions get 404. Stores the scenario, completes the missing steps and submits. Refused once the session was submitted.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSession"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientSimulate"
              },
              "example": {
                "scenario": "approve"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/sandbox/simulate\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"scenario\":\"approve\"}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/sandbox/simulate\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"scenario\\\":\\\"approve\\\"}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/sandbox/simulate\", strings.NewReader(\"{\\\"scenario\\\":\\\"approve\\\"}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/sandbox/simulate\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"scenario\\\":\\\"approve\\\"}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/sandbox/simulate\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"scenario\\\":\\\"approve\\\"}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/sandbox/simulate\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"scenario\\\":\\\"approve\\\"}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/capture/challenge": {
      "post": {
        "operationId": "createCaptureChallenge",
        "summary": "Create a capture-proof challenge",
        "description": "Create a capture-proof challenge. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaptureChallengeResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaptureChallengeRequest"
              },
              "example": {
                "purpose": "upload"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/capture/challenge\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\"purpose\":\"upload\"}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/capture/challenge\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"},\n    data=\"{\\\"purpose\\\":\\\"upload\\\"}\".encode())\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/capture/challenge\", strings.NewReader(\"{\\\"purpose\\\":\\\"upload\\\"}\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/capture/challenge\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json'],\n  CURLOPT_POSTFIELDS => \"{\\\"purpose\\\":\\\"upload\\\"}\"\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/capture/challenge\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"purpose\\\":\\\"upload\\\"}\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/capture/challenge\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"purpose\\\":\\\"upload\\\"}\"\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/capture/key": {
      "post": {
        "operationId": "enrollCaptureKey",
        "summary": "Enroll a device capture key",
        "description": "Enroll a device capture key. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaptureKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaptureKeyRequest"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/capture/key\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/capture/key\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/capture/key\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/capture/key\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/capture/key\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/capture/key\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/wallet/request": {
      "post": {
        "operationId": "createWalletRequest",
        "summary": "Create a revision-bound Digital Credentials request",
        "description": "Create a revision-bound Digital Credentials request. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletRequestResponse"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletRequest"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/wallet/request\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/wallet/request\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/wallet/request\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/wallet/request\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/wallet/request\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/wallet/request\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    },
    "/v1/client/wallet/response": {
      "post": {
        "operationId": "submitWalletResponse",
        "summary": "Verify an encrypted wallet response",
        "description": "Verify an encrypted wallet response. Requires a session-scoped client token. Follow requiredSteps and use the latest revision.",
        "tags": [
          "Client"
        ],
        "security": [
          {
            "ClientToken": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletResult"
                }
              }
            }
          },
          "400": {
            "description": "bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized, token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "409": {
            "description": "session_closed, step_not_allowed, revision_conflict, idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "session_closed",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "410": {
            "description": "challenge_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "challenge_expired",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "415": {
            "description": "unsupported_media_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "internal",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          },
          "503": {
            "description": "dependency_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "dependency_unavailable",
                    "message": "Request could not be completed",
                    "requestId": "req_example"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletResponse"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://kyc.zoi.network/v1/client/wallet/response\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.ZOI_ID_KEY}`, \"Content-Type\": \"application/json\" },\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "Python",
            "source": "import json, os, urllib.request\nrequest = urllib.request.Request(\"https://kyc.zoi.network/v1/client/wallet/response\", method=\"POST\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"ZOI_ID_KEY\"], \"Content-Type\": \"application/json\"})\nwith urllib.request.urlopen(request) as response:\n    print(json.load(response))"
          },
          {
            "lang": "Go",
            "source": "package main\nimport (\"fmt\"; \"io\"; \"net/http\"; \"os\"; \"strings\")\nfunc main() {\n  req, err := http.NewRequest(\"POST\", \"https://kyc.zoi.network/v1/client/wallet/response\", strings.NewReader(\"\"))\n  if err != nil { panic(err) }\n  req.Header.Set(\"Authorization\", \"Bearer \" + os.Getenv(\"ZOI_ID_KEY\"))\n  req.Header.Set(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil { panic(err) }; defer res.Body.Close()\n  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n  if res.StatusCode >= 400 { panic(string(data)) }; fmt.Println(string(data))\n}"
          },
          {
            "lang": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://kyc.zoi.network/v1/client/wallet/response\");\ncurl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => \"POST\", CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('ZOI_ID_KEY'), 'Content-Type: application/json']\n]);\n$result = curl_exec($ch);\nif ($result === false || curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException('Zoi ID request failed');\necho $result;\ncurl_close($ch);"
          },
          {
            "lang": "Java",
            "source": "import java.net.URI;\nimport java.net.http.*;\nclass Example {\n  public static void main(String[] args) throws Exception {\n    var request = HttpRequest.newBuilder(URI.create(\"https://kyc.zoi.network/v1/client/wallet/response\"))\n      .header(\"Authorization\", \"Bearer \" + System.getenv(\"ZOI_ID_KEY\"))\n      .header(\"Content-Type\", \"application/json\")\n      .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"\")).build();\n    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\n    if (response.statusCode() >= 400) throw new RuntimeException(response.body());\n    System.out.println(response.body());\n  }\n}"
          },
          {
            "lang": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nuri = URI(\"https://kyc.zoi.network/v1/client/wallet/response\")\nrequest = Net::HTTP::Post.new(uri)\nrequest['Authorization'] = \"Bearer #{ENV.fetch('ZOI_ID_KEY')}\"\nrequest['Content-Type'] = 'application/json'\nresponse = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }\nraise response.body unless response.is_a?(Net::HTTPSuccess)\nputs JSON.parse(response.body)"
          }
        ]
      }
    }
  },
  "webhooks": {
    "verificationEvent": {
      "post": {
        "operationId": "receiveVerificationEvent",
        "summary": "Receive a signed verification event",
        "description": "Verify Zoi-Id-Signature against the exact raw bytes before JSON parsing: HMAC-SHA256(secret, timestamp + '.' + body), hexadecimal. Header t is Unix seconds, unlike payload timestamps (milliseconds). Accept absolute clock skew <= 300 seconds and any matching v1 during rotation. Reject malformed or duplicate timestamps. Dedupe eventId. Return 2xx only after durable handling. Delivery retries for 72 hours, reconcile through the 30-day events feed.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "WebhookSignature": []
          }
        ],
        "parameters": [
          {
            "name": "Zoi-Id-Signature",
            "in": "header",
            "required": true,
            "description": "Verify Zoi-Id-Signature against the exact raw bytes before JSON parsing: HMAC-SHA256(secret, timestamp + '.' + body), hexadecimal. Header t is Unix seconds, unlike payload timestamps (milliseconds). Accept absolute clock skew <= 300 seconds and any matching v1 during rotation. Reject malformed or duplicate timestamps. Dedupe eventId. Return 2xx only after durable handling. Delivery retries for 72 hours, reconcile through the 30-day events feed.",
            "schema": {
              "type": "string"
            },
            "example": "t=1793491200,v1=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              },
              "example": {
                "v": 1,
                "eventId": "evt_example",
                "type": "session.processing",
                "createdAt": 1793491200000,
                "object": "session",
                "session": {
                  "id": "ses_example",
                  "externalUserId": "user_123",
                  "revision": 0,
                  "sequence": 1,
                  "status": "processing",
                  "level": "standard",
                  "reasonCodes": [],
                  "manualReview": false,
                  "createdAt": 1793491200000,
                  "submittedAt": null,
                  "decidedAt": null,
                  "identity": null,
                  "requirements": [
                    "address"
                  ],
                  "reusesIdentity": false,
                  "address": null,
                  "funds": null
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event durably accepted. Any 2xx stops retries."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "PartnerKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Partner API key",
        "description": "Keep this secret on your server."
      },
      "ClientToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Session token",
        "description": "Short-lived token from createSession, scoped to one session."
      },
      "WebhookSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "Zoi-Id-Signature",
        "description": "Verify Zoi-Id-Signature against the exact raw bytes before JSON parsing: HMAC-SHA256(secret, timestamp + '.' + body), hexadecimal. Header t is Unix seconds, unlike payload timestamps (milliseconds). Accept absolute clock skew <= 300 seconds and any matching v1 during rotation. Reject malformed or duplicate timestamps. Dedupe eventId. Return 2xx only after durable handling. Delivery retries for 72 hours, reconcile through the 30-day events feed."
      }
    },
    "schemas": {
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "$ref": "#/components/schemas/ErrorCode"
              },
              "message": {
                "type": "string"
              },
              "reason": {
                "$ref": "#/components/schemas/ReasonCode"
              },
              "requestId": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "CaptureMethod": {
        "type": "string",
        "enum": [
          "nfc",
          "photo",
          "wallet"
        ]
      },
      "CheckKind": {
        "type": "string",
        "enum": [
          "device_integrity",
          "document_authenticity",
          "chip_possession",
          "document_validity",
          "data_consistency",
          "face_match",
          "liveness",
          "age",
          "country_policy",
          "sanctions",
          "pep",
          "duplicate",
          "declarations",
          "risk_signals",
          "capture_integrity",
          "address",
          "funds"
        ]
      },
      "CheckResult": {
        "type": "string",
        "enum": [
          "pass",
          "fail",
          "review",
          "error",
          "skipped"
        ]
      },
      "CountryCode": {
        "type": "string",
        "pattern": "^[A-Z]{2}$"
      },
      "DocumentKind": {
        "type": "string",
        "enum": [
          "passport",
          "id_card",
          "residence_permit",
          "travel_document",
          "driving_licence",
          "other"
        ]
      },
      "ErrorCode": {
        "type": "string",
        "enum": [
          "bad_request",
          "unauthorized",
          "forbidden",
          "not_found",
          "token_expired",
          "session_closed",
          "step_not_allowed",
          "revision_conflict",
          "idempotency_conflict",
          "payload_too_large",
          "unsupported_media_type",
          "challenge_expired",
          "rate_limited",
          "dependency_unavailable",
          "internal"
        ]
      },
      "FraudCategory": {
        "type": "string",
        "enum": [
          "forged_document",
          "impostor",
          "deepfake_or_replay",
          "synthetic_identity",
          "account_takeover",
          "other"
        ]
      },
      "FraudLabelStatus": {
        "type": "string",
        "enum": [
          "confirmed_fraud",
          "suspected_fraud",
          "cleared"
        ]
      },
      "IdentityStatus": {
        "type": "string",
        "enum": [
          "active",
          "suspended",
          "expired",
          "revoked"
        ]
      },
      "IsoDate": {
        "type": "string",
        "pattern": "^\\d{4}-(\\d{2}|XX)-(\\d{2}|XX)$"
      },
      "MrzCountryCode": {
        "type": "string",
        "pattern": "^[A-Z<]{1,3}$"
      },
      "ReasonCode": {
        "type": "string",
        "enum": [
          "consent_missing",
          "consent_withdrawn",
          "attestation_failed",
          "document_expired",
          "document_unreadable",
          "document_not_supported",
          "document_suspected_tampering",
          "document_number_visible",
          "chip_verification_failed",
          "chip_proof_missing",
          "chip_data_mismatch",
          "mrz_invalid",
          "photo_quality",
          "face_not_found",
          "face_mismatch",
          "liveness_failed",
          "underage",
          "location_not_supported",
          "residence_not_supported",
          "sanctions_match",
          "pep_review",
          "duplicate_identity",
          "possible_duplicate",
          "declaration_requires_review",
          "user_requested_review",
          "reviewer_other",
          "address_unreadable",
          "address_document_too_old",
          "address_document_not_accepted",
          "address_name_mismatch",
          "address_signature_required",
          "funds_document_unreadable",
          "funds_document_too_old",
          "funds_document_not_accepted",
          "funds_more_evidence",
          "funds_evidence_rejected"
        ]
      },
      "SessionStatus": {
        "type": "string",
        "enum": [
          "created",
          "in_progress",
          "processing",
          "review",
          "approved",
          "rejected",
          "resubmit",
          "expired",
          "cancelled"
        ]
      },
      "SessionStep": {
        "type": "string",
        "enum": [
          "consent",
          "attestation",
          "document",
          "liveness",
          "profile",
          "address",
          "funds",
          "declarations"
        ]
      },
      "VerificationLevel": {
        "type": "string",
        "enum": [
          "standard",
          "enhanced"
        ]
      },
      "CreatePartnerSessionRequest": {
        "type": "object",
        "properties": {
          "externalUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "level": {
            "default": "standard",
            "$ref": "#/components/schemas/VerificationLevel"
          },
          "locale": {
            "type": "string",
            "minLength": 2,
            "maxLength": 35
          },
          "ipCountry": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "ipRegion": {
            "type": "string",
            "maxLength": 16
          },
          "appId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "mode": {
            "default": "start",
            "type": "string",
            "enum": [
              "start",
              "manage"
            ]
          },
          "redirectUrl": {
            "type": "string",
            "maxLength": 2000,
            "format": "uri"
          },
          "sandboxScenario": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "requirements": {
            "default": [],
            "maxItems": 3,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionRequirement"
            }
          },
          "addressPolicy": {
            "$ref": "#/components/schemas/AddressPolicy"
          },
          "fundsPolicy": {
            "$ref": "#/components/schemas/FundsPolicy"
          },
          "reuseIdentity": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "externalUserId",
          "appId"
        ]
      },
      "CreatePartnerSessionResponse": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clientToken": {
            "type": "string"
          },
          "clientTokenExpiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/SessionStatus"
          },
          "apiBaseUrl": {
            "type": "string",
            "format": "uri"
          },
          "resumed": {
            "type": "boolean"
          },
          "verificationUrl": {
            "type": "string",
            "format": "uri"
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "sequence": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "sessionId",
          "clientToken",
          "clientTokenExpiresAt",
          "status",
          "apiBaseUrl",
          "resumed",
          "verificationUrl",
          "createdAt",
          "sequence"
        ]
      },
      "ErasePartnerUserResponse": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "images",
                "chip_files",
                "video",
                "personal_data",
                "address",
                "address_documents",
                "financial_data",
                "funds_documents"
              ]
            }
          },
          "retained": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "dedup_keys",
                    "decision_records",
                    "sanctions_screening_records",
                    "audit_log"
                  ]
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "fraud_prevention",
                    "legal_obligation"
                  ]
                },
                "until": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "format": "int64"
                }
              },
              "required": [
                "category",
                "reason",
                "until"
              ]
            }
          },
          "backupsPurgedWithinDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "deleted",
          "retained",
          "backupsPurgedWithinDays"
        ]
      },
      "PartnerEventsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookPayload"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ]
      },
      "PartnerFraudReportRequest": {
        "type": "object",
        "properties": {
          "status": {
            "default": "confirmed_fraud",
            "$ref": "#/components/schemas/FraudLabelStatus"
          },
          "category": {
            "$ref": "#/components/schemas/FraudCategory"
          },
          "note": {
            "type": "string",
            "maxLength": 1000
          }
        }
      },
      "PartnerFraudReport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/FraudLabelStatus"
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FraudCategory"
              },
              {
                "type": "null"
              }
            ]
          },
          "noteKept": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "id",
          "sessionId",
          "status",
          "category",
          "noteKept",
          "createdAt"
        ]
      },
      "PartnerIdentity": {
        "type": "object",
        "properties": {
          "identityId": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "sequence": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/IdentityStatus"
          },
          "revokeReason": {
            "type": "string"
          },
          "level": {
            "$ref": "#/components/schemas/VerificationLevel"
          },
          "verifiedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "validUntil": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "ageOver18": {
            "type": "boolean"
          },
          "captureMethod": {
            "$ref": "#/components/schemas/CaptureMethod"
          },
          "documentKind": {
            "$ref": "#/components/schemas/DocumentKind"
          },
          "documentIssuingCountry": {
            "type": "string"
          },
          "nationality": {
            "type": "string"
          },
          "residenceCountry": {
            "type": "string"
          },
          "residenceRegion": {
            "type": "string"
          },
          "birthYear": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "fullName": {
            "type": "string"
          },
          "dateOfBirth": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/PartnerAddressResult"
          },
          "funds": {
            "$ref": "#/components/schemas/PartnerFundsResult"
          }
        },
        "required": [
          "identityId",
          "revision",
          "sequence",
          "createdAt",
          "status",
          "level",
          "verifiedAt",
          "validUntil",
          "ageOver18",
          "captureMethod"
        ]
      },
      "PartnerScope": {
        "type": "string",
        "enum": [
          "eligibility",
          "country",
          "birth_year",
          "duplicate_link",
          "identity_data",
          "address",
          "financial_data"
        ]
      },
      "PartnerSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "externalUserId": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "sequence": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/SessionStatus"
          },
          "level": {
            "$ref": "#/components/schemas/VerificationLevel"
          },
          "reasonCodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReasonCode"
            }
          },
          "manualReview": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "submittedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              {
                "type": "null"
              }
            ]
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              {
                "type": "null"
              }
            ]
          },
          "identity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerIdentity"
              },
              {
                "type": "null"
              }
            ]
          },
          "duplicateOfExternalUserId": {
            "type": "string"
          },
          "requirements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionRequirement"
            }
          },
          "reusesIdentity": {
            "type": "boolean"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerAddressResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "funds": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerFundsResult"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "externalUserId",
          "revision",
          "sequence",
          "status",
          "level",
          "reasonCodes",
          "manualReview",
          "createdAt",
          "submittedAt",
          "decidedAt",
          "identity",
          "requirements",
          "reusesIdentity",
          "address",
          "funds"
        ]
      },
      "PartnerUserResponse": {
        "type": "object",
        "properties": {
          "externalUserId": {
            "type": "string"
          },
          "identity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerIdentity"
              },
              {
                "type": "null"
              }
            ]
          },
          "latestSession": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerSession"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "externalUserId",
          "identity",
          "latestSession"
        ]
      },
      "WebhookEventType": {
        "type": "string",
        "enum": [
          "session.processing",
          "session.review",
          "session.approved",
          "session.rejected",
          "session.resubmit",
          "session.expired",
          "session.cancelled",
          "identity.updated",
          "identity.suspended",
          "identity.reinstated",
          "identity.expired",
          "identity.revoked"
        ]
      },
      "WebhookPayload": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "v": {
                "type": "number",
                "const": 1
              },
              "eventId": {
                "type": "string"
              },
              "type": {
                "$ref": "#/components/schemas/WebhookEventType"
              },
              "createdAt": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "object": {
                "type": "string",
                "const": "session"
              },
              "session": {
                "$ref": "#/components/schemas/PartnerSession"
              }
            },
            "required": [
              "v",
              "eventId",
              "type",
              "createdAt",
              "object",
              "session"
            ]
          },
          {
            "type": "object",
            "properties": {
              "v": {
                "type": "number",
                "const": 1
              },
              "eventId": {
                "type": "string"
              },
              "type": {
                "$ref": "#/components/schemas/WebhookEventType"
              },
              "createdAt": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "object": {
                "type": "string",
                "const": "identity"
              },
              "externalUserId": {
                "type": "string"
              },
              "identity": {
                "$ref": "#/components/schemas/PartnerIdentity"
              }
            },
            "required": [
              "v",
              "eventId",
              "type",
              "createdAt",
              "object",
              "externalUserId",
              "identity"
            ]
          }
        ]
      },
      "AttestationChallengeResponse": {
        "type": "object",
        "properties": {
          "nonce": {
            "type": "string"
          },
          "expiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "nonce",
          "expiresAt"
        ]
      },
      "AttestationFailureRequest": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string",
            "enum": [
              "android",
              "ios"
            ]
          },
          "nonce": {
            "type": "string"
          },
          "failure": {
            "type": "string",
            "enum": [
              "unsupported",
              "attestation_failed"
            ]
          }
        },
        "required": [
          "platform",
          "nonce",
          "failure"
        ]
      },
      "AttestationRequest": {
        "anyOf": [
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "const": "android"
                  },
                  "nonce": {
                    "type": "string"
                  },
                  "integrityToken": {
                    "type": "string",
                    "minLength": 16,
                    "maxLength": 16000
                  }
                },
                "required": [
                  "platform",
                  "nonce",
                  "integrityToken"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "const": "ios"
                  },
                  "nonce": {
                    "type": "string"
                  },
                  "keyId": {
                    "type": "string",
                    "minLength": 16,
                    "maxLength": 256
                  },
                  "attestationObject": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 42672,
                    "pattern": "^[A-Za-z0-9+/]+={0,2}$"
                  }
                },
                "required": [
                  "platform",
                  "nonce",
                  "keyId",
                  "attestationObject"
                ]
              }
            ]
          },
          {
            "$ref": "#/components/schemas/AttestationFailureRequest"
          }
        ]
      },
      "AttestationResponse": {
        "type": "object",
        "properties": {
          "result": {
            "type": "string",
            "enum": [
              "passed",
              "failed",
              "error"
            ]
          }
        },
        "required": [
          "result"
        ]
      },
      "CameraTrackIssue": {
        "type": "string",
        "enum": [
          "label_missing",
          "facing_mismatch",
          "no_facing_on_mobile",
          "odd_frame_rate",
          "resolution_mismatch",
          "settings_unavailable"
        ]
      },
      "CaptureVideoMeta": {
        "type": "object",
        "properties": {
          "startedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "stillTakenAtOffsetMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "width": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "height": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "mirrored": {
            "type": "boolean"
          },
          "container": {
            "type": "string",
            "enum": [
              "mp4",
              "webm"
            ]
          },
          "platform": {
            "type": "string",
            "enum": [
              "android",
              "ios",
              "web"
            ]
          },
          "segmentBoundariesMs": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991,
              "format": "int64"
            }
          },
          "clientSignals": {
            "$ref": "#/components/schemas/ClientSignals"
          }
        },
        "required": [
          "startedAt",
          "stillTakenAtOffsetMs",
          "width",
          "height",
          "mirrored",
          "container",
          "platform"
        ]
      },
      "ChipChallengeResponse": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "challenge": {
            "type": "string"
          },
          "expiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "challengeId",
          "challenge",
          "expiresAt"
        ]
      },
      "ChipUploadRequest": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "accessMethod": {
            "type": "string",
            "enum": [
              "pace",
              "bac"
            ]
          },
          "com": {
            "type": "string",
            "minLength": 4,
            "maxLength": 5340,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "sod": {
            "type": "string",
            "minLength": 4,
            "maxLength": 85340,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "dg1": {
            "type": "string",
            "minLength": 4,
            "maxLength": 5340,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "dg2": {
            "type": "string",
            "minLength": 4,
            "maxLength": 213340,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "dg11": {
            "type": "string",
            "minLength": 4,
            "maxLength": 10672,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "dg12": {
            "type": "string",
            "minLength": 4,
            "maxLength": 10672,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "dg14": {
            "type": "string",
            "minLength": 4,
            "maxLength": 21340,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "dg15": {
            "type": "string",
            "minLength": 4,
            "maxLength": 5340,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "cardAccess": {
            "type": "string",
            "minLength": 4,
            "maxLength": 5340,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "activeAuthSignature": {
            "type": "string",
            "minLength": 4,
            "maxLength": 1372,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "chipAuthenticationPerformed": {
            "type": "boolean"
          },
          "platform": {
            "type": "string",
            "enum": [
              "android",
              "ios"
            ]
          },
          "captureProof": {
            "$ref": "#/components/schemas/CaptureProof"
          }
        },
        "required": [
          "challengeId",
          "accessMethod",
          "sod",
          "dg1",
          "dg2",
          "platform"
        ]
      },
      "ClientSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/SessionStatus"
          },
          "level": {
            "$ref": "#/components/schemas/VerificationLevel"
          },
          "requiredSteps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionStep"
            }
          },
          "completedSteps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionStep"
            }
          },
          "consent": {
            "$ref": "#/components/schemas/ConsentInfo"
          },
          "biometricConsent": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "document": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "method": {
                    "$ref": "#/components/schemas/CaptureMethod"
                  },
                  "kind": {
                    "$ref": "#/components/schemas/DocumentKind"
                  },
                  "issuingCountry": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "method",
                  "kind",
                  "issuingCountry"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "reasonCodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReasonCode"
            }
          },
          "canRequestReview": {
            "type": "boolean"
          },
          "allowedCaptureMethods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaptureMethod"
            }
          },
          "documentRules": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "coverNationalNumber": {
                  "type": "boolean"
                },
                "acceptBackSide": {
                  "type": "boolean"
                }
              },
              "required": [
                "coverNationalNumber",
                "acceptBackSide"
              ]
            }
          },
          "expiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "redirectUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "messageOrigin": {
            "type": [
              "string",
              "null"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "requirements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionRequirement"
            }
          },
          "reusesIdentity": {
            "type": "boolean"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientAddressState"
              },
              {
                "type": "null"
              }
            ]
          },
          "funds": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientFundsState"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "revision",
          "status",
          "level",
          "requiredSteps",
          "completedSteps",
          "consent",
          "biometricConsent",
          "document",
          "reasonCodes",
          "canRequestReview",
          "allowedCaptureMethods",
          "documentRules",
          "expiresAt",
          "redirectUrl",
          "messageOrigin",
          "livemode",
          "requirements",
          "reusesIdentity",
          "address",
          "funds"
        ]
      },
      "ClientSignals": {
        "type": "object",
        "properties": {
          "virtualCamera": {
            "type": "boolean"
          },
          "cameraLabelMatch": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z0-9_]{1,40}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "trackIssues": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraTrackIssue"
            }
          }
        },
        "required": [
          "virtualCamera",
          "cameraLabelMatch",
          "trackIssues"
        ]
      },
      "ConsentInfo": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "noticeUrl": {
            "type": "string",
            "format": "uri"
          },
          "biometricPolicyUrl": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "version",
          "noticeUrl",
          "biometricPolicyUrl"
        ]
      },
      "ConsentRequest": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "locale": {
            "type": "string",
            "minLength": 2,
            "maxLength": 35
          },
          "biometricConsent": {
            "type": "boolean"
          },
          "ageConfirmed": {
            "type": "boolean",
            "const": true
          },
          "channel": {
            "default": "sdk",
            "type": "string",
            "enum": [
              "sdk",
              "web"
            ]
          },
          "deviceId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
          }
        },
        "required": [
          "version",
          "locale",
          "biometricConsent",
          "ageConfirmed"
        ]
      },
      "DeclarationsRequest": {
        "type": "object",
        "properties": {
          "isPoliticallyExposed": {
            "type": "boolean"
          },
          "actingOnOwnBehalf": {
            "type": "boolean"
          }
        },
        "required": [
          "isPoliticallyExposed",
          "actingOnOwnBehalf"
        ]
      },
      "DocumentAcceptedResponse": {
        "type": "object",
        "properties": {
          "accepted": {
            "type": "boolean",
            "const": true
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "method": {
            "$ref": "#/components/schemas/CaptureMethod"
          },
          "documentKind": {
            "$ref": "#/components/schemas/DocumentKind"
          },
          "issuingCountry": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "accepted",
          "revision",
          "method",
          "documentKind",
          "issuingCountry"
        ]
      },
      "DocumentPhotosFields": {
        "type": "object",
        "properties": {
          "documentKind": {
            "$ref": "#/components/schemas/DocumentKind"
          },
          "issuingCountry": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "documentSubtype": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,40}$"
          }
        },
        "required": [
          "documentKind",
          "issuingCountry"
        ]
      },
      "LivenessChallengeResponse": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "prompts": {
            "minItems": 3,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "move": {
                  "$ref": "#/components/schemas/LivenessMove"
                },
                "atMs": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "format": "int64"
                },
                "windowMs": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "format": "int64"
                }
              },
              "required": [
                "move",
                "atMs",
                "windowMs"
              ]
            }
          },
          "totalDurationMs": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "video": {
            "type": "object",
            "properties": {
              "maxEdgePx": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "maxBytes": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "container": {
                "type": "string",
                "enum": [
                  "mp4",
                  "webm"
                ]
              }
            },
            "required": [
              "maxEdgePx",
              "maxBytes",
              "container"
            ]
          },
          "expiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "challengeId",
          "prompts",
          "totalDurationMs",
          "video",
          "expiresAt"
        ]
      },
      "LivenessMove": {
        "type": "string",
        "enum": [
          "turn_left",
          "turn_right",
          "nod_up",
          "nod_down"
        ]
      },
      "LivenessUploadMeta": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "challengeStartOffsetMs": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "recordingStartedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "promptsShownAt": {
            "minItems": 3,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "format": "int64"
            }
          },
          "camera": {
            "type": "object",
            "properties": {
              "width": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "height": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "fps": {
                "type": "number"
              },
              "mirrored": {
                "type": "boolean"
              }
            },
            "required": [
              "width",
              "height",
              "fps",
              "mirrored"
            ]
          },
          "platform": {
            "type": "string",
            "enum": [
              "android",
              "ios",
              "web"
            ]
          },
          "clientSignals": {
            "$ref": "#/components/schemas/ClientSignals"
          },
          "cannotMove": {
            "type": "boolean"
          }
        },
        "required": [
          "challengeId",
          "recordingStartedAt",
          "promptsShownAt",
          "camera",
          "platform"
        ]
      },
      "LivenessUploadResponse": {
        "type": "object",
        "properties": {
          "accepted": {
            "type": "boolean",
            "const": true
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "accepted",
          "revision"
        ]
      },
      "MrzAccessKey": {
        "type": "object",
        "properties": {
          "documentNumber": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "dateOfBirth": {
            "$ref": "#/components/schemas/IsoDate"
          },
          "dateOfExpiry": {
            "$ref": "#/components/schemas/IsoDate"
          }
        },
        "required": [
          "documentNumber",
          "dateOfBirth",
          "dateOfExpiry"
        ]
      },
      "MrzScanResponse": {
        "type": "object",
        "properties": {
          "found": {
            "type": "boolean"
          },
          "mrz": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "TD1",
                      "TD2",
                      "TD3"
                    ]
                  },
                  "documentKind": {
                    "$ref": "#/components/schemas/DocumentKind"
                  },
                  "issuingCountry": {
                    "type": "string"
                  },
                  "documentNumber": {
                    "type": "string"
                  },
                  "dateOfBirth": {
                    "type": "string",
                    "pattern": "^\\d{6}$"
                  },
                  "dateOfExpiry": {
                    "type": "string",
                    "pattern": "^\\d{6}$"
                  },
                  "checkDigitsValid": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "documentKind",
                  "issuingCountry",
                  "documentNumber",
                  "dateOfBirth",
                  "dateOfExpiry",
                  "checkDigitsValid"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "found",
          "mrz"
        ]
      },
      "ProfileRequest": {
        "type": "object",
        "properties": {
          "residenceCountry": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "residenceRegion": {
            "type": "string",
            "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
          },
          "address": {
            "type": "object",
            "properties": {
              "line1": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "line2": {
                "type": "string",
                "maxLength": 200
              },
              "city": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "region": {
                "type": "string",
                "maxLength": 100
              },
              "postalCode": {
                "type": "string",
                "maxLength": 20
              },
              "country": {
                "$ref": "#/components/schemas/CountryCode"
              }
            },
            "required": [
              "line1",
              "city",
              "country"
            ]
          }
        },
        "required": [
          "residenceCountry"
        ]
      },
      "ReviewRequest": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "maxLength": 1000
          }
        }
      },
      "SubmitRequest": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "revision"
        ]
      },
      "WithdrawResponse": {
        "type": "object",
        "properties": {
          "withdrawn": {
            "type": "boolean",
            "const": true
          },
          "offboxPending": {
            "type": "boolean"
          }
        },
        "required": [
          "withdrawn"
        ]
      },
      "AddressConfirmRequest": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "address": {
            "$ref": "#/components/schemas/PostalAddress"
          }
        },
        "required": [
          "uploadId",
          "address"
        ]
      },
      "AddressDocumentType": {
        "type": "string",
        "enum": [
          "utility_bill",
          "telecom_bill",
          "bank_statement",
          "tax_document",
          "government_letter",
          "residence_certificate",
          "insurance_document",
          "rental_agreement",
          "id_document",
          "other"
        ]
      },
      "AddressEvidenceLevel": {
        "type": "string",
        "enum": [
          "high",
          "medium",
          "low",
          "none"
        ]
      },
      "AddressMethod": {
        "type": "string",
        "enum": [
          "wallet",
          "id_document",
          "signed_pdf",
          "official_code",
          "document_review",
          "declared"
        ]
      },
      "AddressPolicy": {
        "type": "object",
        "properties": {
          "maxAgeDays": {
            "default": 90,
            "type": "integer",
            "minimum": 1,
            "maximum": 366,
            "format": "int64"
          },
          "acceptedTypes": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressDocumentType"
            }
          },
          "signedOnly": {
            "default": false,
            "type": "boolean"
          }
        }
      },
      "AddressUploadHint": {
        "type": "string",
        "enum": [
          "unreadable",
          "too_old",
          "type_not_accepted",
          "name_not_found",
          "country_differs",
          "signature_invalid",
          "reader_unavailable"
        ]
      },
      "AddressUploadMeta": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "camera",
              "file"
            ]
          },
          "documentType": {
            "$ref": "#/components/schemas/AddressDocumentType"
          },
          "timeZone": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[A-Za-z_]+(?:\\/[A-Za-z0-9_+-]+){0,2}$"
          }
        },
        "required": [
          "source"
        ]
      },
      "AddressUploadResponse": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string"
          },
          "signature": {
            "type": "string",
            "enum": [
              "none",
              "valid",
              "untrusted",
              "invalid"
            ]
          },
          "documentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddressDocumentType"
              },
              {
                "type": "null"
              }
            ]
          },
          "documentDate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IsoDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "prefill": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PostalAddress"
              },
              {
                "type": "null"
              }
            ]
          },
          "hints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressUploadHint"
            }
          }
        },
        "required": [
          "uploadId",
          "signature",
          "documentType",
          "documentDate",
          "prefill",
          "hints"
        ]
      },
      "ClientAddressState": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "object",
            "properties": {
              "maxAgeDays": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "acceptedTypes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AddressDocumentType"
                }
              },
              "signedOnly": {
                "type": "boolean"
              }
            },
            "required": [
              "maxAgeDays",
              "acceptedTypes",
              "signedOnly"
            ]
          },
          "coveredBy": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "wallet",
                  "id_document"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "residenceCountry": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CountryCode"
              },
              {
                "type": "null"
              }
            ]
          },
          "pending": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddressUploadResponse"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "policy",
          "coveredBy",
          "residenceCountry",
          "pending"
        ]
      },
      "PartnerAddressResult": {
        "type": "object",
        "properties": {
          "verified": {
            "type": "boolean"
          },
          "method": {
            "$ref": "#/components/schemas/AddressMethod"
          },
          "evidenceLevel": {
            "$ref": "#/components/schemas/AddressEvidenceLevel"
          },
          "documentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddressDocumentType"
              },
              {
                "type": "null"
              }
            ]
          },
          "documentDate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IsoDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "verifiedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "address": {
            "$ref": "#/components/schemas/PostalAddress"
          }
        },
        "required": [
          "verified",
          "method",
          "evidenceLevel",
          "documentType",
          "documentDate",
          "verifiedAt",
          "country"
        ]
      },
      "PostalAddress": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "line2": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "type": "string",
            "maxLength": 100
          },
          "region": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "$ref": "#/components/schemas/CountryCode"
          }
        },
        "required": [
          "line1",
          "city",
          "country"
        ]
      },
      "SessionRequirement": {
        "type": "string",
        "enum": [
          "address",
          "source_of_funds",
          "source_of_wealth"
        ]
      },
      "CaptureChallengeRequest": {
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string",
            "enum": [
              "key",
              "upload"
            ]
          }
        },
        "required": [
          "purpose"
        ]
      },
      "CaptureChallengeResponse": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "key",
              "upload"
            ]
          },
          "version": {
            "type": "number",
            "const": 1
          },
          "issuedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "expiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "challengeId",
          "nonce",
          "purpose",
          "version",
          "issuedAt",
          "expiresAt"
        ]
      },
      "CaptureKeyRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "platform": {
                "type": "string",
                "const": "android"
              },
              "challengeId": {
                "type": "string"
              },
              "certificateChain": {
                "minItems": 2,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 4,
                  "maxLength": 10672,
                  "pattern": "^[A-Za-z0-9+/]+={0,2}$"
                }
              },
              "integrityToken": {
                "type": "string",
                "minLength": 16,
                "maxLength": 16000
              },
              "integrityFailure": {
                "type": "string",
                "enum": [
                  "unsupported",
                  "attestation_failed"
                ]
              }
            },
            "required": [
              "platform",
              "challengeId",
              "certificateChain"
            ]
          },
          {
            "type": "object",
            "properties": {
              "platform": {
                "type": "string",
                "const": "ios"
              },
              "challengeId": {
                "type": "string"
              },
              "keyId": {
                "type": "string",
                "minLength": 16,
                "maxLength": 256
              },
              "attestationObject": {
                "type": "string",
                "minLength": 4,
                "maxLength": 42672,
                "pattern": "^[A-Za-z0-9+/]+={0,2}$"
              },
              "assertion": {
                "type": "string",
                "minLength": 4,
                "maxLength": 5340,
                "pattern": "^[A-Za-z0-9+/]+={0,2}$"
              }
            },
            "required": [
              "platform",
              "challengeId",
              "keyId"
            ]
          }
        ]
      },
      "CaptureKeyResponse": {
        "type": "object",
        "properties": {
          "keyRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "result": {
            "type": "string",
            "enum": [
              "passed",
              "review",
              "failed",
              "unknown_key"
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "keyRef",
          "result",
          "expiresAt"
        ]
      },
      "CaptureManifest": {
        "type": "object",
        "properties": {
          "v": {
            "type": "number",
            "const": 1
          },
          "domain": {
            "type": "string",
            "const": "zoi-id/capture/v1"
          },
          "sessionId": {
            "type": "string"
          },
          "upload": {
            "type": "string",
            "enum": [
              "photos",
              "mrz",
              "chip",
              "liveness"
            ]
          },
          "challengeId": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          },
          "keyRef": {
            "type": "string"
          },
          "platform": {
            "type": "string",
            "enum": [
              "android",
              "ios"
            ]
          },
          "signedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "files": {
            "minItems": 1,
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "part": {
                  "type": "string"
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "size": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "format": "int64"
                },
                "chain": {
                  "type": "object",
                  "properties": {
                    "chunkBytes": {
                      "type": "number",
                      "const": 1048576
                    },
                    "chunks": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991,
                      "format": "int64"
                    },
                    "head": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    }
                  },
                  "required": [
                    "chunkBytes",
                    "chunks",
                    "head"
                  ]
                }
              },
              "required": [
                "part",
                "sha256",
                "size"
              ]
            }
          }
        },
        "required": [
          "v",
          "domain",
          "sessionId",
          "upload",
          "challengeId",
          "nonce",
          "keyRef",
          "platform",
          "signedAt",
          "files"
        ]
      },
      "CaptureProof": {
        "type": "object",
        "properties": {
          "v": {
            "type": "number",
            "const": 1
          },
          "keyRef": {
            "type": "string",
            "pattern": "^cpk_[0-9a-f]{32}$"
          },
          "manifest": {
            "type": "string",
            "minLength": 4,
            "maxLength": 16388,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          },
          "signature": {
            "type": "string",
            "minLength": 4,
            "maxLength": 5468,
            "pattern": "^[A-Za-z0-9+/]+={0,2}$"
          }
        },
        "required": [
          "v",
          "keyRef",
          "manifest",
          "signature"
        ]
      },
      "ClientFundsState": {
        "type": "object",
        "properties": {
          "kinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsRequirement"
            }
          },
          "policy": {
            "$ref": "#/components/schemas/FundsPolicyView"
          },
          "answers": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FundsAnswers"
              },
              {
                "type": "null"
              }
            ]
          },
          "prefill": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FundsAnswersRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsUploadResponse"
            }
          }
        },
        "required": [
          "kinds",
          "policy",
          "answers",
          "prefill",
          "documents"
        ]
      },
      "EmploymentStatus": {
        "type": "string",
        "enum": [
          "employed",
          "self_employed",
          "business_owner",
          "retired",
          "student",
          "unemployed",
          "homemaker",
          "other"
        ]
      },
      "FundsAnswersRequest": {
        "type": "object",
        "properties": {
          "employmentStatus": {
            "$ref": "#/components/schemas/EmploymentStatus"
          },
          "occupation": {
            "type": "string",
            "minLength": 2,
            "maxLength": 100
          },
          "employer": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "income": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8,
            "format": "int64"
          },
          "sources": {
            "minItems": 1,
            "maxItems": 9,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsSource"
            }
          },
          "otherSource": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "volume": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8,
            "format": "int64"
          },
          "wealth": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8,
            "format": "int64"
          },
          "wealthSources": {
            "minItems": 1,
            "maxItems": 9,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsSource"
            }
          }
        }
      },
      "FundsAnswers": {
        "type": "object",
        "properties": {
          "employmentStatus": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmploymentStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "occupation": {
            "type": [
              "string",
              "null"
            ]
          },
          "employer": {
            "type": [
              "string",
              "null"
            ]
          },
          "income": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FundsRange"
              },
              {
                "type": "null"
              }
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsSource"
            }
          },
          "otherSource": {
            "type": [
              "string",
              "null"
            ]
          },
          "volume": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FundsRange"
              },
              {
                "type": "null"
              }
            ]
          },
          "wealth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FundsRange"
              },
              {
                "type": "null"
              }
            ]
          },
          "wealthSources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsSource"
            }
          }
        },
        "required": [
          "employmentStatus",
          "occupation",
          "employer",
          "income",
          "sources",
          "otherSource",
          "volume",
          "wealth",
          "wealthSources"
        ]
      },
      "FundsDocumentType": {
        "type": "string",
        "enum": [
          "payslip",
          "employment_letter",
          "tax_return",
          "bank_statement",
          "investment_statement",
          "crypto_statement",
          "sale_document",
          "inheritance_document",
          "company_document",
          "pension_statement",
          "other"
        ]
      },
      "FundsEvidenceLevel": {
        "type": "string",
        "enum": [
          "high",
          "medium",
          "low",
          "none"
        ]
      },
      "FundsEvidence": {
        "type": "string",
        "enum": [
          "none",
          "optional",
          "required"
        ]
      },
      "FundsPolicy": {
        "type": "object",
        "properties": {
          "questions": {
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsQuestion"
            }
          },
          "evidence": {
            "default": "none",
            "$ref": "#/components/schemas/FundsEvidence"
          },
          "acceptedTypes": {
            "minItems": 1,
            "maxItems": 11,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsDocumentType"
            }
          },
          "maxAgeDays": {
            "default": 180,
            "type": "integer",
            "minimum": 1,
            "maximum": 1095,
            "format": "int64"
          },
          "currency": {
            "default": "USD",
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "brackets": {
            "type": "object",
            "properties": {
              "income": {
                "minItems": 2,
                "maxItems": 8,
                "type": "array",
                "items": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 10000000000000
                }
              },
              "volume": {
                "minItems": 2,
                "maxItems": 8,
                "type": "array",
                "items": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 10000000000000
                }
              },
              "wealth": {
                "minItems": 2,
                "maxItems": 8,
                "type": "array",
                "items": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 10000000000000
                }
              }
            },
            "additionalProperties": false
          }
        }
      },
      "FundsPolicyView": {
        "type": "object",
        "properties": {
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsQuestion"
            }
          },
          "evidence": {
            "$ref": "#/components/schemas/FundsEvidence"
          },
          "acceptedTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsDocumentType"
            }
          },
          "maxAgeDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "currency": {
            "type": "string"
          },
          "maxDocuments": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "ranges": {
            "type": "object",
            "properties": {
              "income": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FundsRange"
                }
              },
              "volume": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FundsRange"
                }
              },
              "wealth": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FundsRange"
                }
              }
            },
            "required": [
              "income",
              "volume",
              "wealth"
            ]
          }
        },
        "required": [
          "questions",
          "evidence",
          "acceptedTypes",
          "maxAgeDays",
          "currency",
          "maxDocuments",
          "ranges"
        ]
      },
      "FundsQuestion": {
        "type": "string",
        "enum": [
          "employment",
          "income",
          "sources",
          "volume",
          "wealth"
        ]
      },
      "FundsRange": {
        "type": "object",
        "properties": {
          "min": {
            "type": "number",
            "minimum": 0
          },
          "max": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "min",
          "max",
          "currency"
        ]
      },
      "FundsRemoveRequest": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": [
          "uploadId"
        ]
      },
      "FundsRequirement": {
        "type": "string",
        "enum": [
          "source_of_funds",
          "source_of_wealth"
        ]
      },
      "FundsSource": {
        "type": "string",
        "enum": [
          "salary",
          "business",
          "savings",
          "sale_of_assets",
          "inheritance",
          "investment",
          "crypto",
          "pension",
          "other"
        ]
      },
      "FundsUploadHint": {
        "type": "string",
        "enum": [
          "unreadable",
          "too_old",
          "type_not_accepted",
          "name_not_found",
          "employer_not_found",
          "signature_invalid",
          "reader_unavailable"
        ]
      },
      "FundsUploadMeta": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "camera",
              "file"
            ]
          },
          "documentType": {
            "$ref": "#/components/schemas/FundsDocumentType"
          }
        },
        "required": [
          "source"
        ]
      },
      "FundsUploadResponse": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string"
          },
          "signature": {
            "type": "string",
            "enum": [
              "none",
              "valid",
              "untrusted",
              "invalid"
            ]
          },
          "documentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FundsDocumentType"
              },
              {
                "type": "null"
              }
            ]
          },
          "documentDate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IsoDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "hints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsUploadHint"
            }
          }
        },
        "required": [
          "uploadId",
          "signature",
          "documentType",
          "documentDate",
          "hints"
        ]
      },
      "PartnerFundsDocument": {
        "type": "object",
        "properties": {
          "documentType": {
            "$ref": "#/components/schemas/FundsDocumentType"
          },
          "documentDate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IsoDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "issuerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "signature": {
            "type": "string",
            "enum": [
              "none",
              "valid",
              "untrusted",
              "invalid"
            ]
          },
          "signedByKnownIssuer": {
            "type": "boolean"
          },
          "nameMatch": {
            "type": "string",
            "enum": [
              "match",
              "partial",
              "mismatch",
              "missing"
            ]
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reviewed": {
            "type": "boolean"
          }
        },
        "required": [
          "documentType",
          "documentDate",
          "issuerName",
          "amount",
          "currency",
          "signature",
          "signedByKnownIssuer",
          "nameMatch",
          "findings",
          "reviewed"
        ]
      },
      "PartnerFundsResult": {
        "type": "object",
        "properties": {
          "kinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundsRequirement"
            }
          },
          "evidenceLevel": {
            "$ref": "#/components/schemas/FundsEvidenceLevel"
          },
          "reviewed": {
            "type": "boolean"
          },
          "documentCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "verifiedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "answers": {
            "$ref": "#/components/schemas/FundsAnswers"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerFundsDocument"
            }
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "kinds",
          "evidenceLevel",
          "reviewed",
          "documentCount",
          "verifiedAt"
        ]
      },
      "CreateUploadRequest": {
        "type": "object",
        "properties": {
          "purpose": {
            "$ref": "#/components/schemas/UploadPurpose"
          },
          "part": {
            "$ref": "#/components/schemas/UploadPart"
          },
          "contentType": {
            "type": "string",
            "enum": [
              "video/mp4",
              "video/webm",
              "image/jpeg",
              "image/png"
            ]
          },
          "size": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 20971520,
            "format": "int64"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "challengeId": {
            "type": "string",
            "maxLength": 100
          },
          "captureChallengeId": {
            "type": "string",
            "maxLength": 100
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._:-]{8,200}$"
          }
        },
        "required": [
          "purpose",
          "part",
          "contentType",
          "size",
          "sha256"
        ]
      },
      "DeleteUploadResponse": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "deleted"
        ]
      },
      "UploadPart": {
        "type": "string",
        "enum": [
          "front",
          "back",
          "frontVideo",
          "backVideo",
          "image",
          "video"
        ]
      },
      "UploadPurpose": {
        "type": "string",
        "enum": [
          "photos",
          "mrz",
          "liveness"
        ]
      },
      "UploadRefs": {
        "type": "object",
        "propertyNames": {
          "$ref": "#/components/schemas/UploadPart"
        },
        "additionalProperties": {
          "type": "string",
          "pattern": "^upl_[0-9a-f]{32}$"
        }
      },
      "UploadState": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "pattern": "^upl_[0-9a-f]{32}$"
          },
          "purpose": {
            "$ref": "#/components/schemas/UploadPurpose"
          },
          "part": {
            "$ref": "#/components/schemas/UploadPart"
          },
          "size": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "complete": {
            "type": "boolean"
          },
          "chunkBytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "maxChunkBytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "expiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          }
        },
        "required": [
          "uploadId",
          "purpose",
          "part",
          "size",
          "offset",
          "complete",
          "chunkBytes",
          "maxChunkBytes",
          "expiresAt"
        ]
      },
      "WalletDigitalRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "protocol": {
                "type": "string",
                "const": "openid4vp-v1-signed"
              },
              "data": {
                "type": "object",
                "properties": {
                  "request": {
                    "type": "string",
                    "minLength": 16
                  }
                },
                "required": [
                  "request"
                ]
              }
            },
            "required": [
              "protocol",
              "data"
            ]
          },
          {
            "type": "object",
            "properties": {
              "protocol": {
                "type": "string",
                "const": "org-iso-mdoc"
              },
              "data": {
                "type": "object",
                "properties": {
                  "deviceRequest": {
                    "type": "string"
                  },
                  "encryptionInfo": {
                    "type": "string"
                  }
                },
                "required": [
                  "deviceRequest",
                  "encryptionInfo"
                ]
              }
            },
            "required": [
              "protocol",
              "data"
            ]
          }
        ]
      },
      "WalletProtocol": {
        "type": "string",
        "enum": [
          "openid4vp",
          "openid4vp-v1-signed",
          "org-iso-mdoc"
        ]
      },
      "WalletRequestResponse": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          },
          "expiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "requests": {
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletDigitalRequest"
            }
          }
        },
        "required": [
          "requestId",
          "nonce",
          "expiresAt",
          "requests"
        ]
      },
      "WalletRequest": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "origin": {
            "type": "string",
            "minLength": 8,
            "maxLength": 512
          },
          "requestPortrait": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "revision",
          "origin"
        ]
      },
      "WalletResponse": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "protocol": {
            "$ref": "#/components/schemas/WalletProtocol"
          },
          "data": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "response": {
                    "type": "string",
                    "minLength": 16,
                    "maxLength": 2800000
                  }
                },
                "required": [
                  "response"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "encryptedResponse": {
                    "type": "string",
                    "minLength": 16,
                    "maxLength": 2800000
                  }
                },
                "required": [
                  "encryptedResponse"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "requestId",
          "revision",
          "protocol",
          "data"
        ]
      },
      "WalletResult": {
        "type": "object",
        "properties": {
          "accepted": {
            "type": "boolean",
            "const": true
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "format": "int64"
          },
          "method": {
            "type": "string",
            "const": "wallet"
          },
          "documentKind": {
            "type": "string",
            "enum": [
              "id_card",
              "driving_licence"
            ]
          },
          "issuingCountry": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "portraitAvailable": {
            "type": "boolean"
          },
          "livenessRequired": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "accepted",
          "revision",
          "method",
          "documentKind",
          "issuingCountry",
          "issuer",
          "portraitAvailable",
          "livenessRequired"
        ]
      },
      "SandboxScenarioId": {
        "type": "string",
        "enum": [
          "approve",
          "reject_underage",
          "reject_location",
          "duplicate_identity",
          "resubmit_photo_quality",
          "resubmit_liveness",
          "review",
          "review_sanctions",
          "review_pep",
          "expire",
          "cancel",
          "address_wallet",
          "address_id_document",
          "address_signed_pdf",
          "address_official_code",
          "address_document_review",
          "address_resubmit_too_old",
          "funds_declared",
          "funds_signed_documents",
          "funds_review",
          "funds_more_evidence"
        ]
      },
      "SandboxScenario": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SandboxScenarioId"
          },
          "status": {
            "$ref": "#/components/schemas/SessionStatus"
          },
          "reasonCodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReasonCode"
            }
          },
          "redoSteps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionStep"
            }
          },
          "description": {
            "type": "string"
          },
          "externalUserIdSuffixes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "documentNumber": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "reasonCodes",
          "redoSteps",
          "description",
          "externalUserIdSuffixes",
          "documentNumber"
        ]
      },
      "SandboxScenariosResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SandboxScenario"
            }
          },
          "screeningLists": {
            "type": "object",
            "properties": {
              "sanctions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "pep": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "sanctions",
              "pep"
            ]
          },
          "specimens": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "scenario": {
                  "$ref": "#/components/schemas/SandboxScenarioId"
                },
                "description": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "scenario",
                "description",
                "fileName"
              ]
            }
          }
        },
        "required": [
          "items",
          "screeningLists",
          "specimens"
        ]
      },
      "ClientSandbox": {
        "type": "object",
        "properties": {
          "livemode": {
            "type": "boolean",
            "const": false
          },
          "scenario": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SandboxScenarioId"
              },
              {
                "type": "null"
              }
            ]
          },
          "scenarios": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/SandboxScenarioId"
                },
                "status": {
                  "$ref": "#/components/schemas/SessionStatus"
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "status",
                "description"
              ]
            }
          }
        },
        "required": [
          "livemode",
          "scenario",
          "scenarios"
        ]
      },
      "ClientSimulate": {
        "type": "object",
        "properties": {
          "scenario": {
            "$ref": "#/components/schemas/SandboxScenarioId"
          }
        },
        "required": [
          "scenario"
        ]
      }
    }
  },
  "x-error-status": {
    "bad_request": 400,
    "unauthorized": 401,
    "token_expired": 401,
    "forbidden": 403,
    "not_found": 404,
    "session_closed": 409,
    "step_not_allowed": 409,
    "revision_conflict": 409,
    "idempotency_conflict": 409,
    "challenge_expired": 410,
    "payload_too_large": 413,
    "unsupported_media_type": 415,
    "rate_limited": 429,
    "internal": 500,
    "dependency_unavailable": 503
  }
}
