---
title: "AjaxResult"
description: "Specialised Result returned by every REST helper. Provides `isMore() / getNext() / getTotal() / getStatus()` for paged responses, and immutable data."
canonical_url: "https://bitrix24.github.io/b24jssdk/docs/working-with-the-rest-api/core-ajax-result"
last_updated: "2026-07-03"
---
# AjaxResult

> Specialised Result returned by every REST helper. Provides `isMore() / getNext() / getTotal() / getStatus()` for paged responses, and immutable data.

`AjaxResult<T>`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} extends [`Result<Payload<T>>`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""}](https://bitrix24.github.io/b24jssdk/raw/docs/working-with-the-rest-api/core-result.md) and is the type every `actions.v{2,3}.call.make()` resolves to. Compared to the generic `Result`, it:

- accepts the raw REST response (`answer`), the original request (`query`), and the HTTP status, and freezes them — `setData()` throws.
- decodes Bitrix24 error payloads into [`AjaxError`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""}](https://github.com/bitrix24/b24jssdk/blob/main/packages/jssdk/src/core/http/ajax-error.ts){rel="[\"nofollow\"]"} instances stored under the key `'base-error'`.
- exposes pagination helpers (`isMore`, `getNext`, `fetchNext`, `getTotal`).
- exposes the HTTP status (`getStatus`) and the original request (`getQuery`).

## Reading Data

```ts-type
getData(): undefined | SuccessPayload<T>
```

Returns `undefined`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} when the result is not successful. On success, returns a frozen object with `result`, `next`, `total`, `time` (only the fields present in the original payload). Use `T` to type the underlying `result`:

```ts
const response = await $b24.actions.v2.call.make<{ id: number, title: string }[]>({
  method: 'crm.item.list',
  params: { entityTypeId: 4, select: ['id', 'title'] },
  requestId: 'list-companies'
})

if (!response.isSuccess) {
  throw new Error(response.getErrorMessages().join('; '))
}

const data = response.getData()!     // { result: { id, title }[], next?: number, total?: number, time }
```

## Pagination

> [!CAUTION]
> `getNext` / `fetchNext` are implemented for **REST API v2 only**. v3 throws `SdkError({ code: 'JSSDK_CORE_METHOD_NOT_SUPPORT_IN_API_V3' })`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} — use [`actions.v3.fetchList.make`](https://bitrix24.github.io/b24jssdk/raw/docs/working-with-the-rest-api/fetch-list-rest-api-ver3.md) instead.

### `isMore` / `hasMore`

```ts-type
isMore(): boolean
hasMore(): boolean   // alias
```

`true` when the success payload contains a numeric `next`. Always `false`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} for unsuccessful results.

### `getNext`

```ts-type
getNext(http: TypeHttp): Promise<AjaxResult<T> | false>
```

Re-runs the original method with `params.start = next`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} and returns a new `AjaxResult<T>`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""}. Returns `false`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} when there is no next page or the current result is unsuccessful.

### `fetchNext`

```ts-type
fetchNext(http: TypeHttp): Promise<AjaxResult<T> | null>
```

Same as `getNext`, but returns `null`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} instead of `false`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""}.

### `getTotal` / `getStatus` / `getQuery`

```ts-type
getTotal(): number
getStatus(): number
getQuery(): Readonly<AjaxQuery>
```

`getTotal` returns `0`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} on unsuccessful results. `AjaxQuery`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} captures `{ method, params, requestId }`; the returned object and its `params` are stable — calling `getNext()` does not mutate them.

## Error Handling

When the raw response carries a `{ error: ... }` field, `AjaxResult`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""} converts it to an [`AjaxError`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""}](https://github.com/bitrix24/b24jssdk/blob/main/packages/jssdk/src/core/http/ajax-error.ts){rel="[\"nofollow\"]"} (subclass of `SdkError`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""}) keyed by `'base-error'` in the inherited `errors` map. Both v2 and v3 error shapes are handled, including v3 `validation[]` arrays.

```ts
import { AjaxError } from '@bitrix24/b24jssdk'

const response = await $b24.actions.v2.call.make({ method: 'profile', requestId: 'p' })
if (!response.isSuccess) {
  for (const error of response.getErrors()) {
    if (error instanceof AjaxError) {
      console.error(error.code, error.requestInfo?.method)
    }
  }
}
```

## `setData` Is Disabled

```ts-type
setData(): never
```

Always throws `ReferenceError('AjaxResult does not allow data modification')`{className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style=""}. Use higher-level helpers (`callList`, `fetchList`, `batch`) when you need to aggregate.

## Sitemap

See the full [sitemap](/b24jssdk/sitemap.md) for all pages.
