Skip to content

/request_email_change

/me/request_email_change

Target audience: Developers

1
Release version: 4.1.4.x

Introduction

This endpoint lets the user request a e-mail change.
If successful the user should receive an e-mail containing the URL to complete the process. Depending on how you verify the user, if you use PCP to verify the account there is no need to call Verify email change. But if you're completing the process using your own e-mail provider you need to send a request to Verify email change along with the confirmation code received.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/me/request_email_change
Production https://backend.worldoftulo.com/external/api/v1/me/request_email_change

Required scope

1
/external/me/w

Parameters

Field Required Type Description
new_email Required String The new e-mail for the user.
Size range: ..1024
Allowed values: e-mail regex that is too long to show here
confirmation_url Optional String The confirmation url the user will be sent to verify him or herself. Not required if you're using Payway as an e-mail provider.
Size range: ..1024
Allowed values: uri regex that is too long to show here

Curl Example

1
2
3
4
5
6
7
8
9
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v1/me/request_email_change \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
--header 'content-type: application/json' \
--data '{
         "new_email": "new-email@adeprimo.se",
         "confirmation_url": "https://confirmation-uri.com"
       }'

Response

Example Response: Successfully requested e-mail change

1
2
3
4
5
6
7
HTTP 200
{
 "current_email" => "current_email@adeprimo.se",
 "new_email" => "new_email@adeprimo.se",
 "confirmation_url" => "https://confirmation-uri.com",
 "confirmation_code" => "89bd6d78-4ace-4a0c-a517-afbbbc97c659"
}

HTTP 400 Bad Request

Name Type Description
invalid_parameter Object Validation error on any of the fields in the posted json
json_parser_error Object The request body could not be parsed as valid json
invalid_content_type_error Object The requests Content-Type header isn't set to application/json
unknown_parameter Object One or more of the fields in the posted json was not recognized

HTTP 404 Not Found

Name Type Description
not_found Object The account or product could not be found

HTTP 409 Conflict

Name Type Description
account_not_belonging_to_organisation Object The account is not connected to your organisation
new_and_current_email_same Object The new e-mail is the same as the current
already_exists Object The new e-mail is taken by another user

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side