(InstanceSettings)
- Update - Update instance settings
- UpdateRestrictions - Update instance restrictions
- UpdateOrganization - Update instance organization settings
Updates the settings of an instance
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using System.Collections.Generic;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
UpdateInstanceRequestBody req = new UpdateInstanceRequestBody() {
TestMode = true,
Hibp = false,
EnhancedEmailDeliverability = true,
SupportEmail = "[email protected]",
ClerkJsVersion = "2.3.1",
DevelopmentOrigin = "http://localhost:3000",
AllowedOrigins = new List<string>() {
"http://localhost:3000",
"chrome-extension://extension_uiid",
"capacitor://localhost",
},
UrlBasedSessionSyncing = true,
};
var res = await sdk.InstanceSettings.UpdateAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
UpdateInstanceRequestBody | ✔️ | The request object to use for the request. |
Error Type | Status Code | Content Type |
---|---|---|
Clerk.BackendAPI.Models.Errors.ClerkErrors | 422 | application/json |
Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Updates the restriction settings of an instance
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
UpdateInstanceRestrictionsRequestBody req = new UpdateInstanceRestrictionsRequestBody() {
Allowlist = false,
Blocklist = true,
BlockEmailSubaddresses = true,
BlockDisposableEmailDomains = true,
IgnoreDotsForGmailAddresses = false,
};
var res = await sdk.InstanceSettings.UpdateRestrictionsAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
UpdateInstanceRestrictionsRequestBody | ✔️ | The request object to use for the request. |
UpdateInstanceRestrictionsResponse
Error Type | Status Code | Content Type |
---|---|---|
Clerk.BackendAPI.Models.Errors.ClerkErrors | 402, 422 | application/json |
Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Updates the organization settings of the instance
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using System.Collections.Generic;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
UpdateInstanceOrganizationSettingsRequestBody req = new UpdateInstanceOrganizationSettingsRequestBody() {
Enabled = true,
MaxAllowedMemberships = 10,
AdminDeleteEnabled = false,
DomainsEnabled = true,
DomainsEnrollmentModes = new List<string>() {
"automatic_invitation",
"automatic_suggestion",
},
CreatorRoleId = "creator_role",
DomainsDefaultRoleId = "member_role",
};
var res = await sdk.InstanceSettings.UpdateOrganizationAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
UpdateInstanceOrganizationSettingsRequestBody | ✔️ | The request object to use for the request. |
UpdateInstanceOrganizationSettingsResponse
Error Type | Status Code | Content Type |
---|---|---|
Clerk.BackendAPI.Models.Errors.ClerkErrors | 402, 404, 422 | application/json |
Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |