PHP
Configuration and request options
Configure the PHP client and override individual requests
Pass baseUrl, maxRetries, timeout, headers, or a PSR-18 client through the client options. Every method also accepts an options array with baseUrl, maxRetries, timeout, headers, queryParameters, and bodyProperties.
$result = $client->listRecords(
options: ['timeout' => 10.0, 'headers' => ['X-Request-ID' => 'request-123']]
);The default timeout is 30 seconds and the default retry count is 2.
Client options
| Option | Scope | Purpose |
|---|---|---|
baseUrl | Client or request | Override the default Insion environment. |
maxRetries | Client or request | Control retry attempts for retryable failures. |
timeout | Client or request | Set the timeout in seconds. |
headers | Client or request | Add HTTP headers. |
queryParameters | Request | Add query-string values. |
bodyProperties | Request | Add JSON body values. |
client | Client | Provide a PSR-18 HTTP client. |
Use client options for application-wide defaults. Use the method-level options array for a single request, such as a shorter timeout on an interactive moderation call or a request ID header for tracing.