This method allows you to upload a file containing multiple companies to add them to a portfolio in bulk.
POST /monitoring/portfolios/{portfolioId}/import
Content-Type: multipart/form-dataSend the file as a multipart/form-data part named importcsv. The file is required: a request without it returns 400. You can also send an email part to get an email when the import has been processed.
{
"correlationId": "23921650-c073-11ea-860f-06bc8182190e",
"message": "Accepted for processing. Import Id 12345"
}- The file is processed in the background, so the companies don't appear in the portfolio straight away. How long it takes varies, for example with the size of the file and how busy the queue is.
- There's no endpoint to check an import's status. Read the portfolio's companies (
GET /monitoring/portfolios/{portfolioId}/companies) to see when they've arrived, or use the optionalemail. - The
200response means the file was accepted for processing. Check the portfolio afterwards to confirm the companies were added.
When utilising the API to submit files for processing, consider the following recommendations to optimize performance:
- 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.
- 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.
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.
Safe Number,Local Org No.,Country Code,Reference,Free Text,Personal Limit
GB-0-99999999,,GB,Test Reference,Test Notes,10000
,01777777,US,Another Reference,,5000The following variations are allowed when submitting files:
- The Safe Number can be substituted for
ConnectIDin column A if preferred. - A greater success rate is achieved when using the Safe Number.
- The Local Org No. can be used instead of
Safe NumberorConnectID. - If the Local Org No. is used, the Country Code becomes mandatory.
- You MUST insert a blank space where the
Safe Numberwould be.
| Safe No. | Local Org No. | Country Code | Reference | Free Text | Personal Limit |
|---|---|---|---|---|---|
| 01777777 | GB |
Safe Number,Local Org No.,Country Code,Reference,Free Text,Personal Limit
,01777777,GB,,,| Safe No. | Local Org No. | Country Code | Reference | Free Text | Personal Limit |
|---|---|---|---|---|---|
| 01777777 | GB | This is a Test |
Safe Number,Local Org No.,Country Code,Reference,Free Text,Personal Limit
,01777777,GB,This is a Test,,- 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
portfolioIdin the URL path to specify the portfolio to which the companies will be added.
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.
POST /monitoring/portfolios/{portfolioId}/sync- The file structure and requirements are identical to the Import Multiple Companies method, including the
importcsvpart, the response and the background processing. - 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.