Create Image from Template
Send a POST request to this endpoint to create a new image using a predefined template.
ℹ️
You will need to authenticate to use this API. See authentication.
Request
POST https://api.ojo.so/v1/image/template
Request Body
Parameter | Type | Description |
---|---|---|
templateId | string | The ID of the template to use |
modify | object | (Optional) An object containing variables to modify in the template |
viewportHeight | number | (Optional) Height of the viewport in pixels (default: 800) |
viewportWidth | number | (Optional) Width of the viewport in pixels (default: 1280) |
curl --request POST \
--url https://api.ojo.so/v1/image/template \
--header 'Authorization: Bearer <API Key>' \
--header 'Content-Type: application/json' \
--data '{
"templateId": "your-template-id",
"modify": {
"title": "Custom Title"
},
"viewportHeight": 1000,
"viewportWidth": 1500
}'
Response
Everything went as planned and your image is generated.
{
"id": "image-uuid",
"imageUrl": "https://example.com/path/to/image.png",
"createdAt": "2023-08-29T12:34:56Z"
}