(email_addresses)
- 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
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
models.EmailAddress
Error Object |
Status Code |
Content Type |
models.ClerkErrors |
400,401,403,404,422 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Returns the details of an email address.
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
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. |
|
models.EmailAddress
Error Object |
Status Code |
Content Type |
models.ClerkErrors |
400,401,403,404 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Delete the email address with the given ID
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
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. |
|
models.DeletedObject
Error Object |
Status Code |
Content Type |
models.ClerkErrors |
400,401,403,404 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Updates an email address.
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
models.EmailAddress
Error Object |
Status Code |
Content Type |
models.ClerkErrors |
400,401,403,404 |
application/json |
models.SDKError |
4xx-5xx |
/ |