{"openapi":"3.1.0","info":{"title":"viibhiiv API","version":"1.0.0","description":"Bearer-key REST API. Errors are {\"error\":{\"code\",\"message\"}}. Lists use keyset cursors (stable under inserts). Rate limit: 120 requests per 60s per key; over it you get 429 with Retry-After."},"servers":[{"url":"https://viibhiiv.com/api/v1"}],"security":[{"bearer":[]}],"paths":{"/subscribers":{"get":{"operationId":"listSubscribers","summary":"List subscribers","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"tag","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","description":"Subscriber state filter, e.g. confirmed, pending, unsubscribed.","schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque; pass next_cursor from the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Subscriber"}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}},"post":{"operationId":"createSubscriber","summary":"Create or update a subscriber (idempotent by email)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"tags":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":64}},"fields":{"type":"object","maxProperties":50,"additionalProperties":{"type":["string","number","boolean","null"]},"description":"null clears a field."},"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"landing_page":{"type":"string"},"referrer":{"type":"string"}}}}}},"responses":{"200":{"description":"Already existed; tags/fields applied","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Subscriber"},"created":{"const":false}}}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Subscriber"},"created":{"const":true}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"413":{"$ref":"#/components/responses/E413"},"429":{"$ref":"#/components/responses/E429"}}}},"/subscribers/{email}":{"parameters":[{"name":"email","in":"path","required":true,"description":"URL-encoded email address.","schema":{"type":"string","format":"email"}}],"get":{"operationId":"getSubscriber","summary":"Get a subscriber","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Subscriber"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}},"patch":{"operationId":"updateSubscriber","summary":"Add/remove tags and set custom fields","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"object","properties":{"add":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":64}},"remove":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":64}}}},"fields":{"type":"object","maxProperties":50,"additionalProperties":{"type":["string","number","boolean","null"]},"description":"null clears a field."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Subscriber"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}},"delete":{"operationId":"deleteSubscriber","summary":"Delete a subscriber","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"email":{"type":"string"},"deleted":{"const":true}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/subscribers/{email}/engagement":{"parameters":[{"name":"email","in":"path","required":true,"description":"URL-encoded email address.","schema":{"type":"string","format":"email"}}],"get":{"operationId":"getSubscriberEngagement","summary":"Every post sent to this subscriber, with opens and clicks (bot-filtered)","parameters":[{"name":"cursor","in":"query","description":"Opaque; pass next_cursor from the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"summary":{"type":"object","properties":{"received":{"type":"integer"},"opened":{"type":"integer"},"clicked":{"type":"integer"},"open_rate":{"type":["number","null"]},"click_rate":{"type":["number","null"]}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/EngagementItem"}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/posts":{"get":{"operationId":"listPosts","summary":"List posts, newest first","parameters":[{"name":"cursor","in":"query","description":"Opaque; pass next_cursor from the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}},"post":{"operationId":"createPost","summary":"Create a draft, optionally copied from another post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","maxLength":128},"title":{"type":"string","maxLength":300},"subject":{"type":"string","maxLength":300},"preheader":{"type":["string","null"],"maxLength":300},"markdown":{"type":"string"},"prepend_markdown":{"type":"string","description":"Added before the body, separated by a blank line."},"append_markdown":{"type":"string","description":"Added after the body, separated by a blank line."},"template_post_id":{"type":"integer","description":"Copy title, subject, preheader and markdown from this post; fields you pass override them."}},"description":"Needs title and markdown unless template_post_id supplies them. slug defaults to the title, made unique."}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/PostFull"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"413":{"$ref":"#/components/responses/E413"},"429":{"$ref":"#/components/responses/E429"}}}},"/posts/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"getPost","summary":"Get a post with its markdown","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/PostFull"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}},"patch":{"operationId":"updatePost","summary":"Update a post; append_markdown/prepend_markdown edit the body atomically","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","maxLength":128},"title":{"type":"string","maxLength":300},"subject":{"type":"string","maxLength":300},"preheader":{"type":["string","null"],"maxLength":300},"markdown":{"type":"string"},"prepend_markdown":{"type":"string","description":"Added before the body, separated by a blank line."},"append_markdown":{"type":"string","description":"Added after the body, separated by a blank line."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/PostFull"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"413":{"$ref":"#/components/responses/E413"},"429":{"$ref":"#/components/responses/E429"}}}},"/posts/{id}/html":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"format","in":"query","schema":{"type":"string","enum":["email","web"],"default":"email"}}],"get":{"operationId":"getPostHtml","summary":"Rendered HTML: the email (placeholder unsubscribe link, no tracking) or the web body","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"post_id":{"type":"integer"},"format":{"type":"string"},"subject":{"type":"string"},"title":{"type":"string"},"url":{"type":["string","null"]},"html":{"type":"string"},"text":{"type":"string"},"size":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/posts/{id}/send":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"post":{"operationId":"sendPost","summary":"Send to every confirmed subscriber. Requires the post's slug as confirm.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["confirm"],"properties":{"confirm":{"type":"string","description":"Must equal the post's slug."},"segment_id":{"type":"integer","description":"Only subscribers in this segment."},"exclude_segment_id":{"type":"integer","description":"Skip subscribers in this segment."},"list_id":{"type":"integer","description":"Only members of this newsletter list; its unsubscribe link leaves that list only."}}}}}},"responses":{"202":{"description":"Accepted; poll status_url","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"send_id":{"type":"integer"},"post_id":{"type":"integer"},"total":{"type":"integer"},"queued":{"type":"boolean"},"status_url":{"type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"}}}},"/posts/{id}/stats":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"getPostStats","summary":"Opens, clicks and rates for every send of a post","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"post_id":{"type":"integer"},"totals":{"type":"object","properties":{"delivered":{"type":"integer"},"opens":{"type":"integer"},"unique_opens":{"type":"integer"},"clicks":{"type":"integer"},"unique_clicks":{"type":"integer"},"open_rate":{"type":["number","null"]},"click_rate":{"type":["number","null"]},"click_to_open_rate":{"type":["number","null"]},"top_links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"clicks":{"type":"integer"}}}}}},"sends":{"type":"array","items":{"allOf":[{"type":"object","properties":{"delivered":{"type":"integer"},"opens":{"type":"integer"},"unique_opens":{"type":"integer"},"clicks":{"type":"integer"},"unique_clicks":{"type":"integer"},"open_rate":{"type":["number","null"]},"click_rate":{"type":["number","null"]},"click_to_open_rate":{"type":["number","null"]},"top_links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"clicks":{"type":"integer"}}}}}},{"type":"object","properties":{"send_id":{"type":"integer"},"status":{"type":"string"},"recipients":{"type":"integer"}}}]}}}}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/sends/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"getSend","summary":"Send progress and stats","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"integer"},"post_id":{"type":"integer"},"status":{"type":"string","enum":["queued","sending","done","failed"]},"recipients":{"type":"object","properties":{"total":{"type":"integer"},"sent":{"type":"integer"},"failed":{"type":"integer"},"skipped":{"type":"integer"},"pending":{"type":"integer"}}},"created_at":{"type":"string"},"finished_at":{"type":["string","null"]},"stats":{"type":"object","properties":{"delivered":{"type":"integer"},"opens":{"type":"integer"},"unique_opens":{"type":"integer"},"clicks":{"type":"integer"},"unique_clicks":{"type":"integer"},"open_rate":{"type":["number","null"]},"click_rate":{"type":["number","null"]},"click_to_open_rate":{"type":["number","null"]},"top_links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"clicks":{"type":"integer"}}}}}}}}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/tags":{"get":{"operationId":"listTags","summary":"Every tag with its subscriber count","parameters":[{"name":"cursor","in":"query","description":"Opaque; pass next_cursor from the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"subscribers":{"type":"integer"}}}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/lists":{"get":{"operationId":"listLists","summary":"Newsletter lists with member counts (default list first)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/List"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}},"post":{"operationId":"createList","summary":"Create a newsletter list","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWrite"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/List"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"409":{"$ref":"#/components/responses/E409"},"413":{"$ref":"#/components/responses/E413"},"429":{"$ref":"#/components/responses/E429"}}}},"/lists/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"getList","summary":"Get a list","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/List"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}},"patch":{"operationId":"updateList","summary":"Update a list","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWrite"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/List"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}}},"delete":{"operationId":"deleteList","summary":"Delete a list and its memberships (not the default list)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"integer"},"deleted":{"const":true}}}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}}}},"/lists/{id}/members":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"listListMembers","summary":"Current members of a list, by email","parameters":[{"name":"cursor","in":"query","description":"Opaque; pass next_cursor from the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"status":{"type":"string"},"source":{"type":["string","null"]},"since":{"type":["string","null"]}}}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}},"post":{"operationId":"addListMembers","summary":"Subscribe existing subscribers to a list: email, emails (up to 500) or a whole segment (segment_id). People who left the list are not re-added by segment_id.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"emails":{"type":"array","maxItems":500,"items":{"type":"string","format":"email"}},"segment_id":{"type":"integer"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":true}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/lists/{id}/members/{email}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"email","in":"path","required":true,"description":"URL-encoded email address.","schema":{"type":"string","format":"email"}}],"delete":{"operationId":"removeListMember","summary":"Unsubscribe one address from this list only","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"list_id":{"type":"integer"},"email":{"type":"string"},"subscribed":{"const":false},"changed":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/segments":{"get":{"operationId":"listSegments","summary":"Saved segments with their conditions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/segments/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"getSegment","summary":"A segment and its current member count","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Segment"},{"type":"object","properties":{"members":{"type":"integer"}}}]}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/segments/{id}/members":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"listSegmentMembers","summary":"Every subscriber in a segment, by email (keyset pages)","parameters":[{"name":"cursor","in":"query","description":"Opaque; pass next_cursor from the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"email":{"type":"string"},"status":{"type":"string"}}}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/polls":{"get":{"operationId":"listPolls","summary":"Polls with vote counts and shortcodes","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/polls/{id}/results":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"getPollResults","summary":"Votes per option (subscribers, plus anonymous web votes)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/surveys":{"get":{"operationId":"listSurveys","summary":"Surveys with questions and response counts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/surveys/{id}/responses":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"get":{"operationId":"listSurveyResponses","summary":"Survey responses with answers, newest first","parameters":[{"name":"cursor","in":"query","description":"Opaque; pass next_cursor from the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"survey":{"type":"object"},"data":{"type":"array"},"next_cursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/automations/{id}/enroll":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"post":{"operationId":"enrollInAutomation","summary":"Start one subscriber on a published, switched-on automation (entry conditions skipped; once per subscriber)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}}}}},"responses":{"201":{"description":"Enrolled","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"automation_id":{"type":"integer"},"email":{"type":"string"},"journey_id":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"vb_live_... key from /admin/api-keys"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Subscriber":{"type":"object","required":["email"],"additionalProperties":true,"properties":{"email":{"type":"string","format":"email"},"tags":{"type":"array","items":{"type":"string"}},"fields":{"type":"object","additionalProperties":{"type":["string","null"]}}}},"Post":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"title":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":["string","null"]},"status":{"type":"string","enum":["draft","published","sent","send_failed"]},"last_send":{"type":["object","null"],"properties":{"id":{"type":"integer"},"status":{"type":"string"}}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"published_at":{"type":["string","null"]}}},"PostFull":{"allOf":[{"$ref":"#/components/schemas/Post"},{"type":"object","properties":{"markdown":{"type":"string"}}}]},"List":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"default_on":{"type":"boolean","description":"Pre-checked on signup forms."},"public":{"type":"boolean","description":"Offered on signup forms and the preferences page."},"is_default":{"type":"boolean","description":"The Main list: every subscriber unless they left it."},"members":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}},"ListWrite":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"slug":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","maxLength":48},"description":{"type":"string","maxLength":300},"default_on":{"type":"boolean"},"public":{"type":"boolean"}}},"Segment":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"kind":{"type":"string","enum":["dynamic","static"]},"conditions":{"type":"object"},"created_at":{"type":["string","null"]},"updated_at":{"type":["string","null"]},"calculated_at":{"type":["string","null"]}}},"EngagementItem":{"type":"object","properties":{"send_id":{"type":"integer"},"post":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"title":{"type":"string"}}},"delivered":{"type":"boolean"},"sent_at":{"type":["string","null"]},"error":{"type":["string","null"]},"opens":{"type":"integer"},"clicks":{"type":"integer"},"opened":{"type":"boolean"},"clicked":{"type":"boolean"},"clicked_urls":{"type":"array","items":{"type":"string"}},"last_activity_at":{"type":["string","null"]}}}},"responses":{"E400":{"description":"Invalid request (codes: invalid_request, invalid_json, invalid_email, invalid_slug, invalid_cursor)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E401":{"description":"Missing, invalid or revoked key (codes: unauthorized, key_revoked)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E409":{"description":"Conflict (codes: slug_taken, already_sent, default_list, automation_off, already_enrolled, subscriber_suppressed)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E413":{"description":"Body over 1 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E422":{"description":"confirmation_required: confirm must equal the post's slug; invalid_segment; invalid_list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E429":{"description":"Rate limited","headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Policy":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}