Anjin Design
Docs navigation

Docs

API reference

Seven endpoints — that's the whole surface. Base URL https://api.anjin.design, all authenticated with Authorization: Bearer ik_live_…

Conventions#

  • All bodies are JSON; send Content-Type: application/json.
  • Errors are envelopes: { "error": { "code", "message" } } — codes listed in Rendering.
  • Rate limits and 429 behaviour: Authentication.

List templates#

GET/v1/templates

Every published template your key can render, with its addressing key.

200
{
  "templates": [
    {
      "id": "tpl_…",
      "name": "Instagram post",
      "derived_key": "acme_instagram_1080x1350",
      "width": 1080,
      "height": 1350
    }
  ]
}

Template schema#

GET/v1/templates/:id/schema

The slot contract — validate before you spend a credit, and keep your integration honest when a designer adds a slot.

200
{
  "slots": [
    { "name": "headline",    "type": "text"  },
    { "name": "hero_image",  "type": "image" },
    { "name": "brand_color", "type": "color" }
  ]
}

Create a render#

POST/v1/renders

FieldTypeDescription
templatestringThe addressing key ({project_slug}_{frame_slug}).
modificationsarraySlot values: {"name", "text" | "image_url" | "color"} per entry. Omitted slots keep their designed content.
formatstring?png (default), jpg or webp.
scalenumber?1–4. Costs scale² credits.
webhook_urlstring?Completion callback — see Webhooks.

Returns 202 with a pending job, or 200 with the finished URLs when you send Prefer: wait and the render completes inside the wait window — the full contract is in Rendering.

202
{ "id": "6f1c…", "status": "pending", "output_url": null }

Get a render#

GET/v1/renders/:id

200 — completed
{
  "id": "6f1c…",
  "status": "completed",           // pending | processing | completed | failed
  "output_url": "https://…signed…",  // ~1h from THIS response
  "asset_url":  "https://…permanent…"
}

output_url is re-signed on every fetch — its ~1 hour lifetime runs from the response you read it in. Failed jobs carry an error message and are refunded.

Batch render#

POST/v1/renders/batch

FieldTypeDescription
rendersarray1–50 render specs (the same fields as a single render).
format / scale / webhook_urlbatch-level?Defaults for every row; a row-level value overrides.

Per-row isolation, ordering and the mixed-outcome response shape are covered in Batch rendering.

Search assets#

POST/v1/assets/query

Search your project’s asset library by tag or metadata — the same index the MCP search_assets tool uses. Returns ranked matches with URLs ready to pass into an image slot.

request
{ "tags": ["product", "hero"], "limit": 10 }

Webhook secret#

GET/v1/webhook-secret

Your HMAC signing secret for verifying X-Anjin-Signature on webhook deliveries. Keep it server-side. Verification recipe: Webhooks.