TwentyT
Twenty4mo ago
2 replies
victorgomesl

[self-host] Correct Query Parameter Syntax for REST API Filtering (/rest/people)

Hello everyone,

I'm working with a self-hosted instance of Twenty and I'm struggling to correctly filter the GET /rest/people endpoint via query parameters. My goal is to find a person by their name or email, but all my attempts seem to return the full, unfiltered list of contacts.

After trying to use the GraphQL API without success, we've focused on the REST API based on community examples, but we still can't get the filtering to work.

Here are three examples of syntaxes we have already tested unsuccessfully:

Using bracket notation with [contains] for the name:
We tried to filter by a partial name, expecting this to work based on some online examples.
GET /rest/people?displayName[contains]=Patricia

Using bracket notation with [equals] for the email:
Similarly, we tried to get an exact match for an email address.
GET /rest/people?email[equals]=test@example.com

Targeting nested fields for the name:
Since we learned from GraphQL that the name might be an object, we also tried to filter on a sub-field.
GET /rest/people?name[firstName][contains]=Patricia

Unfortunately, none of these methods have worked for us. Could someone please clarify what the correct parameter syntax is for filtering people on a self-hosted instance?

Specifically, we need to know how to filter by:

A name field (partial match, like contains).

An email field (exact match).

Thank you in advance for any guidance!
Was this page helpful?