Records a party’s confirmation/signature for a contract. When all parties have confirmed, the contract status is automatically updated to “confirmed”.
Path Parameters
The unique identifier of the contract to confirm
Query Parameters
The phone number of the party confirming the contract
Response
Always returns “confirmed” on successful signature
The identifier of the confirmed contract
Phone number of the party who signed
Indicates whether all parties have now signed the contract
Example Request
curl -X POST "https://api.voicepact.com/api/v1/contracts/AGRI-2026-001234/confirm?phone_number=%2B254712345678" \
-H "Content-Type: application/json"
Example Responses
Partial Confirmation (Not All Parties Signed)
{
"status": "confirmed",
"contract_id": "AGRI-2026-001234",
"signed_by": "+254712345678",
"all_signed": false
}
Full Confirmation (All Parties Signed)
{
"status": "confirmed",
"contract_id": "AGRI-2026-001234",
"signed_by": "+254787654321",
"all_signed": true
}
When all_signed is true, the contract status is automatically updated to “confirmed” and the confirmed_at timestamp is set.
Error Responses
404 Not Found
{
"detail": "Signature record not found"
}
Returned when:
- The contract_id doesn’t exist
- The phone_number is not a party to this contract
- No signature record exists for this combination
500 Internal Server Error
{
"detail": "Failed to confirm contract"
}
Returned when an unexpected error occurs during confirmation.
How It Works
- Signature Lookup: The system finds the signature record for the specified contract and phone number
- Status Update: The signature status is updated to “signed” with a timestamp
- Check All Signatures: The system counts how many parties have signed
- Auto-Confirm: If all parties have signed, the contract status changes to “confirmed”
Signature Lifecycle
- Created: Signature record created when contract is created (status: “pending”)
- Signed: Party confirms via this endpoint (status: “signed”)
- Contract Confirmed: When all signatures are “signed”, contract becomes “confirmed”
Notes
- Each party can only sign once (idempotent operation)
- The phone number must exactly match the number registered for that party
- Signature timestamps are recorded in UTC
- The signature method is tracked as “sms_confirmation”