- list - List enterprise connections
- create - Create an enterprise connection
- get - Retrieve an enterprise connection
- update - Update an enterprise connection
- delete - Delete an enterprise connection
- listTestRuns - List enterprise connection test runs
- createTestRun - Create an enterprise connection test run
Returns the list of enterprise connections for the instance.
Results can be paginated using the optional limit and offset query parameters.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.ListEnterpriseConnectionsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
ListEnterpriseConnectionsResponse res = sdk.enterpriseConnections().list()
.limit(10L)
.offset(0L)
.call();
if (res.enterpriseConnections().isPresent()) {
System.out.println(res.enterpriseConnections().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
Optional<Long> | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset. |
offset |
Optional<Long> | ➖ | Skip the first offset results when paginating.Needs to be an integer greater or equal to zero. To be used in conjunction with limit. |
organizationId |
Optional<String> | ➖ | Filter enterprise connections by organization ID |
active |
Optional<Boolean> | ➖ | Filter by active status. If true, only active connections are returned. If false, only inactive connections are returned. If omitted, all connections are returned. |
ListEnterpriseConnectionsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ClerkErrors | 402, 403, 422 | application/json |
| models/errors/SDKError | 4XX, 5XX | */* |
Create a new enterprise connection.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.CreateEnterpriseConnectionResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CreateEnterpriseConnectionResponse res = sdk.enterpriseConnections().create()
.call();
if (res.enterpriseConnection().isPresent()) {
System.out.println(res.enterpriseConnection().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
CreateEnterpriseConnectionRequestBody | ✔️ | The request object to use for the request. |
CreateEnterpriseConnectionResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ClerkErrors | 402, 403, 404, 409, 422 | application/json |
| models/errors/SDKError | 4XX, 5XX | */* |
Fetches the enterprise connection whose ID matches the provided enterprise_connection_id in the path.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.GetEnterpriseConnectionResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
GetEnterpriseConnectionResponse res = sdk.enterpriseConnections().get()
.enterpriseConnectionId("<id>")
.call();
if (res.enterpriseConnection().isPresent()) {
System.out.println(res.enterpriseConnection().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
enterpriseConnectionId |
String | ✔️ | The ID of the enterprise connection |
GetEnterpriseConnectionResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ClerkErrors | 402, 403, 404 | application/json |
| models/errors/SDKError | 4XX, 5XX | */* |
Updates the enterprise connection whose ID matches the provided enterprise_connection_id in the path.
When enabling the connection (setting active to true), any existing verified organization domains that match the connection's domains (e.g. used for enrollment modes like automatic invitation) may be deleted so the connection can be enabled.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.UpdateEnterpriseConnectionRequestBody;
import com.clerk.backend_api.models.operations.UpdateEnterpriseConnectionResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
UpdateEnterpriseConnectionResponse res = sdk.enterpriseConnections().update()
.enterpriseConnectionId("<id>")
.requestBody(UpdateEnterpriseConnectionRequestBody.builder()
.build())
.call();
if (res.enterpriseConnection().isPresent()) {
System.out.println(res.enterpriseConnection().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
enterpriseConnectionId |
String | ✔️ | The ID of the enterprise connection to update |
requestBody |
UpdateEnterpriseConnectionRequestBody | ✔️ | N/A |
UpdateEnterpriseConnectionResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ClerkErrors | 400, 402, 403, 404, 422 | application/json |
| models/errors/SDKError | 4XX, 5XX | */* |
Deletes the enterprise connection whose ID matches the provided enterprise_connection_id in the path.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.DeleteEnterpriseConnectionResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
DeleteEnterpriseConnectionResponse res = sdk.enterpriseConnections().delete()
.enterpriseConnectionId("<id>")
.call();
if (res.deletedObject().isPresent()) {
System.out.println(res.deletedObject().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
enterpriseConnectionId |
String | ✔️ | The ID of the enterprise connection to delete |
DeleteEnterpriseConnectionResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ClerkErrors | 402, 403, 404 | application/json |
| models/errors/SDKError | 4XX, 5XX | */* |
Returns a paginated list of SAML or OIDC debug test runs for an enterprise connection.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.ListEnterpriseConnectionTestRunsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
ListEnterpriseConnectionTestRunsResponse res = sdk.enterpriseConnections().listTestRuns()
.enterpriseConnectionId("<id>")
.limit(10L)
.offset(0L)
.call();
if (res.enterpriseConnectionTestRuns().isPresent()) {
System.out.println(res.enterpriseConnectionTestRuns().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
enterpriseConnectionId |
String | ✔️ | The ID of the enterprise connection |
status |
List<ListEnterpriseConnectionTestRunsQueryParamStatus> | ➖ | Filter test runs by status (may be repeated) |
limit |
Optional<Long> | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset. |
offset |
Optional<Long> | ➖ | Skip the first offset results when paginating.Needs to be an integer greater or equal to zero. To be used in conjunction with limit. |
ListEnterpriseConnectionTestRunsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ClerkErrors | 402, 403, 404, 422 | application/json |
| models/errors/SDKError | 4XX, 5XX | */* |
Returns a short-lived URL that starts the IdP test flow for this connection.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.CreateEnterpriseConnectionTestRunResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CreateEnterpriseConnectionTestRunResponse res = sdk.enterpriseConnections().createTestRun()
.enterpriseConnectionId("<id>")
.call();
if (res.enterpriseConnectionTestRunResponse().isPresent()) {
System.out.println(res.enterpriseConnectionTestRunResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
enterpriseConnectionId |
String | ✔️ | The ID of the enterprise connection |
CreateEnterpriseConnectionTestRunResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ClerkErrors | 402, 403, 404 | application/json |
| models/errors/SDKError | 4XX, 5XX | */* |