---
title: accountPolicy query | Wartiva GraphQL API
description: Retrieves an endpoint's AccountPolicy by its graph object id: the local account password and lockout policy in effect on a Windows or macOS endpoint.
url: https://wartiva.com/api-docs/queries/account-policy.html
updated: 2026-10-07
---

Endpoint configuration · GraphQL query

# `accountPolicy` query

Retrieves an endpoint's [AccountPolicy](https://wartiva.com/api-docs/types/account-policy.html) by its graph object id: the local account password and lockout policy in effect on a Windows or macOS endpoint, including password length, complexity, age and history requirements, and lockout thresholds. Each [Endpoint](https://wartiva.com/api-docs/types/endpoint.html) has at most one, also reachable through its `accountPolicy` field; find them across endpoints with [graphSearch](https://wartiva.com/api-docs/queries/graph-search.html) on the ACCOUNT_POLICY object type. Returns a not-found error when no object has the id, and an error when the id belongs to another object type.

## Response

Returns an [`AccountPolicyPayload!`](https://wartiva.com/api-docs/types/account-policy-payload.html)

## Arguments

| Name | Description |
|---|---|
| `id` - [`ID!`](https://wartiva.com/api-docs/types/id.html) | The AccountPolicy identifier. |
| `mockOptions` - [`MockDataInput`](https://wartiva.com/api-docs/types/mock-data-input.html) | Options for mock data generation. Options supported: key: "PLATFORM", value: OsPlatform example: "mockOptions": { "options": [ { "key": "PLATFORM", "value": "WINDOWS" } ] } |

## Example

### Query

```graphql
query accountPolicy(
  $id: ID!,
  $mockOptions: MockDataInput
) {
  accountPolicy(
    id: $id,
    mockOptions: $mockOptions
  ) {
    node {
      id
      orgId
      seen {
        ...SeenOnlineFragment
      }
      objectType
      objectTypeLabel
      displayName
      firstSeen
      lastSeen
      createdAt
      updatedAt
      snapshotInfo {
        ...GraphObjectSnapshotInfoFragment
      }
      endpoint {
        ...EndpointFragment
      }
      osSpecific {
        ... on AccountPolicyMacOS {
          ...AccountPolicyMacOSFragment
        }
        ... on AccountPolicyWindows {
          ...AccountPolicyWindowsFragment
        }
      }
      findings {
        ...FindingsPayloadFragment
      }
      issues {
        ...IssuesPayloadFragment
      }
      issuesSummary {
        ...IssuesSummaryFragment
      }
    }
  }
}

```

### Variables

```json
{
  "id": "4",
  "mockOptions": MockDataInput
}

```

### Response

```json
{"data": {"accountPolicy": {"node": AccountPolicy}}}

```

---

Wartiva is in early access. Request access: https://wartiva.com/early-access.html  
All pages: https://wartiva.com/llms.txt
