Skip to content

Files

269 lines (182 loc) · 12.6 KB

File metadata and controls

269 lines (182 loc) · 12.6 KB

InstanceSettings

(instanceSettings())

Overview

Available Operations

get

Fetches the current instance

Example Usage

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
        }
    }
}

Response

GetInstanceResponse

Errors

Error Type Status Code Content Type
models/errors/SDKError 4XX, 5XX */*

update

Updates the settings of an instance

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
request UpdateInstanceRequestBody ✔️ The request object to use for the request.

Response

UpdateInstanceResponse

Errors

Error Type Status Code Content Type
models/errors/ClerkErrors 422 application/json
models/errors/SDKError 4XX, 5XX */*

updateRestrictions

Updates the restriction settings of an instance

Example Usage

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
        }
    }
}

Parameters

Parameter Type Required Description
request UpdateInstanceRestrictionsRequestBody ✔️ The request object to use for the request.

Response

UpdateInstanceRestrictionsResponse

Errors

Error Type Status Code Content Type
models/errors/ClerkErrors 402, 422 application/json
models/errors/SDKError 4XX, 5XX */*

changeDomain

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.

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
request ChangeProductionInstanceDomainRequestBody ✔️ The request object to use for the request.

Response

ChangeProductionInstanceDomainResponse

Errors

Error Type Status Code Content Type
models/errors/ClerkErrors 400, 422 application/json
models/errors/SDKError 4XX, 5XX */*

updateOrganizationSettings

Updates the organization settings of the instance

Example Usage

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
        }
    }
}

Parameters

Parameter Type Required Description
request UpdateInstanceOrganizationSettingsRequestBody ✔️ The request object to use for the request.

Response

UpdateInstanceOrganizationSettingsResponse

Errors

Error Type Status Code Content Type
models/errors/ClerkErrors 400, 402, 404, 422 application/json
models/errors/SDKError 4XX, 5XX */*