LedeWire SDK API Reference
    Preparing search index...

    Type Alias Content

    Content:
        | {
            content_body: string;
            content_type: "markdown";
            metadata?: {
                author?: string;
                publication_date?: string;
                reading_time?: string;
                [key: string]: unknown;
            };
            price_cents: number;
            teaser?: string;
            title: string;
            visibility: "public"
            | "unlisted";
        }
        | {
            content_type: "external_ref";
            content_uri: string;
            external_identifier?: string;
            metadata?: {
                author?: string;
                publication_date?: string;
                reading_time?: string;
                [key: string]: unknown;
            };
            price_cents: number;
            teaser?: string;
            title: string;
            visibility: "public"
            | "unlisted";
        }

    Content creation request body — a discriminated union on content_type.

    • 'markdown' requires content_body (plain text markdown — the SDK encodes it to base64 before transmission).
    • 'external_ref' requires content_uri (the external resource URL) and optionally external_identifier (namespaced platform ID, e.g. vimeo:123).

    Type Declaration

    • {
          content_body: string;
          content_type: "markdown";
          metadata?: {
              author?: string;
              publication_date?: string;
              reading_time?: string;
              [key: string]: unknown;
          };
          price_cents: number;
          teaser?: string;
          title: string;
          visibility: "public"
          | "unlisted";
      }
      • content_body: string

        Full article body in plain text markdown. The SDK base64-encodes this before sending.

      • content_type: "markdown"
      • Optionalmetadata?: {
            author?: string;
            publication_date?: string;
            reading_time?: string;
            [key: string]: unknown;
        }

        Flexible metadata for additional context.

        • Optionalauthor?: string
        • Optionalpublication_date?: string

          date-time

        • Optionalreading_time?: string

          Estimated read time, e.g. '5 min'. Note: the correct key is reading_time, not read_time.

      • price_cents: number

        Price for the content in cents.

      • Optionalteaser?: string

        Optional article teaser in plain text markdown. The SDK base64-encodes this before sending.

      • title: string

        Content title.

      • visibility: "public" | "unlisted"
        public
        
    • {
          content_type: "external_ref";
          content_uri: string;
          external_identifier?: string;
          metadata?: {
              author?: string;
              publication_date?: string;
              reading_time?: string;
              [key: string]: unknown;
          };
          price_cents: number;
          teaser?: string;
          title: string;
          visibility: "public"
          | "unlisted";
      }
      • content_type: "external_ref"
      • content_uri: string

        URI of the external resource (Vimeo, YouTube, PDF, etc.).

      • Optionalexternal_identifier?: string

        Optional namespaced platform ID, e.g. vimeo:123456789.

      • Optionalmetadata?: {
            author?: string;
            publication_date?: string;
            reading_time?: string;
            [key: string]: unknown;
        }

        Flexible metadata for additional context.

        • Optionalauthor?: string
        • Optionalpublication_date?: string

          date-time

        • Optionalreading_time?: string

          Estimated read time, e.g. '5 min'. Note: the correct key is reading_time, not read_time.

      • price_cents: number

        Price for the content in cents.

      • Optionalteaser?: string

        Optional article teaser in plain text markdown. The SDK base64-encodes this before sending.

      • title: string

        Content title.

      • visibility: "public" | "unlisted"
        public
        

    This type is intentionally hand-written rather than aliased from components['schemas']['Content']. The OpenAPI spec defines Content as a flat object (no oneOf/discriminator), so openapi-typescript cannot generate the discriminated union that callers need for type-narrowing.

    A compile-time assignability guard below (_ContentDriftGuard) will produce a TypeScript error if this type drifts from the generated schema.

    TODO: remove the hand-written union and alias the generated type once ledewire.yml uses oneOf + discriminator for the Content schema.