Changing the State of a Document in a Contract Workspace

This topic explains how you can use the Project Document Management State Change API to modify the state of documents such as Main Agreement, Contract Addendum, and standard documents in a contract workspace.

Prerequisites

Context

You can use the POST /projectDocuments/documentID/state endpoint to change the state of a document in the contract workspace. The following table lists the documents and supported state change options:

Document Type

Current State

New State

  • Main Agreement
  • Contract addendum

Draft

Publish

Publish

Finalize

Finalize

MakeDraft

Standard documents

Draft

Publish

Procedure

To change the state of a document use the POST /projectDocuments/documentID/state endpoint as follows:
POST {{runtime_url}}/projectDocuments/documentID/state?user=username&passwordAdapter=PasswordAdapterName&realm=realm
Request body:
{
  "action": "action"
}
Where
  • username is the name of the user whose credentials are used to authenticate the API request.
  • passwordadapter is the password adapter used to authenticate the user specified in user.
  • realm is the name of your site.
  • documentID is the ID of the document for which you want to modify the state.
In the Request body, specify the new state you want to apply to the document. Supported values are:
  • Publish
  • Finalize
  • MakeDraft
You receive one of the following messages:
  • 204 to indicate successful state change.

  • 400 to indicate a bad request.

  • 401 to indicate an unauthorized request.

  • 403 to indicate a forbidden request.

  • 404 to indicate that the specified document was not found.