# Resource Library # Applications ## List applications `zero_trust.resource_library.applications.list(ApplicationListParams**kwargs) -> SyncSinglePage[ApplicationListResponse]` **get** `/accounts/{account_id}/resource-library/applications` List applications with different filters. ### Parameters - `account_id: str` - `filter: Optional[str]` Filter applications using key:value format. Supported filter keys: - name: Filter by application name (e.g., name:HR) - id: Filter by application ID (e.g., id:0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0) - human_id: Filter by human-readable ID (e.g., human_id:HR) - hostname: Filter by hostname or support domain (e.g., hostname:portal.example.com) - source: Filter by application source name (e.g., source:cloudflare) - ip_subnet: Filter by IP subnet using CIDR containment — returns applications where any stored subnet contains the search value (e.g., ip_subnet:10.0.1.5/32 matches apps with 10.0.0.0/16) - intel_id: Filter by Intel API ID (e.g., intel_id:498). also supports multiple values (e.g., intel_id:498,1001) - category_id: Filter by category ID (e.g., category_id:37f8ec03-8766-49d4-9a15-369b044c842c). - category_name: Filter by category name (e.g., category_name:HR). - supported: Filter by supported Cloudflare product (e.g., supported:ACCESS). Values: GATEWAY, ACCESS, CASB. . - `limit: Optional[int]` Limit of number of results to return (max 250). - `offset: Optional[int]` Offset of results to return. - `order_by: Optional[str]` Order results by field name and direction (e.g., name:asc). Ignored when search is provided; results are ranked by relevance instead. - `search: Optional[str]` Fuzzy search across application name and hostnames. Results are ranked by relevance. Must be between 2 and 200 characters. Can be combined with filter parameters. ### Returns - `class ApplicationListResponse: …` - `id: str` Returns the application ID. - `application_confidence_score: float` Confidence score for the application. Returns -1 when no score is available. - `application_source: str` Returns the application source. - `application_type: str` Returns the application type. - `application_type_description: str` Returns the application type description. - `created_at: str` Returns the application creation time. - `gen_ai_score: float` GenAI score for the application. Returns -1 when no score is available. - `hostnames: List[str]` Returns the list of hostnames for the application. - `human_id: str` Returns the human readable ID. - `ip_subnets: List[str]` Returns the list of IP subnets for the application. - `name: str` Returns the application name. - `port_protocols: List[str]` Returns the list of port protocols for the application. - `support_domains: List[str]` Returns the list of support domains for the application. - `supported: List[Literal["GATEWAY", "ACCESS", "CASB"]]` Cloudflare products that support this application. - `"GATEWAY"` - `"ACCESS"` - `"CASB"` - `updated_at: str` Returns the application update time. - `version: str` Returns the application version. - `application_score_composition: Optional[object]` Returns the score composition breakdown for the application. - `intel_id: Optional[int]` Returns the Intel API ID for the application. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.zero_trust.resource_library.applications.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "12345678-1234-1234-1234-123456789012", "application_confidence_score": 0.92, "application_source": "cloudflare", "application_type": "Human Resources", "application_type_description": "Applications used to manage employees and workforce tools.", "created_at": "2025-01-01T00:00:00Z", "gen_ai_score": 1.5, "hostnames": [ "example.com", "foo.com" ], "human_id": "HR", "ip_subnets": [ "192.168.1.0/24", "10.0.0.0/8" ], "name": "HR", "port_protocols": [ "tcp/80", "tcp/443" ], "support_domains": [ "example.com", "foo.com" ], "supported": [ "GATEWAY", "ACCESS" ], "updated_at": "2025-01-01T00:00:00Z", "version": "2025-01-01T00:00:00Z", "application_score_composition": { "categories": [ { "confidence": 0.95, "name": "Security" } ], "plan": "free" }, "intel_id": 498 } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get application `zero_trust.resource_library.applications.get(strid, ApplicationGetParams**kwargs) -> ApplicationGetResponse` **get** `/accounts/{account_id}/resource-library/applications/{id}` Get application by ID. ### Parameters - `account_id: str` - `id: str` ### Returns - `class ApplicationGetResponse: …` - `id: str` Returns the application ID. - `application_confidence_score: float` Confidence score for the application. Returns -1 when no score is available. - `application_source: str` Returns the application source. - `application_type: str` Returns the application type. - `application_type_description: str` Returns the application type description. - `created_at: str` Returns the application creation time. - `gen_ai_score: float` GenAI score for the application. Returns -1 when no score is available. - `hostnames: List[str]` Returns the list of hostnames for the application. - `human_id: str` Returns the human readable ID. - `ip_subnets: List[str]` Returns the list of IP subnets for the application. - `name: str` Returns the application name. - `port_protocols: List[str]` Returns the list of port protocols for the application. - `support_domains: List[str]` Returns the list of support domains for the application. - `supported: List[Literal["GATEWAY", "ACCESS", "CASB"]]` Cloudflare products that support this application. - `"GATEWAY"` - `"ACCESS"` - `"CASB"` - `updated_at: str` Returns the application update time. - `version: str` Returns the application version. - `application_score_composition: Optional[object]` Returns the score composition breakdown for the application. - `intel_id: Optional[int]` Returns the Intel API ID for the application. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) application = client.zero_trust.resource_library.applications.get( id="0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(application.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "12345678-1234-1234-1234-123456789012", "application_confidence_score": 0.92, "application_source": "cloudflare", "application_type": "Human Resources", "application_type_description": "Applications used to manage employees and workforce tools.", "created_at": "2025-01-01T00:00:00Z", "gen_ai_score": 1.5, "hostnames": [ "example.com", "foo.com" ], "human_id": "HR", "ip_subnets": [ "192.168.1.0/24", "10.0.0.0/8" ], "name": "HR", "port_protocols": [ "tcp/80", "tcp/443" ], "support_domains": [ "example.com", "foo.com" ], "supported": [ "GATEWAY", "ACCESS" ], "updated_at": "2025-01-01T00:00:00Z", "version": "2025-01-01T00:00:00Z", "application_score_composition": { "categories": [ { "confidence": 0.95, "name": "Security" } ], "plan": "free" }, "intel_id": 498 } } ``` ## Domain Types ### Application List Response - `class ApplicationListResponse: …` - `id: str` Returns the application ID. - `application_confidence_score: float` Confidence score for the application. Returns -1 when no score is available. - `application_source: str` Returns the application source. - `application_type: str` Returns the application type. - `application_type_description: str` Returns the application type description. - `created_at: str` Returns the application creation time. - `gen_ai_score: float` GenAI score for the application. Returns -1 when no score is available. - `hostnames: List[str]` Returns the list of hostnames for the application. - `human_id: str` Returns the human readable ID. - `ip_subnets: List[str]` Returns the list of IP subnets for the application. - `name: str` Returns the application name. - `port_protocols: List[str]` Returns the list of port protocols for the application. - `support_domains: List[str]` Returns the list of support domains for the application. - `supported: List[Literal["GATEWAY", "ACCESS", "CASB"]]` Cloudflare products that support this application. - `"GATEWAY"` - `"ACCESS"` - `"CASB"` - `updated_at: str` Returns the application update time. - `version: str` Returns the application version. - `application_score_composition: Optional[object]` Returns the score composition breakdown for the application. - `intel_id: Optional[int]` Returns the Intel API ID for the application. ### Application Get Response - `class ApplicationGetResponse: …` - `id: str` Returns the application ID. - `application_confidence_score: float` Confidence score for the application. Returns -1 when no score is available. - `application_source: str` Returns the application source. - `application_type: str` Returns the application type. - `application_type_description: str` Returns the application type description. - `created_at: str` Returns the application creation time. - `gen_ai_score: float` GenAI score for the application. Returns -1 when no score is available. - `hostnames: List[str]` Returns the list of hostnames for the application. - `human_id: str` Returns the human readable ID. - `ip_subnets: List[str]` Returns the list of IP subnets for the application. - `name: str` Returns the application name. - `port_protocols: List[str]` Returns the list of port protocols for the application. - `support_domains: List[str]` Returns the list of support domains for the application. - `supported: List[Literal["GATEWAY", "ACCESS", "CASB"]]` Cloudflare products that support this application. - `"GATEWAY"` - `"ACCESS"` - `"CASB"` - `updated_at: str` Returns the application update time. - `version: str` Returns the application version. - `application_score_composition: Optional[object]` Returns the score composition breakdown for the application. - `intel_id: Optional[int]` Returns the Intel API ID for the application. # Categories ## List application categories `zero_trust.resource_library.categories.list(CategoryListParams**kwargs) -> SyncSinglePage[CategoryListResponse]` **get** `/accounts/{account_id}/resource-library/categories` List application categories. ### Parameters - `account_id: str` - `limit: Optional[int]` Limit of number of results to return. - `offset: Optional[int]` Offset of results to return. ### Returns - `class CategoryListResponse: …` - `id: str` Returns the category ID. - `created_at: str` Returns the category creation time. - `description: str` Returns the category description. - `name: str` Returns the category name. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.zero_trust.resource_library.categories.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "12345678-1234-1234-1234-123456789012", "created_at": "2025-01-01T00:00:00Z", "description": "Category description", "name": "Category name" } ] } ``` ## Get application category `zero_trust.resource_library.categories.get(strid, CategoryGetParams**kwargs) -> CategoryGetResponse` **get** `/accounts/{account_id}/resource-library/categories/{id}` Get application category by ID. ### Parameters - `account_id: str` - `id: str` ### Returns - `class CategoryGetResponse: …` - `id: str` Returns the category ID. - `created_at: str` Returns the category creation time. - `description: str` Returns the category description. - `name: str` Returns the category name. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) category = client.zero_trust.resource_library.categories.get( id="0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(category.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "12345678-1234-1234-1234-123456789012", "created_at": "2025-01-01T00:00:00Z", "description": "Category description", "name": "Category name" } } ``` ## Domain Types ### Category List Response - `class CategoryListResponse: …` - `id: str` Returns the category ID. - `created_at: str` Returns the category creation time. - `description: str` Returns the category description. - `name: str` Returns the category name. ### Category Get Response - `class CategoryGetResponse: …` - `id: str` Returns the category ID. - `created_at: str` Returns the category creation time. - `description: str` Returns the category description. - `name: str` Returns the category name.