# Timeouts and Limits

SCAPI enforces timeout thresholds and size limits to ensure optimal performance and system stability.

## Default Timeouts

:::note
Some API families, such as SLAS and Omnichannel Inventory (OCI), do not have gateway timeouts.
:::

| Type                                                                                                                                                  | Timeout               | HTTP status code if exceeded | Customizable                                                                                                                                                                                                                                                   |
| :---------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **API Client → SCAPI Gateway**                                                                                                                        |                       |                              |                                                                                                                                                                                                                                                                |
| Connection Idle                                                                                                                                       | 400s                  | -                            | No                                                                                                                                                                                                                                                             |
| [**SCAPI > Troubleshoot > (default) Timeouts**](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/timeout-troubleshoot.md) |                       |                              |                                                                                                                                                                                                                                                                |
| Shopper-API Read/Write                                                                                                                                | 10s                   | 504                          | [Yes](https://developer.salesforce.com/docs/commerce/commerce-api/references/timeouts?meta=Summary)                                                                                                                                                            |
| Custom-API Read/Write (Shopper)                                                                                                                       | 60s (10s recommended) | 504                          | Yes. For details, see [Timeouts API](https://developer.salesforce.com/docs/commerce/commerce-api/references/timeouts?meta=Summary) and [Custom API Limitations](https://developer.salesforce.com/docs/commerce/commerce-api/guide/custom-apis.md#limitations). |
| Custom-API Read/Write (Admin)                                                                                                                         | 60s                   | 504                          | Yes. For details, see [Timeouts API](https://developer.salesforce.com/docs/commerce/commerce-api/references/timeouts?meta=Summary) and [Custom API Limitations](https://developer.salesforce.com/docs/commerce/commerce-api/guide/custom-apis.md#limitations). |
| Admin-API Read/Write                                                                                                                                  | 60s                   | 504                          | Yes. For details, see [Timeouts API](https://developer.salesforce.com/docs/commerce/commerce-api/references/timeouts?meta=Summary).                                                                                                                            |
| **Hook Execution (per hook)**                                                                                                                         |                       |                              |                                                                                                                                                                                                                                                                |
| Shopper-API                                                                                                                                           | 10s                   | 500                          | Yes                                                                                                                                                                                                                                                            |
| Admin-API                                                                                                                                             | 60s                   | 500                          | Yes                                                                                                                                                                                                                                                            |

## Limits

SCAPI enforces the following request and response size constraints to ensure optimal performance and system stability.

| Type                                                                                                                                              | Limit                                                                                                                                         | HTTP status code if exceeded | Customizable                                                                                                                                                                      |
| :------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**SCAPI > Troubleshoot > Timeouts and Limits**](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/timeouts-limits.md) |                                                                                                                                               |                              |                                                                                                                                                                                   |
| Max. request line (URL) and headers                                                                                                               | 24kB                                                                                                                                          | 400                          | No                                                                                                                                                                                |
| Max request payload                                                                                                                               | 5MB                                                                                                                                           | 413                          | No                                                                                                                                                                                |
| Max response payload                                                                                                                              | 10MB                                                                                                                                          | 500                          | No                                                                                                                                                                                |
| **Script API - Quotas** (Hooks & Custom APIs)                                                                                                     |                                                                                                                                               |                              |                                                                                                                                                                                   |
| Default limit                                                                                                                                     | [API Quotas](https://salesforcecommercecloud.github.io/b2c-dev-doc/docs/current/quota/html/API_Quotas.html)                                   | 400                          | Yes. For details, see [Implement Quota Overrides](https://developer.salesforce.com/docs/commerce/commerce-solutions/guide/b2c-governance-and-quotas.md#implement-quota-overrides) |
| Storefront Limit                                                                                                                                  | [API Quotas](https://salesforcecommercecloud.github.io/b2c-dev-doc/docs/current/quota/html/API_Quotas.html)                                   | 400                          | Yes. For details, see [Implement Quota Overrides](https://developer.salesforce.com/docs/commerce/commerce-solutions/guide/b2c-governance-and-quotas.md#implement-quota-overrides) |
| **Hook Circuit Breaker**                                                                                                                          |                                                                                                                                               |                              |                                                                                                                                                                                   |
| 50 hook errors within last 100 requests                                                                                                           | [OCAPI Hook Circuit Breaker](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-commerce-ocapi/hookcircuitbreaker.md) | 503                          | No                                                                                                                                                                                |
