List Templates
Retrieve a list of image templates associated with your account.
ℹ️
You will need to authenticate to use this API. See authentication.
Request
GET https://api.ojo.so/v1/template
Query Parameters
Parameter | Type | Description |
---|---|---|
page | number | (Optional) Page number for pagination (default: 1) |
pageSize | number | (Optional) Number of items per page (default: 10) |
sort | string | (Optional) Sort order: 'asc' or 'desc' (default: 'desc') |
curl --request GET \
--url 'https://api.ojo.so/v1/template?page=1&pageSize=10&sort=desc' \
--header 'Authorization: Bearer <API Key>'
Response
Successfully retrieved the list of templates.
{
"items": [
{
"id": "template-uuid-1",
"name": "Template 1",
"html": "<html><body><h1>Template 1</h1></body></html>",
"variables": {...},
"previewUrl": "https://example.com/path/to/preview1.png",
"createdAt": "2023-08-29T12:34:56Z",
"updatedAt": "2023-08-29T12:34:56Z"
},
{
"id": "template-uuid-2",
"name": "Template 2",
"html": "<html><body><h1>Template 2</h1></body></html>",
"variables": {...},
"previewUrl": "https://example.com/path/to/preview2.png",
"createdAt": "2023-08-30T12:34:56Z",
"updatedAt": "2023-08-30T12:34:56Z"
}
],
"totalItems": 48,
"totalPages": 5,
"currentPage": 1,
"pageSize": 10
}