Add a new party to a contract

Update your existing contracts to include new parties using our API. You can add a Company or an Individual party to your contract depending on your business needs.

In this tutorial, we will consider updating your contract with a new Company party.

Step 1. Obtain necessary information

To create a new party in an existing contract, you have to create at least one participant along with this party.

📘

Note:

For an Individual party, the participant is a party; therefore, you only need to specify a new participant's name`.

To run the script described in this step, you’ll need the following data:

Headers
x-oneflow-api-token You will only be able to run the script by using a valid API token. You can create an API token in the Oneflow web application. Find out more in the Authentication section.
x-oneflow-user-email Your Oneflow user account email.
Body
name The name of a contract party you want to add to your contract.
type Each party in the array of parties must have its type set to company.
Participants
participants [array] The array of contract party participants (at least one.)
name The party participant’s name.
delivery_channel Defines the channel that the system will use to send contract-related notifications to the participant. Select this attribute only based on the selected template’s available options. To learn more about delivery_channeltypes, please see Delivery channels.
email The participant's email attribute is mandatory based on the delivery_channel and two_step_authentication_method, e.g., if the delivery channel is email, then the participant's email is required.
phone_number The participant's phone_number attribute is mandatory based on the delivery_channel and two_step_authentication_method, e.g., if the delivery channel is sms, then the participant's phone_number attribute is required.
Permissions
_permissions [object]
contract:update When set to true, the participant can make changes to the contract. Please read more about permissions here.

Step 2. Run the code

Replace the values of the parameters in the following command with the actual data from your account and run it:

curl --request POST \
     --url https://api.oneflow.com/v1/contracts/10015/parties \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
     --header 'x-oneflow-user-email: [email protected]' \
     --data '
{
     "participants": [
          {
               "_permissions": {
                    "contract:update": false
               },
               "signatory": false,
               "delivery_channel": "email",
               "name": "New party participant name"
          }
     ],
     "name": "New party name",
     "type": "company"
}
import requests

url = "https://api.oneflow.com/v1/contracts/10015/parties"

payload = {
    "participants": [
        {
            "_permissions": {"contract:update": False},
            "signatory": False,
            "delivery_channel": "email",
            "name": "New party participant name"
        }
    ],
    "name": "New party name",
    "type": "company"
}
headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Expected response

This request will output details about the contract party you created in JSON format.

Please see the Contract section in the Data model category for more information about the output.

{
  "_links": {
    "next": {
      "href": null
    },
    "previous": {
      "href": null
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/10015/parties?offset=0&limit=100"
    }
  },
  "count": 3,
  "data": [
    {
      "_links": null,
      "contract": {
        "href": "https://api.oneflow.com/v1/contracts/10015"
      },
      "self": {
        "href": "https://api.oneflow.com/v1/contracts/10015/parties/353218"
      },
      "_private_ownerside": {
        "created_time": "2020-06-30T07:15:23+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353218,
      "identification_number": "11223344-5566",
      "my_party": true,
      "name": "Own Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:15:23+00:00",
            "first_visited_time": "2020-06-30T07:15:23+00:00",
            "last_visited_time": "2020-08-04T10:14:30+00:00",
            "updated_time": "2020-08-04T10:14:30+00:00",
            "visits": 5
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113703,
          "identification_number": "",
          "my_participant": false,
          "name": "First Last",
          "organizer": false,
          "phone_number": "",
          "sign_method": "standard_esign",
          "sign_state": "signed",
          "sign_state_updated_time": "2020-07-09T12:53:54+00:00",
          "signatory": true,
          "title": "Sales Manager",
          "two_step_authentication_method": "none"
        }
      ],
      "type": "company"
    },
    {
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/parties/353218"
        }
      },
      "_private_ownerside": {
        "created_time": "2020-06-30T07:17:17+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353219,
      "identification_number": "111111",
      "my_party": false,
      "name": "Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:17:17+00:00",
            "first_visited_time": "2020-07-09T12:54:42+00:00",
            "last_visited_time": "2020-07-09T12:54:55+00:00",
            "updated_time": "2020-07-09T12:55:00+00:00",
            "visits": 3
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113704,
          "identification_number": "",
          "my_participant": false,
          "name": "Endpoint Test",
          "organizer": false,
          "phone_number": "+111222333444",
          "sign_method": "standard_esign",
          "sign_state": "signed",
          "sign_state_updated_time": "2020-07-09T12:54:53+00:00",
          "signatory": true,
          "title": "",
          "two_step_authentication_method": "email"
        }
      ],
      "type": "company"
    },
    {
      "_private_ownerside": {
        "created_time": "2020-07-04T11:59:13+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 350398,
      "identification_number": "10034544-0066",
      "my_party": false,
      "name": "First Last",
      "participant": {
        "_permissions": {
          "contract:update": true
        },
        "_private_ownerside": {
          "created_time": "2020-07-04T11:59:13+00:00",
          "first_visited_time": null,
          "last_visited_time": null,
          "updated_time": "2020-07-04T11:59:13+00:00",
          "visits": 0
        },
        "delivery_channel": "email",
        "delivery_status": "success",
        "email": "[email protected]",
        "id": 170397,
        "identification_number": "10034544-0066",
        "my_participant": false,
        "name": "First Last",
        "organizer": false,
        "phone_number": "+111222333666",
        "sign_method": "standard_esign",
        "sign_state": "undecided",
        "sign_state_updated_time": null,
        "signatory": true,
        "title": "",
        "two_step_authentication_method": "email"
      },
      "type": "individual"
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the contract with the created party.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
403ForbiddenThe request is not authorized by the server.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.