Docs/API reference/Template config

Template config

Fetch your workspace's template configuration — every published template, its non-deprecated versions, and the variables each version expects.

v1 · beta
http
GET https://www.ewyn.ai/api/v1/templates/config

Example

bash
curl https://www.ewyn.ai/api/v1/templates/config \
  -H "Authorization: Bearer $EWYN_API_KEY"

Response

A map keyed by template name. Each template lists its latest major version and all non-deprecated versions with their variable requirements:

json
{
  "welcome": {
    "name": "Welcome Email",
    "latest": 2,
    "versions": {
      "1": {
        "id": "version-uuid-1",
        "vars": {
          "firstName": { "required": true },
          "plan": { "required": false }
        }
      },
      "2": {
        "id": "version-uuid-2",
        "vars": {
          "firstName": { "required": true },
          "ctaUrl": { "required": true }
        }
      }
    }
  },
  "password-reset": {
    "name": "Password Reset",
    "latest": 1,
    "versions": {
      "1": { "id": "version-uuid-3", "vars": { "resetUrl": { "required": true } } }
    }
  }
}

What it's for

  • Feed it to the SDK's templates option for name-based, compile-time-checked sending — the fetch-config CLI wraps this endpoint and writes a ready-to-import TypeScript file
  • Resolve a template name + version to the templateVersionId the send endpoint expects
  • Validate at deploy time that every variable your code passes is one the template actually uses
Was this page helpful?