---
title: "POST /orgs/save-agent-groups"
method: POST
path: "/orgs/save-agent-groups"
tags: ["orgs"]
---

# POST /orgs/save-agent-groups

`POST /orgs/save-agent-groups`

Updates the agent groups and order of the current user's organization.

## Headers

- `X-Phantombuster-Org` string

## Request body

- object
  - `agentGroups` union[], required — New agent groups. Order of the groups and agents will be kept.
    - union
      - string
      - object
        - `id` string, required
        - `name` string, required
        - `agents` string[], required

## Response `200`

Groups successfully updated.

- object
  - `agentGroups` union[], required
    - union
      - string
      - object
        - `id` string, required
        - `name` string, required
        - `agents` string[], required

## Other responses

- `400` — Invalid agent ids provided.

---

[API](https://skmtc.net/phantombuster/apis/phantombuster-api-v2.md) · [All operations](https://skmtc.net/phantombuster/apis/phantombuster-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phantombuster/phantombuster-api-v2/versions/acf0049d7c7f/schema)
