# User provisioning with SCIM

> Create, update, suspend and remove MoreVoice members from your identity provider with SCIM 2.0, and give them roles and teams from its groups: tokens, supported operations, limits and what each change does.

SCIM keeps MoreVoice's members in step with your identity provider: people you assign are created, their changes follow, and people you unassign or deactivate are suspended at once. Step-by-step setup for [Okta](https://docs.morevoice.ai/enterprise/sso-okta/#user-provisioning-with-scim) and [Microsoft Entra ID](https://docs.morevoice.ai/enterprise/sso-entra-id/#user-provisioning-with-scim) is in their guides. Google Workspace has no SCIM for custom apps: use just-in-time sign-up.

and [entra-id.md](https://docs.morevoice.ai/enterprise/sso-entra-id/#user-provisioning-with-scim). Google Workspace has no SCIM for custom apps: use
just-in-time sign-up.

## Connect your identity provider

1. **Security › Single sign-on › User provisioning (SCIM)**.
2. Copy the **SCIM base URL**: `https://YOUR-HOST/scim/v2`.
3. Select **New token**, name it (for example *Okta provisioning*), choose an expiry (MoreVoice reminds admins 14 days
   before), and select **Create token**. Copy the token — `mvscim_` followed by 43 characters — into your IdP. It is
   shown **once**: only a hash is stored. Tick *I've copied the token* to close the dialog.
4. Your IdP authenticates with the header `Authorization: Bearer mvscim_…`.

**Rotation:** two tokens can be active at a time. Create the new one, switch the IdP to it, check its *Last used*, then
**Revoke** the old one (revocation applies at once). Treat tokens like passwords; if one leaks, revoke it.

## What MoreVoice supports

| SCIM feature | Support |
|---|---|
| Resources | `/Users` (core User + enterprise extension), `/Groups` |
| Discovery | `/ServiceProviderConfig`, `/ResourceTypes`, `/Schemas` |
| Operations | `GET`, `POST`, `PUT`, `PATCH`, `DELETE` on users and groups |
| PATCH | `add` / `replace` / `remove`, with and without `path`, value filters (`emails[type eq "work"].value`); Entra ID's and Okta's dialects |
| Filters | `eq`, `sw`, `co`, `pr`, `and`, `or` on `userName`, `externalId`, `id`, `emails.value`, `active`; `displayName`, `externalId`, `members.value` on groups; up to 200 results per page |
| Not supported (optional in SCIM) | bulk, sort, ETags, password changes |
| Limits | 1 MB per request, 1,000 member changes per group request, 600 requests a minute per token |

## How SCIM changes MoreVoice

| In the IdP | In MoreVoice |
|---|---|
| Assign a person (create user) | a member is created — or an existing account with the same email joins the organisation. `userName` must be the person's email. If every seat is taken, they wait for a seat and admins are alerted. |
| Update name / email | the member's profile follows |
| Deactivate (`active: false`) or unassign | the membership is **suspended** and the person is signed out within 30 seconds |
| Reactivate | the membership is active again |
| Delete | the membership is removed (the person's account remains, for their other organisations) |
| Push a group / change its members | the group's members get the role and team of its mapping, at once |

Roles come **only** from group mappings: a `roles` attribute sent by the IdP is ignored, and *Owner* needs an explicit
mapping created by an owner (with the group's name typed to confirm). The last owner is never suspended, removed or
demoted by SCIM. While SCIM is active, just-in-time sign-up doesn't create people.

## Group mapping

**Security › Single sign-on › Group mapping › SCIM groups › Add mapping**: choose a pushed group, a role and/or a team,
and a priority (higher wins when someone is in several mapped groups). People in no mapped group get the agent role and
no team.

## Watching it work

The SCIM section shows active, suspended and waiting people, the number of groups, and **Recent requests** (method,
path, status, time — never request bodies). Every change is in the audit log (`scim.user.*`, `scim.group.*`).
