Create a device posture rule
client.zeroTrust.devices.posture.create(PostureCreateParams { account_id, name, type, 5 more } params, RequestOptionsoptions?): DevicePostureRule { id, description, expiration, 5 more } | null
POST/accounts/{account_id}/devices/posture
Creates a new device posture rule.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Create a device posture rule
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const devicePostureRule = await client.zeroTrust.devices.posture.create({
account_id: '699d98642c564d2e855e9661899b7252',
name: 'Admin Serial Numbers',
type: 'file',
});
console.log(devicePostureRule.id);{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
"description": "The rule for admin serial numbers",
"expiration": "1h",
"input": {
"operating_system": "linux",
"path": "/bin/cat",
"exists": true,
"sha256": "https://api.us-2.crowdstrike.com",
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e"
},
"match": [
{
"platform": "windows"
}
],
"name": "Admin Serial Numbers",
"schedule": "1h",
"type": "file"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
"description": "The rule for admin serial numbers",
"expiration": "1h",
"input": {
"operating_system": "linux",
"path": "/bin/cat",
"exists": true,
"sha256": "https://api.us-2.crowdstrike.com",
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e"
},
"match": [
{
"platform": "windows"
}
],
"name": "Admin Serial Numbers",
"schedule": "1h",
"type": "file"
},
"success": true
}