Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Current »

Create or update a relationship

If you omit the name property for the company, then only the nested properties are synced. In the following example, on the the parentCompanies will be synced since the name of the company is not specified.

PUT /api/v1/sync
Authorization: Bearer :token
Content-Type: application/json
{
  "companies": [
    {
      "referenceId": "d",
      "parentCompanies": [
        {
          "referenceId": "b",
          "ownership": 25
        }
      ]
    }
  ]
}

How to delete a relationship?

Previously created relations are not deleted by default. In order to delete relationships, use the delete property.

PUT /api/v1/sync
Authorization: Bearer :token
Content-Type: application/json
{
  "companies": [
    {
      "referenceId": "d",
      "parentCompanies": [
        {
          "referenceId": "b",
          "ownership": 25,
          "delete": true        <--- Set the `delete` property to `true`
        }
      ]
    }
  ]
}

How to delete all previously created relationships?

In order to delete all previously created relationships, set the value of the cleanup property to true

PUT /api/v1/sync
Authorization: Bearer :token
Content-Type: application/json
{
  "config": {
    "cleanup": true
  },
  "companies": [
    {
      "referenceId": "d",
      "parentCompanies": [
        {
          "referenceId": "b",
          "ownership": 25
        }
      ]
    }
  ]
}

If you have any queries or require additional assistance, please feel free to use the comment function or reach out to support@avallone.io. Our customer success team is always available to help you and ensure that you derive the most out of our platform.

  • No labels