Api referenceNewsletterIssues
Render a newsletter issue fixture (Preview)
Preview · Available to selected organizations. Renders a fixture declared by the layout to email or web at the requested revision.
POST
Renders a fixture declared by the layout to email or web at the requested revision. The web render is the publication page readers get, with the subscribe wall position marked. Requires newsletters and email.
apiKeyheader
x-api-key<token>id*stringMatch
^nl_[0-9a-hjkmnp-tv-z]{16,24}$idempotency-key?|nullapplication/json- body
path*stringMatch
^(?!.*\\)(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?!.*(?:^|\/)\.git(?:\/|$))(?!.*\p{Cc})issues\/(?:[^/]+\/)*[^/]+\.md$Length
length <= 1024expectedRevision*stringLength
1 <= length <= 1024fixture*stringLength
1 <= length <= 128target*stringValue in
"email""web"Success
application/json- response
projectId*TemplateProjectIdMatch
^tproj_[0-9a-hjkmnp-tv-z]{16,24}$revision*stringentryPath*|declaration*|nullissue?diagnostics*array<>incompatibilities*array<>fixture*stringLength
1 <= length <= 128rendered*|nullpage?|nullimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.newsletters.issues.render({ "id": "example", "path": "example", "expectedRevision": "example", "fixture": "example", "target": "email"});Example Response
{ "projectId": "string", "revision": "string", "entryPath": "string", "declaration": { "codeDigest": "string", "templateId": "string", "input": { "schema": { "property1": "string", "property2": "string" }, "schemaDigest": "string", "contractDigest": "string" }, "fixtures": [ "string" ] }, "issue": { "path": "string", "frontmatter": { "title": "string", "date": "string", "slug": "string", "topic": "string", "preheader": "string", "seo": { "title": "string", "description": "string", "image": "string" }, "gate": { "leadIn": 0 } } }, "diagnostics": [ { "code": "string", "severity": "error", "message": "string", "origins": [ { "fileName": "string", "lineNumber": 1, "columnNumber": 1 } ], "clients": [ "string" ], "notes": "string", "provenance": "string", "fixtures": [ "string" ], "occurrences": [ [ { "fileName": "string", "lineNumber": 1, "columnNumber": 1 } ] ], "compatibility": { "assessment": "risk", "title": "string" } } ], "incompatibilities": [ { "code": "string", "severity": "error", "message": "string", "origins": [ { "fileName": "string", "lineNumber": 1, "columnNumber": 1 } ], "clients": [ "string" ], "notes": "string", "provenance": "string", "fixtures": [ "string" ], "occurrences": [ [ { "fileName": "string", "lineNumber": 1, "columnNumber": 1 } ] ], "compatibility": { "assessment": "risk", "title": "string" } } ], "fixture": "string", "rendered": { "subject": "string", "preheader": "string", "html": "string", "text": "string", "selections": [ { "instancePath": "string", "tag": "string", "origins": [ { "fileName": "string", "lineNumber": 1, "columnNumber": 1 } ], "authored": true, "occurrence": 1, "occurrences": 1, "parentPath": "string", "start": 0, "end": 0 } ], "sentBytes": -9007199254740991, "previewBytes": -9007199254740991 }, "page": { "kind": "page", "html": "string", "selections": [ { "instancePath": "string", "tag": "string", "origins": [ { "fileName": "string", "lineNumber": 1, "columnNumber": 1 } ], "authored": true, "occurrence": 1, "occurrences": 1, "parentPath": "string", "start": 0, "end": 0 } ] }}