div
div
h1
Bulk Profile Import Supplemental
h2
NDJSON Data - Not Your Regular JSON Payload
NDJSON is a text-based data format consisting of a packed JSON object separated by a newline. Each line is an independent JSON record.

h2
Sending a Bulk Profile Import Request with NDJSON
Bulk Profile Import API endpoint : /bulk/v1/{itemType}
itemType : profile
NDJSON Sample Request Payload :


```json
   {"clientRefId": "GUID1", "data": {"agent": AGENTDATA}}
   {"clientRefId": "GUID2", "data": {"agent": AGENTDATA}}
   {"clientRefId": "GUID3", "data": {"agent": AGENTDATA}}
   {"clientRefId": "GUID4", "data": {"agency": AGENCYDATA}}
   {"clientRefId": "GUID5", "data": {"agency": AGENCYDATA}}
```

Where **clientRefId** is a GUID which is mandatory and should be unique per request and **data** which contains either an agent and agency record.

You can send both agent and agency records in a single bulk profile import request, but we recommend keeping it to 100 records per import or less

h2
Sample AGENTDATA
> pretty-formatted for readability, but in the NDJSON you have to compress it to a single long line



```json
{
  "businessAddress": {
    "addressId": 1000,
    "city": "Hallandale",
    "clientAddressId": "",
    "country": "USA",
    "county": "1026",
    "fromDate": "2019-08-24T14:15:22Z",
    "state": "NY",
    "streetAddress1": "string",
    "streetAddress2": "string",
    "toDate": "2019-08-24T14:15:22Z",
    "zip": "33001"
  },
  "contact": {
    "additionalEmailAddress": "qa@reged.com",
    "businessEmailAddress": "qa@reged.com",
    "businessFaxNumber": "1112223331",
    "businessPhoneExtension": "111",
    "businessPhoneNumber": "17549127046",
    "cellPhoneNumber": "17549127046",
    "homeEmailAddress": "qa@reged.com",
    "homeFaxNumber": "1112223331",
    "homePhoneNumber": "17549127046",
    "suppressEmail": "N"
  },
  "currentEmployment": {
    "city": "Hallandale",
    "country": "USA",
    "county": "1026",
    "employerName": "Reged",
    "employmentId": 0,
    "hireDate": "2019-08-24T14:15:22Z",
    "investmentRelated": "string",
    "jobTitle": "QA",
    "state": "FL",
    "streetAddress1": "string",
    "streetAddress2": "string",
    "supervisorName": "string",
    "zip": "33001"
  },
  "demographic": {
    "affiliatedWithBank": "Y",
    "alias": "string",
    "backOfficeNrf": "N",
    "billingCode": "001",
    "branchLocation": "NY",
    "cityOfBirth": "NY",
    "costCenter": "string",
    "country": "string",
    "countryOfBirth": "string",
    "crdNumber": "123124",
    "customField1": "string",
    "customField2": "string",
    "customField3": "string",
    "customField4": "string",
    "customField5": "string",
    "customField6": "string",
    "customField7": "string",
    "customField8": "string",
    "customField9": "string",
    "customField10": "string",
    "deptNumber": "string",
    "driverLicenseNumber": "string",
    "driverLicenseState": "NY",
    "employerId": "string",
    "employersFein": "88888888",
    "empStatus": "7040",
    "firstName": "Konstantin",
    "gender": "M",
    "jobTitle": "QA",
    "lastName": "string",
    "middleInitial": "string",
    "niprNumber": "8888888",
    "nmlsRegPriorFirmYn": "string",
    "nmlsRenewalStatus": "7040",
    "residentState": "NY",
    "salutation": "Mr",
    "stateOfBirth": "NY",
    "suffix": "string"
  },
  "hierarchy": {
    "hierarchyCode": "string",
    "manager1": "string",
    "manager2": "string",
    "manager3": "string",
    "manager4": "string",
    "manager5": "string",
    "manager6": "string",
    "manager7": "string",
    "manager8": "string",
    "manager9": "string",
    "manager10": "string",
    "supervisor": "string"
  },
  "information": {
    "iaBrochureSupplementDate": "2019-08-24T14:15:22Z",
    "iaBrochureSupplementRequired": "Y",
    "iaSupervisorName": "string",
    "iaSupervisorPhoneNumber": "17549127046",
    "iaSupervisorTitle": "string"
  },
  "mailingAddress": {
    "addressId": 100,
    "city": "string",
    "clientAddressId": "",
    "country": "USA",
    "county": "1026",
    "fromDate": "2019-08-24T14:15:22Z",
    "state": "NY",
    "streetAddress1": "Street 1",
    "streetAddress2": "Street 2",
    "toDate": "2019-08-24T14:15:22Z",
    "zip": "33001"
  },
  "primaryAddress": {
    "addressId": 100,
    "city": "NY",
    "clientAddressId": "",
    "country": "string",
    "county": "1026",
    "fromDate": "2019-08-24T14:15:22Z",
    "state": "NY",
    "streetAddress1": "string",
    "streetAddress2": "string",
    "toDate": "2019-08-24T14:15:22Z",
    "zip": "33001"
  },
  "profileKey": "9900575426",
  "residentAddress": {
    "addressId": 100,
    "city": "Hallandale",
    "clientAddressId": "",
    "country": "USA",
    "county": "1026",
    "fromDate": "2019-08-24T14:15:22Z",
    "state": "FL",
    "streetAddress1": "Hallandale Streen 1990",
    "streetAddress2": "",
    "toDate": "2019-08-24T14:15:22Z",
    "zip": "33001"
  },
  "ssn": "974261718"
}
```

h2
Sample AGENCYDATA
pretty-formatted for readability, but in the NDJSON you have to compress it to a single long line


```json
{
  "businessAddress": {
    "addressId": 2432,
    "city": "string",
    "clientAddressId": "0",
    "country": "USA",
    "county": "string",
    "fromDate": "2019-08-24T14:15:22Z",
    "state": "CA",
    "streetAddress1": "string",
    "streetAddress2": "string",
    "toDate": "2019-08-24T14:15:22Z",
    "zip": "12345"
  },
  "contacts": [
    {
      "businessFaxNumber": "1112223333",
      "businessPhoneExtension": "1112",
      "businessPhoneNumber": "1112223335",
      "cellPhoneNumber": "1112223336",
      "clientContactId": "0",
      "contactId": 0,
      "contactType": "7162",
      "emailAddress": "qa@reged.com",
      "firstName": "string",
      "lastName": "string"
    }
  ],
  "demographic": {
    "affiliatedWithBank": "N",
    "businessFax": "1112223331",
    "businessPhone": "2112223331",
    "costCenter": "2411",
    "firmBillingCode": "3024",
    "customField1": "1string",
    "customField2": "2string",
    "customField3": "3string",
    "dbaName": "test",
    "domicileCountry": "USA",
    "domicileState": "FL",
    "emailAddress": "qa@reged.com",
    "firmCrd": "202524",
    "firmId": "3202524",
    "firmName": "Create API 24 updat 03",
    "incorporationDate": "2010-08-24T14:15:22Z",
    "nipr": "60524",
    "organizationDate": "2011-08-24T14:15:22Z",
    "organizationType": 23017,
    "parentFirmProfileKey": "",
    "region": "GA",
    "startDate": "2012-08-24T14:15:22Z",
    "status": 7040,
    "terminationDate": "2029-08-24T14:15:22Z",
    "webAddress": "qa@reged.com"
  },
  "mailingAddress": {
    "addressId": 2432,
    "city": "string",
    "clientAddressId": "0",
    "country": "string",
    "county": "string",
    "fromDate": "2019-08-24T14:15:22Z",
    "state": "CO",
    "streetAddress1": "string",
    "streetAddress2": "string",
    "toDate": "2019-08-24T14:15:22Z",
    "zip": "12345"
  },
  "primaryAddress": {
    "addressId": 2432,
    "city": "string",
    "clientAddressId": "0",
    "country": "string",
    "county": "string",
    "fromDate": "2019-08-24T14:15:22Z",
    "state": "CO",
    "streetAddress1": "string",
    "streetAddress2": "string",
    "toDate": "2019-08-24T14:15:22Z",
    "zip": "12345"
  },
  "profileKey": "2045880",
  "tin": "204823755"
}
```

h2
Agent Request Bulk Payload in NDJSON Format

```json
{"clientRefId" :"F93C855D-48DE-429A-9192-44F3272634F2","data":{"agent":{"contact":{"businessEmailAddress":"qa@reged.com"},"demographic":{"empStatus":"7040","firstName":"John","lastName":"Mike"},"profileKey":"107225822","ssn":"107225876"}}}
{"clientRefId" :"F683AFB0-4EA6-4C66-A433-CA21D3ADF3F5","data":{"agent":{"contact":{"businessEmailAddress":"qa@reged.com"},"demographic":{"empStatus":"7040","firstName":"Tom","lastName":"Mike"},"profileKey":"107225823","ssn":"107225823"}}}
{"clientRefId" :"2358C637-A0A7-4A01-9ACD-03A06205E903","data":{"agent":{"contact":{"businessEmailAddress":"qa@reged.com"},"demographic":{"empStatus":"7040","firstName":"Ryan","lastName":"Mike"},"profileKey":"107225824","ssn":"107225866"}}}
{"clientRefId" :"C642501D-D293-451B-9525-38576D258830","data":{"agent":{"contact":{"businessEmailAddress":"qa@reged.com"},"demographic":{"empStatus":"7040","firstName":"Brian","lastName":"Mike"},"profileKey":"107225825","ssn":"107225833"}}}
```

h2
Agency Request Bulk Payload in NDJSON Format

```json
{"clientRefId" :"60546407-B4A6-4095-B659-3D4AD4EA6B21","data":{"agency":{"demographic":{"firmName":"CreateAPI","status":7040},"profileKey":"544823730","tin":"204823731"}}}
{"clientRefId" :"6510CE42-4CAD-450B-88C1-EB0D5C9BA6CA","data":{"agency":{"demographic":{"firmName":"CreateAPI2","status":7040},"profileKey":"874823730","tin":"204823732"}}}
{"clientRefId" :"8248376D-CD85-4C7F-8728-83120C9A11CA","data":{"agency":{"demographic":{"firmName":"CreateAPI3","status":7040},"profileKey":"894823730","tin":"204823733"}}}
{"clientRefId" :"60BED357-6726-465B-B9D5-FEDE275A3526","data":{"agency":{"demographic":{"firmName":"CreateAPI4","status":7040},"profileKey":"184823730","tin":"204823734"}}}
```

h2
Bulk Import Response
After successful post, will get unique bulkRequestId in response.


```json
{
  "bulkRequestId": "153b9a0d-d34b-44ca-80ee-9d64e795a64e"
}
```

h2
Bulk Import Status check
1. Bulk API Status endpoint [/bulk/v1/status/{bulkRequestId}]


Through this endpoint user will get status of bulk profile import endpoint either COMPLETED or FAILED.

h2
Bulk Import Status Check Response

```json
{
  "bulkRequestId": "477946ef-b997-4405-bea8-71e8149cce0b",
  "processingStatus": "COMPLETE",
  "operationDetails": {
    "status": "PARTIAL_SUCCESS",
    "totalItems": 4,
    "success": 1,
    "failures": 3,
    "requestItems": [
      {
        "clientRefId": "1f55aa75-5d53-4b6c-bfd2-b56764387e84",
        "status": "FAILED",
        "retryable": false,
        "errorMessage": [null]
      },
      {
        "clientRefId": "aee4c1d7-abd6-4ca3-bac4-b62013e7fcfe",
        "status": "COMPLETED",
        "retryable": false,
        "errorMessage": [null]
      },
      {
        "clientRefId": "c98aa4b9-d29c-4acc-b41e-6dcdae134e0c",
        "status": "FAILED",
        "retryable": false,
        "errorMessage": [null]
      },
      {
        "clientRefId": "66a830f4-0cbf-478c-9f6d-58afaadb0f9f",
        "status": "FAILED",
        "retryable": false,
        "errorMessage": [null]
      }
    ]
  }
}
```

h2
Schema details
> GUID is Globally Unique Identifier, which we need to create and provide in request.


> For Agency Status : 7040 - Active, 7041 - InActive
and Agent EmpStatus : 7040 - Active, 7041 - InActive


h2
Agent

**Root Fields**
| Field Name | Type / Requirements        |
| ---------- | -------------------------- |
| ProfileKey | required, string non-empty |
| Ssn        | required, string non-empty |

> > Not all imports require all sections, and the rules for which ones are required on a new record vs an update are configurable per client.



**BusinessAddress (AgentImportAddressModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AddressId | integer or null (int64) |
| City | required, string non-empty |
| ClientAddressId | string or null |
| Country | string or null |
| County | string or null |
| FromDate | string or null (date-time) |
| State | required, string non-empty |
| StreetAddress1 | required, string non-empty |
| StreetAddress2 | string or null |
| ToDate | string or null (date-time) |
| Zip | required, string non-empty |


**Contact (AgentImportContactModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AdditionalEmailAddress | string or null |
| BusinessEmailAddress | required, string non-empty |
| BusinessFaxNumber | string or null |
| BusinessPhoneExtension | string or null |
| BusinessPhoneNumber | string or null |
| CellPhoneNumber | string or null |
| HomeEmailAddress | string or null |
| HomeFaxNumber | string or null |
| HomePhoneNumber | string or null |
| SuppressEmail | string or null |


**CurrentEmployment (AgentImportEmploymentHistoryModel)**

| Field Name | Type / Requirement |
|  --- | --- |
| DynamicData | object or null |
| City | required, string non-empty |
| Country | string or null |
| County | string or null |
| EmployerName | required, string non-empty |
| EmploymentId | integer or null (int64) |
| HireDate | required, string (date-time) |
| InvestmentRelated | string or null |
| JobTitle | required, string non-empty |
| State | required, string non-empty |
| StreetAddress1 | required, string non-empty |
| StreetAddress2 | string or null |
| SupervisorName | string or null |
| Zip | required, string non-empty |


**Demographic (AgentImportDemographicModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AffiliatedWithBank | string or null |
| Alias | string or null |
| BackOfficeNrf | string or null |
| BillingCode | string or null |
| BranchLocation | string or null |
| CityOfBirth | string or null |
| CostCenter | string or null |
| Country | string or null |
| CountryOfBirth | string or null |
| CrdNumber | string or null |
| CustomField1 | string or null |
| CustomField2 | string or null |
| CustomField3 | string or null |
| CustomField4 | string or null |
| CustomField5 | string or null |
| CustomField6 | string or null |
| CustomField7 | string or null |
| CustomField8 | string or null |
| CustomField9 | string or null |
| CustomField10 | string or null |
| DateOfBirth | string or null (date-time) |
| DeptNumber | string or null |
| DriverLicenseNumber | string or null |
| DriverLicenseState | string or null |
| EmployerId | string or null |
| EmployersFein | string or null |
| EmpStatus | required, string non-empty |
| FirstName | required, string non-empty |
| Gender | string or null |
| HireDate | string or null (date-time) |
| JobTitle | string or null |
| LastName | required, string non-empty |
| MiddleInitial | string or null |
| NiprNumber | string or null |
| NmlsRegPriorFirmYn | string or null |
| NmlsRenewalDate | string or null (date-time) |
| NmlsRenewalStatus | string or null |
| ResidentState | string or null |
| RfoCode | string or null |
| Salutation | string or null |
| StateOfBirth | string or null |
| Suffix | string or null |
| TerminationDate | string or null (date-time) |
| UsCitizen | string or null |


**Hierarchy (AgentImportHierarchyModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| HierarchyCode | string or null |
| Manager1 | string or null |
| Manager2 | string or null |
| Manager3 | string or null |
| Manager4 | string or null |
| Manager5 | string or null |
| Manager6 | string or null |
| Manager7 | string or null |
| Manager8 | string or null |
| Manager9 | string or null |
| Manager10 | string or null |
| Supervisor | string or null |


**Information (AgentImportInformationModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| IaBrochureSupplementDate | string or null (date-time) |
| IaBrochureSupplementRequired | string or null |
| IaSupervisorName | string or null |
| IaSupervisorPhoneNumber | string or null |
| IaSupervisorTitle | string or null |


**MailingAddress (AgentImportAddressModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AddressId | integer or null (int64) |
| City | required, string non-empty |
| ClientAddressId | string or null |
| Country | string or null |
| County | string or null |
| FromDate | string or null (date-time) |
| State | required, string non-empty |
| StreetAddress1 | required, string non-empty |
| StreetAddress2 | string or null |
| ToDate | string or null (date-time) |
| Zip | required, string non-empty |


**ResidentAddress (AgentImportAddressModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AddressId | integer or null (int64) |
| City | required, string non-empty |
| ClientAddressId | string or null |
| Country | string or null |
| County | string or null |
| FromDate | string or null (date-time) |
| State | required, string non-empty |
| StreetAddress1 | required, string non-empty |
| StreetAddress2 | string or null |
| ToDate | string or null (date-time) |
| Zip | required, string non-empty |


**Agency**
**Root Fields**

| Field Name | Type / Requirements |
|  --- | --- |
| ProfileKey | required, string non-empty |
| Tin | required, string non-empty |


**BusinessAddress (FirmImportAddressModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AddressId | integer or null (int64) |
| City | required, string non-empty |
| ClientAddressId | string or null |
| Country | string or null |
| County | string or null |
| FromDate | string or null (date-time) |
| State | required, string non-empty |
| StreetAddress1 | required, string non-empty |
| StreetAddress2 | string or null |
| ToDate | string or null (date-time) |
| Zip | required, string non-empty |


**Contacts (Array of FirmImportContactModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| BusinessFaxNumber | string or null |
| BusinessPhoneExtension | string or null |
| BusinessPhoneNumber | string or null |
| CellPhoneNumber | string or null |
| ClientContactId | string or null |
| ContactId | integer or null (int64) |
| ContactType | required, string non-empty |
| EmailAddress | required, string non-empty |
| FirstName | string or null |
| LastName | string or null |


**Demographic (FirmImportDemographicModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AffiliatedWithBank | string or null |
| BusinessFax | string or null |
| BusinessPhone | string or null |
| CostCenter | string or null |
| FirmBillingCode | string or null |
| CustomField1 | string or null |
| CustomField2 | string or null |
| CustomField3 | string or null |
| DbaName | string or null |
| DomicileCountry | string or null |
| DomicileState | string or null |
| EmailAddress | string or null |
| FirmCrd | string or null |
| FirmId | string or null |
| FirmName | required, string non-empty |
| IncorporationDate | string or null |
| Nipr | string or null |
| OrganizationDate | string or null (date-time) |
| OrganizationType | integer or null (int64) |
| ParentFirmProfileKey | string or null |
| Region | string or null |
| StartDate | string or null (date-time) |
| Status | required, integer (int64) |
| TerminationDate | string or null (date-time) |
| WebAddress | string or null |


**MailingAddress (FirmImportAddressModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AddressId | integer or null (int64) |
| City | required, string non-empty |
| ClientAddressId | string or null |
| Country | string or null |
| County | string or null |
| FromDate | string or null (date-time) |
| State | required, string non-empty |
| StreetAddress1 | required, string non-empty |
| StreetAddress2 | string or null |
| ToDate | string or null (date-time) |
| Zip | required, string non-empty |


**PrimaryAddress (FirmImportAddressModel)**

| Field Name | Type / Requirements |
|  --- | --- |
| DynamicData | object or null |
| AddressId | integer or null (int64) |
| City | required, string non-empty |
| ClientAddressId | string or null |
| Country | string or null |
| County | string or null |
| FromDate | string or null (date-time) |
| State | required, string non-empty |
| StreetAddress1 | required, string non-empty |
| StreetAddress2 | string or null |
| ToDate | string or null (date-time) |
| Zip | required, string non-empty |