> ## Documentation Index
> Fetch the complete documentation index at: https://docs.imagior.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve All Templates

> Retrieves all templates belonging to the authenticated user, with optional sorting by fields such as `updatedAt`.

<Note type="warning">**Note:** This operation does not consume any account credits, but rate limits apply.</Note>

## Retrieve All Templates

This endpoint retrieves all templates belonging to the authenticated user. You can optionally sort the results by fields such as `updatedAt`.

### Request

* **Endpoint**: `GET /templates/all`
* **Authorization**: Bearer token required

#### Query Parameters

* `sort` (string, optional): Sort behavior, either by the date the template was created (`createdAt`) or when it was last updated (`updatedAt`). Defaults to `updatedAt`.
* `order` (string, optional): Sort order, either ascending (`asc`) or descending (`desc`). Defaults to `desc`.

### Response

A successful response will return an array of templates.

#### Example Response

```json
[
   {
      "id": "template123",
      "name": "Sample Template",
      "createdAt": "2024-09-12T02:44:45.213Z",
      "updatedAt": "2024-09-13T02:44:45.213Z"
   },
   {
      "id": "template456",
      "name": "Another Template",
      "createdAt": "2024-09-10T02:44:45.213Z",
      "updatedAt": "2024-09-11T02:44:45.213Z"
   }
]
```
