# Import Multiple Companies This method allows you to upload a file containing multiple companies to add them to a portfolio in bulk. ### Example Request ```http POST /monitoring/portfolios/{portfolioId}/import ``` #### Key Considerations When utilising the API to submit files for processing, consider the following recommendations to optimize performance: #### 1. File Size and Format: - Files smaller than 50KB or in CSV format are processed faster compared to larger files or those in XLS format. - The advanced queuing system efficiently handles smaller files and CSV formats, expediting their processing. #### 2. Best Practices: - **Break Down Larger Files**: For datasets exceeding the recommended file size threshold, break them into smaller, manageable chunks. This allows the queuing system to process each segment more efficiently, resulting in quicker results. - **Prefer CSV over XLS Format**: Whenever possible, use CSV files for submissions. CSV files are simpler and have minimal overhead, leading to faster processing times compared to XLS files. - **Practical Considerations**: While CSV format and smaller files are encouraged, specific use cases may require XLS format or larger datasets. In such scenarios, evaluate the trade-offs between processing time and other factors to determine the most suitable approach. ### Example File Structure The file must include the following fields: | Header Name | Required | Description | | --- | --- | --- | | Safe Number | Yes | The unique identifier for the company | | Local Org No. | No | The local organization number for the company | | Country Code | Yes | The ISO country code for the company | | Reference | No | Optional field for internal references | | Free Text | No | Optional field for additional notes | | Personal Limit | No | Optional field for setting an internal limit (not related to credit limits) | > **NOTE**: If a field is not being used, leave it blank in the file but ensure the column headers remain in place. ### Example CSV File ```csv Safe Number,Local Org No.,Country Code,Reference,Free Text,Personal Limit GB-0-12345678,,GB,Test Reference,Test Notes,10000 ,01777777,US,Another Reference,,5000 ``` #### Variations Allowed in the Submitted File The following variations are allowed when submitting files: #### 1. Safe Number vs. ConnectID: - The **Safe Number** can be substituted for `ConnectID` in **column A** if preferred. - A greater success rate is achieved when using the **Safe Number**. #### 2.Local Org No.: - The Local Org No. can be used instead of `Safe Number` or `ConnectID`. - If the **Local Org No.** is used, the Country Code becomes mandatory. - You **MUST** insert a blank space where the `Safe Number` would be. ### Examples #### Example 1: Using Local Org No. | Safe No. | Local Org No. | Country Code | Reference | Free Text | Personal Limit | | --- | --- | --- | --- | --- | --- | | | 01777777 | GB | | | | #### CSV Format: ```csv ,01777777,GB ``` #### Example 2: Using Local Org No. with Reference | Safe No. | Local Org No. | Country Code | Reference | Free Text | Personal Limit | | --- | --- | --- | --- | --- | --- | | | 01777777 | GB | This is a Test | | | #### CSV Format: ```csv ,01777777,GB,,This is a test ``` ### Key Details - Existing companies in the portfolio will be skipped, and only new unique entries will be added. - If optional fields are not used, they can be left blank, but the column headers must remain in the file. - Use the `portfolioId` in the URL path to specify the portfolio to which the companies will be added. ## Sync Portfolio The Sync Portfolio method allows you to replace all existing companies in a portfolio with the contents of an uploaded file. Unlike the Import method, this endpoint overwrites the entire portfolio, deleting all previously allocated companies. ### Example Request ```http POST /monitoring/portfolios/{portfolioId}/sync ``` ### Key Details - The file structure and requirements are identical to the **Import Multiple Companies** method. - All existing companies in the portfolio will be **deleted** and replaced with the companies in the uploaded file. - Use this method when you want to completely reset the portfolio with a new set of companies. By following these guidelines, you can efficiently import multiple companies into a portfolio while optimising processing speed and ensuring accurate data handling.