The enclave’s trusted timestamp (Unix epoch milliseconds) used to evaluate every policy.
curl --request POST \
--url https://api.turnkey.com/public/v1/query/get_active_policies \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"organizationId": "<string>"
}'
import { Turnkey } from "@turnkey/sdk-server";
const turnkeyClient = new Turnkey({
apiBaseUrl: "https://api.turnkey.com",
apiPublicKey: process.env.API_PUBLIC_KEY!,
apiPrivateKey: process.env.API_PRIVATE_KEY!,
defaultOrganizationId: process.env.ORGANIZATION_ID!,
});
const response = await turnkeyClient.apiClient().getActivePolicies({
organizationId: "<string> (Unique identifier for a given Organization.)"
});
{
"statuses": [
{
"organizationId": "<string>",
"policyId": "<string>",
"active": "<boolean>",
"timeExpr": "<string>",
"error": "<string>"
}
],
"evaluatedAtMs": "<string>"
}
Queries
Get active policies
For each policy in an organization, report whether it is currently active based on the enclave’s trusted timestamp and the policy’s time window (if any). Policies without a time field are always active.
curl --request POST \
--url https://api.turnkey.com/public/v1/query/get_active_policies \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"organizationId": "<string>"
}'
import { Turnkey } from "@turnkey/sdk-server";
const turnkeyClient = new Turnkey({
apiBaseUrl: "https://api.turnkey.com",
apiPublicKey: process.env.API_PUBLIC_KEY!,
apiPrivateKey: process.env.API_PRIVATE_KEY!,
defaultOrganizationId: process.env.ORGANIZATION_ID!,
});
const response = await turnkeyClient.apiClient().getActivePolicies({
organizationId: "<string> (Unique identifier for a given Organization.)"
});
{
"statuses": [
{
"organizationId": "<string>",
"policyId": "<string>",
"active": "<boolean>",
"timeExpr": "<string>",
"error": "<string>"
}
],
"evaluatedAtMs": "<string>"
}
A successful response returns the following fields:
Was this page helpful?