# List template bundles

> Available starting with the **sign 26.1300.0** module. On older self-hosted installations the method may be unavailable: the platform returns `422 METHOD_NOT_YET_AVAILABLE` with `error.release`.

`POST /v1/sign-b2e/template-folders/tail`

Returns bundles whose templates are all available to the key owner for sending. Requires permission to read documents. Keep paginating until `hasMore=false`, even when intermediate pages are empty.

**Scopes:** `sign.b2e`, `crm`.

## Request body fields

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cursor` | object \| null | no | The entire cursor from meta.cursor of the previous response. Omit it in the first request; null is allowed. |
| `cursor.field` | string | no | Cursor field: id. |
| `cursor.value` | integer \| string | no | Last seen ID; 0 at the start of pagination. |
| `cursor.order` | string | no | Sort direction: ASC, case-insensitive. |
| `cursor.limit` | integer \| string | no | Defaults to 50; minimum 1. The core reduces values above 50 to 50. |

## Examples

### curl — personal key

```bash
curl -X POST 'https://vibecode.bitrix24.com/v1/sign-b2e/template-folders/tail' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

### curl — OAuth application

```bash
curl -X POST 'https://vibecode.bitrix24.com/v1/sign-b2e/template-folders/tail' \
  -H 'X-Api-Key: YOUR_APP_KEY' \
  -H 'Authorization: Bearer USER_SESSION_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

### JavaScript — personal key

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/sign-b2e/template-folders/tail', {
  "method": "POST",
  "headers": {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({})
});
const result = await response.json();
if (!response.ok || !result.success) throw new Error(result.error?.message);
console.log(result.data);
```

### JavaScript — OAuth application

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/sign-b2e/template-folders/tail', {
  "method": "POST",
  "headers": {
    "X-Api-Key": "YOUR_APP_KEY",
    "Authorization": "Bearer USER_SESSION_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({})
});
const result = await response.json();
if (!response.ok || !result.success) throw new Error(result.error?.message);
console.log(result.data);
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | Whether the request succeeded. |
| `data` | array<object> | Operation data. |
| `data[].id` | integer | Object ID. |
| `data[].title` | string | Object name. |
| `data[].companyId` | integer | CRM company ID. |
| `data[].companyName` | string | Company name. |
| `data[].templateCount` | integer | Number of templates. |
| `data[].templates` | array | Bundle templates. |
| `data[].templates[].uid` | string | Template UID. |
| `data[].templates[].title` | string | Object name. |
| `data[].templates[].companyId` | integer \| null | CRM company ID. |
| `data[].templates[].companyName` | string \| null | Company name. |
| `data[].templates[].regionDocumentType` | string \| null | Regional document type. |
| `data[].templates[].providerCode` | string \| null | Stored provider code; null if unknown. |
| `meta.cursor` | object | Cursor for the next request. |
| `meta.hasMore` | boolean | Whether there is a next page; can be true even when data is empty. |
| `meta.redacted` | array<string> | Present when credentials are hidden; contains the paths of the replaced values. |

## Response example

Shape of a successful response; the data depends on the Bitrix24 account and the request.

```json
{
  "success": true,
  "data": [],
  "meta": {
    "cursor": {
      "field": "id",
      "value": "7",
      "order": "ASC",
      "limit": 50
    },
    "hasMore": false
  }
}
```

## Error response example

403 — the key lacks a required scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'sign.b2e' scope"
  }
}
```

## Errors

| HTTP | Code | Reason |
|---|---|---|
| 400 | `INVALID_PARAMS` | Invalid request shape: types, required fields or an unknown query string parameter. |
| 401 | `TOKEN_MISSING` | No credentials for the Bitrix24 connection. |
| 403 | `SCOPE_DENIED` | One of the required scopes is not granted. |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the operation; the code is in error.b24Code, the text in error.message. |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The method is not yet available on the Bitrix24 account; the release is in error.release. |

[Common API errors](/docs/errors).

## Known specifics

Bitrix24 checks user permissions, HR e-signature availability, business rules, page sizes and field contents. Values are passed through without local correction. Response text is JSON-encoded; credential-bearing links are hidden.

## See also

- [Employee signatures](/docs/sign-b2e)
- [API errors](/docs/errors)
