Skip to content

Create an Email

Request

OAuth 2.0 scope:
  • okta.myAccount.email.manage

Creates a primary or secondary email address for the user's account. The new email address has an UNVERIFIED status.

Headers
Acceptstringrequired

Specifies the API version. Current version: 1.0.0

Example:application/json; okta-version=1.0.0
Bodyapplication/json

New email

profileobjectrequired

Defines the email address on the profile

sendEmailboolean

Specifies whether Okta or the application sends an email to the end user

Default:true
statestringwrite-only

Any application state that the client wishes to persist across the email challenge flow, and receive at the callback URL. Define the callback URL in the OIDC app configuration. This parameter proves to the client that the email link is verified.

Example:"JPcFLTwOq7UvoFtmRd3EnyQwsR0PbDSI"
rolestringwrite-only
Enum:"PRIMARY""SECONDARY"
Example:"PRIMARY"
POST
/idp/myaccount/emails
curl -i -X POST \
  https://okta-subdomain.pixtulate.com/idp/myaccount/emails \
  -H 'Accept: application/json; okta-version=1.0.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "profile": {
      "email": "saml.jackson@example.com"
    },
    "sendEmail": true,
    "role": "PRIMARY",
    "state": "JPcFLTwOq7UvoFtmRd3EnyQwsR0PbDSI"
  }'

Responses

Example response

Bodyapplication/json;okta-version=1.0.0
idstring, non-emptyread-onlyrequired

The email ID of the caller

profileobjectrequired

Defines the email address on the profile

rolesArray of stringsrequired

Defines the role of the email

Items Enum:"PRIMARY""SECONDARY"
statusstring, non-emptyread-onlyrequired

The email status of the caller

Enum:"VERIFIED""UNVERIFIED"
Response
{ "id": "e2a84ed3cc538f75457596faa74a4532", "status": "UNVERIFIED", "roles": [ "PRIMARY" ], "profile": { "email": "s.jackson@company.com" }, "_links": { "self": {}, "challenge": {}, "verify": {}, "poll": {} } }