# Got error when try to search files API Invalid search query

**URL:** <https://community.hubspot.com/t/got-error-when-try-to-search-files-api-invalid-search-query/148636>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [April 23, 2026, 7:49am UTC](https://community.hubspot.com/t/got-error-when-try-to-search-files-api-invalid-search-query/148636 "2026-04-23T07:49:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FadlyKnight](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@FadlyKnight](https://community.hubspot.com/u/FadlyKnight)\
**Post date:** [April 23, 2026, 7:49am UTC](https://community.hubspot.com/t/got-error-when-try-to-search-files-api-invalid-search-query/148636/1 "2026-04-23T07:49:36Z")

</div>

Got error when try to search files :  
Endpoint :

curl --location ‘[https://api.hubapi.com/files/2026-03/files/search?limit=1](https://api.hubapi.com/files/2026-03/files/search?limit=1)’  
or

curl --location ‘[https://api.hubapi.com/files/v3/files/search?limit=1](https://api.hubapi.com/files/v3/files/search?limit=1)’

Response :

{

“status”: “error”,

“message”: “Invalid search query”,

“correlationId”: “xxxxx”,

“category”: “VALIDATION\_ERROR”

}

---

<div class="post-metadata">

**Author:** ![chighsmith](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@chighsmith](https://community.hubspot.com/u/chighsmith)\
**Post date:** [April 23, 2026, 1:02pm UTC](https://community.hubspot.com/t/got-error-when-try-to-search-files-api-invalid-search-query/148636/2 "2026-04-23T13:02:01Z")

</div>

Hi @FadlyKnight,  
Thank you for posting to the Community! I understand that you are receiving a Validation Error when trying to search files using the API.  
I want to tag in some of our Top Contributors to see if they have experienced this before. Hi @Gonzalo @ChristinaKay and @Teun have any of you seen this error before? If so, how did you resolve it?  
Cassie, Community Manager

---

<div class="post-metadata">

**Author:** ![FadlyKnight](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@FadlyKnight](https://community.hubspot.com/u/FadlyKnight)\
**Post date:** [April 23, 2026, 4:58pm UTC](https://community.hubspot.com/t/got-error-when-try-to-search-files-api-invalid-search-query/148636/3 "2026-04-23T16:58:24Z")

</div>

It’s a bit confusing the API works when using one private token, but doesn’t work when using another private token. Both tokens have the files scope permission.
