Create a user account
const url = 'https://client-api.abi.ai/user';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"uniqueId":"123abc789xyz","firstName":"Jane","lastName":"Doe","email":"janedoe@example.com","phone":"+441234567890","validatePhone":true,"address":"123 Main St, Apt 4B","age":34,"dateOfBirth":"1994-10-07","gender":"male","language":"en","country":"it","location":"es","origin":"gb","physicianCountry":"es","privacyAt":false,"termsAt":false,"shouldNotify":true,"subscriptionStartDate":"2021-11-17","subscriptionEndDate":"2022-05-31","associatedAccounts":5,"productName":"Free trial"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://client-api.abi.ai/user \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "uniqueId": "123abc789xyz", "firstName": "Jane", "lastName": "Doe", "email": "janedoe@example.com", "phone": "+441234567890", "validatePhone": true, "address": "123 Main St, Apt 4B", "age": 34, "dateOfBirth": "1994-10-07", "gender": "male", "language": "en", "country": "it", "location": "es", "origin": "gb", "physicianCountry": "es", "privacyAt": false, "termsAt": false, "shouldNotify": true, "subscriptionStartDate": "2021-11-17", "subscriptionEndDate": "2022-05-31", "associatedAccounts": 5, "productName": "Free trial" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
An optional identifier from your system
Example
123abc789xyzThe user’s first name.
Example
JaneThe user’s surname.
Example
DoeThe user’s email address.
Example
janedoe@example.comThe user’s mobile number including international dialing code (E.164).
Example
+441234567890Validate the supplied phone number before creating the user.
Example
trueThe user’s address.
Example
123 Main St, Apt 4BThe user’s age.
Example
34The user’s date of birth.
Example
1994-10-07The user’s gender
Example
femaleThe language Abi uses to communicate with the user.
Example
enThe user’s nationality or country code.
Example
itThe country where the user lives or is currently located.
Example
esThe country in which the user was born.
Example
gbThe country in which responding healthcare professionals are licensed.
Example
esWhether the user has accepted the Privacy Notice.
Example
falseWhether the user has accepted the Terms and Conditions.
Example
falseSend the configured invitation notification when contact details are supplied.
Example
trueThe UTC date on which the subscription becomes active.
Example
2021-11-17The UTC date on which the subscription expires.
Example
2022-05-31The number of associated accounts allowed by an enabled group-account policy. This user becomes the main policy holder.
Example
5The Abi-provided product identifier for this account subscription.
Example
Free trialResponses
Section titled “Responses”User created. See the User account model for the full response-field reference.
object
Example
{ "id": "abi1234", "uniqueId": "123abc789xyz", "userStatus": "activeUser", "firstName": "Jane", "lastName": "Doe", "email": "janedoe@gmail.com", "gender": "female", "phone": "+441234567890", "origin": "gb", "location": "es", "country": "it", "physicianCountry": "es", "language": "en", "dateOfBirth": "1994-10-07", "partnerName": "Abi", "associatedAccounts": 5}