{
  "openapi": "3.1.0",
  "info": {
    "title": "Blaaiz Platform API - Show Customer KYB Document",
    "version": "1.0.0",
    "description": "Retrieve a single KYB document on a business-type customer. The `url` field is a 2-minute presigned download link."
  },
  "tags": [
    {
      "name": "Customer"
    }
  ],
  "servers": [
    {
      "url": "https://api-prod.blaaiz.com"
    },
    {
      "url": "https://api-dev.blaaiz.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "oauth2ClientCredentials": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oauth/token",
            "scopes": {
              "customer:read": "Read customers."
            }
          }
        }
      }
    }
  },
  "paths": {
    "/api/external/customer/{customer}/document/{document}": {
      "get": {
        "summary": "Show a customer KYB document",
        "description": "Retrieves a single KYB document by ID. The customer must be of type `business` and the document must belong to the supplied customer. Required scope: `customer:read`.",
        "tags": [
          "Customer"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "customer:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document detail.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Document retrieved successfully",
                  "data": {
                    "id": "019a6e10-1fb3-7b2f-8f8b-ad1e92c4017a",
                    "business_customer_id": "019a6da3-4a9a-7033-81b9-12489eff13ee",
                    "type": "CERTIFICATE_OF_INCORPORATION",
                    "name": "Acme Inc — Certificate of Incorporation.pdf",
                    "extension": "pdf",
                    "description": "Filed 2019-03-12, Companies House",
                    "status": "APPROVED",
                    "admin_comments": null,
                    "url": "https://s3.amazonaws.com/...?X-Amz-Signature=...",
                    "created_at": "2026-04-20T10:14:31.000000Z",
                    "updated_at": "2026-04-22T08:01:12.000000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Customer or document not found, or the document does not belong to this customer."
          }
        }
      }
    }
  }
}