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/templateQuery 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
curl --request GET \
--url 'https://api.ojo.so/v1/template?page=1&pageSize=10&sort=desc' \
--header 'Authorization: Bearer <your API key>'Response
200
Successfully retrieved the list of templates. previewUrl links to a thumbnail of the template,
at most 800x800 px, for one hour. template_id, preview_url, created_at and updated_at
repeat id, previewUrl, createdAt and updatedAt for older clients.
{
"items": [
{
"id": "template-uuid-1",
"name": "Template 1",
"description": "Monthly invoice",
"variables": { "recipient_name": "Jane Sample" },
"inputs": ["recipient_name"],
"previewUrl": "https://example.com/path/to/preview1.png",
"createdAt": "2023-08-29T12:34:56Z",
"updatedAt": "2023-08-29T12:34:56Z",
"template_id": "template-uuid-1",
"preview_url": "https://example.com/path/to/preview1.png",
"created_at": "2023-08-29T12:34:56Z",
"updated_at": "2023-08-29T12:34:56Z"
}
],
"totalItems": 48,
"totalPages": 5,
"currentPage": 1,
"pageSize": 10
}