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"
}
]
Tag Assignments
Create Tag Assignments (Batch)
Assign multiple tags to targets in a single request
POST
/
tag-assignments
/
batch
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"
}
]
Request Body
Array of tag assignment objects.Optional client-provided ID
ID of the tag to assign
Type of target. One of:
resource, subject, role, permissionID of the target entity
Scope context for this assignment
Response
Returns an array of created tag assignment objects.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"
}
]
Was this page helpful?
⌘I