rest api – SOQL query 414 URI Too Long: What’s the actual length limit?

We are currently encountering 414 errors with our lengthy queries, and it’s difficult to find a definitive solution.

I found some information, but it’s inconsistent:

In API Request Limits and Allocations, it states:

In each REST call, the maximum length for the combined URI and headers is 16,384 bytes. A request exceeding this limit returns a 431 Request Header Fields Too Large error. If the URI itself exceeds this limit, the request returns a 414 URI Too Long error.

However, SOQL and SOSL Limits for Search Queries mentions a different limit:

SOQL statements | Maximum length of SOQL statements | By default, 100,000 characters.

Our queries (well below 100,000 characters) are rejected by Salesforce with a 414 URI Too Long error.

Multiple sources suggest switching to a POST API, but this API is undocumented. When I attempted to switch to POST, I received an error stating that POST is not supported.

Does anyone know the actual limit for SOQL queries? It seems the stricter URI/header limit always applies, which makes the 100,000-character SOQL limit somewhat unclear. Is there a non-REST SOQL API available?

Read more here: Source link