# Credentials

Manage customer credentials.

## Sending a request to update a customer email address

> Sends a request to change a customer email address. As a result, the customer receives a unique token through email.\
> \
> \*\*Note\*\*: The request needs to be authorized with a customer access token.\
> \
> Request for changing login email token using current email id and password requires the \`customer.customerprofile\_edit\` scope assigned with the customer access token.<br>

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Credentials","description":"Manage customer credentials."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer","description":"To generate a customer access token, go to the 'Logging in a customer' endpoint."}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}},"ChangeEmailRequestDto":{"title":"ChangeEmailRequestDto","type":"object","properties":{"email":{"type":"string","description":"Customer email address currently used for logging in."},"password":{"type":"string","description":"Customer account password."},"newEmail":{"type":"string","description":"Customer new email address."},"syncContactEmail":{"type":"boolean","default":false,"description":"Flag indicating whether the `contactEmail` should be changed to the new email address."}}}}},"paths":{"/customer/{tenant}/me/accounts/internal/email/change":{"post":{"responses":{"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Sends a request to change a customer email address. As a result, the customer receives a unique token through email.\n\n**Note**: The request needs to be authorized with a customer access token.\n\nRequest for changing login email token using current email id and password requires the `customer.customerprofile_edit` scope assigned with the customer access token.\n","operationId":"POST-customer-change-customer-login-email","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeEmailRequestDto"}}},"required":false},"summary":"Sending a request to update a customer email address","tags":["Credentials"]}}}}
```

## Updating a customer email address

> Updates a customer email address using the token received through email.\
> \
> \*\*Note\*\*: The request needs to be authorized with a anonymous access token.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Credentials","description":"Manage customer credentials."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"AnonymousAccessToken":[]}],"components":{"securitySchemes":{"AnonymousAccessToken":{"type":"http","scheme":"bearer","description":"To generate an anonymous token, check out the 'Requesting an anonymous token' endpoint."}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}},"UpdateEmail":{"title":"UpdateEmail","type":"object","properties":{"token":{"type":"string","description":"Token received by the customer through email."}}}}},"paths":{"/customer/{tenant}/me/accounts/internal/email/change/confirm":{"post":{"responses":{"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Updates a customer email address using the token received through email.\n\n**Note**: The request needs to be authorized with a anonymous access token.","operationId":"POST-customer-confirm-customer-login-email","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmail"}}},"required":false},"tags":["Credentials"],"summary":"Updating a customer email address"}}}}
```

## Sending a request to reset a customer password

> Sends a request to reset a Customer account password. As a result, the customer receives a unique token through email.\
> \
> \*\*Note\*\*: The request needs to be authorized with a anonymous access token.<br>

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Credentials","description":"Manage customer credentials."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"AnonymousAccessToken":[]}],"components":{"securitySchemes":{"AnonymousAccessToken":{"type":"http","scheme":"bearer","description":"To generate an anonymous token, check out the 'Requesting an anonymous token' endpoint."}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}},"PasswordResetRequestDto":{"type":"object","properties":{"email":{"type":"string","description":"Customer email address."},"site":{"type":"string","description":"Site from which password reset request was sent"}},"required":["email"]}}},"paths":{"/customer/{tenant}/password/reset":{"post":{"responses":{"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Sends a request to reset a Customer account password. As a result, the customer receives a unique token through email.\n\n**Note**: The request needs to be authorized with a anonymous access token.\n","operationId":"POST-customer-request-reset-password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetRequestDto"}}},"required":false},"summary":"Sending a request to reset a customer password","tags":["Credentials"]}}}}
```

## Resetting a customer password

> Resets a customer password using the token received through email and sets a new password.\
> \
> \*\*Note\*\*: The request needs to be authorized with a anonymous access token.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Credentials","description":"Manage customer credentials."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"AnonymousAccessToken":[]}],"components":{"securitySchemes":{"AnonymousAccessToken":{"type":"http","scheme":"bearer","description":"To generate an anonymous token, check out the 'Requesting an anonymous token' endpoint."}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}},"PasswordUpdate":{"type":"object","properties":{"token":{"type":"string","description":"Token received by the customer through email."},"password":{"type":"string","description":"Customer new account password."}},"required":["token","password"]}}},"paths":{"/customer/{tenant}/password/reset/update":{"post":{"responses":{"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Resets a customer password using the token received through email and sets a new password.\n\n**Note**: The request needs to be authorized with a anonymous access token.","operationId":"POST-customer-reset-password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordUpdate"}}},"required":false},"tags":["Credentials"],"summary":"Resetting a customer password"}}}}
```

## Changing a customer password

> Changes a Customer account password.\
> \
> \*\*Note\*\*: The request needs to be authorized with a customer access token.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Credentials","description":"Manage customer credentials."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer","description":"To generate a customer access token, go to the 'Logging in a customer' endpoint."}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}},"PasswordChangeDto":{"type":"object","properties":{"currentPassword":{"type":"string","description":"Customer current account password."},"newPassword":{"type":"string","description":"Customer new account password."}},"required":["currentPassword","newPassword"]}}},"paths":{"/customer/{tenant}/password/change":{"post":{"responses":{"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Changes a Customer account password.\n\n**Note**: The request needs to be authorized with a customer access token.","operationId":"POST-customer-change-account-password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChangeDto"}}},"required":false},"tags":["Credentials"],"summary":"Changing a customer password"}}}}
```
