-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
3022 lines (2835 loc) · 85 KB
/
Copy pathopenapi.yaml
File metadata and controls
3022 lines (2835 loc) · 85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: Substack API (Unofficial)
version: 0.14.0
summary: Reverse-engineered reference for Substack's undocumented internal JSON API.
description: |
**Unofficial.** Substack does not publish or support this API. Endpoints can
change without notice. This spec is generated from the live web app's
network traffic across 14 capture rounds and is intended as a working
notebook, not a contract.
## Hosts
Substack uses two host families:
- **Account host** (`https://substack.com`) — for account-wide endpoints
(your profile, settings, global feed, blocks, DMs).
- **Publication host** (`https://{subdomain}.substack.com`) — for
publication-scoped endpoints (drafts, posts, tags, subscribers, threads,
stats, recommendations).
Some endpoints are gated on one host but open on the other (notably
`GET /api/v1/publication` — 403 from account host, 200 from publication
host). When in doubt, try both.
## Authentication
Session cookies, the same ones the web app sets. There is no OAuth or API
key program. Send `connect.sid` (current) or `substack.sid` (older) — or
both. Cookies are valid for months unless you sign out.
## Source
https://github.com/AnthonyDavidAdams/substack-api-reference
license:
name: MIT
url: https://github.com/AnthonyDavidAdams/substack-api-reference/blob/main/LICENSE
contact:
name: Anthony David Adams
url: https://earthpilot.co/play
servers:
- url: https://substack.com
description: Account host (account-wide endpoints — profile, inbox, blocks, search)
- url: https://{subdomain}.substack.com
description: Publication host (publication-scoped endpoints — drafts, posts, subscribers, threads, stats)
variables:
subdomain:
default: yourpublication
description: Your Substack publication subdomain (the part before `.substack.com`)
security:
- cookieAuth: []
tags:
- name: Account
description: Profile, account-level info, blocks, public profile
- name: Auth
description: Login (magic link, legacy password)
- name: Activity
description: Activity feed, realtime tokens
- name: Publications
description: Publication CRUD, settings, sections, exports, recommendations from this pub
- name: Drafts
description: Draft create, update, delete, publish, schedule, prepublish
- name: Posts
description: Published posts, post management, per-post stats, themes
- name: Notes
description: Substack Notes — create, list, profile feed, home feed, seen
- name: Comments
description: Reader comments on posts, comment reactions, moderation
- name: Reactions
description: Reaction catalog and post-level reactions (like/unreact)
- name: Subscribers
description: Subscriber list, add, remove, import status, paged subscriptions
- name: Recommendations
description: Cross-publication recommendations (add/remove/list/suggested/edge-check)
- name: Messages
description: DMs between writers (inbox, unread count)
- name: Stats
description: Publication-level and per-post analytics
- name: Growth
description: Growth sources, events, suggestions
- name: Chat
description: Substack Chat (publication threads) — enable, send, delete, list
- name: Media
description: Image upload, audio/podcast upload (S3 presigned multipart)
- name: LiveStreams
description: Live video streams
- name: CrossPosting
description: YouTube and LinkedIn cross-post auth
- name: UserSettings
description: Per-user key-value settings
- name: Search
description: Global publication / post search
- name: ReaderFeed
description: Inbox, reader feed, tabs, subscriptions
- name: Notifications
description: Notification settings, comment moderation reasons
- name: Tags
description: Per-post tags, publication-level discovery tags
- name: Telemetry
description: Client-side analytics batch (firehose) — documented to identify, not to use
components:
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: connect.sid
description: |
Substack uses session cookies. Send `connect.sid` (current) or
`substack.sid` (older), or both. The value is URL-encoded by the
server (`s%3A...` prefix when encoded). Cookies are valid for months.
schemas:
Error:
type: object
properties:
error:
type: string
type:
type: string
enum: [single]
required: [error]
FieldErrors:
type: object
properties:
errors:
type: array
items:
type: object
properties:
location:
type: string
enum: [body, query]
param:
type: string
msg:
type: string
value:
type: string
required: [param, msg]
required: [errors]
UserProfileSelf:
type: object
properties:
id:
type: integer
description: The numeric user id
name:
type: string
handle:
type: string
photo_url:
type: string
bio:
type: string
publicationUsers:
type: array
items:
$ref: '#/components/schemas/PublicationUser'
PublicationUser:
type: object
properties:
id:
type: integer
description: The `publicationUserId` — required as byline reference when creating drafts.
publication:
$ref: '#/components/schemas/PublicationSummary'
role:
type: string
enum: [admin, editor, owner]
is_primary:
type: boolean
PublicationSummary:
type: object
properties:
id:
type: integer
name:
type: string
subdomain:
type: string
logo_url:
type: string
Publication:
type: object
properties:
id:
type: integer
subdomain:
type: string
name:
type: string
is_personal_mode:
type: boolean
custom_domain:
type: string
nullable: true
logo_url:
type: string
hero_text:
type: string
language:
type: string
description: ISO 639-1 (e.g. `en`, `es`)
welcome_email_content:
type: string
description: |
Stringified ProseMirror document (the doc shape
`{type:"doc", content:[...]}` encoded as a single JSON string,
**not** a nested object).
welcome_email_subject:
type: string
PublicationUpdate:
type: object
description: |
Partial publication. The web UI saves **one field per call** — clicking
Save on a specific field sends only that field, not the whole object.
Confirmed writable fields: `name`, `hero_text`, `language`,
`welcome_email_content`. Other fields from the GET response are likely
accepted (logo_url, custom_domain, ...) but unconfirmed.
properties:
name:
type: string
hero_text:
type: string
language:
type: string
welcome_email_content:
type: string
welcome_email_subject:
type: string
logo_url:
type: string
custom_domain:
type: string
PublicationSettings:
type: object
description: |
Flat key-value map of boolean toggles and a few non-boolean values.
Distinct from the publication object itself (which holds name/logo/etc).
additionalProperties: true
properties:
high_res_recording_beta:
type: boolean
Section:
type: object
properties:
id:
type: integer
name:
type: string
slug:
type: string
PostTag:
type: object
properties:
id:
type: string
format: uuid
publication_id:
type: integer
name:
type: string
slug:
type: string
hidden:
type: boolean
PostTagWithNav:
allOf:
- $ref: '#/components/schemas/PostTag'
- type: object
properties:
navigationBarItem:
type: object
nullable: true
CategoryTag:
type: object
description: Publication-level discovery category tags (different from per-post tags).
properties:
id:
type: integer
name:
type: string
canonical_name:
type: string
active:
type: boolean
parent_tag_id:
type: integer
nullable: true
DraftBody:
description: |
ProseMirror/TipTap document (preferred for new content), or an HTML
string (web UI accepts both).
oneOf:
- type: string
description: HTML or stringified JSON.
- type: object
Draft:
type: object
properties:
id:
type: integer
draft_title:
type: string
draft_subtitle:
type: string
draft_body:
$ref: '#/components/schemas/DraftBody'
draft_podcast_url:
type: string
nullable: true
draft_podcast_duration:
type: number
nullable: true
type:
type: string
enum: [newsletter, podcast, thread, video]
draft_bylines:
type: array
items:
type: object
properties:
id:
type: integer
description: Numeric user id (from `/user/profile/self`).
publicationUserId:
type: integer
description: "`publicationUsers[N].id` for this pub."
DraftCreate:
type: object
required: [draft_title, draft_body, type, draft_bylines]
properties:
draft_title:
type: string
draft_subtitle:
type: string
draft_body:
$ref: '#/components/schemas/DraftBody'
type:
type: string
enum: [newsletter, podcast, thread, video]
draft_bylines:
type: array
items:
type: object
required: [id, publicationUserId]
properties:
id:
type: integer
publicationUserId:
type: integer
PublishRequest:
type: object
required: [send]
properties:
send:
type: boolean
description: If `true`, emails subscribers immediately (irreversible).
share_automatically:
type: boolean
ScheduledRelease:
type: object
required: [trigger_at]
properties:
trigger_at:
type: string
format: date-time
description: |
ISO 8601 timestamp. The field name is **`trigger_at`** —
NOT `post_date`, `publish_date`, or `scheduled_at`.
post_audience:
type: string
enum: [everyone, subscribers_only, paid_subscribers_only]
PostManagementList:
type: object
properties:
posts:
type: array
items:
$ref: '#/components/schemas/Post'
offset:
type: integer
limit:
type: integer
total:
type: integer
isCapped:
type: boolean
PostManagementCounts:
type: object
properties:
published:
type: integer
publishedIsCapped:
type: boolean
drafts:
type: integer
draftsIsCapped:
type: boolean
scheduled:
type: integer
scheduledIsCapped:
type: boolean
Post:
type: object
description: Published post. ~80 fields total in the full payload.
additionalProperties: true
properties:
id:
type: integer
title:
type: string
subtitle:
type: string
slug:
type: string
publication_id:
type: integer
type:
type: string
audience:
type: string
is_published:
type: boolean
post_date:
type: string
format: date-time
postTags:
type: array
items:
$ref: '#/components/schemas/PostTag'
PostStats:
type: object
description: 31-field per-post engagement breakdown.
properties:
sent: { type: integer }
delivered: { type: integer }
opens: { type: integer, description: "Total opens incl. multiple per user" }
opened: { type: integer, description: "Unique users who opened" }
open_rate: { type: number, description: "opened / delivered" }
clicks: { type: integer }
clicked: { type: integer }
click_through_rate: { type: number }
engagement_rate: { type: number }
views: { type: integer }
shares: { type: integer }
signups: { type: integer }
subscribes: { type: integer }
signups_within_1_day: { type: integer }
subscriptions_within_1_day: { type: integer }
unsubscribes_within_1_day: { type: integer }
disables_within_1_day: { type: integer }
downloads: { type: integer }
downloads_day7: { type: integer }
downloads_day30: { type: integer }
downloads_day90: { type: integer }
podcast_preview_downloads: { type: integer }
podcast_preview_downloads_day30: { type: integer }
video_views: { type: integer }
video_minutes_watched: { type: integer }
estimated_value: { type: number }
firstWeekDailyStats:
type: array
items:
type: object
links:
type: array
items:
type: object
referrers:
type: object
comps:
type: object
has_more_links:
type: boolean
PublishDashboardSummary:
type: object
properties:
subscribers: { type: integer }
appSubscribers: { type: integer }
appSubscribersLast30Days: { type: integer }
totalEmail: { type: integer }
openRate: { type: number, description: "Publication-level open rate" }
pledgesAmount: { type: number }
numPledges: { type: integer }
pledgeCurrency: { type: string }
isBestseller: { type: boolean }
PublishDashboardSummaryV2:
type: object
properties:
totalSubscribersStart: { type: integer }
totalSubscribersEnd: { type: integer }
paidSubscribersStart: { type: integer }
paidSubscribersEnd: { type: integer }
arrStart: { type: number }
arrEnd: { type: number }
totalViewsStart: { type: integer }
totalViewsEnd: { type: integer }
pledgedArrStart: { type: number }
pledgedArrEnd: { type: number }
NetworkAttribution:
type: object
properties:
rows:
type: array
items:
type: object
properties:
publication_id: { type: integer }
time_window: { type: string }
is_subscribed: { type: boolean }
criteria: { type: integer }
label: { type: string }
subs_count: { type: integer }
pct_time_window_total: { type: number }
data_updated_at: { type: string, format: date-time }
EmailTimeseries:
type: array
description: Array of `[YYYY/MM/DD, count]` pairs.
items:
type: array
items:
oneOf:
- type: string
- type: integer
Subscriber:
type: object
properties:
user_id: { type: integer }
user_email_address: { type: string }
user_name: { type: string }
user_photo_url: { type: string, nullable: true }
subscription_id: { type: integer }
subscription_created_at: { type: string, format: date-time }
subscription_interval:
type: string
enum: [free, monthly, annual]
subscription_type:
type: string
nullable: true
is_subscribed: { type: boolean }
is_founding: { type: boolean }
is_free_trial: { type: boolean }
is_gift: { type: boolean }
is_comp: { type: boolean }
is_bitcoin: { type: boolean }
activity_rating: { type: integer }
total_revenue_generated: { type: number }
total_count: { type: integer }
SubscriberStatsRequest:
type: object
required: [filters, limit, offset]
properties:
filters:
type: object
properties:
order_by_desc_nulls_last:
type: string
description: |
Sort column. Verified values include `subscription_created_at`.
limit:
type: integer
offset:
type: integer
SubscriberStatsResponse:
type: object
properties:
count: { type: integer }
subscribers:
type: array
items:
$ref: '#/components/schemas/Subscriber'
pendingImports:
type: array
items: { type: object }
pendingCRMImportsCount: { type: integer }
order:
type: object
properties:
by: { type: string }
direction: { type: string, enum: [asc, desc] }
chartCounts:
type: object
additionalProperties: true
batchSubscriberActions:
type: array
items: { type: object }
lastSync: { type: string, format: date-time }
Comment:
type: object
properties:
id: { type: integer }
user_id: { type: integer }
body: { type: string }
body_json:
type: object
description: Parsed ProseMirror document tree.
deleted: { type: boolean }
CommentCreate:
type: object
required: [body]
properties:
body:
type: string
description: |
Plain text. Substack auto-converts to ProseMirror in storage.
NoteCreate:
type: object
required: [bodyJson]
properties:
bodyJson:
type: object
description: |
ProseMirror document tree. The simplest valid shape is
`{type:"doc", attrs:{schemaVersion:"v1", title:null},
content:[{type:"paragraph", content:[{type:"text", text:"..."}]}]}`.
required: [type, content]
properties:
type:
type: string
enum: [doc]
attrs:
type: object
properties:
schemaVersion: { type: string }
title:
type: string
nullable: true
content:
type: array
items:
type: object
replyMinimumRole:
type: string
enum: [everyone, free_subscriber, paid_subscriber, founding_member]
ReactionRequest:
type: object
required: [reaction, surface]
properties:
reaction:
type: string
description: |
The **literal emoji character** (e.g. `❤`, `👍`), NOT a named
reaction string. The Notes/threads reaction catalog
(`GET /threads/reactions`) returns named strings, but the wire
format for post reactions is the actual unicode character.
surface:
type: string
enum: [reader, editor, feed]
Recommendation:
type: object
properties:
recommended_publication_id: { type: integer }
recommending_publication_id: { type: integer }
source: { type: string }
suggested: { type: boolean }
note: { type: string }
RecommendationCreate:
type: object
required: [recommended_publication_id, recommending_publication_id, source]
properties:
recommended_publication_id: { type: integer }
recommending_publication_id: { type: integer }
source:
type: string
description: Click-origin tracking. Verified value `recommendation-stats`.
suggested: { type: boolean }
note: { type: string }
RecommendationDelete:
type: object
required: [recommended_publication_id, recommending_publication_id, source]
properties:
recommended_publication_id: { type: integer }
recommending_publication_id: { type: integer }
source: { type: string }
StripeAccountStatus:
type: object
properties:
account:
type: object
nullable: true
plans:
type: array
nullable: true
items: { type: object }
PledgePlans:
type: object
properties:
enabled: { type: boolean }
payment_pledge_plans:
type: array
items:
type: object
properties:
name: { type: string }
amount:
type: integer
description: Amount in cents.
interval:
type: string
enum: [month, year]
currency: { type: string }
Thread:
type: object
description: Substack Chat "thread" (the `communityPost` shape).
properties:
id:
type: string
format: uuid
created_at: { type: string, format: date-time }
updated_at: { type: string, format: date-time }
user_id: { type: integer }
publication_id: { type: integer }
body: { type: string }
link_url:
type: string
nullable: true
status:
type: string
enum: [published, draft, scheduled, deleted]
type:
type: string
enum: [media, text, video, link]
audience:
type: string
enum: [all_subscribers, paid_subscribers, founding_members]
media_assets:
type: array
items: { type: object }
is_locked: { type: boolean }
pub_moderation_status:
type: string
nullable: true
trust_and_safety_status:
type: string
nullable: true
is_edited: { type: boolean }
comment_count: { type: integer }
max_comment_created_at:
type: string
format: date-time
nullable: true
reaction_count: { type: integer }
ThreadCreate:
type: object
required: [id, body, audience, type]
properties:
id:
type: string
format: uuid
description: |
**Client-generated UUID** (the server uses this as the canonical
thread id; not assigned server-side). Use for idempotency.
body: { type: string }
media_urls:
type: array
items: { type: string }
audience:
type: string
enum: [all_subscribers, paid_subscribers, founding_members]
type:
type: string
enum: [media, text, video, link]
send_email: { type: boolean }
send_push: { type: boolean }
link_url:
type: string
nullable: true
ThreadsSettings:
type: object
required: [threads_v2_enabled]
properties:
threads_v2_enabled:
type: boolean
description: Master toggle for Substack Chat on this publication.
create_thread_minimum_role:
type: string
enum: [everyone, free_subscriber, paid_subscriber, founding_member]
reader_thread_notifications_enabled:
type: boolean
ImageUploadRequest:
type: object
required: [image]
properties:
image:
type: string
description: |
Base64 data URI, e.g. `data:image/png;base64,<base64-bytes>`.
**Not** a multipart upload — multipart returns 400.
ImageUploadResponse:
type: object
description: |
Verified end-to-end against a live upload (round 15). The error mode
for mismatched field names is silent: client code reads missing
fields as undefined, falls back to 0, embeds a captionedImage block
with zero dimensions, and Substack renders an empty placeholder.
properties:
id: { type: integer }
url:
type: string
description: |
URL on `substack-post-media.s3.amazonaws.com` (not
`substackcdn.com`). Foreign image URLs are silently dropped by
the editor's render pipeline — upload via this endpoint first.
example: https://substack-post-media.s3.amazonaws.com/public/images/6d5c5adf-5fc3-4c6b-a455-fb5136830ca5_10x10.png
contentType:
type: string
example: image/png
bytes:
type: integer
description: File size in bytes. **NOT** `bytes_required`.
imageWidth:
type: integer
description: Pixel width. **NOT** `width`.
imageHeight:
type: integer
description: Pixel height. **NOT** `height`.
CaptionedImageBlock:
type: object
description: |
ProseMirror block for embedding an uploaded image in `draft_body`.
The shape is **nested**: `captionedImage` wraps an `image2` child
(yes, `image2` — not `image`), plus an optional `caption` child.
A bare `{type:"image2", attrs}` or `{type:"image", attrs}` block
gets silently stripped on save. Only `captionedImage > image2`
survives.
required: [type, content]
properties:
type:
type: string
enum: [captionedImage]
content:
type: array
items:
oneOf:
- $ref: '#/components/schemas/Image2Node'
- $ref: '#/components/schemas/CaptionNode'
Image2Node:
type: object
description: |
Inner image node within `captionedImage`. 14 attrs — most can be
null/false/0, but **width, height, and bytes are critical**;
zeroes cause Substack to render the image as an empty placeholder.
Source them from the `/api/v1/image` upload response
(`imageWidth`, `imageHeight`, `bytes`).
required: [type, attrs]
properties:
type:
type: string
enum: [image2]
attrs:
type: object
required: [src, width, height, bytes, type]
properties:
src:
type: string
description: URL from `/api/v1/image` response.
srcNoWatermark: { type: string, nullable: true }
fullscreen: { type: string, nullable: true }
imageSize: { type: string, nullable: true }
width: { type: integer }
height: { type: integer }
resizeWidth: { type: integer, nullable: true }
bytes: { type: integer }
alt: { type: string, nullable: true }
title: { type: string, nullable: true }
type:
type: string
description: MIME type, e.g. `image/png`.
href: { type: string, nullable: true }
belowTheFold: { type: boolean }
topImage: { type: boolean }
internalRedirect: { type: string, nullable: true }
CaptionNode:
type: object
required: [type, content]
properties:
type:
type: string
enum: [caption]
content:
type: array
items:
type: object
description: 'Text node — `{type: "text", text: "...", marks?: [...]}`.'
SubscribeWidgetBlock:
type: object
description: |
Substack-native subscribe button as a ProseMirror leaf block. With
`url` omitted, the editor auto-binds to the current publication.
Substack's own editor emits the full {url, text, language} triplet
on a fresh insert; mirroring that is the safe play.
required: [type]
properties:
type:
type: string
enum: [subscribeWidget]
attrs:
type: object
properties:
url:
type: string
description: Subscribe URL. Defaults to current publication when omitted.
text:
type: string
description: Button label.
example: Subscribe
language:
type: string
description: Localization code for button copy.
example: en
AudioUploadInit:
type: object
description: |
Empty body POST returns the multipart upload id and an S3 presigned
PUT URL. Audio uploads go to the `substack-video` bucket via the
`video_upload/post/{post_id}/{upload_id}/original` path — this is the
unified media store, not a typo.
additionalProperties: true
AudioTranscodeRequest:
type: object
required: [multipart_upload_id, multipart_upload_etags]
properties:
duration:
type: number
nullable: true
description: Duration in seconds. `null` is accepted (Substack measures during transcode).
multipart_upload_id:
type: string
description: Opaque token from the S3 presigned URL's `uploadId` query param.
multipart_upload_etags:
type: array
description: |
Array of S3-returned ETags for each part. **Preserve the
surrounding quote characters** that S3 returns (e.g.
`"\"7934201b4a7be4e377bca86ae28f0714\""`).
items:
type: string
InboxItems:
type: object
properties:
items:
type: array
items: