---
title: "Bulk Assign Role"
method: POST
path: "/internal/migration/companies/{company_id}/bulk-assign-role"
tags: ["internal"]
---

# Bulk Assign Role

`POST /internal/migration/companies/{company_id}/bulk-assign-role`

## Request

- Base URL: `https://api.kobaltlabs.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kobaltlabs.com/internal/migration/companies/{company_id}/bulk-assign-role`
- Auth: none declared

Attach one role to a batch of the company's active users in a single step.

Handy for migration (put everyone on the same company role at once) and for recovery —
selecting all users and assigning the global ``full_user`` role restores broad access after
a botched migration. Additive only: it never removes a role, so it's safe to re-run and
doesn't undo anything; strip stale roles afterward via the per-user move flow.

The role must be this company's own or a shared global role (never the staff
``kobalt_admin``). DB-only like the rest of the migration flow (nothing mirrored to
SuperTokens); caches are cleared per newly-attached user so the change takes effect at once.

## Path parameters

- `company_id` string, uuid, required

## Request body

- BulkAssignRoleRequest
  - `user_ids` string[], required
  - `role_id` string, uuid, required

## Response `200`

Successful Response

- BulkAssignRoleResponse: Result of attaching one role to a batch of the company's active users.
  - `role_id` string, required
  - `role_name` string, required
  - `users_total` integer, required
  - `users_assigned` integer, required
  - `users_already_had` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kobaltlabs/apis/fastapi.md) - [All operations](https://skmtc.dev/kobaltlabs/apis/fastapi/llms.txt) - [OpenAPI document](https://skmtc.dev/kobaltlabs/apis/fastapi/revisions/8587332d5e43?raw)
