# Double opt In

Allow option for double opt-in.

## Creating a customer account with double opt-in

> Creates a customer account using the token obtained through double opt-in.\
> \
> \*\*Note\*\*: The request needs to be authorized with an anonymous access token.\
> \*\*\*\
> \### Required scopes\
> No specific scopes are required.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Double opt-in","description":"Allow option for double opt-in."}],"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."}},"schemas":{"CustomerToken":{"description":"","type":"object","allOf":[{"$ref":"#/components/schemas/RefreshCustomerToken"}],"properties":{"saasToken":{"type":"string","minLength":1,"deprecated":true},"saas_token":{"type":"string","minLength":1},"initialPassword":{"type":"string","description":"Indicates if login was performed with password created by an employee"}}},"RefreshCustomerToken":{"description":"","type":"object","properties":{"accessToken":{"type":"string","minLength":1,"deprecated":true},"expiresIn":{"type":"number","format":"int32","deprecated":true},"refreshToken":{"type":"string","minLength":1,"deprecated":true},"refreshTokenExpiresIn":{"type":"number","format":"int32","deprecated":true},"access_token":{"type":"string","minLength":1},"expires_in":{"type":"number","format":"int32"},"refresh_token":{"type":"string","minLength":1},"refresh_token_expires_in":{"type":"number","format":"int32"},"token_type":{"type":"string"},"session_id":{"type":"string"}}},"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."}}}}}}},"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"}}}}}}}}}}}},"paths":{"/customer/{tenant}/signup/optin/{token}":{"get":{"operationId":"GET-customer-signup-customer-optin","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerToken"}}}},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"}},"description":"Creates a customer account using the token obtained through double opt-in.\n\n**Note**: The request needs to be authorized with an anonymous access token.\n***\n### Required scopes\nNo specific scopes are required.","parameters":[{"name":"token","in":"path","required":true,"description":"The token sent in email to customer during account creation.\n","schema":{"type":"string"}}],"summary":"Creating a customer account with double opt-in","tags":["Double opt-in"]}}}}
```

## Resending an account activation link to a customer

> Resends an account activation link to the customer.\
> \
> \*\*Note\*\*: The request needs to be authorized with an anonymous access token.\
> \*\*\*\
> \### Required scopes\
> No specific scopes are required.<br>

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Double opt-in","description":"Allow option for double opt-in."}],"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"}}}}}}}}}}},"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."}}}}}},"RefreshToken":{"type":"object","properties":{"email":{"type":"string","description":"Customer email address."}},"required":["email"]}}},"paths":{"/customer/{tenant}/signup/optin/refresh_token":{"post":{"operationId":"POST-customer-refresh-token","responses":{"202":{"description":"Accepted"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshToken"}}},"required":true},"description":"Resends an account activation link to the customer.\n\n**Note**: The request needs to be authorized with an anonymous access token.\n***\n### Required scopes\nNo specific scopes are required.\n","summary":"Resending an account activation link to a customer","tags":["Double opt-in"]}}}}
```
