Skip to main content
PUT
Apply an atomic add/remove membership batch

Authorizations

Authorization
string
header
required

Supabase JWT token in Authorization: Bearer header

Body

application/json
org_id
string
required

Organization that owns the targeted groups and agents

ops
object[]
required

The add/remove operations to apply atomically

Required array length: 1 - 50 elements

Response

Batch applied atomically. added/removed are the ids that actually CHANGED; the *_noop_count fields count operations that were already in the requested state; ops_applied (post-dedupe) may be less than ops_received (raw count) when duplicate operations were collapsed.

added
string[]
required

Agent ids that were newly added (real changes only)

removed
string[]
required

Agent ids that were actually removed (real changes only)

added_count
integer
required
removed_count
integer
required
add_noop_count
integer
required

Add ops whose agent was already a member (idempotent no-op)

remove_noop_count
integer
required

Remove ops whose agent was already absent (idempotent no-op)

ops_applied
integer
required

Distinct operations applied after dedupe

ops_received
integer
required

Raw operation count as submitted (before dedupe)