To enable the Compliance API, see the setup guide.
Set up the Compliance API获取组织的 Security posture
Get an organization's security controls and their current results.
Returns the organization's security controls, evaluated at the time of the
request, each with its attestation when this endpoint returns one. The controls come
in one controls list, which is not paginated. A control can have no entry, for
example when it is about a feature that the organization cannot have, so a missing
control is not a pass.
The anthropic-version header is required: a request without it returns 400.
The endpoint takes no query parameters, so there is no filter, and a request with
any query parameter also returns 400. A request also returns 400 when the Compliance
API is not enabled for the API key's parent organization.
The request returns 404 when organization_id names no organization, names one
that the API key cannot read, or names one whose security controls are not
available. A request over a rate limit returns 429.
One error has an error_code in error.details. A 503 with
posture_evaluation_failed means that the evaluation could not be completed.
Wait for the time in the Retry-After header before trying again. A 504 means
that the evaluation did not finish in time, and the request can be tried again.
Path parameters
Headers
Returns
curl https://api.anthropic.com/v1/compliance/organizations/$ORGANIZATION_ID/security_posture \
-H 'anthropic-version: 2023-06-01' \
-H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"{
"comments_status": "not_enabled",
"controls": [
{
"id": "sso_enabled",
"attestation": {
"attested_at": "2025-03-12T18:22:41.123456Z",
"attested_by": {
"type": "user_actor",
"user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu"
},
"comment": null,
"state": "in_force"
},
"current_value": "On",
"desired_state": "On",
"display_name": "Single sign-on (SSO)",
"rating": "passed",
"section": "identity_access",
"setting_name": "sso_enabled",
"status": "passed"
}
],
"evaluated_at": "2025-03-12T18:22:41.123456Z",
"organization_id": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
"type": "security_posture"
}Returns Examples
{
"comments_status": "not_enabled",
"controls": [
{
"id": "sso_enabled",
"attestation": {
"attested_at": "2025-03-12T18:22:41.123456Z",
"attested_by": {
"type": "user_actor",
"user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu"
},
"comment": null,
"state": "in_force"
},
"current_value": "On",
"desired_state": "On",
"display_name": "Single sign-on (SSO)",
"rating": "passed",
"section": "identity_access",
"setting_name": "sso_enabled",
"status": "passed"
}
],
"evaluated_at": "2025-03-12T18:22:41.123456Z",
"organization_id": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
"type": "security_posture"
}