Developer API

Welcome to the Wafrow API documentation. Our API allows you to programmatically generate images, manage templates, and leverage our AI copywriting tools.

Authentication

All API requests (except for public image routes) require authentication using a Bearer Token. You can generate an API token from your dashboard.

Authorization: Bearer YOUR_API_TOKEN

Check Authentication

GET /api/me

Returns the current authenticated user and organization details.


Image Generation

The core of Wafrow is dynamic image generation. There are several ways to generate and manipulate images via the API.

1. Simple Dynamic Overrides (GET)

The easiest way to generate images is by appending URL parameters to the template URL. This is perfect for emails and landing pages.

GET /i/{template_id}?layerName[text]=Hello+World&layerName[fill]=#FF0000

  • template_id: Your template UUID.
  • layerName: The name of the layer you want to override (defined in the editor).
  • [text]: Override the text content.
  • [fill]: Override the color (hex).
  • [src]: Override image source URL.
  • [opacity]: Override opacity (0-1).

2. Personalized Image Generation (POST)

For more complex manipulations or when you want to send data in the request body.

POST /api/img/{template_id}

Request Body:

{
  "personalize": {
    "Headline": {
      "text": "Special Offer for John",
      "fill": "#333333"
    },
    "Background": {
      "src": "https://example.com/custom-bg.jpg"
    }
  }
}

3. List Templates

POST /api/listBannerTemplates

Returns a paginated list of your image templates.


AI Copywriting

Leverage Wafrow's AI to generate subject lines, tweets, or translations.

Create Subject Line

POST /api/createSubjectLine

Request Body:

{
  "prompt": "A summer sale for 20% off",
  "lang": "en",
  "audiencePersonaId": "optional-uuid"
}

AI Sentence Rewriter

POST /api/rewrite

Request Body:

{
  "prompt": "Your original sentence here",
  "lang": "en"
}

Full API Reference

For a complete, interactive API reference including all endpoints, schemas, and a "Try It" feature, visit our auto-generated documentation:

View Interactive API Docs →

Note: The interactive docs are powered by Scramble and always reflect the latest changes in our API.