Skip to content

Documents API

Document management endpoints.

List Documents

Get all documents for the current user.

http
GET /api/v1/documents
Authorization: Bearer <access_token>

Query Parameters

ParameterTypeDescription
limitintItems per page (default: 20)
cursorstringPagination cursor
statusstringFilter by status
searchstringSearch by name

Response (200 OK)

json
{
  "success": true,
  "data": [
    {
      "id": "doc-uuid",
      "name": "Contract 2026",
      "original_name": "contract.pdf",
      "type": "pdf",
      "mime_type": "application/pdf",
      "size": 1024000,
      "page_count": 5,
      "status": "ready",
      "encrypted": true,
      "created_at": "2026-01-24T10:00:00Z",
      "updated_at": "2026-01-24T10:00:00Z"
    }
  ],
  "meta": {
    "limit": 20,
    "has_more": true,
    "next_cursor": "abc123"
  }
}

Upload Document

Upload a new document.

http
POST /api/v1/documents
Authorization: Bearer <access_token>
Content-Type: multipart/form-data

Request

FieldTypeRequiredDescription
filefileYesDocument file (PDF, DOCX, XLSX)
namestringNoDisplay name
tagsarrayNoDocument tags

Response (201 Created)

json
{
  "success": true,
  "data": {
    "id": "doc-uuid",
    "name": "Contract 2026",
    "original_name": "contract.pdf",
    "type": "pdf",
    "mime_type": "application/pdf",
    "size": 1024000,
    "page_count": 5,
    "status": "processing",
    "encrypted": true,
    "created_at": "2026-01-24T10:00:00Z"
  }
}

Get Document

Get document details.

http
GET /api/v1/documents/:id
Authorization: Bearer <access_token>

Response (200 OK)

json
{
  "success": true,
  "data": {
    "id": "doc-uuid",
    "name": "Contract 2026",
    "original_name": "contract.pdf",
    "type": "pdf",
    "mime_type": "application/pdf",
    "size": 1024000,
    "page_count": 5,
    "status": "ready",
    "encrypted": true,
    "hash": "sha256:abc123...",
    "tags": ["contract", "2026"],
    "metadata": {
      "author": "John Doe"
    },
    "created_at": "2026-01-24T10:00:00Z",
    "updated_at": "2026-01-24T10:00:00Z"
  }
}

Update Document

Update document metadata.

http
PUT /api/v1/documents/:id
Authorization: Bearer <access_token>

Request

json
{
  "name": "Updated Contract Name",
  "tags": ["contract", "updated"]
}

Response (200 OK)

json
{
  "success": true,
  "data": {
    "id": "doc-uuid",
    "name": "Updated Contract Name",
    "tags": ["contract", "updated"],
    "updated_at": "2026-01-24T11:00:00Z"
  }
}

Delete Document

Delete a document.

http
DELETE /api/v1/documents/:id
Authorization: Bearer <access_token>

Response (200 OK)

json
{
  "success": true,
  "data": {
    "message": "Document deleted successfully"
  }
}

Download Document

Download the original document file.

http
GET /api/v1/documents/:id/download
Authorization: Bearer <access_token>

Response

Returns the file binary with appropriate headers:

Content-Type: application/pdf
Content-Disposition: attachment; filename="contract.pdf"

Document Status

StatusDescription
processingDocument is being processed
readyDocument is ready for use
errorProcessing failed

Supported File Types

TypeExtensionsMax Size
PDF.pdf25 MB
Word.docx25 MB
Excel.xlsx25 MB

Error Codes

CodeDescription
DOCUMENT_NOT_FOUNDDocument does not exist
DOCUMENT_PROCESSINGDocument still processing
FILE_TOO_LARGEFile exceeds size limit
UNSUPPORTED_TYPEFile type not supported

GSign Digital Signature Platform