> For the complete documentation index, see [llms.txt](https://ninja-lender.gitbook.io/ninja-lender-v2-api-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ninja-lender.gitbook.io/ninja-lender-v2-api-en/seller/getting-the-list-of-templates.md).

# Getting the list of templates

**Method:** POST

**Url:** <https://test.ninjalender.online/template/list>

**Headers:**

| header\_key   | content           |
| ------------- | ----------------- |
| Content-Type: | application/json; |
| Authorization | Bearer {{Token}}  |

Where {{Token}} - token obtained during authorization

\
**Request body:**

| Key    | Type        | Required | Description        |
| ------ | ----------- | -------- | ------------------ |
| params | JSON.object | +        | Request parameters |

**Params:**

| Key    | Type       | Required | Description                                                                                                                                                                                                                              |
| ------ | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fields | JSON.array | -        | A list of fields for serialization (which data of each template will be returned upon response). The entire list is provided in a table with an analysis of the answer. In case of absence, only id, label, description will be returned |

**Response:**

| Key      | Type        | Description                |
| -------- | ----------- | -------------------------- |
| code     | int         | Response code              |
| message  | string      | Response message           |
| data     | JSON.object | Response data              |
| log\_key | int         | ID for current request log |

**data:**

| Key         | Type        | Description                    |
| ----------- | ----------- | ------------------------------ |
| id          | int         | Id of template                 |
| label       | string      | name of template               |
| description | string      | description of template        |
| title       | string      | title of template              |
| body        | json.object | list of requisites in template |

**Request example:**

```
{
    "params" : {}
}
```

**Response example:**

**Success:**

```
{
    "code": 0,
    "message": "ok",
    "data": [
        {
            "id": 3,
            "label": "1_8_test",
            "description": null
        },
        {
            "id": 1,
            "label": "first_template",
            "description": null
        }
    ],
    "log_key": 730
}
```

&#x20; **Error:**

```
{
    "code": -1,
    "message": "error",
    "log_key": 748,
    "errors": [
        {
            "code": -1020101,
            "message": "Params is required"
        }
    ]
}
```

**Error list:**

| Key      | Message            |
| -------- | ------------------ |
| -96      | invalid key        |
| -97      | invalid token      |
| -98      | expired token      |
| -99      | system error       |
| -100     | access denied      |
| -1020101 | Params is required |
