(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
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.email_addresses.create(request={
"user_id": "user_12345",
"email_address": "[email protected]",
"verified": False,
"primary": True,
})
assert res is not None
# Handle response
print(res)
models.EmailAddress
Error Type |
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
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.email_addresses.get(email_address_id="email_address_id_example")
assert res is not None
# Handle response
print(res)
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 Type |
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
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.email_addresses.delete(email_address_id="email_address_id_example")
assert res is not None
# Handle response
print(res)
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 Type |
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
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.email_addresses.update(email_address_id="email_address_id_example", verified=False, primary=True)
assert res is not None
# Handle response
print(res)
Parameter |
Type |
Required |
Description |
Example |
email_address_id |
str |
✔️ |
The ID of the email address to update |
email_address_id_example |
verified |
OptionalNullable[bool] |
➖ |
The email address will be marked as verified. |
false |
primary |
OptionalNullable[bool] |
➖ |
Set this email address as the primary email address for the user. |
true |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.EmailAddress
Error Type |
Status Code |
Content Type |
models.ClerkErrors |
400, 401, 403, 404 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |