Customer account management
When a customer registers, they become the owner of their account. They can change their own data and security settings.
The requests for self-management do not require parameters that identify the customer. Identity information is encoded in the JSON Web Token used for authorization.
Retrieving customers’ own data
Method reference available here.
A customer can access their own data stored in the database.
curl --location --request \
GET 'https://{SYNERISE_API_BASE_PATH}/v4/my-account/personal-information' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Api-Version: 4.4' \
--header 'Authorization: Bearer eyJh...1FG5M'
The response includes all of the customer’s data from the database.
Updating customers’ own data
Method reference available here.
A customer can update their personal data.
When sending the request, include only the fields that you want to update. Sending a null value deletes an attribute (if it’s a custom attribute) or sets it to null/default value (if the attribute is Synerise-native). Empty strings are not accepted.
The following example request updates the customer’s avatar:
curl --location --request \
POST 'https://{SYNERISE_API_BASE_PATH}/v4/my-account/personal-information' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Api-Version: 4.4' \
--header 'Authorization: Bearer eyJh...JxkM5o' \
--data-raw '{
"avatarUrl": "https://www.gravatar.com/avatar/21b3b5d704c1a5169d16cef176ad4415?s=100&r=g&d=blank"
}'
Changing email addresses
A customer can change their own email address.
Prerequisites:
SMS sender integration must be enabled.
- Request an email change.
Result: A confirmation token is sent to the customer’s phone number.
curl --request POST --url https://{SYNERISE_API_BASE_PATH}/sauth/my-account/email-change/request --header 'authorization: Bearer eyJh...JxkM5o' --header 'content-type: application/json' --data '{ "email":"newemail@synerise.com", "password":"strongpassword", "uuid":"07243772-008a-42e1-ba37-c3807cebde8f", "deviceId":"b3f56868-9667-4843-a8e5-0509456baa9b" }'
- Confirm email change.
You can also use this request to enable newsletter agreements for the new email.curl --request POST --url https://{SYNERISE_API_BASE_PATH}/sauth/my-account/email-change/confirmation --header 'authorization: Bearer eyJh...JxkM5o' --header 'content-type: application/json' --data '{ "token":"string", "newsletterAgreement":true }'
Changing phone numbers
A customer can change their own phone number.
Prerequisites:
SMS sender integration must be enabled.
- Request a phone number change.
Result: A confirmation token is sent to the new phone number.
curl --request POST --url https://{SYNERISE_API_BASE_PATH}/v4/my-account/phone-update/request --header 'authorization: Bearer eyJh...JxkM5o' --data '{ "phone":"555015332" }'
- Confirm the phone number change.
You can also use this request to enable SMS marketing permissions for the new number.curl --request POST --url https://{SYNERISE_API_BASE_PATH}/v4/my-account/phone-update/confirmation --header 'authorization: Bearer eyJh...JxkM5o' --data '{ "phone":"string", "confirmationCode":"string", "deviceId":"string", "smsAgreement":true }'
Account deletion
Customers can delete their own accounts. Depending on the registration method, you need to use one of the following methods:
- Delete RaaS account
- Delete OAuth account
- Delete Log in with Facebook account
- Delete Sign in with Apple account
When an account is deleted, its events (anonymized) are retained in the database. The customer profile stops being visible in the Profiles module and is deleted.