Signatures

Document Comment

Markdown for LLMs
POST
/signatures/document/{documentId}/comment

Adds a comment to a document on an envelope, as the recipient a tid identifies. documentId is the envelope document's id, as signatures-envelope-open and signatures-envelope-get return it in documents — not the storage id of the uploaded file, which is rejected with DOCUMENT_ID_INVALID.

A comment can be anchored to a point on a page with pageNumber, positionX and positionY, shown only to some people with visibleTo, and made a reply with parentCommentId. A parentCommentId that matches no comment is not an error: the comment is created at top level instead. The response returns the comment as stored, with signerId set to the recipient who wrote it.

A recipient whose isMfaEnabled is true must verify a multi-factor authentication code first (401 MFA_SESSION_INVALID otherwise). A signed-in user with access to the envelope can comment with a bearer token instead of a tid, and is not checked for multi-factor authentication.

No bearer token is required. This operation is open to guest callers — a recipient with no Doctavian account, acting from the link in their email — who are identified by the tid from that link instead of a token. The API key is still required, as on every operation: send it in the X-Api-Key header or the x-api-key query parameter. When the call carries no bearer token, the caller is anonymous and the response carries no userId.

Authorization

AuthorizationBearer <token>

JWT token to authenticate the request.

In: header

X-Api-Key<token>

API key, sent as a request header.

In: header

Path Parameters

documentId*string

Id of the document on the envelope, as signatures-envelope-open and signatures-envelope-get return it in documents[].id. It is not the storage id of the uploaded file: that id, or any GUID that matches no envelope document, is rejected with DOCUMENT_ID_INVALID, and a value that is not a GUID matches no operation and returns a bodiless 404.

Formatuuid

Query Parameters

tid?string

Transaction token identifying one recipient position on one envelope. It reaches the recipient in the link of their notification email — or, for an inpersonsigner, reaches the host named in hostEmail — and signatures-envelope-list returns it as transactionTokenId on entries for positions the caller holds.

Mandatory unless the call carries a bearer token; a call with neither is rejected with 401 MISSING_TRANSACTION_TOKEN. A value that is not a GUID, or a GUID that matches no token, is rejected with 401 INVALID_TRANSACTION_TOKEN — even when the call also carries a bearer token.

Formatuuid

Request Body

application/json

Mandatory: comment carries the comment to add. A request with no body, or one that is not valid JSON, is rejected with 400 REQUEST_BODY_INVALID.

TypeScript Definitions

Use the request body type in TypeScript.

Request body for adding a comment to a document on an envelope.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/signatures/document/f5d32692-685d-4190-9b6f-0ec1c40d2030/comment?tid=6c82c35c-ded7-4b49-83a1-e5fed49a0e69" \  -H "Content-Type: application/json" \  -d '{    "comment": {      "content": "Please confirm the delivery date before signing.",      "pageNumber": 2,      "positionX": 120,      "positionY": 480,      "parentCommentId": "",      "visibleTo": [        "name@example.com"      ]    },    "externalContext": {      "id": "12345"    }  }'
{  "result": {    "statusCode": 201,    "message": "Created",    "data": {      "comment": {        "id": "82405ccd-529d-460c-88fd-20d83d116f15",        "documentId": "f5d32692-685d-4190-9b6f-0ec1c40d2030",        "signerId": "2bdacd57-662d-49da-be4b-e876b8b12ea1",        "parentCommentId": "",        "content": "Please confirm the delivery date before signing.",        "pageNumber": 2,        "positionX": 120,        "positionY": 480,        "visibleTo": "[\"name@example.com\"]",        "createdAt": "2026-10-15T09:51:25.000Z",        "authorName": "John Smith",        "authorEmail": "name@example.com"      }    }  },  "externalContext": {    "id": "12345"  },  "origin": "POST https://api.doctavian.com/v1/signatures/document/{documentId}/comment",  "dateTime": "2026-10-15T09:51:05.000Z",  "operationId": "61aec99dea1a8e07a437c26a6b72a5b7"}
{  "error": {    "statusCode": 400,    "message": "Bad Request",    "innerErrors": [      {        "code": "DOCUMENT_ID_INVALID",        "message": "Document with ID cf758777-3dc8-473e-bbbe-af85c48ef21e does not exist",        "userMessage": "Document with ID cf758777-3dc8-473e-bbbe-af85c48ef21e does not exist"      }    ],    "externalErrors": []  },  "origin": "POST https://api.doctavian.com/v1/signatures/document/{documentId}/comment",  "dateTime": "2026-10-15T09:51:05.000Z",  "operationId": "d1832ab524bab0eefe678a6903eae8af"}
{  "error": {    "statusCode": 401,    "message": "Unauthorized",    "innerErrors": [      {        "code": "INVALID_TRANSACTION_TOKEN",        "message": "Transaction token identifier is invalid or does not exist in the database.",        "userMessage": "Transaction token identifier is invalid. Please make sure that you are accessing this page via the link from your email."      }    ],    "externalErrors": []  },  "origin": "POST https://api.doctavian.com/v1/signatures/document/{documentId}/comment",  "dateTime": "2026-10-15T09:51:05.000Z",  "operationId": "d040ddbc73ecfb8ae9190ec46b745932"}
{  "error": {    "statusCode": 403,    "message": "Forbidden",    "innerErrors": [      {        "code": "ENVELOPE_ACCESS_DENIED",        "message": "Envelope access denied for envelope id 3f2b8c1e-7a4d-4e9b-9c21-5d6f0a8b1e47",        "userMessage": "You do not have permission to access envelope with id 3f2b8c1e-7a4d-4e9b-9c21-5d6f0a8b1e47"      }    ]  },  "origin": "POST https://api.doctavian.com/v1/signatures/document/{documentId}/comment",  "dateTime": "2026-10-01T09:41:06.000Z",  "userId": "d08ae9c2-048c-4dc2-bf6b-b58ca6293c5c",  "operationId": "c4e81a0f6b2d49e7a35f90d1b8e62c47"}
Empty
{  "error": {    "statusCode": 500,    "message": "Internal Server Error",    "innerErrors": [      {        "code": "FUNCTION_EXECUTION_ERROR",        "message": "An error occurred during function execution.",        "userMessage": "An error occurred during function execution.",        "eventId": "3914bcfd-fb75-47fe-a94d-40bf22bf02d3"      }    ],    "externalErrors": []  },  "origin": "POST https://api.doctavian.com/v1/signatures/document/{documentId}/comment",  "dateTime": "2026-10-15T09:51:05.000Z",  "operationId": "72937699be0cd42c0bbb044c3bc8fc7c"}