curl -X POST 'https://api.example.com/tag-assignments' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
}'
{
"id": "tag_assignment_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
}
Assign a tag to a target (resource, subject, etc.)
curl -X POST 'https://api.example.com/tag-assignments' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
}'
{
"id": "tag_assignment_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
}
tag_assignment_{uuidv7}resource, subject, role, permissioncurl -X POST 'https://api.example.com/tag-assignments' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
}'
{
"id": "tag_assignment_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
}
curl -X POST 'https://api.example.com/tag-assignments' \
-d '{
"tagId": "tag_confidential",
"targetType": "resource",
"targetId": "resource_doc_123",
"scopeId": "scope_acme"
}'
curl -X POST 'https://api.example.com/tag-assignments' \
-d '{
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
}'
Was this page helpful?