> ## 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 > Management endpoints for SCIM group-to-workspace mappings, authenticated with a management key. These are not the SCIM 2.0 connector endpoints for your identity provider. In your identity provider, enter the SCIM endpoint URL shown when you enable provisioning under Settings > Members > SCIM Mappings. See https://openrouter.ai/docs/guides/features/scim-mappings#set-up-provisioning. ## Overview Management endpoints for SCIM group-to-workspace mappings, authenticated with a management key. These are not the SCIM 2.0 connector endpoints for your identity provider. In your identity provider, enter the SCIM endpoint URL shown when you enable provisioning under Settings > Members > SCIM Mappings. See [https://openrouter.ai/docs/guides/features/scim-mappings#set-up-provisioning](https://openrouter.ai/docs/guides/features/scim-mappings.md#set-up-provisioning). ### 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](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.scim.listMappings(); for await (const page of result) { console.log(page); } } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { scimListMappings } from "@openrouter/sdk/funcs/scimListMappings.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await scimListMappings(openRouter); if (res.ok) { const { value: result } = res; for await (const page of result) { console.log(page); } } else { console.log("scimListMappings failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.ListScimGroupMappingsRequest](../../models/operations/listscimgroupmappingsrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListScimGroupMappingsResponse](../../models/operations/listscimgroupmappingsresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 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](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.scim.create({ createScimGroupMappingRequest: { role: "admin", scimGroupId: "ecdda85d-40dc-4ed7-9955-2bf12128e7da", workspaceId: "d5a84a53-ce30-4057-ab5e-bd7b45553567", }, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { scimCreate } from "@openrouter/sdk/funcs/scimCreate.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await scimCreate(openRouter, { createScimGroupMappingRequest: { role: "admin", scimGroupId: "ecdda85d-40dc-4ed7-9955-2bf12128e7da", workspaceId: "d5a84a53-ce30-4057-ab5e-bd7b45553567", }, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("scimCreate failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.CreateScimGroupMappingRequest](../../models/operations/createscimgroupmappingrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.CreateScimGroupMappingResponse](../../models/createscimgroupmappingresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## delete Delete a SCIM group-to-workspace mapping. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.scim.delete({ id: "ef7219ae-c495-43b3-b46b-52bf82772570", keepMembers: false, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { scimDelete } from "@openrouter/sdk/funcs/scimDelete.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await scimDelete(openRouter, { id: "ef7219ae-c495-43b3-b46b-52bf82772570", keepMembers: false, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("scimDelete failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.DeleteScimGroupMappingRequest](../../models/operations/deletescimgroupmappingrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.DeleteScimGroupMappingResponse](../../models/deletescimgroupmappingresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## read Get a SCIM group-to-workspace mapping. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.scim.read({ id: "aca4d64d-fff7-419d-a8ae-3ec5ab8a0c1e", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { scimRead } from "@openrouter/sdk/funcs/scimRead.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await scimRead(openRouter, { id: "aca4d64d-fff7-419d-a8ae-3ec5ab8a0c1e", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("scimRead failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.GetScimGroupMappingRequest](../../models/operations/getscimgroupmappingrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.GetScimGroupMappingResponse](../../models/getscimgroupmappingresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## update Update a SCIM group mapping role. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.scim.update({ id: "361a9698-8c34-4cbb-b0be-f6fd47094a30", updateScimGroupMappingRequest: { role: "member", }, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { scimUpdate } from "@openrouter/sdk/funcs/scimUpdate.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await scimUpdate(openRouter, { id: "361a9698-8c34-4cbb-b0be-f6fd47094a30", updateScimGroupMappingRequest: { role: "member", }, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("scimUpdate failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.UpdateScimGroupMappingRequest](../../models/operations/updatescimgroupmappingrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.UpdateScimGroupMappingResponse](../../models/updatescimgroupmappingresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## listGroups List SCIM groups for the organization. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.scim.listGroups(); for await (const page of result) { console.log(page); } } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { scimListGroups } from "@openrouter/sdk/funcs/scimListGroups.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await scimListGroups(openRouter); if (res.ok) { const { value: result } = res; for await (const page of result) { console.log(page); } } else { console.log("scimListGroups failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.ListScimGroupsRequest](../../models/operations/listscimgroupsrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListScimGroupsResponse](../../models/operations/listscimgroupsresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## createSyncJob Start a SCIM directory sync. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.scim.createSyncJob(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { scimCreateSyncJob } from "@openrouter/sdk/funcs/scimCreateSyncJob.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await scimCreateSyncJob(openRouter); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("scimCreateSyncJob failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.CreateScimSyncJobRequest](../../models/operations/createscimsyncjobrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.CreateScimSyncJobResponse](../../models/operations/createscimsyncjobresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## getSyncJob Get SCIM directory sync status. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.scim.getSyncJob({ id: "11506961-3c26-4184-a388-53273cc64c83", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { scimGetSyncJob } from "@openrouter/sdk/funcs/scimGetSyncJob.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await scimGetSyncJob(openRouter, { id: "11506961-3c26-4184-a388-53273cc64c83", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("scimGetSyncJob failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.GetScimSyncJobRequest](../../models/operations/getscimsyncjobrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.GetScimSyncJobResponse](../../models/getscimsyncjobresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |