Skip to main content
GET
http://localhost:3000
/
tag-assignments
# Get all tags for a subject
curl -X GET 'https://api.example.com/tag-assignments?targetType=subject&targetId=subject_jane' \
  -H 'Authorization: Bearer YOUR_TOKEN'

# Get all assignments for a tag
curl -X GET 'https://api.example.com/tag-assignments?tagId=tag_engineering' \
  -H 'Authorization: Bearer YOUR_TOKEN'
[
  {
    "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:01Z"
  }
]

Query Parameters

tagId
string
Filter by tag ID
targetType
string
Filter by target type. One of: resource, subject, role, permission
targetId
string
Filter by target ID
scopeId
string
Filter by scope ID
tagGroupId
string
Filter by tag group ID (returns assignments for all tags in the group)

Response

Returns an array of tag assignment objects.
# Get all tags for a subject
curl -X GET 'https://api.example.com/tag-assignments?targetType=subject&targetId=subject_jane' \
  -H 'Authorization: Bearer YOUR_TOKEN'

# Get all assignments for a tag
curl -X GET 'https://api.example.com/tag-assignments?tagId=tag_engineering' \
  -H 'Authorization: Bearer YOUR_TOKEN'
[
  {
    "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:01Z"
  }
]