(EmailAddresses)
- Create - Create an email address
- Get - Retrieve an email address
- Delete - Delete an email address
- Update - Update an email address
Create a new email address
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
CreateEmailAddressRequestBody req = new CreateEmailAddressRequestBody() {
UserId = "user_12345",
EmailAddress = "[email protected]",
Verified = false,
Primary = true,
};
var res = await sdk.EmailAddresses.CreateAsync(req);
// handle response
CreateEmailAddressResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 401, 403, 404, 422 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Returns the details of an email address.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.EmailAddresses.GetAsync(emailAddressId: "email_address_id_example");
// handle response
Parameter |
Type |
Required |
Description |
Example |
EmailAddressId |
string |
✔️ |
The ID of the email address to retrieve |
email_address_id_example |
GetEmailAddressResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 401, 403, 404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Delete the email address with the given ID
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.EmailAddresses.DeleteAsync(emailAddressId: "email_address_id_example");
// handle response
Parameter |
Type |
Required |
Description |
Example |
EmailAddressId |
string |
✔️ |
The ID of the email address to delete |
email_address_id_example |
DeleteEmailAddressResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 401, 403, 404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Updates an email address.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.EmailAddresses.UpdateAsync(
emailAddressId: "email_address_id_example",
requestBody: new UpdateEmailAddressRequestBody() {
Verified = false,
Primary = true,
}
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
EmailAddressId |
string |
✔️ |
The ID of the email address to update |
email_address_id_example |
RequestBody |
UpdateEmailAddressRequestBody |
✔️ |
N/A |
|
UpdateEmailAddressResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 401, 403, 404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |