{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/narrareach-com/json-schema/narrareach-com-create-notes-request-schema.json",
  "title": "CreateNotesRequest",
  "description": "Unknown fields are ignored.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/narrareach-com-openapi.json#/components/schemas/CreateNotesRequest",
  "type": "object",
  "required": [
    "content",
    "platforms"
  ],
  "properties": {
    "content": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000
    },
    "contentJson": {
      "description": "Optional rich-text document (the Narrareach editor JSON) for the same Note. Defaults to content as plain paragraphs. Images and videos inside it are added to imageUrls and videoUrls."
    },
    "platforms": {
      "type": "array",
      "minItems": 1,
      "maxItems": 9,
      "items": {
        "type": "string",
        "enum": [
          "SUBSTACK",
          "LINKEDIN",
          "X",
          "BLUESKY",
          "THREADS",
          "INSTAGRAM",
          "FACEBOOK",
          "TIKTOK",
          "PINTEREST"
        ]
      }
    },
    "imageUrls": {
      "type": "array",
      "maxItems": 8,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 20000
      },
      "description": "Public HTTPS image URLs to attach. Platform media limits apply."
    },
    "videoUrls": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 20000
      },
      "description": "Public HTTPS video URLs to attach. Platform media limits apply."
    },
    "threadsTopicTag": {
      "type": "string",
      "maxLength": 50,
      "description": "Optional Threads topic. Requires THREADS in platforms (otherwise THREADS_TOPIC_TAG_REQUIRES_THREADS). Up to 50 characters, with no periods, ampersands, or line breaks (otherwise INVALID_THREADS_TOPIC_TAG). Stored only on the Threads destination."
    },
    "firstReply": {
      "type": "string",
      "description": "Optional first reply posted under the Note where the platform supports it. Each platform's length rules apply; the response's firstReply says where it was accepted or omitted. A reply that cannot be used never stops the Note. Text past 20,000 characters is dropped."
    },
    "threadPosts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Optional posts 2 to n of a thread, in order; content is post 1. X, Threads and Bluesky post the whole thread, each post replying to the one before, exactly as written; every other platform posts post 1 only. Up to 25 posts counting content, none empty (MISSING_INPUT, otherwise THREAD_TOO_LONG), and each within the per-post limit of every selected thread platform: X 280, or 25,000 with X Premium; Threads 500; Bluesky 300 (otherwise THREAD_POST_TOO_LONG, with details.field naming the post, e.g. threadPosts[2], and details.platform). When set, firstReply is ignored: post 2 is the first reply. The response's thread says where it posts in full."
    },
    "publication": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300,
      "description": "Substack publication name, handle, or URL. Only with SUBSTACK in platforms. Needed only when the connected publications span more than one Substack profile (SUBSTACK_PUBLICATION_REQUIRED)."
    },
    "substackConnectionId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 191,
      "description": "Connected Substack publication id. Only with SUBSTACK in platforms. Must match metadata.substackConnectionId when both are sent (otherwise SUBSTACK_PUBLICATION_CONFLICT)."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true,
      "description": "Optional key-value data stored with the Note. A substackConnectionId key here selects the Substack publication like the top-level field."
    },
    "scheduledFor": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "timezone": {
      "type": "string",
      "description": "IANA timezone saved with the item and used to show its local time. scheduledFor always carries its own offset. Defaults to the account's saved timezone, else UTC."
    },
    "mode": {
      "type": "string",
      "enum": [
        "now",
        "schedule"
      ],
      "description": "Omit to publish now when scheduledFor is absent, or to schedule when scheduledFor is present."
    },
    "idempotencyKey": {
      "type": "string",
      "maxLength": 200
    },
    "socialAccountIds": {
      "type": "object",
      "description": "Which connected account to post to on Threads, Facebook, TikTok, Pinterest or X, keyed by platform (e.g. {\"THREADS\": \"<accountId>\"}), with accountId values returned by GET /api/v1/social-accounts. Each key must be one of those platforms and in platforms (otherwise SOCIAL_ACCOUNT_INVALID); an unknown account fails with SOCIAL_ACCOUNT_NOT_FOUND. Omit a platform to use its only account or its default. With several accounts and no default the request fails with SOCIAL_ACCOUNT_CHOICE_REQUIRED. Instagram and LinkedIn use instagramDestinations and linkedInAccountId instead. Keys are case-insensitive.",
      "additionalProperties": {
        "type": "string",
        "minLength": 1,
        "maxLength": 191
      }
    },
    "instagramDestinations": {
      "type": "array",
      "minItems": 1,
      "maxItems": 5,
      "description": "Instagram accounts to post to, each with an accountId returned by GET /api/v1/instagram/destinations and an optional caption of its own. Requires INSTAGRAM in platforms. Omit to post to the default account that endpoint reports.",
      "items": {
        "type": "object",
        "required": [
          "accountId"
        ],
        "properties": {
          "accountId": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "maxLength": 200
          },
          "caption": {
            "type": "string",
            "maxLength": 2200
          }
        },
        "additionalProperties": false
      }
    },
    "linkedInAccountId": {
      "type": "string",
      "description": "LinkedIn account id returned by GET /api/v1/linkedin/destinations. Omit together with linkedInOrganizationUrn to use the Settings default or the only available personal profile. Narrareach never guesses among Company Pages."
    },
    "linkedInOrganizationUrn": {
      "type": "string",
      "description": "Company Page URN returned by GET /api/v1/linkedin/destinations. Requires linkedInAccountId."
    },
    "platformVersions": {
      "type": "object",
      "description": "Text for a selected platform with a character limit (Bluesky 300, Threads 500, LinkedIn 3000, X 25000), keyed by platform. Each must fit as written or the request fails with INVALID_PLATFORM_VERSION. A platform over its limit without a version is shortened automatically and listed in adjustedPlatforms.",
      "additionalProperties": {
        "type": "string",
        "minLength": 1
      }
    }
  },
  "additionalProperties": true
}