Document
A Document represents a document that has been sent for signing. Every Document is created from a Template and sent to one or more Recipients. Documents belong to a Group and may be part of a Batch.
Implements: Node
Fields
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier |
name | String | Title of the document |
link | String | Short-lease URL for downloading the document |
status | String | Current state (e.g. inprogress, completed, rejected) |
hash | String | Hash value for verifying the document hasn't been tampered with |
tags | String | Comma-separated tags assigned to this document |
created | AWSDateTime | When the document was created |
modified | AWSDateTime | When the document was last modified |
senderName | String | Name of the person who sent the document |
senderEmail | AWSEmail | Email of the sender |
batchId | ID | ID of the batch this document belongs to (if any) |
batchName | String | Name of the batch |
batchOrder | Int | Position within the batch |
taskId | ID | ID of the async task that created this document |
certifyDocument | Boolean | Whether the final document is certified |
retention | Float | Expiry datetime in unix epoch seconds |
sendMethod | String | Method/tool used to send this document |
sourceTemplateId | ID | ID of the template this was created from (efficient for list queries) |
sourceTemplateName | String | Name of the source template |
Relationships
| Field | Type | Description |
|---|---|---|
group | Group | The group this document belongs to |
template | Template | The original template |
recipients | [Recipient] | Participants who received this document |
auditLog | [AuditLogItem] | Audit trail for this document |
elementConnection | DocumentElementConnection | Sender fields on this document |
Query
query GetDocument($id: ID!) {
document(id: $id) {
id
name
status
created
}
}
Documents are also accessed via Group.documentConnection — see How Pagination Works.
documentConnection Arguments
When querying documents through a group:
| Argument | Type | Default | Description |
|---|---|---|---|
first | Int | — | Number of items to return |
after | ID | — | Cursor for forward pagination |
from | AWSDateTime | — | Filter by start date |
to | AWSDateTime | — | Filter by end date |
search | String | null | Search by document name |
status | String | null | Filter by status |
sendType | SendType | ALL | Filter by SINGLE, BATCHED, or ALL |
sender | [ID] | null | Filter by sender user IDs |
Example
A typical document detail query (based on the Legalesign Console app):
query GetDocumentDetails {
document(id: "ZG9jMWVmMjdkYWYtMGJlMS0xMWYwLWJiYjUtMDZlNDc2YTA3NTY5") {
id
name
status
batchId
batchName
created
modified
senderName
senderEmail
certifyDocument
hash
retention
group {
id
name
publicName
}
template {
id
title
}
recipients {
id
firstName
lastName
email
status
roleType
role
signedDateTime
sentDateTime
emailProblem
recipientOrder
}
auditLog {
created
description
name
email
status
code
ip
}
}
}
Related
- Template — the source template for a document
- Recipient — participants on a document
- Batch — batch containing this document
- Group — the group this document belongs to
- How Pagination Works — paginating document lists
- Query Examples — basic document query
- Complex Query Examples — document with nested data