---
title: Cloud Workload Security
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

[Zero Trust](https://developers.cloudflare.com/api/python/resources/zero_trust)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Cloud Workload Security

#### Cloud Workload SecurityBasic Auth Credentials

##### [List basic-auth credentials for an account](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/basic_auth_credentials/methods/list)

zero\_trust.cws.basic\_auth\_credentials.list(BasicAuthCredentialListParams\*\*kwargs) -> SyncCursorPagination\[[BasicAuthCredential](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/basic-auth-credentials

##### [Get a basic-auth credential by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/basic_auth_credentials/methods/get)

zero\_trust.cws.basic\_auth\_credentials.get(strcredential\_id, BasicAuthCredentialGetParams\*\*kwargs) -> [BasicAuthCredential](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/basic-auth-credentials/{credential\_id}

##### [Create a basic-auth credential](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/basic_auth_credentials/methods/create)

zero\_trust.cws.basic\_auth\_credentials.create(BasicAuthCredentialCreateParams\*\*kwargs) -> [BasicAuthCredential](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/basic-auth-credentials

##### [Delete a basic-auth credential](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/basic_auth_credentials/methods/delete)

zero\_trust.cws.basic\_auth\_credentials.delete(strcredential\_id, BasicAuthCredentialDeleteParams\*\*kwargs) -> [BasicAuthCredentialDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/basic-auth-credentials/{credential\_id}

##### ModelsExpand Collapse

<details>

<summary>

class BasicAuthCredential: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

username: str

Login presented by the client. Printable ASCII only, excluding space and colon (RFC 7617 forbids a colon in the user-id).

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential%20%3E%20(schema)%20%3E%20(property)%20username">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential%20%3E%20(schema)>)

<details>

<summary>

class BasicAuthCredentialDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.basic_auth_credentials%20%3E%20(model)%20basic_auth_credential_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityBasic Auth CredentialsSecrets

##### [List secrets for a basic-auth credential](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/basic_auth_credentials/subresources/secrets/methods/list)

zero\_trust.cws.basic\_auth\_credentials.secrets.list(strcredential\_id, SecretListParams\*\*kwargs) -> SyncCursorPagination\[[BasicAuthSecret](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20basic_auth_secret%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/basic-auth-credentials/{credential\_id}/secrets

##### [Get a basic-auth secret by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/basic_auth_credentials/subresources/secrets/methods/get)

zero\_trust.cws.basic\_auth\_credentials.secrets.get(strsecret\_id, SecretGetParams\*\*kwargs) -> [BasicAuthSecret](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20basic_auth_secret%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/basic-auth-credentials/{credential\_id}/secrets/{secret\_id}

##### [Add a secret to a basic-auth credential](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/basic_auth_credentials/subresources/secrets/methods/create)

zero\_trust.cws.basic\_auth\_credentials.secrets.create(strcredential\_id, SecretCreateParams\*\*kwargs) -> [BasicAuthSecret](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20basic_auth_secret%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/basic-auth-credentials/{credential\_id}/secrets

##### [Delete a basic-auth secret](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/basic_auth_credentials/subresources/secrets/methods/delete)

zero\_trust.cws.basic\_auth\_credentials.secrets.delete(strsecret\_id, SecretDeleteParams\*\*kwargs) -> [SecretDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20secret_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/basic-auth-credentials/{credential\_id}/secrets/{secret\_id}

##### ModelsExpand Collapse

<details>

<summary>

class BasicAuthSecret: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20basic_auth_secret%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20basic_auth_secret%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

expires\_at: Optional\[datetime]

Optional RFC 3339 expiration time. Omit for no expiration.

formatdate-time

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20basic_auth_secret%20%3E%20(schema)%20%3E%20(property)%20expires_at">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20basic_auth_secret%20%3E%20(schema)>)

<details>

<summary>

class SecretDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20secret_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.basic_auth_credentials.secrets%20%3E%20(model)%20secret_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityDeployments

##### [List deployments](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/deployments/methods/list)

zero\_trust.cws.deployments.list(DeploymentListParams\*\*kwargs) -> SyncCursorPagination\[[Deployment](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/deployments

##### [Get a deployment by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/deployments/methods/get)

zero\_trust.cws.deployments.get(strdeployment\_id, DeploymentGetParams\*\*kwargs) -> [Deployment](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/deployments/{deployment\_id}

##### [Create a new deployment](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/deployments/methods/create)

zero\_trust.cws.deployments.create(DeploymentCreateParams\*\*kwargs) -> [Deployment](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/deployments

##### [Update a deployment](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/deployments/methods/update)

zero\_trust.cws.deployments.update(strdeployment\_id, DeploymentUpdateParams\*\*kwargs) -> [Deployment](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/deployments/{deployment\_id}

##### [Delete a deployment](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/deployments/methods/delete)

zero\_trust.cws.deployments.delete(strdeployment\_id, DeploymentDeleteParams\*\*kwargs) -> [DeploymentDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/deployments/{deployment\_id}

##### ModelsExpand Collapse

<details>

<summary>

class Deployment: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

basic\_auth\_credential\_ids: Optional\[List\[str]]

IDs of basic-auth credentials attached to this deployment

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20basic_auth_credential_ids">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

<details>

<summary>

default\_mode: Literal\["ALLOW", "BLOCK"]

Default traffic decision when no policy set matches

</summary>

One of the following:

"ALLOW"

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20default_mode%20%3E%20(member)%200">Link to this property</a>

"BLOCK"

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20default_mode%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20default_mode">Link to this property</a>

name: str

Human-readable name; unique per account

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

on\_error\_action: Literal\["BLOCK", "SKIP"]

Action applied when an enforcing policy has a runtime Rego error

</summary>

One of the following:

"BLOCK"

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20on_error_action%20%3E%20(member)%200">Link to this property</a>

"SKIP"

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20on_error_action%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20on_error_action">Link to this property</a>

policy\_set\_ids: Optional\[List\[str]]

IDs of policy sets attached to this deployment

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20policy_set_ids">Link to this property</a>

rego\_raise\_error: bool

Whether OPA builtin failures are raised as runtime evaluation errors

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20rego_raise_error">Link to this property</a>

tags: Dict\[str, str]

Tags attached to this deployment

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20tags">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

description: Optional\[str]

Optional free-form description.

maxLength1024

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

domain\_acl\_id: Optional\[str]

ID of the attached domain ACL. Omitted when none.

formatuuid

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20domain_acl_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)>)

<details>

<summary>

class DeploymentDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.deployments%20%3E%20(model)%20deployment_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityDomain ACLs

##### [List domain ACLs](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/domain_acls/methods/list)

zero\_trust.cws.domain\_acls.list(DomainACLListParams\*\*kwargs) -> SyncCursorPagination\[[DomainACL](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/domain-acls

##### [Get a domain ACL by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/domain_acls/methods/get)

zero\_trust.cws.domain\_acls.get(strdomain\_acl\_id, DomainACLGetParams\*\*kwargs) -> [DomainACL](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/domain-acls/{domain\_acl\_id}

##### [Create a new domain ACL](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/domain_acls/methods/create)

zero\_trust.cws.domain\_acls.create(DomainACLCreateParams\*\*kwargs) -> [DomainACL](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/domain-acls

##### [Update a domain ACL and replace its entries](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/domain_acls/methods/update)

zero\_trust.cws.domain\_acls.update(strdomain\_acl\_id, DomainACLUpdateParams\*\*kwargs) -> [DomainACL](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/domain-acls/{domain\_acl\_id}

##### [Delete a domain ACL](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/domain_acls/methods/delete)

zero\_trust.cws.domain\_acls.delete(strdomain\_acl\_id, DomainACLDeleteParams\*\*kwargs) -> [DomainACLDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/domain-acls/{domain\_acl\_id}

##### ModelsExpand Collapse

<details>

<summary>

class DomainACL: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

<details>

<summary>

default\_action: Literal\["ALLOW", "BLOCK"]

Action applied when no entry matches the request domain

</summary>

One of the following:

"ALLOW"

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20default_action%20%3E%20(member)%200">Link to this property</a>

"BLOCK"

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20default_action%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20default_action">Link to this property</a>

<details>

<summary>

entries: Optional\[List\[Entry]]

Per-domain action overrides. Each domain appears at most once.

</summary>

<details>

<summary>

action: Literal\["ALLOW", "BLOCK"]

Per-domain decision overriding the parent ACL’s default\_action

</summary>

One of the following:

"ALLOW"

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20entries%20%3E%20(items)%20%3E%20(property)%20action%20%3E%20(member)%200">Link to this property</a>

"BLOCK"

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20entries%20%3E%20(items)%20%3E%20(property)%20action%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20entries%20%3E%20(items)%20%3E%20(property)%20action">Link to this property</a>

domain: str

Hostname or domain pattern, capped at 255 UTF-8 bytes

maxLength255

minLength1

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20entries%20%3E%20(items)%20%3E%20(property)%20domain">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20entries">Link to this property</a>

name: str

Human-readable name; unique per account

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl%20%3E%20(schema)>)

<details>

<summary>

class DomainACLDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.domain_acls%20%3E%20(model)%20domain_acl_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityPolicies

##### [List policies](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policies/methods/list)

zero\_trust.cws.policies.list(PolicyListParams\*\*kwargs) -> SyncCursorPagination\[[Policy](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/policies

##### [Get a policy by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policies/methods/get)

zero\_trust.cws.policies.get(strpolicy\_id, PolicyGetParams\*\*kwargs) -> [Policy](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/policies/{policy\_id}

##### [Create a new policy](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policies/methods/create)

zero\_trust.cws.policies.create(PolicyCreateParams\*\*kwargs) -> [Policy](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/policies

##### [Update a policy](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policies/methods/update)

zero\_trust.cws.policies.update(strpolicy\_id, PolicyUpdateParams\*\*kwargs) -> [Policy](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/policies/{policy\_id}

##### [Delete a policy](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policies/methods/delete)

zero\_trust.cws.policies.delete(strpolicy\_id, PolicyDeleteParams\*\*kwargs) -> [PolicyDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/policies/{policy\_id}

##### ModelsExpand Collapse

<details>

<summary>

class Policy: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

entrypoint: str

Non-function rule declared in rego\_source. Evaluation uses data.&lt;package\_path&gt;..

maxLength255

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20entrypoint">Link to this property</a>

filter: str

Filter expression that determines whether this policy applies. Maximum 4096 UTF-8 bytes.

maxLength4096

minLength1

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20filter">Link to this property</a>

name: str

Human-readable name; unique per account

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

package\_path: str

Dotted path derived from rego\_source. Begins with policy. and is unique per account.

maxLength1024

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20package_path">Link to this property</a>

rego\_source: str

Inline Rego source with a package beginning with “policy.” Maximum 16384 UTF-8 bytes.

maxLength16384

minLength1

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20rego_source">Link to this property</a>

tags: Dict\[str, str]

Tags attached to this policy

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20tags">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

description: Optional\[str]

Optional free-form description.

maxLength1024

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy%20%3E%20(schema)>)

<details>

<summary>

class PolicyDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.policies%20%3E%20(model)%20policy_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityPolicy Sets

##### [List policy sets](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policy_sets/methods/list)

zero\_trust.cws.policy\_sets.list(PolicySetListParams\*\*kwargs) -> SyncCursorPagination\[[PolicySet](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/policy-sets

##### [Get a policy set by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policy_sets/methods/get)

zero\_trust.cws.policy\_sets.get(strpolicy\_set\_id, PolicySetGetParams\*\*kwargs) -> [PolicySet](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/policy-sets/{policy\_set\_id}

##### [Create a new policy set](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policy_sets/methods/create)

zero\_trust.cws.policy\_sets.create(PolicySetCreateParams\*\*kwargs) -> [PolicySet](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/policy-sets

##### [Update a policy set](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policy_sets/methods/update)

zero\_trust.cws.policy\_sets.update(strpolicy\_set\_id, PolicySetUpdateParams\*\*kwargs) -> [PolicySet](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/policy-sets/{policy\_set\_id}

##### [Delete a policy set](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/policy_sets/methods/delete)

zero\_trust.cws.policy\_sets.delete(strpolicy\_set\_id, PolicySetDeleteParams\*\*kwargs) -> [PolicySetDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/policy-sets/{policy\_set\_id}

##### ModelsExpand Collapse

<details>

<summary>

class PolicySet: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

exclude\_workload\_ids: Optional\[List\[str]]

IDs of workloads that exclude matching requests. Exclusions take precedence.

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20exclude_workload_ids">Link to this property</a>

include\_workload\_ids: Optional\[List\[str]]

IDs of workloads that include matching requests. Empty includes all requests before exclusions.

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20include_workload_ids">Link to this property</a>

name: str

Human-readable name; unique per account

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

policies: Optional\[List\[Policy]]

Member policies and their per-membership enforcement mode

</summary>

enforce: bool

Whether this policy should enforce when it matches. False keeps the policy attached for non-enforcing evaluation.

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20policies%20%3E%20(items)%20%3E%20(property)%20enforce">Link to this property</a>

policy\_id: str

ID of the member policy

formatuuid

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20policies%20%3E%20(items)%20%3E%20(property)%20policy_id">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20policies">Link to this property</a>

tags: Dict\[str, str]

Tags attached to this policy set

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20tags">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

description: Optional\[str]

Optional free-form description.

maxLength1024

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set%20%3E%20(schema)>)

<details>

<summary>

class PolicySetDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.policy_sets%20%3E%20(model)%20policy_set_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityRego Metadata

##### [List Rego metadata documents](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_metadata/methods/list)

zero\_trust.cws.rego\_metadata.list(RegoMetadataListParams\*\*kwargs) -> SyncCursorPagination\[[RegoMetadata](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/rego-metadata

##### [Get a rego metadata document by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_metadata/methods/get)

zero\_trust.cws.rego\_metadata.get(strrego\_metadata\_id, RegoMetadataGetParams\*\*kwargs) -> [RegoMetadata](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/rego-metadata/{rego\_metadata\_id}

##### [Create a new rego metadata document](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_metadata/methods/create)

zero\_trust.cws.rego\_metadata.create(RegoMetadataCreateParams\*\*kwargs) -> [RegoMetadata](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/rego-metadata

##### [Update a rego metadata document](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_metadata/methods/update)

zero\_trust.cws.rego\_metadata.update(strrego\_metadata\_id, RegoMetadataUpdateParams\*\*kwargs) -> [RegoMetadata](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/rego-metadata/{rego\_metadata\_id}

##### [Delete a rego metadata document](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_metadata/methods/delete)

zero\_trust.cws.rego\_metadata.delete(strrego\_metadata\_id, RegoMetadataDeleteParams\*\*kwargs) -> [RegoMetadataDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/rego-metadata/{rego\_metadata\_id}

##### ModelsExpand Collapse

<details>

<summary>

class RegoMetadata: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

data: object

<a href="#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)%20%3E%20(property)%20data">Link to this property</a>

import\_path: str

Unique Rego import path in the form metadata., with one alphanumeric or underscore segment. Reference it as data.&lt;import\_path&gt;.

maxLength255

minLength1

<a href="#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)%20%3E%20(property)%20import_path">Link to this property</a>

name: str

Human-readable name; unique per account

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata%20%3E%20(schema)>)

<details>

<summary>

class RegoMetadataDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.rego_metadata%20%3E%20(model)%20rego_metadata_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityRego Modules

##### [List Rego modules](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_modules/methods/list)

zero\_trust.cws.rego\_modules.list(RegoModuleListParams\*\*kwargs) -> SyncCursorPagination\[[RegoModule](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/rego-modules

##### [Get a Rego module by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_modules/methods/get)

zero\_trust.cws.rego\_modules.get(strrego\_module\_id, RegoModuleGetParams\*\*kwargs) -> [RegoModule](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/rego-modules/{rego\_module\_id}

##### [Create a new Rego module](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_modules/methods/create)

zero\_trust.cws.rego\_modules.create(RegoModuleCreateParams\*\*kwargs) -> [RegoModule](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/rego-modules

##### [Update a Rego module](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_modules/methods/update)

zero\_trust.cws.rego\_modules.update(strrego\_module\_id, RegoModuleUpdateParams\*\*kwargs) -> [RegoModule](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/rego-modules/{rego\_module\_id}

##### [Delete a Rego module](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/rego_modules/methods/delete)

zero\_trust.cws.rego\_modules.delete(strrego\_module\_id, RegoModuleDeleteParams\*\*kwargs) -> [RegoModuleDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/rego-modules/{rego\_module\_id}

##### ModelsExpand Collapse

<details>

<summary>

class RegoModule: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

name: str

Human-readable name; unique per account

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

package\_path: str

Dotted path derived from rego\_source. Begins with lib. and is unique per account.

maxLength1024

<a href="#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)%20%3E%20(property)%20package_path">Link to this property</a>

rego\_source: str

Library Rego source with a package beginning with “lib.” Maximum 16384 UTF-8 bytes.

maxLength16384

minLength1

<a href="#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)%20%3E%20(property)%20rego_source">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module%20%3E%20(schema)>)

<details>

<summary>

class RegoModuleDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.rego_modules%20%3E%20(model)%20rego_module_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityTenant Structures

##### [List tenant structures for an account](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/methods/list)

zero\_trust.cws.tenant\_structures.list(TenantStructureListParams\*\*kwargs) -> SyncCursorPagination\[[TenantStructure](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/tenant-structures

##### [Get a tenant structure by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/methods/get)

zero\_trust.cws.tenant\_structures.get(strstructure\_id, TenantStructureGetParams\*\*kwargs) -> [TenantStructure](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/tenant-structures/{structure\_id}

##### [Create a tenant structure](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/methods/create)

zero\_trust.cws.tenant\_structures.create(TenantStructureCreateParams\*\*kwargs) -> [TenantStructure](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/tenant-structures

##### [Update a tenant structure](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/methods/update)

zero\_trust.cws.tenant\_structures.update(strstructure\_id, TenantStructureUpdateParams\*\*kwargs) -> [TenantStructure](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/tenant-structures/{structure\_id}

##### [Delete a tenant structure](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/methods/delete)

zero\_trust.cws.tenant\_structures.delete(strstructure\_id, TenantStructureDeleteParams\*\*kwargs) -> [TenantStructureDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/tenant-structures/{structure\_id}

##### ModelsExpand Collapse

<details>

<summary>

class TenantStructure: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

application: Literal\["aws", "cloudflare"]

Platform this structure models. Immutable after creation; determines valid node kinds and identifier formats.

</summary>

One of the following:

"aws"

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)%20%3E%20(property)%20application%20%3E%20(member)%200">Link to this property</a>

"cloudflare"

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)%20%3E%20(property)%20application%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)%20%3E%20(property)%20application">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

name: str

Human-readable name; unique per account

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

import\_path: Optional\[str]

Optional unique Rego mount path in the form tenant... The application segment must match application; omitted when unmounted.

maxLength255

minLength1

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)%20%3E%20(property)%20import_path">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure%20%3E%20(schema)>)

<details>

<summary>

class TenantStructureDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.tenant_structures%20%3E%20(model)%20tenant_structure_delete_response%20%3E%20(schema)>)

#### Cloud Workload SecurityTenant StructuresNodes

##### [List nodes for a tenant structure](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/subresources/nodes/methods/list)

zero\_trust.cws.tenant\_structures.nodes.list(strstructure\_id, NodeListParams\*\*kwargs) -> SyncCursorPagination\[[TenantStructureNode](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/tenant-structures/{structure\_id}/nodes

##### [Get a tenant node by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/subresources/nodes/methods/get)

zero\_trust.cws.tenant\_structures.nodes.get(strnode\_id, NodeGetParams\*\*kwargs) -> [TenantStructureNode](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/tenant-structures/{structure\_id}/nodes/{node\_id}

##### [Add a node to a tenant structure](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/subresources/nodes/methods/create)

zero\_trust.cws.tenant\_structures.nodes.create(strstructure\_id, NodeCreateParams\*\*kwargs) -> [TenantStructureNode](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/tenant-structures/{structure\_id}/nodes

##### [Update a tenant node](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/subresources/nodes/methods/update)

zero\_trust.cws.tenant\_structures.nodes.update(strnode\_id, NodeUpdateParams\*\*kwargs) -> [TenantStructureNode](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/tenant-structures/{structure\_id}/nodes/{node\_id}

##### [Delete a tenant node](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/subresources/nodes/methods/delete)

zero\_trust.cws.tenant\_structures.nodes.delete(strnode\_id, NodeDeleteParams\*\*kwargs) -> [NodeDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/tenant-structures/{structure\_id}/nodes/{node\_id}

##### [Apply a batch of tenant node mutations](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/tenant_structures/subresources/nodes/methods/batch)

zero\_trust.cws.tenant\_structures.nodes.batch(strstructure\_id, NodeBatchParams\*\*kwargs) -> [NodeBatchResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_batch_response%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/tenant-structures/{structure\_id}/nodes/batch

##### ModelsExpand Collapse

<details>

<summary>

class TenantStructureNode: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

native\_id: str

Cloud-native identifier of this node, unique within the structure; the parent-reference target. Shape depends on the structure’s application. Immutable after create.

maxLength255

minLength1

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20native_id">Link to this property</a>

node\_kind: str

Position in the tree. Legal values depend on the structure’s application (aws: root/ou/account; cloudflare: org/account/zone). At most one root per structure. Immutable after create.

maxLength64

minLength1

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20node_kind">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

name: Optional\[str]

Display name (e.g. an OU or account name), mutable. Optional; empty by default.

maxLength100

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

parent: Optional\[str]

Native ID of this node’s parent. Required for non-root nodes and omitted for the root. The parent must be in the same structure and able to contain this node kind.

maxLength255

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20parent">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)>)

<details>

<summary>

class NodeDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_delete_response%20%3E%20(schema)>)

<details>

<summary>

class NodeBatchResponse: …

</summary>

<details>

<summary>

created: List\[<a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)">TenantStructureNode</a>]

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

native\_id: str

Cloud-native identifier of this node, unique within the structure; the parent-reference target. Shape depends on the structure’s application. Immutable after create.

maxLength255

minLength1

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20native_id">Link to this property</a>

node\_kind: str

Position in the tree. Legal values depend on the structure’s application (aws: root/ou/account; cloudflare: org/account/zone). At most one root per structure. Immutable after create.

maxLength64

minLength1

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20node_kind">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

name: Optional\[str]

Display name (e.g. an OU or account name), mutable. Optional; empty by default.

maxLength100

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

parent: Optional\[str]

Native ID of this node’s parent. Required for non-root nodes and omitted for the root. The parent must be in the same structure and able to contain this node kind.

maxLength255

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20parent">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_batch_response%20%3E%20(schema)%20%3E%20(property)%20created">Link to this property</a>

<details>

<summary>

deleted: List\[Deleted]

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_batch_response%20%3E%20(schema)%20%3E%20(property)%20deleted%20%3E%20(items)%20%3E%20(property)%20id">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_batch_response%20%3E%20(schema)%20%3E%20(property)%20deleted">Link to this property</a>

<details>

<summary>

updated: List\[<a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)">TenantStructureNode</a>]

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

native\_id: str

Cloud-native identifier of this node, unique within the structure; the parent-reference target. Shape depends on the structure’s application. Immutable after create.

maxLength255

minLength1

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20native_id">Link to this property</a>

node\_kind: str

Position in the tree. Legal values depend on the structure’s application (aws: root/ou/account; cloudflare: org/account/zone). At most one root per structure. Immutable after create.

maxLength64

minLength1

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20node_kind">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

name: Optional\[str]

Display name (e.g. an OU or account name), mutable. Optional; empty by default.

maxLength100

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

parent: Optional\[str]

Native ID of this node’s parent. Required for non-root nodes and omitted for the root. The parent must be in the same structure and able to contain this node kind.

maxLength255

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20tenant_structure_node%20%3E%20(schema)%20%3E%20(property)%20parent">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_batch_response%20%3E%20(schema)%20%3E%20(property)%20updated">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.tenant_structures.nodes%20%3E%20(model)%20node_batch_response%20%3E%20(schema)>)

#### Cloud Workload SecurityWorkloads

##### [List workloads](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/workloads/methods/list)

zero\_trust.cws.workloads.list(WorkloadListParams\*\*kwargs) -> SyncCursorPagination\[[Workload](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)>)]

GET/accounts/{account\_id}/cws/workloads

##### [Get a workload by ID](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/workloads/methods/get)

zero\_trust.cws.workloads.get(strworkload\_id, WorkloadGetParams\*\*kwargs) -> [Workload](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)>)

GET/accounts/{account\_id}/cws/workloads/{workload\_id}

##### [Create a new workload](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/workloads/methods/create)

zero\_trust.cws.workloads.create(WorkloadCreateParams\*\*kwargs) -> [Workload](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)>)

POST/accounts/{account\_id}/cws/workloads

##### [Update a workload](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/workloads/methods/update)

zero\_trust.cws.workloads.update(strworkload\_id, WorkloadUpdateParams\*\*kwargs) -> [Workload](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)>)

PUT/accounts/{account\_id}/cws/workloads/{workload\_id}

##### [Delete a workload](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/cws/subresources/workloads/methods/delete)

zero\_trust.cws.workloads.delete(strworkload\_id, WorkloadDeleteParams\*\*kwargs) -> [WorkloadDeleteResponse](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/cws/workloads/{workload\_id}

##### ModelsExpand Collapse

<details>

<summary>

class Workload: …

</summary>

id: str

Server-assigned UUID

formatuuid

<a href="#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

created\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

filter: str

Filter expression selecting the requests this workload matches. Maximum 4096 UTF-8 bytes.

maxLength4096

minLength1

<a href="#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)%20%3E%20(property)%20filter">Link to this property</a>

name: str

Human-readable handle; unique per account.

maxLength100

minLength1

<a href="#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

tags: Dict\[str, str]

Tags attached to this workload

<a href="#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)%20%3E%20(property)%20tags">Link to this property</a>

updated\_at: datetime

formatdate-time

<a href="#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

description: Optional\[str]

Optional free-form description.

maxLength1024

<a href="#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload%20%3E%20(schema)>)

<details>

<summary>

class WorkloadDeleteResponse: …

</summary>

id: str

formatuuid

<a href="#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.cws.workloads%20%3E%20(model)%20workload_delete_response%20%3E%20(schema)>)