openapi: 3.2.0 info: title: MyAccount Management Email API version: 2025.01.1 description: 'APIs for managing a user''s own emails, phones, profile, and app authenticators. > **Note:** The MyAccount API doesn''t support delegated authentication.' termsOfService: https://developer.okta.com/terms/ contact: name: Okta Developer Team url: https://developer.okta.com/ email: devex-public@okta.com license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html x-logo: url: logo.svg backgroundColor: transparent altText: Okta Developer servers: - url: https://{yourOktaDomain} variables: yourOktaDomain: default: subdomain.okta.com description: The domain of your organization. This can be an official Okta domain (for example, `okta.com` or `oktapreview.com`) or one of your configured custom domains. tags: - name: Email description: 'The MyAccount Email API provides operations to enroll, update, and delete emails. The API also provides utilities to create, view, and answer verification challenges. ### API versioning A valid API version in the `Accept` header is required to access the API. Current version: `1.0.0` ```json Accept: application/json; okta-version=1.0.0 ```' paths: /idp/myaccount/emails: get: summary: List all Emails description: 'Lists all of the current user''s email information: a collection of links for each email that describe the acceptable operations' operationId: listEmails responses: '200': $ref: '#/components/responses/Email-Array-Response' '401': $ref: '#/components/responses/Error-IdpMyAccountNotEnabled-Response-401' security: - oauth2: - okta.myAccount.email.read tags: - Email x-okta-lifecycle: lifecycle: GA isGenerallyAvailable: true post: summary: Create an Email description: Creates a primary or secondary email address for the user's account. The new email address has an `UNVERIFIED` status. operationId: createEmail requestBody: content: application/json: schema: type: object properties: profile: type: object description: Defines the email address on the profile required: - email properties: email: type: string example: saml.jackson@example.com format: email writeOnly: true sendEmail: type: boolean default: true description: Specifies whether Okta or the application sends an email to the end user state: type: string example: JPcFLTwOq7UvoFtmRd3EnyQwsR0PbDSI description: '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. ' writeOnly: true role: type: string enum: - PRIMARY - SECONDARY example: PRIMARY writeOnly: true required: - profile examples: New-Email: value: profile: email: saml.jackson@example.com sendEmail: true role: PRIMARY state: JPcFLTwOq7UvoFtmRd3EnyQwsR0PbDSI description: New email responses: '201': $ref: '#/components/responses/Unverified-Email-Response' '400': $ref: '#/components/responses/Error-InvalidEmail-Response-400' '401': $ref: '#/components/responses/Error-IdpMyAccountNotEnabled-Response-401' '403': $ref: '#/components/responses/Error-Email-Response-403' '409': $ref: '#/components/responses/Error-EmailConflict-Response-409' security: - oauth2: - okta.myAccount.email.manage tags: - Email x-okta-lifecycle: lifecycle: GA isGenerallyAvailable: true /idp/myaccount/emails/{id}: parameters: - schema: type: string example: 69dca29c2d8dbb0dca14395ccdb92317 description: 'The email ID Use `GET /idp/myaccount/emails` or `POST /idp/myaccount/emails` operations to obtain the email ID when adding a new email address. ' name: id in: path required: true get: summary: Retrieve an Email description: 'Retrieves the current user''s email information by ID: a collection of links that describe the acceptable email operations' operationId: getEmail responses: '200': $ref: '#/components/responses/Verified-Email-Response' '401': $ref: '#/components/responses/Error-IdpMyAccountNotEnabled-Response-401' security: - oauth2: - okta.myAccount.email.read tags: - Email x-okta-lifecycle: lifecycle: GA isGenerallyAvailable: true delete: summary: Delete an Email description: Deletes the current user's email information by ID. You can only delete unverified primary and secondary emails. operationId: deleteEmail parameters: [] responses: '204': description: No Content content: application/json;okta-version=1.0.0: {} '400': $ref: '#/components/responses/Error-InvalidEmailDeletion-400' '401': $ref: '#/components/responses/Error-IdpMyAccountNotEnabled-Response-401' '404': $ref: '#/components/responses/Error-EmailResourceNotFound-Response-404' security: - oauth2: - okta.myAccount.email.manage tags: - Email x-okta-lifecycle: lifecycle: GA isGenerallyAvailable: true /idp/myaccount/emails/{id}/challenge: parameters: - schema: type: string example: 00T196qTp3LIMZQ0L0g3 description: 'The email ID Use the `GET /idp/myaccount/emails` or `POST /idp/myaccount/emails` operations when adding a new email address.' name: id in: path required: true post: summary: Send an Email Challenge description: '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.' operationId: sendEmailChallenge requestBody: content: application/json: schema: type: object properties: state: type: string example: JPcFLTwOq7UvoFtmRd3EnyQwsR0PbDSI writeOnly: true description: (Optional) The state parameter that contains the state of the client required: - state examples: Challenge-Example: value: state: JPcFLTwOq7UvoFtmRd3EnyQwsR0PbDSI responses: '201': description: Created headers: {} content: application/json;okta-version=1.0.0: schema: type: object example: id: myaccount.2wdtXPtmS0WpKq4bnjlYIw status: UNVERIFIED expiresAt: '2022-02-01T00:19:08.220Z' profile: email: s.jackson@example.com _links: verify: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge/myaccount.2wdtXPtmS0WpKq4bnjlYIw/verify hints: allow: - POST poll: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge/myaccount.2wdtXPtmS0WpKq4bnjlYIw hints: allow: - GET properties: id: type: string description: The email ID of the caller minLength: 1 status: type: string description: The challenge status of the caller's email enum: - VERIFIED - UNVERIFIED minLength: 1 expiresAt: type: string description: The time when the challenge expires. A challenge has a lifetime of five minutes. minLength: 1 profile: type: object description: Defines the email address on the profile required: - email properties: email: type: string description: The email address on the profile minLength: 1 _links: type: object description: Discoverable resources related to the caller's email challenge required: - verify - poll properties: verify: type: object description: Link to the resource (verify) required: - href - hints properties: href: type: string description: Link URI minLength: 1 hints: type: object description: Describes the allowed HTTP verbs for the `href` required: - allow properties: allow: type: array items: type: string enum: - POST poll: type: object description: Link to the resource (poll) required: - href - hints properties: href: type: string description: Link URI minLength: 1 hints: type: object description: Describes the allowed HTTP verbs for the `href` required: - allow properties: allow: type: array items: type: string enum: - GET required: - id - status - expiresAt - profile - _links examples: Challenge-Created-Response: value: id: myaccount.2wdtXPtmS0WpKq4bnjlYIw status: UNVERIFIED expiresAt: '2022-02-01T00:19:08.220Z' profile: email: s.jackson@example.com _links: verify: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge/myaccount.2wdtXPtmS0WpKq4bnjlYIw/verify hints: allow: - POST poll: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge/myaccount.2wdtXPtmS0WpKq4bnjlYIw hints: allow: - GET '401': $ref: '#/components/responses/Error-IdpMyAccountNotEnabled-Response-401' '403': $ref: '#/components/responses/Error-Email-Response-403' '404': $ref: '#/components/responses/Error-EmailResourceNotFound-Response-404' security: - oauth2: - okta.myAccount.email.manage tags: - Email x-okta-lifecycle: lifecycle: GA isGenerallyAvailable: true /idp/myaccount/emails/{id}/challenge/{challengeId}: parameters: - schema: type: string example: 00T196qTp3LIMZQ0L0g3 description: 'The email ID Use the `GET /idp/myaccount/emails` or `POST /idp/myaccount/emails` operations to obtain the ID when adding a new email address.' name: id in: path required: true - schema: type: string example: x1MDGzUb name: challengeId description: 'The `challengeId` of the email Use the `POST /idp/myaccount/emails/{id}/challenge/` operation to obtain the `challengeId` when creating a new challenge.' in: path required: true get: summary: Poll the Challenge for Email Magic Link description: Polls for the email challenge's status operationId: pollChallengeForEmailMagicLink responses: '200': description: OK content: application/json;okta-version=1.0.0: schema: description: '' type: object example: id: myaccount.DDvNA6XORA2dIfB894o32g status: UNVERIFIED expiresAt: '2022-02-01T00:41:25.497Z' profile: email: s.jackson@example.com _links: verify: href: https://example.okta.com/idp/myaccount/emails/da03e945d44d8b714da2b9fded39e851/challenge/myaccount.DDvNA6XORA2dIfB894o32g/verify hints: allow: - POST poll: href: https://example.okta.com/idp/myaccount/emails/da03e945d44d8b714da2b9fded39e851/challenge/myaccount.DDvNA6XORA2dIfB894o32g hints: allow: - GET properties: id: type: string description: The email ID minLength: 1 status: type: string description: The challenge status of the caller's email minLength: 1 enum: - VERIFIED - UNVERIFIED expiresAt: type: string description: The time at which the challenge expires. The lifetime of a challenge is five minutes. minLength: 1 profile: type: object description: Defines the email address on the profile required: - email properties: email: type: string description: The email address on the profile minLength: 1 _links: type: object description: Discoverable resources related to the poll for the email challenge's status required: - verify - poll properties: verify: type: object description: Link to the resource (verify) required: - href - hints properties: href: type: string description: Link URI minLength: 1 hints: type: object description: Describes the allowed HTTP verbs for the `href` required: - allow properties: allow: type: array items: type: string enum: - DELETE - GET - POST - PUT poll: type: object description: Link to the resource (poll) required: - href - hints properties: href: type: string description: Link URI minLength: 1 hints: type: object description: Describes the allowed HTTP verbs for the `href` required: - allow properties: allow: type: array items: type: string enum: - DELETE - GET - POST - PUT required: - id - status - expiresAt - profile - _links examples: Polling-Response-Example: value: id: myaccount.DDvNA6XORA2dIfB894o32g status: UNVERIFIED expiresAt: '2022-02-01T00:41:25.497Z' profile: email: s.jackson@example.com _links: verify: href: https://example.okta.com/idp/myaccount/emails/da03e945d44d8b714da2b9fded39e851/challenge/myaccount.DDvNA6XORA2dIfB894o32g/verify hints: allow: - POST poll: href: https://example.okta.com/idp/myaccount/emails/da03e945d44d8b714da2b9fded39e851/challenge/myaccount.DDvNA6XORA2dIfB894o32g hints: allow: - GET '401': $ref: '#/components/responses/Error-IdpMyAccountNotEnabled-Response-401' '404': $ref: '#/components/responses/Error-EmailChallengeResourceNotFound-Response-404' security: - oauth2: - okta.myAccount.email.read tags: - Email x-okta-lifecycle: lifecycle: GA isGenerallyAvailable: true /idp/myaccount/emails/{id}/challenge/{challengeId}/verify: parameters: - schema: type: string example: 00T196qTp3LIMZQ0L0g3 description: 'The email ID Use `GET /idp/myaccount/emails` or `POST /idp/myaccount/emails` operations to obtain the email ID when adding a new email address. ' name: id in: path required: true - schema: type: string example: x1MDGzUb description: 'The `challengeId` of the email Use the `POST /idp/myaccount/emails/{id}/challenge` operation to obtain the `challengeId` when creating a new challenge. ' name: challengeId in: path required: true post: summary: Verify an Email OTP description: Verifies the email challenge with the code that the user receives from the \"Confirm email address change\" email. Once verified, the email is active. operationId: verifyEmailOtp requestBody: content: application/json: schema: type: object properties: verificationCode: type: string example: '498560' format: password writeOnly: true description: A six-digit verification code sent to the user in the "Confirm email address change" email required: - verificationCode examples: OTP-Example: value: verificationCode: '456058' responses: '200': description: OK content: application/json;okta-version=1.0.0: {} '401': $ref: '#/components/responses/Error-VerifyPhoneEmail-Response-401' '403': $ref: '#/components/responses/Error-Email-Response-403' '404': $ref: '#/components/responses/Error-EmailChallengeResourceNotFound-Response-404' security: - oauth2: - okta.myAccount.email.manage tags: - Email x-okta-lifecycle: lifecycle: GA isGenerallyAvailable: true components: responses: Error-EmailConflict-Response-409: description: Conflict content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Error' examples: Email-Conflict-409: value: errorCode: E0000157 errorSummary: 'Another authenticator with key: email is already active.' errorLink: E0000157 errorId: oaejUwz8U5FQ_SyggQwz1kC3w errorCauses: - errorSummary: The email example@email.com is already registered to the current user profile. Verified-Email-Response: description: Example response content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Email' examples: Success-Response: value: id: 69dca29c2d8dbb0dca14395ccdb92317 status: VERIFIED roles: - PRIMARY profile: email: saml.jackson@example.com _links: self: href: https://example.okta.com/idp/myaccount/emails/69dca29c2d8dbb0dca14395ccdb92317 hints: allow: - GET challenge: href: https://example.okta.com/idp/myaccount/emails/69dca29c2d8dbb0dca14395ccdb92317/challenge hints: allow: - POST Error-Email-Response-403: description: Forbidden content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Error' examples: Secondary-Email: value: errorCode: E0000038 errorSummary: This operation is not allowed in the user's current status. errorLink: E0000038 errorId: oaejUwz8U5FQ_SyggQwz1kC3w errorCauses: - errorSummary: Secondary email is not enabled as an authenticator for your org. Error-IdpMyAccountNotEnabled-Response-401: description: Unauthorized content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Error' examples: IDP-MyAccount-not-enabled-401: value: errorCode: E0000015 errorSummary: You do not have permission to access the feature you are requesting errorLink: E0000015 errorId: oaeStOuPPxDRUm3PJhf-tL7bQ errorCauses: [] Error-EmailChallengeResourceNotFound-Response-404: description: Not Found content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Error' examples: Email-Challenge-Resource-Not-Found-404: value: errorCode: E0000007 errorSummary: 'Not found: Resource not found: myaccount.WJLzOhehQwSVUFLVTy2ywb (IdpMyAccountChallenge)' errorLink: E0000007 errorId: oaejUwz8U5FQ_SyggQwz1kC3w errorCauses: [] Error-EmailResourceNotFound-Response-404: description: Not Found content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Error' examples: Email-Resource-Not-Found-404: value: errorCode: E0000007 errorSummary: 'Not found: Resource not found: 796bc844c1802c5ad5a65e1dbd26c30a (UserProfileEmail)' errorLink: E0000007 errorId: oaejUwz8U5FQ_SyggQwz1kC3w errorCauses: [] Error-InvalidEmailDeletion-400: description: Bad Request content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Error' examples: Invalid-Email-Deletion-400: value: errorCode: E0000001 errorSummary: 'Api validation failed: email' errorLink: E0000001 errorId: oaejUwz8U5FQ_SyggQwz1kC3w errorCauses: - errorSummary: Can't delete a verified email address. Email-Array-Response: description: Example response content: application/json;okta-version=1.0.0: schema: type: array items: $ref: '#/components/schemas/Email' examples: Success-Response: value: - id: 69dca29c2d8dbb0dca14395ccdb92317 status: VERIFIED roles: - PRIMARY profile: email: saml.jackson@example.com _links: self: href: https://example.okta.com/idp/myaccount/emails/69dca29c2d8dbb0dca14395ccdb92317 hints: allow: - GET challenge: href: https://example.okta.com/idp/myaccount/emails/69dca29c2d8dbb0dca14395ccdb92317/challenge hints: allow: - POST - id: e2a84ed3cc538f75457596faa74a4532 status: UNVERIFIED roles: - PRIMARY profile: email: s.jackson@company.com _links: self: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532 hints: allow: - GET - DELETE challenge: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge hints: allow: - POST verify: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge/myaccount.IDseIErVSEiFlLyAbzSp5Q/verify hints: allow: - POST poll: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge/myaccount.IDseIErVSEiFlLyAbzSp5Q hints: allow: - GET Error-InvalidEmail-Response-400: description: Bad Request content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Error' examples: Invalid-Email-400: value: errorCode: E0000001 errorSummary: 'Api validation failed: email' errorLink: E0000001 errorId: oaejUwz8U5FQ_SyggQwz1kC3w errorCauses: - errorSummary: Invalid email address. Unverified-Email-Response: description: Example response content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Email' examples: Success-Response: value: id: e2a84ed3cc538f75457596faa74a4532 status: UNVERIFIED roles: - PRIMARY profile: email: s.jackson@company.com _links: self: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532 hints: allow: - GET - DELETE challenge: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge hints: allow: - POST verify: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge/myaccount.IDseIErVSEiFlLyAbzSp5Q/verify hints: allow: - POST poll: href: https://example.okta.com/idp/myaccount/emails/e2a84ed3cc538f75457596faa74a4532/challenge/myaccount.IDseIErVSEiFlLyAbzSp5Q hints: allow: - GET Error-VerifyPhoneEmail-Response-401: description: Unauthorized content: application/json;okta-version=1.0.0: schema: $ref: '#/components/schemas/Error' examples: IDP-MyAccount-not-enabled-401: value: errorCode: E0000015 errorSummary: You do not have permission to access the feature you are requesting errorLink: E0000015 errorId: oaeStOuPPxDRUm3PJhf-tL7bQ errorCauses: [] Unauthorized-User-401: value: errorCode: E0000004 errorSummary: Authentication failed errorLink: E0000004 errorId: oaejUwz8U5FQ_SyggQwz1kC3w errorCauses: - errorSummary: User is not authorized. User-Failed-To-Answer-Challenge-401: value: errorCode: E0000004 errorSummary: Authentication failed errorLink: E0000004 errorId: oaejUwz8U5FQ_SyggQwz1kC3w errorCauses: - errorSummary: The verification challenge failed due to an invalid code. schemas: Error: description: Standard API error object type: object properties: errorCauses: type: array description: (Optional) Further information about what caused this error items: type: object properties: errorSummary: type: string description: A natural language explanation of the error example: Bad request because XYZ is missing. readOnly: true errorCode: type: string description: A code that is associated with this error type example: E0000001 readOnly: true errorId: type: string description: A unique identifier for this error. This can be used by Okta Support to help with troubleshooting. example: oaeWGQKoQHeQmy0u8w8bPwi_Q readOnly: true errorLink: type: string description: A link to documentation with a more detailed explanation of the error (not yet implemented and is currently the same value as the 'errorCode') example: E0000001 readOnly: true errorSummary: type: string description: A natural language explanation of the error example: Bad request because XYZ is missing. readOnly: true Email: description: Email object type: object properties: id: type: string description: The email ID of the caller minLength: 1 readOnly: true profile: type: object description: Defines the email address on the profile required: - email properties: email: type: string description: Email address of the user minLength: 1 roles: type: array description: Defines the role of the email items: type: string enum: - PRIMARY - SECONDARY status: type: string description: The email status of the caller minLength: 1 readOnly: true enum: - VERIFIED - UNVERIFIED _links: type: object description: Discoverable resources related to the caller's email properties: self: type: object description: Link to the resource (self) properties: href: type: string description: Link URI minLength: 1 hints: type: object description: Describes the allowed HTTP verbs for the `href` properties: allow: type: array items: type: string enum: - GET - DELETE - PUT challenge: type: object description: Link to the resource (challenge) properties: href: type: string description: Link URI minLength: 1 hints: type: object description: Describes the allowed HTTP verbs for the `href` properties: allow: type: array items: type: string enum: - DELETE - GET - POST - PUT verify: type: object description: Link to the resource (verify) properties: href: type: string description: Link URI minLength: 1 hints: type: object description: Describes the allowed HTTP verbs for the `href` properties: allow: type: array items: type: string enum: - DELETE - GET - POST - PUT poll: type: object description: Link to the resource (poll) properties: href: type: string description: Link URI minLength: 1 hints: type: object description: Describes the allowed HTTP verbs for the `href` properties: allow: type: array items: type: string enum: - DELETE - GET - POST - PUT required: - id - status - profile - roles securitySchemes: oauth2: type: oauth2 description: 'Pass the access_token as the value of the Authorization header: `Authorization: Bearer {access_token}`' flows: authorizationCode: authorizationUrl: /oauth2/v1/authorize tokenUrl: /oauth2/v1/token scopes: okta.myAccount.appAuthenticator.maintenance.manage: Write access to non-sensitive attributes of user app authenticator enrollments okta.myAccount.appAuthenticator.maintenance.read: Read access to non-sensitive attributes of user app authenticator enrollments okta.myAccount.appAuthenticator.manage: Write access to user app authenticator enrollments okta.myAccount.appAuthenticator.read: Read access to user app authenticator enrollments okta.myAccount.authenticators.manage: Write access to user authenticator enrollments okta.myAccount.authenticators.read: Read access to user authenticator configurations and enrollments okta.myAccount.email.manage: Write access to user emails okta.myAccount.email.read: Read access to user emails okta.myAccount.oktaApplications.read: Read access to the Okta apps list okta.myAccount.organization.read: Read access to org details okta.myAccount.password.manage: Write access to user password okta.myAccount.password.read: Read access to user password metadata okta.myAccount.phone.manage: Write access to user phones okta.myAccount.phone.read: Read access to user phones okta.myAccount.profile.manage: Write access to user profile and schema okta.myAccount.profile.read: Read access to user profile and schema okta.myAccount.sessions.manage: Write access to user sessions externalDocs: description: Find more info here url: https://developer.okta.com