---
title: "Assign workspace to group."
method: POST
path: "/api/workspaces/groups/assign"
tags: ["WorkspaceGroups"]
---

# Assign workspace to group.

`POST /api/workspaces/groups/assign`

## Request

- Base URL: `https://app.airfocus.com`
- URL: `https://app.airfocus.com/api/workspaces/groups/assign`
- Auth: HTTP bearer

Requirements:<br/>- auth-client scopes: "workspace"<br/>- user permission: "write" or higher

## Query parameters

- `actAsAdmin` boolean

## Request body

- WorkspaceGroupAssignWorkspaceRequest: Payload to assign a workspace to a workspace-group (or move it to the root when no group is provided).
  - `workspaceGroupId` string, uuid: UUID of the target workspace-group. If omitted, the workspace is moved out of any group to the root.
  - `workspaceId` string, uuid, required: UUID of the workspace to assign.

## Response `204`

## Other responses

- `400`: If payload is invalid or resource does not exist.
- `401`: If missing authentication token.
- `403`: If user does not have the required permission, or authenticated client does not have the required access scopes.
- `default`: If any other error happens.

---

[API](https://skmtc.dev/airfocus/apis/airfocus-api.md) · [All operations](https://skmtc.dev/airfocus/apis/airfocus-api/llms.txt) · [OpenAPI document](https://skmtc.dev/airfocus/apis/airfocus-api/revisions/fc9ccaa2ec6d?raw)
