Delete a party from a contract
If a contract party is no longer relevant to your contract, you can delete this party from your contract using the corresponding API endpoint.
Step 1. Obtain necessary information
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
|
The Oneflow user account email on whose behalf you want to delete the contract. |
Path parameter | |
CONTRACT_ID |
The unique ID of the contract you want to delete. You can find the contract ID using the contracts endpoint. |
PARTY_ID |
The unique ID of the party you want to delete. You can find the party ID using the Get contract parties endpoint. |
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 DELETE \
--url https://api.oneflow.com/v1/contracts/10015/parties/353218 \
--header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
--header 'x-oneflow-user-email: [email protected]'
import requests
url = "https://api.oneflow.com/v1/contracts/10015/parties/353218"
headers = {
"x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
"x-oneflow-user-email": "[email protected]"
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
Expected response
This operation will delete the specified party from your contract and display an empty body in the response.
Response codes
Status | Meaning | Description |
---|---|---|
200 | OK | The contract party was deleted successfully. This response is also returned if the party does not exist. |
400 | Bad Request | Invalid format or content of the request. |
401 | Unauthorized | The API token or the user email is invalid. |
403 | Forbidden | The request is not authorized by the server. |
404 | Not Found | A required entity is missing. |
409 | Conflict | A conflict occurred with the current state of the target resource. |
Updated almost 2 years ago