(instanceSettings())
- get - Fetch the current instance
- update - Update instance settings
- updateRestrictions - Update instance restrictions
- changeDomain - Update production instance domain
- updateOrganizationSettings - Update instance organization settings
Fetches the current instance
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.operations.GetInstanceResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetInstanceResponse res = sdk.instanceSettings().get()
.call();
if (res.instance().isPresent()) {
// handle response
}
}
}
Error Type | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4XX, 5XX | */* |
Updates the settings of an instance
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.UpdateInstanceRequestBody;
import com.clerk.backend_api.models.operations.UpdateInstanceResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
UpdateInstanceRequestBody req = UpdateInstanceRequestBody.builder()
.build();
UpdateInstanceResponse res = sdk.instanceSettings().update()
.request(req)
.call();
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
UpdateInstanceRequestBody | ✔️ | The request object to use for the request. |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ClerkErrors | 422 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
Updates the restriction settings of an instance
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsRequestBody;
import com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
UpdateInstanceRestrictionsRequestBody req = UpdateInstanceRestrictionsRequestBody.builder()
.build();
UpdateInstanceRestrictionsResponse res = sdk.instanceSettings().updateRestrictions()
.request(req)
.call();
if (res.instanceRestrictions().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
UpdateInstanceRestrictionsRequestBody | ✔️ | The request object to use for the request. |
UpdateInstanceRestrictionsResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ClerkErrors | 402, 422 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
Change the domain of a production instance.
Changing the domain requires updating the DNS records accordingly, deploying new SSL certificates, updating your Social Connection's redirect URLs and setting the new keys in your code.
WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainRequestBody;
import com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
ChangeProductionInstanceDomainRequestBody req = ChangeProductionInstanceDomainRequestBody.builder()
.build();
ChangeProductionInstanceDomainResponse res = sdk.instanceSettings().changeDomain()
.request(req)
.call();
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
ChangeProductionInstanceDomainRequestBody | ✔️ | The request object to use for the request. |
ChangeProductionInstanceDomainResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ClerkErrors | 400, 422 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
Updates the organization settings of the instance
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsRequestBody;
import com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
UpdateInstanceOrganizationSettingsRequestBody req = UpdateInstanceOrganizationSettingsRequestBody.builder()
.build();
UpdateInstanceOrganizationSettingsResponse res = sdk.instanceSettings().updateOrganizationSettings()
.request(req)
.call();
if (res.organizationSettings().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
UpdateInstanceOrganizationSettingsRequestBody | ✔️ | The request object to use for the request. |
UpdateInstanceOrganizationSettingsResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ClerkErrors | 400, 402, 404, 422 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |