Skip to main content
POST
/
api
/
images
cURL
curl --request POST \
  --url https://api.gnomy.io/api/images \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "template_id": "<string>",
  "modifications": {}
}
'
{
  "status": "success",
  "id": "<string>",
  "image_url": "<string>"
}
Generates an image based on a template and modifications.

Authentication

This endpoint requires an API key for authentication. Include your API key in the request headers using the x-api-key header.

Request Body

{
  "template_id": "string",
  "modifications": [
    {
      "name": "string",
      "text": "string | null",
      "color": "string | null",
      "background": "string | null",
      "image_url": "string | null",
      "rating": number
    }
  ]
}
FieldTypeRequiredDescription
template_idstringYesThe ID of the template to use for generation
modificationsarrayYesArray of modifications to apply to template elements
modifications[].namestringYesThe name of the element to modify (must match an element in the template)
modifications[].textstring | nullNoNew text content for text elements. Set to null to reset to default.
modifications[].colorstring | nullNoNew color value for text, SVG, and shape elements. Set to null to reset to default.
modifications[].backgroundstring | nullNoNew background color for elements that support it. Set to null to reset to default.
modifications[].image_urlstring | nullNoNew image URL for image and SVG elements. Set to null to reset to default.
modifications[].ratingnumberNoNew rating value for star rating elements (typically 1-5)

Element Types and Their Modifiable Properties

Different element types support different modification properties:
Element TypeModifiable Properties
texttext, color
imageimage_url
svgimage_url, color
starRatingrating
rectangle, circle, ellipse, star, triangle, diamond, pentagon, hexagon, heart, semicircle, cross, arrow, trapezoid, wedge, ringcolor

Response

Success Response (200 OK)

{
  "status": "success",
  "id": "string",
  "image_url": "string"
}

Error Response (400 Bad Request)

{
  "error": "templateId must be provided"
}

Error Response (401 Unauthorized)

{
  "error": "Unauthorized"
}

Error Response (403 Forbidden)

{
  "error": "Unauthorized: You do not have access to this template"
}

Error Response (500 Internal Server Error)

{
  "error": "Error message"
}

Example

curl -X POST "https://api.gnomy.io/api/images" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "template_id": "template123",
    "modifications": {
      "text": "Hello World",
      "color": "#FF0000"
    }
  }'

Example Request

{
  "template_id": "8f628cd3-59f6-4f03-9ecb-983a21d3b58a",
  "modifications": [
    {
      "name": "image_1",
      "image_url": "https://example.com/image.jpg"
    },
    {
      "name": "text",
      "text": "Custom text content",
      "color": null
    },
    {
      "name": "svg_1",
      "color": "#FF0000",
      "image_url": "https://example.com/icon.svg"
    },
    {
      "name": "starRating123",
      "rating": 5
    },
    {
      "name": "rectangle",
      "color": "#000000"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Body

application/json

Template and modifications for image generation

template_id
string
required

The ID of the template to use for generation

modifications
object
required

The modifications to apply to the template

Response

Image generated successfully

status
enum<string>
Available options:
success
id
string
image_url
string