> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SCIM

> Reference for the Redo SCIM 2.0 service provider

Redo implements the [SCIM 2.0 protocol](https://datatracker.ietf.org/doc/html/rfc7644)
and [core schema](https://datatracker.ietf.org/doc/html/rfc7643) for
provisioning Merchant App users. For IdP setup, see [User provisioning with
SCIM](https://developers.redo.com/docs/identity/scim-provisioning.md).

**Base URL:** `https://api.redo.com/scim/v2`

## Authentication

Every request carries the SCIM token of one of the store's identity providers,
generated under **Settings → General → Identity providers → Provisioning**:

```http theme={null}
Authorization: Bearer <SCIM token>
Content-Type: application/scim+json
```

A SCIM token holds only the `scim_provision` [scope](https://developers.redo.com/docs/api-reference/scopes.md).
Requests with no token, a revoked token, or any other API token receive `401`.

Each identity provider sees only the users it provisioned, users no identity
provider has provisioned yet, and its own groups. A user provisioned by another
identity provider reads as `404`, and creating one with the same `userName`
returns `409`.

## Discovery

| Path | Description |
| - | - |
| `/ServiceProviderConfig` | Supported features: `patch`, `filter`, no `bulk`, no `sort`, no `etag` |
| `/ResourceTypes` | `User` and `Group` |
| `/Schemas` | Core `User` and `Group` schemas |

## Filtering and pagination

List endpoints accept a `filter` parameter using `eq` on the attributes listed
per resource below. Other operators and attributes return `400` with
`scimType` `invalidFilter`.

Results are paginated with `startIndex` (1-based) and `count`, up to 200 per
page; responses include `totalResults`, `startIndex`, and `itemsPerPage` per
[RFC 7644 §3.4.2.4](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.4).

## Users

Schema: `urn:ietf:params:scim:schemas:core:2.0:User`
([RFC 7643 §4.1](https://datatracker.ietf.org/doc/html/rfc7643#section-4.1)).
Attributes not listed are accepted and ignored. The enterprise User extension
is not supported.

| Attribute | Notes |
| - | - |
| `id` | Assigned by Redo. Read-only. |
| `externalId` | Stored and returned. Filterable. |
| `userName` | Required. The user's email address; unique per store. Filterable. Immutable after creation. |
| `name.givenName` | First name |
| `name.familyName` | Last name |
| `emails` | The `primary` entry must equal `userName` |
| `active` | `false` deactivates the user; `true` reactivates |
| `groups` | Read-only. The SCIM groups the user belongs to. |
| `meta` | `resourceType`, `created`, `lastModified`, `location` |

| Method | Path | Notes |
| - | - | - |
| `GET` | `/Users` | Filters: `userName eq "…"` (case-insensitive), `externalId eq "…"` |
| `POST` | `/Users` | `409` with `scimType` `uniqueness` if `userName` exists |
| `GET` | `/Users/{id}` | |
| `PUT` | `/Users/{id}` | Full replace. `userName` must be unchanged. |
| `PATCH` | `/Users/{id}` | `add`, `replace`, `remove` per [RFC 7644 §3.5.2](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2) |
| `DELETE` | `/Users/{id}` | Deactivates the user (equivalent to `active: false`) and returns `204`. Users are never hard-deleted. |

Setting `active` to `false` removes the user from the store's team. A
deactivated user is still returned with `active: false`, so the IdP can
reactivate them.

### Create a user

```json theme={null}
POST /scim/v2/Users

{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "userName": "jane@example.com",
  "name": { "givenName": "Jane", "familyName": "Doe" },
  "emails": [{ "value": "jane@example.com", "primary": true }],
  "externalId": "00u1abcd2EFGHijkl3x7",
  "active": true
}
```

### Deactivate a user

```json theme={null}
PATCH /scim/v2/Users/{id}

{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
  "Operations": [{ "op": "replace", "path": "active", "value": false }]
}
```

## Groups

Schema: `urn:ietf:params:scim:schemas:core:2.0:Group`
([RFC 7643 §4.2](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2)).
A group corresponds to a Redo role; `displayName` must equal the name of an
existing role, and each role has at most one group.

| Attribute | Notes |
| - | - |
| `id` | Assigned by Redo. Read-only. |
| `externalId` | Stored and returned |
| `displayName` | Required. Must match an existing role name; otherwise `400` with `scimType` `invalidValue`. Filterable. |
| `members` | `value` is a user `id`. Membership grants the role; removal revokes it. |

| Method | Path | Notes |
| - | - | - |
| `GET` | `/Groups` | Filter: `displayName eq "…"` |
| `POST` | `/Groups` | Links the group to the role it names. `409` with `scimType` `uniqueness` if one already does. |
| `GET` | `/Groups/{id}` | |
| `PUT` | `/Groups/{id}` | Full replace of `displayName` and `members` |
| `PATCH` | `/Groups/{id}` | `add` / `remove` on `members`; `replace` on `displayName` or `members`. Returns `204`. |
| `DELETE` | `/Groups/{id}` | Stops managing the role through SCIM. The role and its current assignments remain. |

Removing a member revokes the role only if SCIM granted it. A role the user
already held when they joined the group, such as one assigned in Redo, stays.

## Errors

Errors use `urn:ietf:params:scim:api:messages:2.0:Error` with `status`,
`detail`, and where applicable `scimType`
([RFC 7644 §3.12](https://datatracker.ietf.org/doc/html/rfc7644#section-3.12)).

| Status | `scimType` | Meaning |
| - | - | - |
| `400` | `invalidValue` | Group `displayName` doesn't match a role; invalid attribute value |
| `400` | `invalidFilter` | Unsupported filter attribute or operator |
| `400` | `mutability` | Attempt to change `userName` |
| `401` | | Missing, revoked, or malformed SCIM token |
| `404` | | Unknown resource `id`, including another store's |
| `409` | `uniqueness` | `userName` already exists, or a group already manages the role |

```json theme={null}
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "409",
  "scimType": "uniqueness",
  "detail": "A user with userName jane@example.com already exists"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.