docs: mark all v1 API endpoints as deprecated

Add deprecated flag and migration message to all 19 v1 API endpoints
to signal users should migrate to the v2 API.
This commit is contained in:
ephraimduncan
2026-01-20 14:36:35 +00:00
parent 158b36a9b7
commit fd94a403af
3 changed files with 126 additions and 5 deletions
@@ -0,0 +1,87 @@
# V1 API Legacy Deprecation Specification
## Overview
Mark all V1 API endpoints as legacy/deprecated in the OpenAPI documentation to signal that users should migrate to the V2 API.
## Decision Summary
| Decision | Choice |
|----------|--------|
| Deprecation Scope | All V1 endpoints |
| Message Style | Generic for all endpoints |
| Sunset Timeline | No specific date |
| V2 API Status | V2 exists now |
| OpenAPI Info | Update to include deprecation notice |
## Implementation Details
### Files to Modify
1. `packages/api/v1/contract.ts` - Add `deprecated: true` and `description` to all endpoints
2. `packages/api/v1/openapi.ts` - Update the OpenAPI info description
### Deprecation Message
**Per-endpoint message:**
```
Deprecated. Please migrate to the V2 API.
```
**OpenAPI info description:**
```
[DEPRECATED] The Documenso API for retrieving, creating, updating and deleting documents. Please migrate to V2.
```
### Endpoints to Update (19 total)
| Endpoint | Method | Path | Action |
|----------|--------|------|--------|
| getDocuments | GET | /api/v1/documents | Add deprecation |
| getDocument | GET | /api/v1/documents/:id | Add deprecation |
| downloadSignedDocument | GET | /api/v1/documents/:id/download | Add deprecation |
| createDocument | POST | /api/v1/documents | Add deprecation |
| createTemplate | POST | /api/v1/templates | Add deprecation |
| deleteTemplate | DELETE | /api/v1/templates/:id | Add deprecation |
| getTemplate | GET | /api/v1/templates/:id | Add deprecation |
| getTemplates | GET | /api/v1/templates | Add deprecation |
| createDocumentFromTemplate | POST | /api/v1/templates/:templateId/create-document | Update existing deprecation message |
| generateDocumentFromTemplate | POST | /api/v1/templates/:templateId/generate-document | Add deprecation |
| sendDocument | POST | /api/v1/documents/:id/send | Add deprecation |
| resendDocument | POST | /api/v1/documents/:id/resend | Add deprecation |
| deleteDocument | DELETE | /api/v1/documents/:id | Add deprecation |
| createRecipient | POST | /api/v1/documents/:id/recipients | Add deprecation |
| updateRecipient | PATCH | /api/v1/documents/:id/recipients/:recipientId | Add deprecation |
| deleteRecipient | DELETE | /api/v1/documents/:id/recipients/:recipientId | Add deprecation |
| createField | POST | /api/v1/documents/:id/fields | Add deprecation |
| updateField | PATCH | /api/v1/documents/:id/fields/:fieldId | Add deprecation |
| deleteField | DELETE | /api/v1/documents/:id/fields/:fieldId | Add deprecation |
## Changes Required
### contract.ts Changes
For each endpoint, add:
```typescript
deprecated: true,
description: 'Deprecated. Please migrate to the V2 API.',
```
For endpoints that already have a description, prepend the deprecation notice.
### openapi.ts Changes
Update the info block description from:
```typescript
description: 'The Documenso API for retrieving, creating, updating and deleting documents.',
```
to:
```typescript
description: '[DEPRECATED] The Documenso API for retrieving, creating, updating and deleting documents. Please migrate to V2.',
```
## Notes
- The `createDocumentFromTemplate` endpoint's existing deprecation message (pointing to `generateDocumentFromTemplate`) will be replaced with the generic V2 migration message
- No sunset date is included - endpoints are marked deprecated but without a removal timeline
- The V2 API is available and ready for users to migrate to
+37 -4
View File
@@ -55,6 +55,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Get all documents',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
getDocument: {
@@ -66,6 +68,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Get a single document',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
downloadSignedDocument: {
@@ -78,6 +82,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Download a signed document when the storage transport is S3',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
createDocument: {
@@ -90,6 +96,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Upload a new document and get a presigned URL',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
createTemplate: {
@@ -102,6 +110,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Create a new template and get a presigned URL',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
deleteTemplate: {
@@ -114,6 +124,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Delete a template',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
getTemplate: {
@@ -125,6 +137,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Get a single template',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
getTemplates: {
@@ -137,6 +151,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Get all templates',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
createDocumentFromTemplate: {
@@ -150,7 +166,7 @@ export const ApiContractV1 = c.router(
},
summary: 'Create a new document from an existing template',
deprecated: true,
description: `This has been deprecated in favour of "/api/v1/templates/:templateId/generate-document". You may face unpredictable behavior using this endpoint as it is no longer maintained.`,
description: 'Deprecated. Please migrate to the v2 API.',
},
generateDocumentFromTemplate: {
@@ -165,8 +181,9 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Create a new document from an existing template',
deprecated: true,
description:
'Create a new document from an existing template. Passing in values for title and meta will override the original values defined in the template. If you do not pass in values for recipients, it will use the values defined in the template.',
'Deprecated. Please migrate to the v2 API.\n\nCreate a new document from an existing template. Passing in values for title and meta will override the original values defined in the template. If you do not pass in values for recipients, it will use the values defined in the template.',
},
sendDocument: {
@@ -181,9 +198,9 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Send a document for signing',
// I'm aware this should be in the variable itself, which it is, however it's difficult for users to find in our current UI.
deprecated: true,
description:
'Notes\n\n`sendEmail` - Whether to send an email to the recipients asking them to action the document. If you disable this, you will need to manually distribute the document to the recipients using the generated signing links. Defaults to true',
'Deprecated. Please migrate to the v2 API.\n\nNotes\n\n`sendEmail` - Whether to send an email to the recipients asking them to action the document. If you disable this, you will need to manually distribute the document to the recipients using the generated signing links. Defaults to true',
},
resendDocument: {
@@ -198,6 +215,8 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Re-send a document for signing',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
deleteDocument: {
@@ -210,6 +229,8 @@ export const ApiContractV1 = c.router(
404: ZUnsuccessfulResponseSchema,
},
summary: 'Delete a document',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
createRecipient: {
@@ -224,6 +245,8 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Create a recipient for a document',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
updateRecipient: {
@@ -238,6 +261,8 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Update a recipient for a document',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
deleteRecipient: {
@@ -252,6 +277,8 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Delete a recipient from a document',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
createField: {
@@ -266,6 +293,8 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Create a field for a document',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
updateField: {
@@ -280,6 +309,8 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Update a field for a document',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
deleteField: {
@@ -294,6 +325,8 @@ export const ApiContractV1 = c.router(
500: ZUnsuccessfulResponseSchema,
},
summary: 'Delete a field from a document',
deprecated: true,
description: 'Deprecated. Please migrate to the v2 API.',
},
},
{
+2 -1
View File
@@ -11,7 +11,8 @@ export const OpenAPIV1 = Object.assign(
info: {
title: 'Documenso API',
version: '1.0.0',
description: 'The Documenso API for retrieving, creating, updating and deleting documents.',
description:
'[DEPRECATED] The Documenso API for retrieving, creating, updating and deleting documents. Please migrate to the v2 API.',
},
servers: [
{