> For the complete documentation index, see [llms.txt](https://docs.opensoutheners.com/oss/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opensoutheners.com/oss/laravel-scim/readme.md).

# Introduction

Integrate your Laravel application with the [SCIM v2](http://www.simplecloud.info/) specification for automated user and group provisioning.

SCIM (System for Cross-domain Identity Management) is the standard protocol used by identity providers like **Microsoft Entra ID** (Azure AD), **Okta**, **OneLogin**, and **JumpCloud** to automatically create, update, and delete users in your application.

## What this package does

* Exposes SCIM v2 endpoints under `/scim/v2/` with zero controller boilerplate
* Maps your Eloquent models to SCIM resources via simple PHP classes
* Handles validation, pagination, filtering, and PATCH operations per the spec
* Provides discovery endpoints (`ServiceProviderConfig`, `Schemas`, `ResourceTypes`) so identity providers can auto-configure

## Quick example

Define a schema that maps SCIM attributes to your User model:

```php
use OpenSoutheners\LaravelScim\Schemas\UserScimSchema;
use OpenSoutheners\LaravelScim\Attributes\ScimSchemaAttribute;
use OpenSoutheners\LaravelScim\Enums\ScimAttributeUniqueness;

readonly class MyUserSchema extends UserScimSchema
{
    public function __construct(
        #[ScimSchemaAttribute(modelAttribute: 'email', uniqueness: ScimAttributeUniqueness::Server)]
        string $userName,
        #[ScimSchemaAttribute(modelAttribute: 'name')]
        ?string $name = null,
    ) {
        $this->fill(func_get_args());
    }
}
```

Register it in a service provider:

```php
use OpenSoutheners\LaravelScim\Repository;

$repository = app(Repository::class);
$repository->add(User::class, MyUserSchema::class);
```

That's it. Your app now has a fully functional SCIM v2 API at `/scim/v2/Users`.

## Supported SCIM operations

| Operation          | HTTP Method | Endpoint                                | Status    |
| ------------------ | ----------- | --------------------------------------- | --------- |
| List resources     | GET         | `/{ResourceType}`                       | Supported |
| Get resource       | GET         | `/{ResourceType}/{id}`                  | Supported |
| Create resource    | POST        | `/{ResourceType}`                       | Supported |
| Replace resource   | PUT         | `/{ResourceType}/{id}`                  | Supported |
| Modify resource    | PATCH       | `/{ResourceType}/{id}`                  | Supported |
| Delete resource    | DELETE      | `/{ResourceType}/{id}`                  | Supported |
| Filter resources   | GET         | `/{ResourceType}?filter=...`            | Supported |
| Pagination         | GET         | `/{ResourceType}?startIndex=1&count=10` | Supported |
| Service discovery  | GET         | `/ServiceProviderConfig`                | Supported |
| Schema discovery   | GET         | `/Schemas`                              | Supported |
| Resource types     | GET         | `/ResourceTypes`                        | Supported |
| Bulk operations    | POST        | `/Bulk`                                 | Not yet   |
| ETag / Conditional | -           | -                                       | Not yet   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opensoutheners.com/oss/laravel-scim/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
