Skip to main content
Organization administrators can perform the same governance and identity tasks through the Python SDK that are available under Settings → Organizations. The calling user or service account must be an administrator of the target organization.

Create and update an organization

Manage members

Direct membership and Microsoft Entra group membership are independent access sources. Removing a direct grant does not remove access supplied by a mapped Entra group. Pass create_manual_grant=True only when you intentionally want a direct grant to remain after the person leaves that group.

Read and download audit events

List recent events with cursor pagination:
before must be a timezone-aware datetime. To download every event in a half-open time range—start_at is included and end_at is excluded—use:
The download is streamed to a temporary file and atomically moved to output_path after it succeeds.

Map a Microsoft Entra group

In an Entra-enabled deployment, Docent searches Microsoft Graph using the read-only GroupMember.Read.All and User.ReadBasic.All application permissions approved by the tenant administrator. Mapping by name is convenient, while Docent stores the immutable group object ID:
If no security group has that exact display name, or multiple groups share it, the method raises ValueError without changing the mapping. Call search_entra_groups and then set_entra_group_mapping when you need to select an object ID explicitly. To replace a deleted or renamed group, call either setter again. Replacing the object ID immediately removes access derived from the old mapping and records the transition in the audit log. Members of the replacement group receive access on their next Microsoft sign-in. Direct Docent grants remain intact.
When the tenant has organization group mappings, Docent retrieves the user’s complete transitive security-group IDs from Graph during Microsoft sign-in. If Graph cannot provide the complete list, the sign-in is rejected and existing group access is not incorrectly retained. Tenants without group mappings do not depend on this Graph lookup for sign-in.

Create a service account

API key

Microsoft Entra workload

The enterprise application must have the deployment’s service-account app role.

AWS outbound OIDC workload

The issuer is account-specific and is required for new AWS outbound OIDC bindings. Omitting it creates a legacy signed-request binding. See Authentication for workload setup. Disabling a service account revokes all of its API keys, Entra identity, and AWS identity for subsequent requests: