Skip to main content
POST
http://localhost:3000
/
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.
[].id
string
Optional client-provided ID
[].tagId
string
required
ID of the tag to assign
[].targetType
string
required
Type of target. One of: resource, subject, role, permission
[].targetId
string
required
ID of the target entity
[].scopeId
string
required
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"
  }
]