<@U04UQ68083H> how do I mark existing emails as va...
# ory-copilot
p
@chilly-king-10285 how do I mark existing emails as valid using curl
b
A message from kapa.ai
To mark existing emails as valid (i.e., verified) in Ory, you need to update the identity using the admin API and set the
verifiable_addresses
field with the email address, marking it as
verified: true
and
status: completed
. Here’s how you can do it with a cURL command:
Copy code
bash curl --request POST -sL \   --header "Authorization: Bearer <your-ory-pat>" \   --header "Content-Type: application/json" \   --data '{     "schema_id": "<preset://email>",     "traits": {       "email": "<mailto:user@example.org|user@example.org>"     },     "verifiable_addresses": [       {         "value": "<mailto:user@example.org|user@example.org>",         "verified": true,         "via": "email",         "status": "completed"       }     ]   }' https://$<http://PROJECT_SLUG.projects.oryapis.com/admin/identities|PROJECT_SLUG.projects.oryapis.com/admin/identities>
- Replace
<your-ory-pat>
with your Ory Personal Access Token. - Replace
<mailto:user@example.org|user@example.org>
with the email you want to mark as verified. - Replace
$PROJECT_SLUG
with your project slug. Note: - The email must also be present in the identity's traits and marked as a verifiable address in your identity schema. - If you update an existing identity, use the PATCH or PUT method and the identity's ID in the endpoint URL. For more details and examples, see the official documentation on [importing identities with verified addresses](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities)<source>https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities&lt;/source>.