Create a host access rule.
POST
Secret API key operationId: create/v1/os/access-rules Authorization
Server-to-server. Send a secret key as a Bearer token plus the x-application-id header.
Request body · required
effectstring requiredsubject_idstring<uuid> uuidsubject_kindstring requiredtarget_idstring<uuid> uuidtarget_kindstring required
Responses
201 Created
{
"data": {
"created_at": "2026-01-15T09:30:00Z",
"effect": "string",
"id": "018f3c4a-7b2e-7c1d-9e0a-1f2b3c4d5e6f",
"subject_id": "018f3c4a-7b2e-7c1d-9e0a-1f2b3c4d5e6f",
"subject_kind": "string",
"target_id": "018f3c4a-7b2e-7c1d-9e0a-1f2b3c4d5e6f",
"target_kind": "string"
},
"error": {
"code": "string",
"message": "string"
},
"meta": {
"timestamp": "string"
},
"success": false
} 422 Invalid rule
Request
curl -X POST "https://api.identrahq.com/v1/os/access-rules" \
-H "Content-Type: application/json" \
-d '{
"effect": "allow",
"subject_id": "018f3c4a-7b2e-7c1d-9e0a-1f2b3c4d5e6f",
"subject_kind": "user",
"target_id": "018f3c4a-7b2e-7c1d-9e0a-1f2b3c4d5e6f",
"target_kind": "host"
}'Try it
live requestPOST
https://api.identrahq.com/v1/os/access-rules