Skip to content

Latest commit

 

History

History
183 lines (117 loc) · 9.54 KB

File metadata and controls

183 lines (117 loc) · 9.54 KB

EmailAddresses

(email_addresses)

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

from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.email_addresses.create(request={
    "user_id": "user_12345",
    "email_address": "example@clerk.com",
    "verified": False,
    "primary": True,
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request models.CreateEmailAddressRequestBody ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.EmailAddress

Errors

Error Object Status Code Content Type
models.ClerkErrors 400,401,403,404,422 application/json
models.SDKError 4xx-5xx /

get

Returns the details of an email address.

Example Usage

from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.email_addresses.get(email_address_id="email_address_id_example")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
email_address_id str ✔️ The ID of the email address to retrieve email_address_id_example
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.EmailAddress

Errors

Error Object Status Code Content Type
models.ClerkErrors 400,401,403,404 application/json
models.SDKError 4xx-5xx /

delete

Delete the email address with the given ID

Example Usage

from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.email_addresses.delete(email_address_id="email_address_id_example")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
email_address_id str ✔️ The ID of the email address to delete email_address_id_example
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.DeletedObject

Errors

Error Object Status Code Content Type
models.ClerkErrors 400,401,403,404 application/json
models.SDKError 4xx-5xx /

update

Updates an email address.

Example Usage

from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.email_addresses.update(email_address_id="email_address_id_example", request_body={
    "verified": False,
    "primary": True,
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
email_address_id str ✔️ The ID of the email address to update email_address_id_example
request_body Optional[models.UpdateEmailAddressRequestBody] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.EmailAddress

Errors

Error Object Status Code Content Type
models.ClerkErrors 400,401,403,404 application/json
models.SDKError 4xx-5xx /