Filter by subType while using API

Filter by subType while using API

avatar

Is there a way to filter on "subType" for entries within a vault using API? We want to get all entries with subType "X.509" inside our vaults, without retrieving all entries within the vault.

For example:
https://<https://dvls-server>/api/v1/vault/42ee6ef3-2b83-4dd5-b5e5-6e6ba64dae56/entry?pageSize=100&pageNumber=0&subType=X509

All Comments (1)

avatar

Hello pvansluisveld,

Thank you for contacting the Devolutions support team.

The /api/v1/vault/{vaultId}/entry endpoint does not support server-side filtering by subType, so adding subType to the query string will be ignored and the endpoint will return the normal paged list.
As a workaround, you can filter client-side. In Postman, you can do this with a post-response script:

  1. Open the request
  2. Go to Scripts (or Tests in older Postman)
  3. Paste the following under Post-response, then click Send


pm.test("Status is 200", function () {
 pm.response.to.have.status(200);
 });
const json = pm.response.json();
 const entries = json.data ?? json.items ?? json; // adjust if your API wraps differently
 const x509 = (entries || []).filter(e => e?.subType === "X509");
console.log("X509 entries:", x509);
 pm.collectionVariables.set("x509Entries", JSON.stringify(x509));


Documentation
Devolutions Server REST API documentation (Swagger) is available in the web UI under Help & Tools – API documentation:
https://docs.devolutions.net/server/web-interface/utilities/api-documentation/

Best regards,

Patrick Ouimet