Skip to content

SDK documents.list uses wrong query param name (filter instead of filters) #69

@KudoExtase810

Description

@KudoExtase810

When using the Ragie TypeScript SDK:

await ragie.documents.list({
  filter: `{"document_name":{"$eq":"resume.pdf"}}`,
});

The request is sent to:
https://api.ragie.ai/documents?filter=%7B%22document_name%22%3A%7B%22%24eq%22%3A%22resume.pdf%22%7D%7D

This returns an empty list even though the document exists.

The identical query works when calling the API directly with the correct parameter name:
https://api.ragie.ai/documents?filters={%22document_name%22:{%22$eq%22:%22resume.pdf%22}}

Here's the full code:

const documents = await ragie.documents.list({
				filter: `{"document_name":{"$eq":"resume.pdf"}}`,
			});

			console.log("Method 1:", documents); // returns no docs

			const url =
				"https://api.ragie.ai/documents?" +
				'filters={"document_name":{"$eq":"resume.pdf"}}';
				

			const res = await fetch(url, options);
			const json = await res.json();
			
			console.log("Method 2:", json); // returns the correct docs

This could be happening with other function aswell, I haven't tested them

Problem

The SDK incorrectly uses the query parameter filter while the Ragie API only accepts filters.
Filtering therefore silently fails (no error, just empty results).

Expected behavior

The SDK should send filters=… (with an “s”) so filtering works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions