> ## Documentation Index > Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt > Use this file to discover all available pages before exploring further. # Scim > SCIM endpoints ## Overview SCIM endpoints ### Available Operations * [ListMappings](#listmappings) - List SCIM group mappings * [Create](#create) - Create a SCIM group mapping * [Delete](#delete) - Delete a SCIM group mapping * [Read](#read) - Get a SCIM group mapping * [Update](#update) - Update a SCIM group mapping * [ListGroups](#listgroups) - List SCIM groups * [CreateSyncJob](#createsyncjob) - Start a SCIM directory sync * [GetSyncJob](#getsyncjob) - Get SCIM directory sync status ## ListMappings List SCIM group-to-workspace mappings for the organization. [Management key](/docs/client-sdks/go/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```go theme={null} package main import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "github.com/OpenRouterTeam/go-sdk/optionalnullable" "log" ) func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) res, err := s.Scim.ListMappings(ctx, optionalnullable.From(openrouter.Pointer[int64](0)), openrouter.Pointer[int64](50)) if err != nil { log.Fatal(err) } if res != nil { for { // handle items res, err = res.Next() if err != nil { // handle error } if res == nil { break } } } } ``` ### Parameters | Parameter | Type | Required | Description | Example | | --------- | ---------------------------------------------------------- | -------------------- | --------------------------------------------- | ------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy\_check\_mark: | The context to use for the request. | | | `offset` | optionalnullable.OptionalNullable\[`int64`] | :heavy\_minus\_sign: | Number of records to skip for pagination | 0 | | `limit` | `*int64` | :heavy\_minus\_sign: | Maximum number of records to return (max 100) | 50 | | `opts` | \[][operations.Option](../../models/operations/option.mdx) | :heavy\_minus\_sign: | The options for this request. | | ### Response **[\*operations.ListScimGroupMappingsResponse](../../models/operations/listscimgroupmappingsresponse.mdx), error** ### Errors | Error Type | Status Code | Content Type | | ------------------------------------- | ----------- | ---------------- | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | ## Create Create a SCIM group-to-workspace role mapping. Creating a mapping that already exists with the same role succeeds and re-applies the mapping to the group members. Requesting a different role for an existing mapping returns 409. [Management key](/docs/client-sdks/go/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```go theme={null} package main import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "github.com/OpenRouterTeam/go-sdk/models/components" "log" ) func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) res, err := s.Scim.Create(ctx, components.CreateScimGroupMappingRequest{ Role: components.CreateScimGroupMappingRequestRoleAdmin, ScimGroupID: "ecdda85d-40dc-4ed7-9955-2bf12128e7da", WorkspaceID: "d5a84a53-ce30-4057-ab5e-bd7b45553567", }) if err != nil { log.Fatal(err) } if res != nil { // handle response } } ``` ### Parameters | Parameter | Type | Required | Description | | --------- | ----------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------ | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy\_check\_mark: | The context to use for the request. | | `request` | [components.CreateScimGroupMappingRequest](../../models/components/createscimgroupmappingrequest.mdx) | :heavy\_check\_mark: | The request object to use for the request. | | `opts` | \[][operations.Option](../../models/operations/option.mdx) | :heavy\_minus\_sign: | The options for this request. | ### Response **[\*components.CreateScimGroupMappingResponse](../../models/components/createscimgroupmappingresponse.mdx), error** ### Errors | Error Type | Status Code | Content Type | | ------------------------------------- | ----------- | ---------------- | | sdkerrors.BadRequestResponseError | 400 | application/json | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.ConflictResponseError | 409 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | ## Delete Delete a SCIM group-to-workspace mapping. [Management key](/docs/client-sdks/go/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```go theme={null} package main import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "github.com/OpenRouterTeam/go-sdk/models/operations" "log" ) func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) res, err := s.Scim.Delete(ctx, "ef7219ae-c495-43b3-b46b-52bf82772570", operations.CreateKeepMembersBoolean( false, )) if err != nil { log.Fatal(err) } if res != nil { // handle response } } ``` ### Parameters | Parameter | Type | Required | Description | Example | | ------------- | ----------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy\_check\_mark: | The context to use for the request. | | | `id` | `string` | :heavy\_check\_mark: | N/A | | | `keepMembers` | [operations.KeepMembers](../../models/operations/keepmembers.mdx) | :heavy\_check\_mark: | Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required. | false | | `opts` | \[][operations.Option](../../models/operations/option.mdx) | :heavy\_minus\_sign: | The options for this request. | | ### Response **[\*components.DeleteScimGroupMappingResponse](../../models/components/deletescimgroupmappingresponse.mdx), error** ### Errors | Error Type | Status Code | Content Type | | ------------------------------------- | ----------- | ---------------- | | sdkerrors.BadRequestResponseError | 400 | application/json | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | ## Read Get a SCIM group-to-workspace mapping. [Management key](/docs/client-sdks/go/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```go theme={null} package main import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "log" ) func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) res, err := s.Scim.Read(ctx, "aca4d64d-fff7-419d-a8ae-3ec5ab8a0c1e") if err != nil { log.Fatal(err) } if res != nil { // handle response } } ``` ### Parameters | Parameter | Type | Required | Description | | --------- | ---------------------------------------------------------- | -------------------- | ----------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy\_check\_mark: | The context to use for the request. | | `id` | `string` | :heavy\_check\_mark: | N/A | | `opts` | \[][operations.Option](../../models/operations/option.mdx) | :heavy\_minus\_sign: | The options for this request. | ### Response **[\*components.GetScimGroupMappingResponse](../../models/components/getscimgroupmappingresponse.mdx), error** ### Errors | Error Type | Status Code | Content Type | | ------------------------------------- | ----------- | ---------------- | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | ## Update Update a SCIM group mapping role. [Management key](/docs/client-sdks/go/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```go theme={null} package main import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "github.com/OpenRouterTeam/go-sdk/models/components" "log" ) func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) res, err := s.Scim.Update(ctx, "361a9698-8c34-4cbb-b0be-f6fd47094a30", components.UpdateScimGroupMappingRequest{ Role: components.UpdateScimGroupMappingRequestRoleMember, }) if err != nil { log.Fatal(err) } if res != nil { // handle response } } ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy\_check\_mark: | The context to use for the request. | | `id` | `string` | :heavy\_check\_mark: | N/A | | `updateScimGroupMappingRequest` | [components.UpdateScimGroupMappingRequest](../../models/components/updatescimgroupmappingrequest.mdx) | :heavy\_check\_mark: | N/A | | `opts` | \[][operations.Option](../../models/operations/option.mdx) | :heavy\_minus\_sign: | The options for this request. | ### Response **[\*components.UpdateScimGroupMappingResponse](../../models/components/updatescimgroupmappingresponse.mdx), error** ### Errors | Error Type | Status Code | Content Type | | ------------------------------------- | ----------- | ---------------- | | sdkerrors.BadRequestResponseError | 400 | application/json | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | ## ListGroups List SCIM groups for the organization. [Management key](/docs/client-sdks/go/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```go theme={null} package main import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "github.com/OpenRouterTeam/go-sdk/optionalnullable" "log" ) func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) res, err := s.Scim.ListGroups(ctx, optionalnullable.From(openrouter.Pointer[int64](0)), openrouter.Pointer[int64](50)) if err != nil { log.Fatal(err) } if res != nil { for { // handle items res, err = res.Next() if err != nil { // handle error } if res == nil { break } } } } ``` ### Parameters | Parameter | Type | Required | Description | Example | | --------- | ---------------------------------------------------------- | -------------------- | --------------------------------------------- | ------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy\_check\_mark: | The context to use for the request. | | | `offset` | optionalnullable.OptionalNullable\[`int64`] | :heavy\_minus\_sign: | Number of records to skip for pagination | 0 | | `limit` | `*int64` | :heavy\_minus\_sign: | Maximum number of records to return (max 100) | 50 | | `opts` | \[][operations.Option](../../models/operations/option.mdx) | :heavy\_minus\_sign: | The options for this request. | | ### Response **[\*operations.ListScimGroupsResponse](../../models/operations/listscimgroupsresponse.mdx), error** ### Errors | Error Type | Status Code | Content Type | | ------------------------------------- | ----------- | ---------------- | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | ## CreateSyncJob Start a SCIM directory sync. [Management key](/docs/client-sdks/go/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```go theme={null} package main import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "log" ) func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) res, err := s.Scim.CreateSyncJob(ctx) if err != nil { log.Fatal(err) } if res != nil { // handle response } } ``` ### Parameters | Parameter | Type | Required | Description | | --------- | ---------------------------------------------------------- | -------------------- | ----------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy\_check\_mark: | The context to use for the request. | | `opts` | \[][operations.Option](../../models/operations/option.mdx) | :heavy\_minus\_sign: | The options for this request. | ### Response **[\*operations.CreateScimSyncJobResponse](../../models/operations/createscimsyncjobresponse.mdx), error** ### Errors | Error Type | Status Code | Content Type | | ------------------------------------- | ----------- | ---------------- | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | ## GetSyncJob Get SCIM directory sync status. [Management key](/docs/client-sdks/go/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```go theme={null} package main import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "log" ) func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) res, err := s.Scim.GetSyncJob(ctx, "11506961-3c26-4184-a388-53273cc64c83") if err != nil { log.Fatal(err) } if res != nil { // handle response } } ``` ### Parameters | Parameter | Type | Required | Description | | --------- | ---------------------------------------------------------- | -------------------- | ----------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy\_check\_mark: | The context to use for the request. | | `id` | `string` | :heavy\_check\_mark: | N/A | | `opts` | \[][operations.Option](../../models/operations/option.mdx) | :heavy\_minus\_sign: | The options for this request. | ### Response **[\*components.GetScimSyncJobResponse](../../models/components/getscimsyncjobresponse.mdx), error** ### Errors | Error Type | Status Code | Content Type | | ------------------------------------- | ----------- | ---------------- | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* |