enum<string>
required
Enum options:
ACTIVITY_TYPE_SET_IP_ALLOWLISTstring
required
Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
string
required
Unique identifier for a given Organization.
object
required
The parameters object containing the specific intent data for this activity.
Show details
Show details
array
List of IP allowlist rules with CIDR blocks and optional labels.
Show item details
Show item details
object
required
The activity object containing type, intent, and result
Show activity details
Show activity details
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/set_ip_allowlist \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_SET_IP_ALLOWLIST",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"publicKey": "<string>",
"enabled": "<boolean>",
"rules": [
{
"cidr": "<string>",
"label": "<string>"
}
],
"onEvaluationError": "<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().setIpAllowlist({
publicKey: "<string> (The public component of an API key. If null, the IP allowlist applies at the organization level. If set, it applies only to this specific API key.)",
enabled: true // Whether the IP allowlist is enabled. Only meaningful for organization-level allowlists. Omit for API key-level allowlists.,
rules: [{ // List of IP allowlist rules with CIDR blocks and optional labels.,
cidr: "<string> (CIDR block (e.g., '192.168.1.0/24', '2001:db8::/32').)",
label: "<string> (Optional human-readable label for this rule (e.g., 'Office VPN').)",
}],
onEvaluationError: "<string> (Behavior when an error occurs during IP allowlist evaluation. Valid values: ALLOW, DENY. Defaults to DENY.)"
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_SET_IP_ALLOWLIST",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"setIpAllowlistIntent": {
"publicKey": "<string>",
"enabled": "<boolean>",
"rules": [
{
"cidr": "<string>",
"label": "<string>"
}
],
"onEvaluationError": "<string>"
}
},
"result": {
"setIpAllowlistResult": {}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}