Salesforce Decode
Salesforcedecode
Back to questions
IntegrationIntermediaterestquerylimits

Handle REST API URI length limits for large SOQL IN clause queries

Real World Scenario

Integration queries 800 Account Ids via GET /query?q=... IN clause; 414 URI Too Long errors abort sync.

Expected Answer

• POST /composite with query subrequest in body not URL • Batch IN clause 200 Ids per query under URI limit • Bulk API 2.0 query job for large Id set filter • Temporary custom object load Ids query via relationship • SOQL semi-join filter subquery instead of huge IN list • Middleware chunk Id list automatic batching • Monitor query length in integration logs

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Stay within limits by: POST /composite with query subrequest in body not URL. Bulkify everything — never query or DML in loops. Bulk API 2.0 query job for large Id set filter. Large IN clauses belong in POST body or Bulk query—not GET URL string. Balance speed of delivery with maintainability.

Architect Perspective

Large IN clauses belong in POST body or Bulk query—not GET URL string.