Agent Groups

Apply an atomic add/remove membership batch

Apply a mixed set of add + remove operations across multiple agents and multiple groups in a single call, all-or-nothing. The whole batch executes inside one database transaction: if any id is invalid, inaccessible, or belongs to a foreign org, the entire batch is rejected and nothing is applied. Membership is a set — an add of an existing member and a remove of a non-member are idempotent no-ops (reported via the *_noop_count fields), so re-sending an identical batch changes nothing and returns 200. Duplicate operations within one request are deduped; the same (agent, group) pair appearing as both an add and a remove is contradictory and rejected. At most 50 operations per request.

put/agents/groups:batch

Request

  • Base URL: https://api.mnemom.ai/v1
  • URL: https://api.mnemom.ai/v1/agents/groups:batch
  • Auth: one of:
    • HTTP bearer
    • API key in header X-Mnemom-Api-Key

Request body

org_idstring required

Organization that owns the targeted groups and agents

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.

addedstring[] required

Agent ids that were newly added (real changes only)

removedstring[] required

Agent ids that were actually removed (real changes only)

added_countinteger required
removed_countinteger required
add_noop_countinteger required

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

remove_noop_countinteger required

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

ops_appliedinteger required

Distinct operations applied after dedupe

ops_receivedinteger required

Raw operation count as submitted (before dedupe)

Changes

No recorded changes to this operation across all 1 revision of this API.