Skip to content
Start here

Get an Access policy test users page

client.ZeroTrust.Access.Applications.PolicyTests.Users.List(ctx, policyTestID, params) (*V4PagePaginationArray[AccessApplicationPolicyTestUserListResponse], error)
GET/accounts/{account_id}/access/policy-tests/{policy_test_id}/users

Fetches a single page of user results from an Access policy test.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Access: Policy Test WriteAccess: Policy Test Read
ParametersExpand Collapse
policyTestID string

The UUID of the policy test.

maxLength64
params AccessApplicationPolicyTestUserListParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32
Page param.Field[int64]Optional

Query param: Page number of results.

PerPage param.Field[int64]Optional

Query param

Query param: Filter users by their policy evaluation status.

const AccessApplicationPolicyTestUserListParamsStatusSuccess AccessApplicationPolicyTestUserListParamsStatus = "success"
const AccessApplicationPolicyTestUserListParamsStatusFail AccessApplicationPolicyTestUserListParamsStatus = "fail"
const AccessApplicationPolicyTestUserListParamsStatusError AccessApplicationPolicyTestUserListParamsStatus = "error"
ReturnsExpand Collapse
type AccessApplicationPolicyTestUserListResponse struct{…}
ID stringOptional

UUID.

maxLength36
Email stringOptional

The email of the user.

formatemail
Name stringOptional

The name of the user.

Status AccessApplicationPolicyTestUserListResponseStatusOptional

Policy evaluation result for an individual user.

One of the following:
const AccessApplicationPolicyTestUserListResponseStatusApproved AccessApplicationPolicyTestUserListResponseStatus = "approved"
const AccessApplicationPolicyTestUserListResponseStatusBlocked AccessApplicationPolicyTestUserListResponseStatus = "blocked"
const AccessApplicationPolicyTestUserListResponseStatusError AccessApplicationPolicyTestUserListResponseStatus = "error"

Get an Access policy test users page

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/zero_trust"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.ZeroTrust.Access.Applications.PolicyTests.Users.List(
    context.TODO(),
    "f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6",
    zero_trust.AccessApplicationPolicyTestUserListParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
      "email": "jdoe@example.com",
      "name": "Jane Doe",
      "status": "approved"
    }
  ]
}
Returns Examples
{
  "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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
      "email": "jdoe@example.com",
      "name": "Jane Doe",
      "status": "approved"
    }
  ]
}