Warning
This SDK is DEPRECATED
upsert- Update a template for a given type and slug⚠️ Deprecated
Updates the existing template of the given type and slug
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.UpsertTemplatePathParamTemplateType;
import com.clerk.backend_api.models.operations.UpsertTemplateResponse;
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();
UpsertTemplateResponse res = sdk.emailAndSmsTemplates().upsert()
.templateType(UpsertTemplatePathParamTemplateType.EMAIL)
.slug("<value>")
.call();
if (res.template().isPresent()) {
System.out.println(res.template().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
templateType |
UpsertTemplatePathParamTemplateType | ✔️ | The type of template to update |
slug |
String | ✔️ | The slug of the template to update |
requestBody |
Optional<UpsertTemplateRequestBody> | ➖ | N/A |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ClerkErrors | 400, 401, 402, 403, 404, 422 | application/json |
| models/errors/SDKError | 4XX, 5XX | */* |