actions.v2.* / actions.v3.* and never touch TypeHttp directly. Reach for it when you need raw call / batch, custom limiter tuning, or runtime stats.TypeHttp is the contract implemented by HttpV2 and HttpV3. Each B24Frame / B24Hook / B24OAuth owns one instance per REST API version. Reach them through:
import { ApiVersion } from '@bitrix24/b24jssdk'
const v2 = $b24.getHttpClient(ApiVersion.v2)
const v3 = $b24.getHttpClient(ApiVersion.v3)
Properties
Logger
setLogger(logger: LoggerInterface): void
getLogger(): LoggerInterface
Lets you swap a debug logger into a single client without affecting the rest of the SDK. See Logger.
Calling REST
call
call<T = unknown>(
method: string,
params: TypeCallParams,
requestId?: string
): Promise<AjaxResult<T>>
Low-level single-method call. Higher-level helpers (actions.v2.call.make, callList, fetchList) build on top.
batch
batch<T = unknown>(
calls: BatchCommandsArrayUniversal | BatchCommandsObjectUniversal | BatchNamedCommandsUniversal,
options?: ICallBatchOptions
): Promise<Result<ICallBatchResult<T>>>
Low-level batch call. Three input shapes are accepted:
- Array of tuples:
[ [method, params], [method, params] ] - Array of objects:
[ { method, params, as?, parallel? }, ... ] - Named map:
{ key1: { method, params }, key2: [method, params] }
For most use cases call actions.v2.batch.make / actions.v3.batch.make, which handle the response unwrapping and returnAjaxResult.
Limiter Configuration
setRestrictionManagerParams(params: RestrictionParams): Promise<void>
getRestrictionManagerParams(): RestrictionParams
Replace or read the rate-limit / operating-limit / adaptive-delay configuration on this client. To change both v2 and v3 at once, prefer b24.setRestrictionManagerParams(...).
See Limiters for the params shape and presets (ParamsFactory.getDefault(), getBatchProcessing(), getRealtime(), fromTariffPlan()).
Statistics
getStats(): RestrictionManagerStats & {
adaptiveDelayAvg: number
errorCounts: Record<string, number>
totalRequests: number
successfulRequests: number
failedRequests: number
totalDuration: number
byMethod: Map<string, { count: number, totalDuration: number }>
lastErrors: { method: string, error: string, timestamp: number }[]
}
Snapshot of the limiter + per-method counters. Useful for dashboards. See Limiters → Monitoring for the full breakdown.
Reset
reset(): Promise<void>
Clears the limiter state and statistics. Typical use: after a destructive incident response or in long-running daemons that want a clean window.
Client-Side Warning
setClientSideWarning(value: boolean, message: string): void
B24Hook and B24OAuth enable a runtime warning when used in a browser environment (their secrets must never reach the client). Toggle it from the parent class via b24.offClientSideWarning(); this method is the underlying primitive.