Skip to content

Latest commit

 

History

History
165 lines (109 loc) · 8.72 KB

File metadata and controls

165 lines (109 loc) · 8.72 KB

EmailAddresses

(EmailAddresses)

Overview

Available Operations

  • Create - Create an email address
  • Get - Retrieve an email address
  • Delete - Delete an email address
  • Update - Update an email address

Create

Create a new email address

Example Usage

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

Parameters

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

Response

CreateEmailAddressResponse

Errors

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 */*

Get

Returns the details of an email address.

Example Usage

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

Parameters

Parameter Type Required Description Example
EmailAddressId string ✔️ The ID of the email address to retrieve email_address_id_example

Response

GetEmailAddressResponse

Errors

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

Delete the email address with the given ID

Example Usage

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

Parameters

Parameter Type Required Description Example
EmailAddressId string ✔️ The ID of the email address to delete email_address_id_example

Response

DeleteEmailAddressResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 403, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Update

Updates an email address.

Example Usage

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

Parameters

Parameter Type Required Description Example
EmailAddressId string ✔️ The ID of the email address to update email_address_id_example
RequestBody UpdateEmailAddressRequestBody ✔️ N/A

Response

UpdateEmailAddressResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 403, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*