[PR #1918] [MERGED] feat: download document via api v2 #1929

Closed
opened 2026-02-26 20:31:42 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1918
Author: @ephraimduncan
Created: 7/22/2025
Status: Merged
Merged: 8/5/2025
Merged by: @Mythie

Base: mainHead: feat/download-api-v2


📝 Commits (6)

  • fd2bfe2 feat: download document via api v2
  • d540319 fix: use app errors
  • b548d72 chore: remove redundant catch
  • 4c1ada6 Merge branch 'main' into feat/download-api-v2
  • fadf030 Merge branch 'main' into feat/download-api-v2
  • b4faaba fix: add beta suffix to endpoint

📊 Changes

5 files changed (+123 additions, -18 deletions)

View changed files

packages/trpc/server/document-router/download-document.ts (+93 -0)
📝 packages/trpc/server/document-router/router.ts (+3 -3)
📝 packages/trpc/server/document-router/schema.ts (+19 -0)
📝 packages/trpc/server/folder-router/router.ts (+5 -10)
📝 packages/trpc/server/template-router/router.ts (+3 -5)

📄 Description

Description

This PR adds document download functionality to the API v2, returning pre-signed S3 URLs that provide secure, time-limited access to document files similar to what happens in the API v1 download document endpoint.

API Reference

Request

curl --request GET \
  --url http://localhost:3000/api/v2-beta/document/[documentId]/download \
  --header 'Authorization: Bearer your-api-token'

Query Parameters

Parameter Type Default Description
version "original" | "signed" "signed" Which version of the document to download

Response

{
  "downloadUrl": "https://documenso.s3.amazonaws.com/signed-url...",
  "filename": "contract_signed.pdf",
  "contentType": "application/pdf"
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1918 **Author:** [@ephraimduncan](https://github.com/ephraimduncan) **Created:** 7/22/2025 **Status:** ✅ Merged **Merged:** 8/5/2025 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `feat/download-api-v2` --- ### 📝 Commits (6) - [`fd2bfe2`](https://github.com/documenso/documenso/commit/fd2bfe26c0df8ed729860f38daba65e93976d904) feat: download document via api v2 - [`d540319`](https://github.com/documenso/documenso/commit/d54031955390ade33b3b1438783f4702fdceb952) fix: use app errors - [`b548d72`](https://github.com/documenso/documenso/commit/b548d7239a483001a7f11db9dcff424eb32032ff) chore: remove redundant catch - [`4c1ada6`](https://github.com/documenso/documenso/commit/4c1ada6a555429cdd0e21d48e3cce823a1616e6e) Merge branch 'main' into feat/download-api-v2 - [`fadf030`](https://github.com/documenso/documenso/commit/fadf030ce70d52191adfaa8699c03915e2130b97) Merge branch 'main' into feat/download-api-v2 - [`b4faaba`](https://github.com/documenso/documenso/commit/b4faabaa754b803695e1aed456284014abeb68b4) fix: add beta suffix to endpoint ### 📊 Changes **5 files changed** (+123 additions, -18 deletions) <details> <summary>View changed files</summary> ➕ `packages/trpc/server/document-router/download-document.ts` (+93 -0) 📝 `packages/trpc/server/document-router/router.ts` (+3 -3) 📝 `packages/trpc/server/document-router/schema.ts` (+19 -0) 📝 `packages/trpc/server/folder-router/router.ts` (+5 -10) 📝 `packages/trpc/server/template-router/router.ts` (+3 -5) </details> ### 📄 Description ## Description This PR adds document download functionality to the API v2, returning pre-signed S3 URLs that provide secure, time-limited access to document files similar to what happens in the API v1 download document endpoint. ## API Reference ### Request ```bash curl --request GET \ --url http://localhost:3000/api/v2-beta/document/[documentId]/download \ --header 'Authorization: Bearer your-api-token' ``` ### Query Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `version` | `"original"` \| `"signed"` | `"signed"` | Which version of the document to download | ### Response ```json { "downloadUrl": "https://documenso.s3.amazonaws.com/signed-url...", "filename": "contract_signed.pdf", "contentType": "application/pdf" } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:31:42 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1929
No description provided.