{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canopyservicing-com/json-schema/canopyservicing-com-get-account-response-schema.json",
  "title": "GetAccountResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canopyservicing-com-accounts-api-openapi.yml#/components/schemas/GetAccountResponse",
  "properties": {
    "account_id": {
      "type": "string",
      "title": "Account Id",
      "description": "The account ID."
    },
    "effective_at": {
      "type": "string",
      "title": "Effective At",
      "description": "The effective at date of account creation."
    },
    "external_fields": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "items": {},
          "type": "array"
        }
      ],
      "title": "External Fields",
      "description": "The external fields associated with the account."
    },
    "borrowers": {
      "items": {
        "$ref": "#/$defs/GetBorrowerDetailsResponse"
      },
      "type": "array",
      "title": "Borrowers",
      "description": "The borrowers associated with the account."
    },
    "tags": {
      "items": {
        "$ref": "#/$defs/TagSchema"
      },
      "type": "array",
      "title": "Tags",
      "description": "The tags associated with the account."
    },
    "system_tags": {
      "items": {
        "$ref": "#/$defs/GetSystemTagResponse"
      },
      "type": "array",
      "title": "System Tags",
      "description": "The system tags associated with the account."
    },
    "originating_organization_name": {
      "type": "string",
      "title": "Originating Organization Name",
      "description": "The name of the organization that originated the account."
    },
    "current_owner_organization_name": {
      "type": "string",
      "title": "Current Owner Organization Name",
      "description": "The name of the organization that owns the account."
    }
  },
  "type": "object",
  "required": [
    "account_id",
    "effective_at",
    "external_fields",
    "borrowers",
    "tags",
    "system_tags"
  ],
  "$defs": {
    "GetBorrowerDetailsResponse": {
      "properties": {
        "borrower_id": {
          "type": "string",
          "title": "Borrower Id",
          "description": "The borrower's ID."
        },
        "external_borrower_id": {
          "type": "string",
          "title": "External Borrower Id",
          "description": "The borrower's external ID."
        },
        "is_active": {
          "type": "boolean",
          "title": "Is Active",
          "description": "Field to indicate if the borrower is active."
        },
        "name_first": {
          "type": "string",
          "title": "Name First",
          "description": "Borrower's first name."
        },
        "name_last": {
          "type": "string",
          "title": "Name Last",
          "description": "Borrower's last name."
        },
        "doing_business_as": {
          "type": "string",
          "title": "Doing Business As",
          "description": "The DBA name of the Business."
        },
        "business_legal_name": {
          "type": "string",
          "title": "Business Legal Name",
          "description": "The legal name of the Business."
        }
      },
      "type": "object",
      "required": [
        "borrower_id",
        "external_borrower_id",
        "is_active"
      ],
      "title": "GetBorrowerDetailsResponse"
    },
    "GetSystemTagResponse": {
      "properties": {
        "tag_id": {
          "type": "integer",
          "title": "Tag Id",
          "description": "The ID of the tag"
        },
        "label": {
          "type": "string",
          "title": "Label",
          "description": "The label of the tag"
        },
        "description": {
          "type": "string",
          "title": "Description",
          "description": "The description of the tag"
        },
        "color": {
          "$ref": "#/$defs/TagColor",
          "description": "The color of the tag"
        },
        "category": {
          "$ref": "#/$defs/TagCategory",
          "description": "The category of the tag"
        },
        "active": {
          "type": "boolean",
          "title": "Active",
          "description": "The active status of the tag"
        }
      },
      "type": "object",
      "required": [
        "tag_id",
        "label",
        "description",
        "color",
        "category",
        "active"
      ],
      "title": "GetSystemTagResponse",
      "description": "Response schema for the get system tags endpoint."
    },
    "TagCategory": {
      "type": "string",
      "enum": [
        "COLLATERAL_LIQUIDATION",
        "CREDIT_UTILIZATION",
        "DELINQUENCY_BUCKETS",
        "DISPUTE_STATUS",
        "GRADUATION",
        "MISSED_PAYMENT",
        "PAYMENT_DEFERRAL",
        "PERSISTENT_DEBT",
        "TEST_CATEGORY"
      ],
      "title": "TagCategory"
    },
    "TagColor": {
      "type": "string",
      "enum": [
        "red",
        "orange",
        "yellow",
        "green",
        "blue",
        "purple",
        "pink",
        "sky",
        "teal",
        "gray",
        "black"
      ],
      "title": "TagColor",
      "description": "Enum for the colors of tags."
    },
    "TagSchema": {
      "properties": {
        "tag_id": {
          "type": "integer",
          "title": "Tag Id",
          "description": "The unique identifier of the tag"
        },
        "label": {
          "type": "string",
          "title": "Label",
          "description": "The label of the tag"
        },
        "description": {
          "type": "string",
          "title": "Description",
          "description": "The description of the tag"
        },
        "color": {
          "$ref": "#/$defs/TagColor",
          "description": "The color of the tag"
        },
        "active": {
          "type": "boolean",
          "title": "Active",
          "description": "The active status of the tag"
        }
      },
      "type": "object",
      "required": [
        "label",
        "description",
        "color"
      ],
      "title": "TagSchema",
      "description": "Base response schema for surfacing tag information to the user."
    }
  }
}