Create a device posture rule
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
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/devices/posture \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"name": "Admin Serial Numbers",
"type": "file",
"description": "The rule for admin serial numbers",
"expiration": "1h",
"input": {
"operating_system": "linux",
"path": "/bin/cat",
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e"
},
"schedule": "1h"
}'{
"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
}