API Reference
Retrieve All Templates
Retrieves all templates belonging to the authenticated user, with optional sorting by fields such as updatedAt
.
GET
/
templates
/
all
Note: This operation does not consume any account credits, but rate limits apply.
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): Field by which to sort the templates (e.g.,updatedAt
). Defaults toupdatedAt
.order
(string, optional): Sort order, either ascending (asc
) or descending (desc
). Defaults todesc
.
Response
A successful response will return an array of templates.
Example Response
[
{
"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"
}
]
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
sort
string
default: updatedAtField by which to sort the templates (e.g., 'updatedAt').
order
enum<string>
default: descSort order, either ascending ('asc') or descending ('desc').
Available options:
asc
, desc
Response
200 - application/json
id
string
The ID of the template
name
string
The name of the template
createdAt
string
The date and time when the template was created
updatedAt
string
The date and time when the template was last updated