Workspace API

Email library

Email library endpoints of the Zanfia Workspace API, with schemas and code samples.

3 min readLast updated Sep 19, 2026

Reusable emails from the dashboard’s Email templates library, the ones workflow “Send email” steps reference. contentMarkdown is the source of truth (block directives and {{variables}} included); branded wraps the email in your branded frame; attachments reference Media Library files. Editing an email changes what referencing workflows send from their next run. These are not the system emails (purchase confirmation, access granted, …): those live under Email templates. All routes require a Authorization: Bearer header — see Authentication.

List library emails

GET/email-library

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/email-library"
{  "emails": [    {      "id": "string",      "name": "string",      "subject": "string",      "preheader": "string",      "contentMarkdown": "string",      "branded": true,      "fromName": "string",      "replyTo": "string",      "attachments": [        {          "kind": "media",          "mediaId": "string",          "name": "string",          "mimeType": "string",          "size": 0,          "storagePath": "string",          "url": "string"        }      ],      "createdAt": "string",      "updatedAt": "string"    }  ]}
{  "error": "string",  "message": "string"}

Create a library email

POST/email-library

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/email-library" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "email": {    "id": "string",    "name": "string",    "subject": "string",    "preheader": "string",    "contentMarkdown": "string",    "branded": true,    "fromName": "string",    "replyTo": "string",    "attachments": [      {        "kind": "media",        "mediaId": "string",        "name": "string",        "mimeType": "string",        "size": 0,        "storagePath": "string",        "url": "string"      }    ],    "createdAt": "string",    "updatedAt": "string"  }}
{  "error": "string",  "message": "string"}

Get a library email

GET/email-library/{emailId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

emailId*string

Library e-mail template id

Response Body

application/json

application/json

curl -X GET "https://example.com/email-library/string"
{  "email": {    "id": "string",    "name": "string",    "subject": "string",    "preheader": "string",    "contentMarkdown": "string",    "branded": true,    "fromName": "string",    "replyTo": "string",    "attachments": [      {        "kind": "media",        "mediaId": "string",        "name": "string",        "mimeType": "string",        "size": 0,        "storagePath": "string",        "url": "string"      }    ],    "createdAt": "string",    "updatedAt": "string"  }}
{  "error": "string",  "message": "string"}

Update a library email

PATCH/email-library/{emailId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

emailId*string

Library e-mail template id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Partial update — omitted fields stay untouched; an empty patch is a 400.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/email-library/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "email": {    "id": "string",    "name": "string",    "subject": "string",    "preheader": "string",    "contentMarkdown": "string",    "branded": true,    "fromName": "string",    "replyTo": "string",    "attachments": [      {        "kind": "media",        "mediaId": "string",        "name": "string",        "mimeType": "string",        "size": 0,        "storagePath": "string",        "url": "string"      }    ],    "createdAt": "string",    "updatedAt": "string"  }}
{  "error": "string",  "message": "string"}

Delete a library email

DELETE/email-library/{emailId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

emailId*string

Library e-mail template id

Response Body

application/json

application/json

curl -X DELETE "https://example.com/email-library/string"
{  "status": "ok"}
{  "error": "string",  "message": "string"}

Duplicate a library email

POST/email-library/{emailId}/duplicate

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

emailId*string

Library e-mail template id

Response Body

application/json

application/json

curl -X POST "https://example.com/email-library/string/duplicate"
{  "email": {    "id": "string",    "name": "string",    "subject": "string",    "preheader": "string",    "contentMarkdown": "string",    "branded": true,    "fromName": "string",    "replyTo": "string",    "attachments": [      {        "kind": "media",        "mediaId": "string",        "name": "string",        "mimeType": "string",        "size": 0,        "storagePath": "string",        "url": "string"      }    ],    "createdAt": "string",    "updatedAt": "string"  }}
{  "error": "string",  "message": "string"}

Was this article helpful?

Related articles

Spotted something off? Tell us at support@zanfia.com.