Skip to main content
POST
Add Knowledge Base Entry

Authorizations

Authorization
string
header
required

API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where YOUR_API_KEY is obtained from the Migma dashboard under Settings → Developers → API Keys.

Path Parameters

projectId
string
required

Project ID (MongoDB ObjectId)

Pattern: ^[0-9a-fA-F]{24}$

Body

application/json
title
string
required

Title of the knowledge base entry

Required string length: 1 - 100
content
string
required

Entry content, up to 512000 UTF-8 bytes. Declared email references keep the full original and prepare editable source in the background. HTML, EML, and MJML must fit 250000 UTF-8 bytes after email-source cleanup. Ordinary notes are truncated at 15,000 characters; explicit instructions over 15,000 characters are rejected.

Required string length: 1 - 512000
sourceFileName
string

Original upload filename, including .html, .eml, or .mjml. An empty string clears a previous filename on update.

Maximum string length: 255
previewHtml
string

Rendered HTML preview. For email references prepared in the background, the server creates this from the completed email source.

thumbnailUrl
string

URL of a thumbnail image for the entry.

screenshotUrl
string

URL of a full screenshot of the entry.

referenceKind
enum<string>

Use instructions for explicitly approved design guidance such as footer rules. Instructions are limited to 15,000 characters and rejected rather than truncated. Omit to keep existing email-example behavior.

Available options:
email,
instructions
referenceOrigin
enum<string>

Marks the entry as a design reference the email writer should learn from, and records where it came from. Omit for an ordinary note — omit referenceKind too for an ordinary knowledge entry.

Available options:
favorite,
upload,
manual

Response

Knowledge base entry added

success
boolean
required
data
object
error
string | null