[GH-ISSUE #2393] implement query parameter filtering for api/v2/template #672

Open
opened 2026-02-26 18:48:00 +03:00 by kerem · 2 comments
Owner

Originally created by @jormigo on GitHub (Jan 17, 2026).
Original GitHub issue: https://github.com/documenso/documenso/issues/2393

Issue Description

The api/v2/template endpoint documentation lists a query parameter for search, but it is currently ignored by the backend implementation. Making a request with ?query=... returns all templates instead of filtering them.

Steps to Reproduce

  1. Create a template titled "Test Template".
  2. Call the API: GET /api/v2/template?query=RandomString
  3. Observe that "Test Template" is returned despite not matching the query.

Expected Behavior

The endpoint should return only templates that match the search query. Functionality will match the query parameter in the document enpoint:
Based on the implementation in
find-documents.ts
, the document query filter searches against the following fields:

Title: { title: { contains: query, mode: 'insensitive' } }
External ID: { externalId: { contains: query, mode: 'insensitive' } }
Recipient Names: { recipients: { some: { name: { contains: query, mode: 'insensitive' } } } }
Recipient Emails: { recipients: { some: { email: { contains: query, mode: 'insensitive' } } } }

Current Behavior

The endpoint returns all available templates, ignoring the query parameter completely.

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

MacOs

Browser [e.g., Chrome, Firefox]

Chrome

Version [e.g., 2.0.1]

2.3.1

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
  • I want to work on creating a PR for this issue if approved
Originally created by @jormigo on GitHub (Jan 17, 2026). Original GitHub issue: https://github.com/documenso/documenso/issues/2393 ### Issue Description The api/v2/template endpoint documentation lists a query parameter for search, but it is currently ignored by the backend implementation. Making a request with ?query=... returns all templates instead of filtering them. ### Steps to Reproduce 1. Create a template titled "Test Template". 2. Call the API: GET /api/v2/template?query=RandomString 3. Observe that "Test Template" is returned despite not matching the query. ### Expected Behavior The endpoint should return only templates that match the search query. Functionality will match the query parameter in the document enpoint: Based on the implementation in [ find-documents.ts ](documenso/packages/lib/server-only/document/find-documents.ts), the document query filter searches against the following fields: Title: { title: { contains: query, mode: 'insensitive' } } External ID: { externalId: { contains: query, mode: 'insensitive' } } Recipient Names: { recipients: { some: { name: { contains: query, mode: 'insensitive' } } } } Recipient Emails: { recipients: { some: { email: { contains: query, mode: 'insensitive' } } } } ### Current Behavior The endpoint returns all available templates, ignoring the query parameter completely. ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] MacOs ### Browser [e.g., Chrome, Firefox] Chrome ### Version [e.g., 2.0.1] 2.3.1 ### Please check the boxes that apply to this issue report. - [x] I have searched the existing issues to make sure this is not a duplicate. - [x] I have provided steps to reproduce the issue. - [x] I have included relevant environment information. - [ ] I have included any relevant screenshots. - [x] I understand that this is a voluntary contribution and that there is no guarantee of resolution. - [x] I want to work on creating a PR for this issue if approved
Author
Owner

@github-actions[bot] commented on GitHub (Jan 17, 2026):

Thank you for opening your first issue and for being a part of the open signing revolution!

One of our team members will review it and get back to you as soon as it possible 💚

Meanwhile, please feel free to hop into our community in Discord

<!-- gh-comment-id:3762643704 --> @github-actions[bot] commented on GitHub (Jan 17, 2026): Thank you for opening your first issue and for being a part of the open signing revolution! <br /> One of our team members will review it and get back to you as soon as it possible 💚 <br /> Meanwhile, please feel free to hop into our community in [Discord](https://documen.so/discord)
Author
Owner

@jormigo commented on GitHub (Feb 15, 2026):

@Mythie im a heavy user of the api and this broken endpoint needs to be fixed

<!-- gh-comment-id:3905115613 --> @jormigo commented on GitHub (Feb 15, 2026): @Mythie im a heavy user of the api and this broken endpoint needs to be fixed
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#672
No description provided.