Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.chamelio.ai/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

GET /tasks/{task_id}/latest-negotiation-version

Authentication

This endpoint requires authentication via API key. Include your API key in the X-API-Key header:
X-API-Key: ca_your_api_key_here

Path Parameters

ParameterTypeRequiredDescription
task_idintegerYesUnique identifier for the task

Query Parameters

ParameterTypeRequiredDescription
step_run_idstringNoID of a specific step run to retrieve the negotiation version for

Request Example

curl -X GET "https://platform.chamelio.ai/tasks/12345/latest-negotiation-version" \
  -H "X-API-Key: ca_your_api_key_here"

Response

Success Response

Status Code: 200 OK
{
  "file_id": "document_789",
  "version": 3,
  "our_party_changes": true,
  "download_url": "https://s3.amazonaws.com/chamelio-files/...",
  "expires_at": "2025-01-20T12:00:00Z"
}

Response Fields

FieldTypeDescription
file_idstringUnique identifier of the latest negotiation document version
versionintegerVersion number of the negotiation document
our_party_changesbooleanWhether the latest version contains changes made by your party
download_urlstringPresigned URL to download the document
expires_atstringISO 8601 timestamp when the download URL expires

Error Responses

401 Unauthorized

Returned when authentication fails. See the authentication errors section for details.
{
  "detail": "Invalid API key"
}

404 Not Found

Returned when the task doesn’t exist, you don’t have access to it, or no negotiation version is available.
{
  "detail": "Task not found"
}

500 Internal Server Error

Returned when the request fails due to a server error.
{
  "detail": "Failed to retrieve latest negotiation version"
}

Notes

This endpoint returns the most recent version of the negotiation document. Use the version field to track how many rounds of negotiation have occurred.
The presigned download URL expires after a certain time (indicated by expires_at). Download the file before the URL expires or request a new URL.
Use the our_party_changes field to determine whether the latest version reflects your edits or the counterparty’s edits, which is useful for tracking negotiation turn order.

Use Cases

This endpoint is useful for:
  • Negotiation tracking - Monitor the current state of contract negotiations
  • Document retrieval - Download the latest version of a negotiated document
  • Turn detection - Determine which party made the most recent changes
  • Integration - Sync negotiation progress with external contract management systems