User
Services at this endpoint access and modify the currently logged in user's record.
A user is an ampliFi customer. Users are initially processed as prospects, then converted to users when they have been validated.
Endpoint | Action |
---|---|
User Object | Description of the user object |
GET /user | Get the currently logged in user's details |
POST /user | Modify the currently logged in user's details |
User Object
The ampliFi API represents a user by a JSON object. This table lists properties usually included in a user object. Some details may vary.
Properties | Description | Schema | Required? (default) | Example Values |
---|---|---|---|---|
AFiUserId | ampliFi ID for the user | string | yes | "qweaurl8kgtlv9pc" |
dtsCreated | Date and time when the record was created | dts | yes | "2022-09-27T17:21:23.445Z" |
names | Older names, if any | array of name objects | no (none) | [ {//name object 1}, {//name object 2}, ... ] |
name | The user's name object | object | yes | {"firstName": "John", "middleName": "", "lastName": "Testman"} |
firstName | The user's first (given) name | string | yes | "John" |
middleName | The user's middle name(s), if any | string | no (none) | "" |
lastName | The user's last (family) name | string | yes | "Testman" |
sortId | An ID for sorting, randomly generated | string | yes | "s7j" |
languageCode | A 2-letter code for user's preferred language | string | yes | "en" |
dtsModified | The date and time when the record was last modified | dts | yes | "2022-09-27T17:22:03.172Z" |
dtsCreatedAtUsers | The date and time when the user applied | dts | yes | "2022-09-27T17:21:23.445Z" |
segment | The customer segment for user | string | yes | "demo" |
postOnboardingStepsRequired | The next step required in the prospect to user process | string | no (none) | "postonboardingadultstep2" |
referralCode | A referral code this user can use to invite others | string | no (none) | "BBBUTHZFE" |
extras | Additional information if any (see below) | object | no (none) | { //See extras Object Example below} |
private | True if user is not a business | boolean | yes | true |
isFullyRegistered | True if user passed KYC (Know Your Customer) and has opened an account | boolean | yes | true |
isIdleUser | True if user was created, but bank account was not opened | boolean | yes | false |
uiStage | User's current stage | string | no (none) | "firstContact" |
ssn | The user's 9 digit Social Security Number | string | no (none) | "123456789" |
dosDob | User's date of birth in "YYYY-MM-DD" format | string | yes | "1978-10-15" |
dobDay | User's birth date day in "DD" format | string | yes | "15" |
dobMonth | User's birth date month in "MM" format | string | yes | "10" |
dobYear | User's birth date year in "YYYY" format | string | yes | "1978" |
addresses | Array of address objects | array | yes | [ { //See address Object Example below}, ... ] |
mobile | The user's mobile 10 digit phone number | string | no (none) | "1234567890" |
The user's email address in email format | string | no (none) | "aa@aa.ae" | |
homeCurrency | 3-letter currency code | string | yes | "USD" |
isActive | True if user is active | boolean | yes | true |
dtsRegistered | The date and time when user was registered | dts | yes | "2022-09-27T17:21:57.913Z" |
phoneNumbers | An array of user's phone numbers | array | no (none) | [ "1234567890", ... ] |
emails | An array of user's email addresses | array | no (none) | [ "aa@aa.ae", ... ] |
isMetric | True if customer prefers metric measurements | boolean | yes | false |
faceImage | The user's face image, png encoded in Base 64 | string | no (none) | "/a/very/long/string/of/characters/and/digits" |
mainAFiAccountId | The account ID for the user's main account | string | yes | "qwegal8kgtmysmels" |
extras Object Example
"extras": {
"sex": "female",
"eyeColor": "BRO",
"heightImperial": "66",
"heightMetric": "168",
"veteran": "1"
}
address Object Example
{
"addressLine1": "123 Main Str.",
"addressLine2": null,
"city": "Somecity",
"state": "PA",
"postalCode": "12345",
"countryCode": "US",
"AFiUserId": "qweaurl8kgtlv9pc",
"dtsRecorded": "2022-09-27T17:21:57.953Z",
"AFiUserAddressId": "qwebeteysxkycnkcyddoziktasubadowcprrvwjsjri",
"dtsModified": "2022-09-27T17:21:57.953Z"
}
Get User Details
Request method and URL
GET /user
Description
Get a complete user record for the currently logged in user. No request body or path parameters are necessary for this endpoint, as the current context will be sufficient.
Request headers
Request body example None
Response body example
{
"AFiUserId": "qweaurl8kgtlv9pc", //ampliFi ID for the user
"dtsCreated": "2022-09-27T17:21:23.445Z", //date and time when the record was created
"names": [], //array list of previously used name objects
"name": { //currently used name object
"firstName": "John",
"middleName": "",
"lastName": "Testman"
},
"firstName": "John", //user first name
"sortId": "s7j", //randomly generated
"languageCode": "en", //user's preferred language 2-digit code
"dtsModified": "2022-09-27T17:22:03.172Z", //date time stamp when the user record was last modified
"dtsCreatedAtUsers": "2022-09-27T17:21:23.445Z", //date time stamp when the user applied
"segment": "demo", //customer segment for user
"postOnboardingStepsRequired": "postonboardingadultstep2", //next step required in the prospect to user process
"referralCode": "BBBUTHZFE", //referral code this user can use to invite others
"extras": { //object containing any additional information
"sex": "male",
"eyeColor": "BRO",
"hairColor": "BLK",
"heightMetric": "181",
"weightMetric": "85"
},
"private": true, //true if the user is not a business (is an individual)
"isFullyRegistered": true, //true if user passed KYC (Know Your Customer) and has opened an account
"isIdleUser": false, //true if user was created, but bank account was not opened
"uiStage": "firstContact", //user's current stage
"middleName": "", //user's middle name
"lastName": "Testman", //user's last name (family name)
"ssn": "1234856789", //user's Social Security number
"dosDob": "1978-10-15", //user's date of birth in "YYYY-MM-DD" format
"dobDay": "15", //user's birth date day
"dobMonth": "10", //user's birth date month
"dobYear": "1978", //user's birth date year
"addresses": [ //array containing list of address objects
{
"addressLine1": "123 Main Str.",
"addressLine2": null,
"city": "Somecity",
"state": "PA",
"postalCode": "12345",
"countryCode": "US",
"AFiUserId": "qweaurl8kgtlv9pc", //user ID in ampliFi
"dtsRecorded": "2022-09-27T17:21:57.953Z",
"AFiUserAddressId": "qwebeteysxkycnkcyddoziktasubadowcprrvwjsjri", //account ID in ampliFi for user's main account
"dtsModified": "2022-09-27T17:21:57.953Z"
}
],
"mobile": "1234567890", //mobile phone number for user
"email": "aa@aa.ae", //current email address for user
"homecurrency": "USD", //3-letter currency code
"isActive": true, //true if user is active
"dtsRegistered": "2022-09-27T17:21:57.913Z", //date time stamp when the user was registered
"phoneNumbers": [ //array containing list of user phone numbers
"1234567890"
],
"emails": [ //array containing list of user email addresses
"aa@aa.ae"
],
"isMetric": false, //true if user preferrs metric measurements
"faceImage": "/9j/2wBDAAYEBQY...DFCI2BoSLUymaR0h6r/9k=", //base64 PNG image with user's face
"mainAFiAccountId": "qwegal8kgtmysmels" //account ID in ampliFi for user's main account
}
- See user object
Possible Errors
Status Code | Description of possible error |
---|---|
401+ | Unauthorized, Cannot find the user (not logged in) |
Modify User Details
Request method and URL
POST /user
Description
Change elements of a user record. The user is identified by the token supplied. The request body should contain only fields that actually are to be changed.
Request headers
{
"Content-Type": "application/json"
"token": "a long random string" //Authorization token received from /token request
}
Request body example
{
"dtsModified": "Wed Oct 27 2021 16:52:52 GMT-0400", //dts when user details were modified
"mobile": "1234567890", //optional. Provide if the mobile number did change
"email": "janice@sample.com", //optional. Provide if the email did change
"newAddresses": {}, //optional. Provide if user did enter a new address
"languageCode": "en", //optional.
"postOnboardingStepsRequired": null, //optional. Provide a screen user has to be taken to immediately after the next login.
"faceImage": "/9j/2wBDAAYEBQY...DFCI2BoSLUymaR0h6r/9k=" //base64 PNG image with user's face
}
Response body example