How to remove a collaborator from a contract

What is a collaborator?

A Collaborator is a User who is associated with a contract. A collaborator can add or remove people from a contract. A first side collaborator can also edit the terms of the contract.

How to remove a collaborator from a contract?

To remove a collaborator, the Delete a collaborator endpoint is simply used, where only the CollaboratorId is needed>

curl --request DELETE \
     --url https://sandbox.legislate.tech/v1/collaborators/{{CollaboratorId}} \
     --header 'Accept: application/json'

A successful 200 response looks like:

{
  "_links": {
    "empty": true
  },
  "completedDate": "2022-06-20T11:50:36.932Z",
  "contract_name": "Contract_Name",
  "created_date": "2022-06-20T11:50:36.932Z",
  "fields": [
    {
      "id": {{CollaboratorId}},
      "name": "Collaborator_Name",
      "value": "string"
    }
  ],
  "purchased_date": "2022-06-20T11:50:36.932Z"
}

A collaborator can no longer add or remove people, or even edit the terms of the contract once deleted.

How to get CollaboratorID

If the CollaboratorID is unknown we can use the Get Collaborators for a given contract endpoint to get it (https://developers.legislate.tech/reference/getcollaboratorsusingget):

curl --request DELETE \
     --url https://sandbox.legislate.tech/v1/collaborators/CollaboratorID \
     --header 'Authorization: Bearer API Key'

We can then go back and follow the guide along to delete this collaborator from the contract.