curl -X POST 'https://api.example.com/tag-assignments/batch' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '[
{
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
},
{
"tagId": "tag_backend",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
},
{
"tagId": "tag_engineering",
"targetType": "resource",
"targetId": "resource_doc_123",
"scopeId": "scope_acme"
}
]'
[
{
"id": "tag_assignment_001",
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
},
{
"id": "tag_assignment_002",
"tagId": "tag_backend",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
},
{
"id": "tag_assignment_003",
"tagId": "tag_engineering",
"targetType": "resource",
"targetId": "resource_doc_123",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
}
]
Assign multiple tags to targets in a single request
curl -X POST 'https://api.example.com/tag-assignments/batch' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '[
{
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
},
{
"tagId": "tag_backend",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
},
{
"tagId": "tag_engineering",
"targetType": "resource",
"targetId": "resource_doc_123",
"scopeId": "scope_acme"
}
]'
[
{
"id": "tag_assignment_001",
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
},
{
"id": "tag_assignment_002",
"tagId": "tag_backend",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
},
{
"id": "tag_assignment_003",
"tagId": "tag_engineering",
"targetType": "resource",
"targetId": "resource_doc_123",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
}
]
resource, subject, role, permissioncurl -X POST 'https://api.example.com/tag-assignments/batch' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '[
{
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
},
{
"tagId": "tag_backend",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme"
},
{
"tagId": "tag_engineering",
"targetType": "resource",
"targetId": "resource_doc_123",
"scopeId": "scope_acme"
}
]'
[
{
"id": "tag_assignment_001",
"tagId": "tag_engineering",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
},
{
"id": "tag_assignment_002",
"tagId": "tag_backend",
"targetType": "subject",
"targetId": "subject_jane",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
},
{
"id": "tag_assignment_003",
"tagId": "tag_engineering",
"targetType": "resource",
"targetId": "resource_doc_123",
"scopeId": "scope_acme",
"appliedBy": "subject_admin",
"appliedAt": "2024-01-15T10:30:00Z"
}
]
Was this page helpful?