Skip to main content
PUT
/
api
/
v1
/
contracts
/
{contract_id}
Update Contract
curl --request PUT \
  --url https://api.example.com/api/v1/contracts/{contract_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "status": "<string>",
  "terms": {}
}
'
{
  "status": "<string>",
  "contract_id": "<string>"
}
Updates an existing contract’s status or terms. When status is changed to “confirmed” or “completed”, timestamps are automatically recorded.

Path Parameters

contract_id
string
required
The unique identifier of the contract to update

Request Body

status
string
New contract status. Possible values:
  • pending: Awaiting signatures
  • confirmed: All parties have signed (sets confirmed_at timestamp)
  • active: Contract is in effect
  • completed: Contract has been fulfilled (sets completed_at timestamp)
  • cancelled: Contract was cancelled
terms
object
Updated contract terms. This will merge with existing terms, adding or updating specified fields:
  • total_amount: Update the contract amount
  • delivery_location: Update delivery location
  • delivery_deadline: Update delivery deadline
  • quality_requirements: Update quality specifications
  • Any other custom terms

Response

status
string
Always returns “updated” on success
contract_id
string
The identifier of the updated contract

Example Requests

Update Status

curl -X PUT https://api.voicepact.com/api/v1/contracts/AGRI-2026-001234 \
  -H "Content-Type: application/json" \
  -d '{
    "status": "confirmed"
  }'

Update Terms

curl -X PUT https://api.voicepact.com/api/v1/contracts/AGRI-2026-001234 \
  -H "Content-Type: application/json" \
  -d '{
    "terms": {
      "delivery_location": "Updated Market Location",
      "delivery_deadline": "2026-03-20"
    }
  }'

Update Both Status and Terms

curl -X PUT https://api.voicepact.com/api/v1/contracts/AGRI-2026-001234 \
  -H "Content-Type: application/json" \
  -d '{
    "status": "active",
    "terms": {
      "payment_status": "deposit_received",
      "notes": "Initial payment confirmed"
    }
  }'

Example Response

{
  "status": "updated",
  "contract_id": "AGRI-2026-001234"
}

Error Responses

404 Not Found

{
  "detail": "Contract not found"
}
Returned when the specified contract_id does not exist.

500 Internal Server Error

{
  "detail": "Failed to update contract"
}
Returned when an unexpected error occurs during the update.

Automatic Timestamp Updates

Certain status changes trigger automatic timestamp updates:
  • Status = “confirmed”: Sets confirmed_at to current UTC time
  • Status = “completed”: Sets completed_at to current UTC time

Notes

  • Terms updates are merged with existing terms (not replaced)
  • Both status and terms are optional - you can update either or both
  • Status changes do not trigger SMS notifications to parties

Build docs developers (and LLMs) love