The MyAccount Email API provides operations to enroll, update, and delete emails. The API also provides utilities to create, view, and answer verification challenges.
A valid API version in the Accept
header is required to access the API. Current version: 1.0.0
Accept: application/json; okta-version=1.0.0
okta.myAccount.email.read
Lists all of the current user's email information: a collection of links for each email that describe the acceptable operations
Example response
Unauthorized
[- {
- "id": "69dca29c2d8dbb0dca14395ccdb92317",
- "status": "VERIFIED",
- "roles": [
- "PRIMARY"
], - "profile": {
- "email": "saml.jackson@example.com"
}, - "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "challenge": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}, - {
- "id": "e2a84ed3cc538f75457596faa74a4532",
- "status": "UNVERIFIED",
- "roles": [
- "PRIMARY"
], - "profile": {
- "email": "s.jackson@company.com"
}, - "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "DELETE"
]
}
}, - "challenge": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "poll": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
]
okta.myAccount.email.manage
Creates a primary or secondary email address for the user's account. The new email address has an UNVERIFIED
status.
New email
Example response
Bad Request
Unauthorized
Forbidden
Conflict
{- "profile": {
- "email": "saml.jackson@example.com"
}, - "sendEmail": true,
- "role": "PRIMARY",
- "state": "JPcFLTwOq7UvoFtmRd3EnyQwsR0PbDSI"
}
{- "id": "e2a84ed3cc538f75457596faa74a4532",
- "status": "UNVERIFIED",
- "roles": [
- "PRIMARY"
], - "profile": {
- "email": "s.jackson@company.com"
}, - "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "DELETE"
]
}
}, - "challenge": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "poll": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
okta.myAccount.email.read
Retrieves the current user's email information by ID: a collection of links that describe the acceptable email operations
Example response
Unauthorized
{- "id": "69dca29c2d8dbb0dca14395ccdb92317",
- "status": "VERIFIED",
- "roles": [
- "PRIMARY"
], - "profile": {
- "email": "saml.jackson@example.com"
}, - "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "challenge": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.myAccount.email.manage
Deletes the current user's email information by ID. You can only delete unverified primary and secondary emails.
No Content
Bad Request
Unauthorized
Not Found
{- "errorCode": "E0000001",
- "errorSummary": "Api validation failed: Email",
- "errorLink": "E0000001",
- "errorId": "oaejUwz8U5FQ_SyggQwz1kC3w",
- "errorCauses": [
- {
- "errorSummary": "Can't delete a verified email address."
}
]
}
okta.myAccount.email.manage
Sends a "Confirm email address change" email to the user with a one-time passcode for verification. Also, the user receives a "Notice of pending email address change" email. After the challenge is verified, the email becomes active.
Created
Unauthorized
Forbidden
Not Found
{- "state": "JPcFLTwOq7UvoFtmRd3EnyQwsR0PbDSI"
}
{- "id": "myaccount.2wdtXPtmS0WpKq4bnjlYIw",
- "status": "UNVERIFIED",
- "expiresAt": "2022-02-01T00:19:08.220Z",
- "profile": {
- "email": "s.jackson@example.com"
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "poll": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
okta.myAccount.email.read
Polls for the email challenge's status
OK
Unauthorized
Not Found
{- "id": "myaccount.DDvNA6XORA2dIfB894o32g",
- "status": "UNVERIFIED",
- "expiresAt": "2022-02-01T00:41:25.497Z",
- "profile": {
- "email": "s.jackson@example.com"
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "poll": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
okta.myAccount.email.manage
Verifies the email challenge with the code that the user receives from the "Confirm email address change" email. Once verified, the email is active.
OK
Unauthorized
Forbidden
Not Found
{- "verificationCode": "456058"
}
{- "errorCode": "E0000015",
- "errorSummary": "You do not have permission to access the feature you are requesting",
- "errorLink": "E0000015",
- "errorId": "oaeStOuPPxDRUm3PJhf-tL7bQ",
- "errorCauses": [ ]
}