Api referenceNewsletterIssues

Create a newsletter issue (Preview)

Preview · Available to selected organizations. Creates an unsaved Markdown file. View request and response details for this Samva email API endpoint.

POST
/v1/newsletters/{id}/issues

Creates an unsaved Markdown file. The first request provisions the newsletter's project and layout; omit expectedRevision only for that first request or its retry. Further creates require the current revision. No template entry is registered. Requires newsletters and email.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^nl_[0-9a-hjkmnp-tv-z]{16,24}$

Header Parameters

idempotency-key?|null

Request Body

application/json
  1. body
path*string
Match^(?!.*\\)(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?!.*(?:^|\/)\.git(?:\/|$))(?!.*\p{Cc})issues\/(?:[^/]+\/)*[^/]+\.md$
Lengthlength <= 1024
content*string
expectedRevision?|null

Response Body

Success

application/json
  1. response
workspace*
files*
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.newsletters.issues.create({  "id": "example",  "path": "example",  "content": "example"});
Example Response
{  "workspace": {    "projectId": "string",    "organizationId": "string",    "ownerEpoch": 0,    "repositoryName": "string",    "defaultBranch": "string",    "baseCommit": "string",    "remoteHead": "string",    "pendingRemoteHead": "string",    "revision": "string",    "overlay": {      "property1": "string",      "property2": "string"    },    "assetChanges": [      {        "path": "string",        "status": "added"      }    ],    "conflicts": [      {        "path": "string",        "base": "string",        "draft": "string",        "main": "string"      }    ],    "provenance": {      "references": [        {          "kind": "string",          "digest": "string",          "locator": "string"        }      ]    },    "mounts": [      {        "kind": "project",        "root": "/project",        "access": "read-write"      }    ],    "libraryManifestDigest": "string",    "createdAt": "string",    "updatedAt": "string",    "createdBy": {      "userId": "string",      "via": "api"    },    "updatedBy": {      "userId": "string",      "via": "api"    }  },  "files": {    "property1": "string",    "property2": "string"  }}