/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { "/accounts/me": { /** * Get Account * @description Retrieve the account associated with the current API key */ get: operations["get_account"]; }; "/advertising_units": { /** * List Advertising Units * @description List all advertising units */ get: operations["list_advertising_units"]; /** * Create Advertising Unit * @description Create a new advertising unit */ post: operations["create_advertising_unit"]; }; "/advertising_units/{id}": { /** * Delete Advertising Unit * @description Delete an advertising unit */ delete: operations["delete_advertising_unit"]; /** * Update Advertising Unit * @description Update an advertising unit's properties */ patch: operations["update_advertising_unit"]; }; "/advertising_units/slots": { /** * List Advertising Slots * @description List all advertising slots */ get: operations["list_advertising_slots"]; }; "/advertising_units/slots/{id}": { /** * Update Advertising Slot * @description Update an advertising slot's sponsor content */ patch: operations["update_advertising_slot"]; }; "/api_requests/{id}": { /** * Retrieve Api Request * @description Retrieve a specific API request by its ID */ get: operations["retrieve_api_request"]; }; "/api_requests": { /** * List Api Requests * @description List all API requests */ get: operations["list_api_requests"]; }; "/attachments": { /** * List Attachments * @description List all attachments */ get: operations["list_attachments"]; /** * Create Attachment * @description Upload a new attachment */ post: operations["create_attachment"]; }; "/attachments/{id}": { /** * Retrieve Attachment * @description Retrieve an attachment */ get: operations["retrieve_attachment"]; /** * Delete Attachment * @description Delete an attachment */ delete: operations["delete_attachment"]; }; "/automations": { /** * List Automations * @description List all automations */ get: operations["list_automations"]; /** * Create Automation * @description Create a new automation */ post: operations["create_automation"]; }; "/automations/{id}": { /** * Retrieve Automation * @description Retrieve a specific automation by its ID */ get: operations["retrieve_automation"]; /** * Delete Automation * @description Delete an automation */ delete: operations["delete_automation"]; /** * Update Automation * @description Update an automation's properties */ patch: operations["update_automation"]; }; "/automations/{id}/invoke": { /** * Invoke Automation * @description Manually trigger an automation */ post: operations["invoke_automation"]; }; "/automations/{id}/analytics": { /** * Retrieve Automation Analytics * @description Retrieve analytics data for an automation */ get: operations["retrieve_automation_analytics"]; }; "/books": { /** * List Books * @description List all books for the authenticated newsletter */ get: operations["list_books"]; /** * Create Book * @description Create a new book */ post: operations["create_book"]; }; "/books/{id}": { /** * Retrieve Book * @description Retrieve a specific book by its ID */ get: operations["retrieve_book"]; /** * Delete Book * @description Delete a book */ delete: operations["delete_book"]; /** * Update Book * @description Update a book's properties */ patch: operations["update_book"]; }; "/bulk_actions": { /** * Create Bulk Action * @description Create a new bulk action */ post: operations["create_bulk_action"]; }; "/bulk_actions/{id}": { /** * Retrieve Bulk Action * @description Retrieve the status of a bulk action */ get: operations["retrieve_bulk_action"]; }; "/comments": { /** * List Comments * @description List all comments */ get: operations["list_comments"]; /** * Create Comment * @description Create a new comment or reply to an existing comment. If subscriber_id is provided, the comment is attributed to that subscriber; otherwise it is attributed to the newsletter author. */ post: operations["create_comment"]; }; "/comments/{id}": { /** * Retrieve Comment * @description Retrieve a specific comment by its ID */ get: operations["retrieve_comment"]; /** * Delete Comment * @description Delete a comment. Only the comment owner (subscriber) or the newsletter author can delete a comment. */ delete: operations["delete_comment"]; /** * Update Comment * @description Update a comment's status. Only the newsletter owner can call this. */ patch: operations["update_comment"]; }; "/coupons": { /** * List Coupons * @description List all Stripe coupons */ get: operations["list_coupons"]; }; "/emails": { /** * List Emails * @description List all emails */ get: operations["list_emails"]; /** * Create Email * @description Create a new email */ post: operations["create_email"]; }; "/emails/{id}": { /** * Retrieve Email * @description Retrieve a specific email by its ID */ get: operations["retrieve_email"]; /** * Delete Email * @description Delete an email */ delete: operations["delete_email"]; /** * Update Email * @description Update an email's properties */ patch: operations["update_email"]; }; "/emails/{id}/history": { /** * Retrieve Email History * @description Retrieve the edit history for a specific email */ get: operations["retrieve_email_history"]; }; "/emails/{id}/history/body/{history_id}": { /** * Retrieve Email History By Id * @description Retrieve a specific historical version of an email's body */ get: operations["retrieve_email_history_by_id"]; }; "/emails/{id}/analytics": { /** * Retrieve Email Analytics * @description Retrieve analytics for a specific email */ get: operations["retrieve_email_analytics"]; }; "/emails/{id}/renders": { /** * Retrieve Email Renders * @description Retrieve rendered HTML for a specific email */ get: operations["retrieve_email_renders"]; }; "/emails/{id}/send-draft": { /** * Send Draft * @description Send a draft email to specific recipients */ post: operations["send_draft"]; }; "/emails/{id}/publish": { /** * Publish Email * @description Publish an email */ post: operations["publish_email"]; }; "/events": { /** * List Events * @description List all events */ get: operations["list_events"]; }; "/events/{id}": { /** * Get Event * @description Retrieve a specific event by its ID */ get: operations["get_event"]; }; "/exports": { /** * List Exports * @description List all exports */ get: operations["list_exports"]; /** * Create Export * @description Create a new data export */ post: operations["create_export"]; }; "/exports/{id}": { /** * Retrieve Export * @description Retrieve a specific export by its ID */ get: operations["retrieve_export"]; }; "/external_feeds": { /** * List External Feed * @description List all external feeds */ get: operations["list_external_feed"]; /** * Create External Feed * @description Create a new external feed */ post: operations["create_external_feed"]; }; "/external_feeds/{id}": { /** * Retrieve External Feed * @description Retrieve a specific external feed by its ID */ get: operations["retrieve_external_feed"]; /** * Delete External Feed * @description Delete an external feed */ delete: operations["delete_external_feed"]; /** * Update External Feed * @description Update an external feed's properties */ patch: operations["update_external_feed"]; }; "/external_feeds/{id}/items": { /** * Retrieve Items * @description Retrieve items from an external feed */ get: operations["retrieve_items"]; /** * Poll Items * @description Poll for new items in an external feed */ post: operations["poll_items"]; }; "/forms": { /** * List Forms * @description List all forms */ get: operations["list_forms"]; /** * Create Form * @description Create a new form */ post: operations["create_form"]; }; "/forms/{id}": { /** * Retrieve Form * @description Retrieve a specific form by its ID */ get: operations["retrieve_form"]; /** * Delete Form * @description Delete a form */ delete: operations["delete_form"]; /** * Update Form * @description Update a form's properties */ patch: operations["update_form"]; }; "/images": { /** * List Images * @description List all uploaded images */ get: operations["list_images"]; /** * Create Image * @description Upload an image */ post: operations["create_image"]; }; "/images/{id}": { /** * Delete Image * @description Delete an uploaded image */ delete: operations["delete_image"]; /** * Update Image * @description Update an image's metadata */ patch: operations["update_image"]; }; "/imports": { /** * List Imports * @description List all imports */ get: operations["list_imports"]; /** * Create Import * @description Create a new import by uploading a file */ post: operations["create_import"]; }; "/imports/{id}": { /** * Retrieve Import * @description Retrieve a specific import by its ID */ get: operations["retrieve_import"]; /** * Delete Import * @description Delete an import */ delete: operations["delete_import"]; /** * Update Import * @description Update an import's properties */ patch: operations["update_import"]; }; "/newsletters": { /** * List Newsletters * @description List all newsletters */ get: operations["list_newsletters"]; /** * Create Newsletter * @description Create a new newsletter */ post: operations["create_newsletter"]; }; "/newsletters/{id}": { /** * Retrieve Newsletter * @description Retrieve a specific newsletter by its ID */ get: operations["retrieve_newsletter"]; /** * Delete Newsletter * @description Delete a newsletter */ delete: operations["delete_newsletter"]; /** * Update Newsletter * @description Update a newsletter's settings */ patch: operations["update_newsletter"]; }; "/newsletters/{id}/sending-domain": { /** * Retrieve Sending Domain * @description Retrieve the DNS verification status and required records for a newsletter's custom sending domain. While `is_checking` is true, a background re-verification is in flight; poll until it flips to false. Pass `force=true` to trigger a re-check. */ get: operations["retrieve_sending_domain"]; }; "/newsletters/{id}/hosting-domain": { /** * Retrieve Hosting Domain * @description Retrieve the DNS verification status for a newsletter's custom hosting domain. This synchronously re-verifies the domain's DNS records. */ get: operations["retrieve_hosting_domain"]; }; "/notes": { /** * List Notes * @description List all notes */ get: operations["list_notes"]; /** * Create Note Endpoint * @description Create a new note */ post: operations["create_note_endpoint"]; }; "/notes/{id}": { /** * Delete Note Endpoint * @description Delete a note */ delete: operations["delete_note_endpoint"]; }; "/ping": { /** * Ping * @description Check if the API is reachable and your credentials are valid */ get: operations["ping"]; }; "/prices": { /** * List Prices * @description List all prices */ get: operations["list_prices"]; /** * Create Price * @description Create a new price */ post: operations["create_price"]; }; "/prices/{price_id}": { /** * Delete Price * @description Archive a price, making it unavailable for new subscriptions. Stripe prices cannot be deleted outright; archiving deactivates the price while leaving existing subscriptions on it untouched. */ delete: operations["delete_price"]; }; "/public/emails/{username}": { /** * Search public emails * @description Search and list public emails for a newsletter. No authentication required. */ get: operations["list_public_emails"]; }; "/segments": { /** * List Segments * @description List all segments */ get: operations["list_segments"]; /** * Create Segment * @description Create a new segment */ post: operations["create_segment"]; }; "/segments/{id}": { /** * Retrieve Segment * @description Retrieve a specific segment by its ID */ get: operations["retrieve_segment"]; /** * Delete Segment * @description Delete a segment */ delete: operations["delete_segment"]; /** * Update Segment * @description Update a segment's properties */ patch: operations["update_segment"]; }; "/snippets": { /** * List Snippets * @description List all snippets */ get: operations["list_snippets"]; /** * Create Snippet * @description Create a new snippet */ post: operations["create_snippet"]; }; "/snippets/{id}": { /** * Retrieve Snippet * @description Retrieve a single snippet. */ get: operations["retrieve_snippet"]; /** * Delete Snippet * @description Delete a snippet. */ delete: operations["delete_snippet"]; /** * Update Snippet * @description Update a snippet. */ patch: operations["update_snippet"]; }; "/subscribers": { /** * List Subscribers * @description List all subscribers */ get: operations["list_subscribers"]; /** * Create Subscriber * @description Create a new subscriber */ post: operations["create_subscriber"]; }; "/subscribers/{id_or_email}": { /** * Retrieve Subscriber * @description Retrieve a specific subscriber by their ID or email address */ get: operations["retrieve_subscriber"]; /** * Delete Subscriber * @description Delete a subscriber */ delete: operations["delete_subscriber"]; /** * Update Subscriber * @description Update a subscriber's properties */ patch: operations["update_subscriber"]; }; "/subscribers/{id_or_email}/send-reminder": { /** * Send Reminder * @description Send a confirmation reminder email to an unactivated subscriber */ post: operations["send_reminder"]; }; "/subscribers/{id_or_email}/send-magic-link": { /** * Send Magic Link To Subscriber * @description Send a magic link email to a subscriber */ post: operations["send_magic_link_to_subscriber"]; }; "/subscribers/{id_or_email}/emails/{email_id}": { /** * Send Email To * @description Send a specific email to a specific subscriber */ post: operations["send_email_to"]; }; "/subscribers/{id_or_email}/referrals": { /** * Get Referrals * @description List subscribers referred by a specific subscriber */ get: operations["get_referrals"]; }; "/subscribers/{id_or_email}/automations": { /** * Get Automations * @description List automation attempts for a specific subscriber */ get: operations["get_automations"]; }; "/subscribers/{id_or_email}/automations/{automation_attempt_id}": { /** * Update Automation Attempt * @description Update the status of an automation attempt for a subscriber */ patch: operations["update_automation_attempt"]; }; "/subscribers/{id_or_email}/stripe-subscriptions": { /** * Get Stripe Subscriptions * @description List Stripe subscriptions for a specific subscriber */ get: operations["get_stripe_subscriptions"]; }; "/survey_responses": { /** * Retrieve Survey Responses * @description List all survey responses */ get: operations["retrieve_survey_responses"]; /** * Create Survey Response * @description Create a new survey response */ post: operations["create_survey_response"]; }; "/survey_responses/{id}": { /** * Update Survey Response * @description Update a survey response's text. Only the response owner (subscriber) can update their response. */ patch: operations["update_survey_response"]; }; "/surveys": { /** * List Surveys * @description List all surveys */ get: operations["list_surveys"]; /** * Create Survey * @description Create a new survey */ post: operations["create_survey"]; }; "/surveys/{id}": { /** * Retrieve Survey * @description Retrieve a specific survey by its ID */ get: operations["retrieve_survey"]; /** * Delete Survey * @description Delete a survey */ delete: operations["delete_survey"]; /** * Update Survey * @description Update a survey's properties */ patch: operations["update_survey"]; }; "/tags": { /** * List Tags * @description List all tags */ get: operations["list_tags"]; /** * Create Tag * @description Create a new tag */ post: operations["create_tag"]; }; "/tags/{id}": { /** * Retrieve Tag * @description Retrieve a specific tag by its ID */ get: operations["retrieve_tag"]; /** * Delete Tag * @description Delete a tag */ delete: operations["delete_tag"]; /** * Update Tag * @description Update a tag's properties */ patch: operations["update_tag"]; }; "/tags/{id}/analytics": { /** * Retrieve Tag Analytics * @description Retrieve analytics for a specific tag */ get: operations["retrieve_tag_analytics"]; }; "/users": { /** * List Users * @description List all users */ get: operations["list_users"]; /** * Create User * @description Invite a new user to the newsletter */ post: operations["create_user"]; }; "/users/{id}": { /** * Retrieve User * @description Retrieve a specific user by its ID */ get: operations["retrieve_user"]; /** * Delete User * @description Delete a user */ delete: operations["delete_user"]; /** * Update User * @description Update a user's properties */ patch: operations["update_user"]; }; "/webhooks": { /** * List Webhooks * @description List all webhooks */ get: operations["list_webhooks"]; /** * Create Webhook * @description Create a new webhook */ post: operations["create_webhook"]; }; "/webhooks/{id}": { /** * Retrieve Webhook * @description Retrieve a specific webhook by its ID */ get: operations["retrieve_webhook"]; /** * Delete Webhook * @description Delete a webhook */ delete: operations["delete_webhook"]; /** * Update Webhook * @description Update a webhook's properties */ patch: operations["update_webhook"]; }; "/webhooks/{id}/attempts": { /** * Retrieve Webhook Attempts * @description Retrieve webhook attempts for a specific webhook */ get: operations["retrieve_webhook_attempts"]; }; "/webhooks/{id}/test": { /** * Test Webhook * @description Send a test event to a webhook */ post: operations["test_webhook"]; }; } export interface webhooks { "event": { /** * Event notification * @description When an event you've subscribed to occurs, Buttondown sends an HTTP `POST` to your configured webhook URL. If the webhook has a signing key, the request carries an `X-Buttondown-Signature: sha256=` header — an HMAC-SHA256 of the raw request body keyed with your signing key. Respond with any 2xx status to acknowledge receipt; five consecutive non-2xx responses disable the webhook. */ post: operations["webhook_event"]; }; } export interface components { schemas: { /** Account */ Account: { /** * Username * @description The username associated with the account. */ username: string; /** * Email Address * @description The email address associated with the account. */ email_address: string; }; /** AdvertisingSlot */ AdvertisingSlot: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Date * Format: date * @description The date this advertising slot is scheduled for. */ date: string; /** @description The current status of the advertising slot. */ status: components["schemas"]["AdvertisingSlotStatus"]; /** * Invoice Url * @description URL to the Stripe invoice PDF for this slot, if available. */ invoice_url?: string | null; /** * Sku Id * @description The ID of the advertising unit this slot belongs to. */ sku_id: string; /** * Submission Url * @description URL where the sponsor can submit their ad content. */ submission_url: string; /** * Sponsor Company * @description The name of the sponsoring company. */ sponsor_company: string; /** * Sponsor Email * @description The email address of the sponsor contact. */ sponsor_email: string; /** * Sponsor Name * @description The name of the sponsor contact. */ sponsor_name: string; /** * Content * @description The ad content text. */ content: string; /** * Content Image Id * @description The ID of the image attached to this ad, if any. */ content_image_id?: string | null; /** * Content Url * @description The URL the ad links to. */ content_url: string; /** * Content Approved At * @description When the ad content was approved, if applicable. */ content_approved_at?: string | null; /** * Content Rejected At * @description When the ad content was rejected, if applicable. */ content_rejected_at?: string | null; /** * Content Rejection Reason * @description The reason the ad content was rejected, if applicable. */ content_rejection_reason: string; /** * Content Submitted At * @description When the ad content was submitted for review. */ content_submitted_at?: string | null; /** * Inquiry Message * @description Optional message from the sponsor inquiry. */ inquiry_message: string; }; /** AdvertisingUnit */ AdvertisingUnit: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** @description The current status of the advertising unit. */ status: components["schemas"]["AdvertisingSKUStatus"]; /** * Slots * @description The list of advertising slots for this unit. */ slots: (components["schemas"]["AdvertisingSlot"])[]; /** * Title * @description The title of the advertising unit. */ title: string; /** * Description * @description A description of the advertising unit. */ description: string; /** * Behavior * @description The behavior type of the advertising unit. */ behavior: string; /** * Url * @description The URL for the advertising unit's landing page. */ url: string; /** * Price * @description The price in the smallest currency unit, or null if not set. */ price?: number | null; /** * Allows Html * @description Whether the advertising unit accepts HTML content. */ allows_html: boolean; /** * Allows Image * @description Whether the advertising unit accepts an image. */ allows_image: boolean; /** * Max Characters * @description Maximum number of characters allowed for the ad content. */ max_characters?: number | null; /** * Submission Deadline Days * @description Number of days before the slot date that content must be submitted. */ submission_deadline_days: number; }; /** ErrorMessage */ ErrorMessage: { /** * Code * @description The error code. */ code?: string; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** AdvertisingUnitInput */ AdvertisingUnitInput: { /** * Title * @description The title of the advertising unit. */ title: string; /** * Description * @description A description of the advertising unit. * @default */ description?: string; /** * Behavior * @description The behavior type of the advertising unit. * @default */ behavior?: string; /** * Url * @description The URL for the advertising unit's landing page. * @default */ url?: string; /** * Price * @description The price in the smallest currency unit. */ price?: number | null; /** * Allows Html * @description Whether the advertising unit accepts HTML content. * @default false */ allows_html?: boolean; /** * Allows Image * @description Whether the advertising unit accepts an image. * @default false */ allows_image?: boolean; /** * Max Characters * @description Maximum number of characters allowed for the ad content. */ max_characters?: number | null; /** * Submission Deadline Days * @description Number of days before the slot date that content must be submitted. * @default 3 */ submission_deadline_days?: number; }; /** AdvertisingUnitUpdateInput */ AdvertisingUnitUpdateInput: { /** * Title * @description The title of the advertising unit. */ title?: string | null; /** * Description * @description A description of the advertising unit. */ description?: string | null; /** * Dates * @description The dates for this advertising unit's slots. */ dates: (string)[]; /** * Behavior * @description The behavior type of the advertising unit. */ behavior?: string | null; /** * Url * @description The URL for the advertising unit's landing page. */ url?: string | null; /** * Price * @description The price in the smallest currency unit. */ price?: number | null; /** * Allows Html * @description Whether the advertising unit accepts HTML content. */ allows_html?: boolean | null; /** * Allows Image * @description Whether the advertising unit accepts an image. */ allows_image?: boolean | null; /** * Max Characters * @description Maximum number of characters allowed for the ad content. */ max_characters?: number | null; /** * Submission Deadline Days * @description Number of days before the slot date that content must be submitted. */ submission_deadline_days?: number | null; }; /** AdvertisingSlotUpdateInput */ AdvertisingSlotUpdateInput: { /** * Content * @description The ad content text. */ content?: string | null; /** * Content Approved At * @description When the ad content was approved. */ content_approved_at?: string | null; /** * Content Image Id * @description The ID of the image attached to this ad. */ content_image_id?: string | null; /** * Content Rejection Reason * @description The reason the ad content was rejected. */ content_rejection_reason?: string | null; /** * Content Url * @description The URL the ad links to. */ content_url?: string | null; /** * Sponsor Company * @description The name of the sponsoring company. */ sponsor_company?: string | null; /** * Sponsor Email * @description The email address of the sponsor contact. */ sponsor_email?: string | null; /** * Sponsor Name * @description The name of the sponsor contact. */ sponsor_name?: string | null; /** * Status * @description Set to 'approve', 'reject', 'hold_accept', or 'hold_decline' to update the slot status. */ status?: ("approve" | "hold_accept" | "hold_decline" | "reject") | null; }; /** * APIRequestDetail * @description Represents a request to the API (api.buttondown.com). */ APIRequestDetail: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Status Code * @description The HTTP status code the API returned. */ status_code: number; /** * Path * @description The request path (e.g. `/v1/subscribers`). */ path: string; /** * Method * @description The HTTP method used (e.g. `GET`, `POST`). */ method: string; /** @description Where the request originated (e.g. `api`, `dashboard`). */ source: components["schemas"]["APIRequestSource"]; /** * Version * @description The API version the request was made against. * @enum {string} */ version: "2024-07-01" | "2024-08-01" | "2024-08-15" | "2024-09-30" | "2024-12-30" | "2025-01-02" | "2025-05-19" | "2025-06-01" | "2026-01-01" | "2026-04-01"; /** * Ip Address * @description The IP address the request was made from. */ ip_address: string; /** * Api Key Id * @description The ID of the API key used, if authenticated via API key. */ api_key_id?: string | null; /** * Api Key Label * @description The human-readable label of the API key used, if any. */ api_key_label?: string | null; /** * Request Data * @description The raw request body, JSON-encoded as a string. */ request_data: string; /** * Response Data * @description The raw response body, JSON-encoded as a string, if retained. */ response_data?: string | null; /** * Headers * @description The request headers. UUIDs within header values are redacted. */ headers: { [key: string]: string | undefined; }; }; /** * APIRequest * @description Represents a request to the API (api.buttondown.com). */ APIRequest: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Status Code * @description The HTTP status code the API returned. */ status_code: number; /** * Path * @description The request path (e.g. `/v1/subscribers`). */ path: string; /** * Method * @description The HTTP method used (e.g. `GET`, `POST`). */ method: string; /** @description Where the request originated (e.g. `api`, `dashboard`). */ source: components["schemas"]["APIRequestSource"]; /** * Version * @description The API version the request was made against. * @enum {string} */ version: "2024-07-01" | "2024-08-01" | "2024-08-15" | "2024-09-30" | "2024-12-30" | "2025-01-02" | "2025-05-19" | "2025-06-01" | "2026-01-01" | "2026-04-01"; /** * Ip Address * @description The IP address the request was made from. */ ip_address: string; /** * Api Key Id * @description The ID of the API key used, if authenticated via API key. */ api_key_id?: string | null; /** * Api Key Label * @description The human-readable label of the API key used, if any. */ api_key_label?: string | null; }; /** APIRequestList */ APIRequestList: { /** * Results * @description The list of API requests on this page. */ results: (components["schemas"]["APIRequest"])[]; /** * Cursor * @description An opaque cursor to pass back to fetch the next page, or null if this is the last page. */ cursor?: string | null; }; /** * Attachment * @description Attachments are files that can be included with your emails. Buttondown allows * you to upload attachments to its secure S3 bucket and attach them to your emails. * Supported file types include documents, images, audio files, and more. */ Attachment: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Name * @description The name of the attachment. * @example newsletter-guide.pdf */ name: string; /** * File * @description The URL of the attachment file. * @example https://buttondown.s3.amazonaws.com/attachments/newsletter-guide.pdf */ file: string; /** * Size * @description The size of the attachment in bytes. * @example 1000 */ size: number; }; /** ValidationErrorDetail */ ValidationErrorDetail: { /** * Type * @description The type of validation error. */ type: string; /** * Loc * @description The location of the error in the request. */ loc: (string | number)[]; /** * Msg * @description A human-readable error message. */ msg: string; }; /** ValidationErrorMessage */ ValidationErrorMessage: { /** * Detail * @description A list of validation errors. */ detail: (components["schemas"]["ValidationErrorDetail"])[]; }; /** * Action * @description An action to perform when the automation's trigger fires. */ Action: { /** @description The type of action to perform. */ type: components["schemas"]["AutomationActionType"]; /** * Metadata * @description Configuration specific to the action type. */ metadata: { [key: string]: unknown | undefined; }; /** @description When to execute this action. Defaults to immediate if not specified. */ timing?: components["schemas"]["Timing"] | null; }; /** * Automation * @description A rule that automatically performs actions in response to events. */ Automation: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Name * @description The name of the automation. */ name: string; /** @description Whether the automation is enabled or disabled. */ status: components["schemas"]["AutomationStatus"]; /** @description The event that causes this automation to run. */ trigger: components["schemas"]["ExternalEventType"]; /** * Actions * @description The actions to perform when the trigger fires. */ actions: (components["schemas"]["Action"])[]; /** @description Conditions that must be met for the automation to run. */ filters: components["schemas"]["FilterGroup"]; /** * Metadata * @description Additional metadata for the automation. */ metadata: { [key: string]: unknown | undefined; }; /** * Should Evaluate Filter After Delay * @description If true, filters are re-evaluated after the delay has passed. */ should_evaluate_filter_after_delay: boolean; }; /** * Delay * @description Configuration for how long to wait before executing the automation's action. */ Delay: { /** * Value * @description The number of time units to delay. */ value: string; /** * Unit * @description The unit of time for the delay. * @enum {string} */ unit: "minutes" | "hours" | "days" | "weeks"; /** * Time Of Day * @description If set, the action will be executed at this time of day after the delay has passed. */ time_of_day?: ("morning" | "evening" | "") | null; }; /** * Filter * @description A filter is a single condition that can be evaluated against a [Subscriber](/api-subscribers-retrieve). It has a field, an operator, and a value: * * ```json * { * "field": "subscriber.tags", * "operator": "contains", * "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40j" * } * ``` * * The field is the path to the field on the subscriber to evaluate. The operator is the operator to use when evaluating the filter. The value is the value to compare the field to. Tag filters require the tag's ID (either a UUID or TypeID), not its name. */ Filter: { /** Field */ field: string; operator: components["schemas"]["Operator"]; /** Value */ value: string; }; /** * FilterGroup * @description Buttondown's filtering schema can be used for multiple things: * * - Filtering [the audience of an email](/api-emails-create) to a specific subset * - Creating [finely-tuned automations](/api-automation-introduction) * * Filters are fractal; they can be nested in groups, and groups can be nested in other groups. This is accomplished through a tree-like structure. Every "FilterGroup" has a "predicate" field, which is either "and" or "or", which determines how the filters and groups within the group are combined, a "groups" field, which is a list of "FilterGroup" objects (that's that recursive bit!), and a "filters" field, which are the leaf-level filters themselves. * * Let's say you want a simple filter: all subscribers who have a tag whose ID is `sub_tag_0j6hb7h40j6hb7h40j6hb7h40j`. You can do that like this: * * ```json * { * "filters": [{"field": "subscriber.tags", "operator": "contains", "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40j"}], * "groups": [], * "predicate": "and" * } * ``` * * Now, let's say you want to filter for subscribers who have that tag and a tag whose ID is `sub_tag_0j6hb7h40j6hb7h40j6hb7h40k`. You can do that like this: * * ```json * { * "filters": [{"field": "subscriber.tags", "operator": "contains", "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40j"}, {"field": "subscriber.tags", "operator": "contains", "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40k"}], * "groups": [], * "predicate": "and" * } * ``` * * If you wanted to change that `and` to an `or`, you can do that like this: * * ```json * { * "filters": [{"field": "subscriber.tags", "operator": "contains", "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40j"}, {"field": "subscriber.tags", "operator": "contains", "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40k"}], * "groups": [], * "predicate": "or" * } * ``` * * Now, let's say you want to filter for subscribers who have the first tag _or_ both the second tag and a third tag whose ID is `sub_tag_0j6hb7h40j6hb7h40j6hb7h40m`. This is where the whole nested thing comes in handy. You can do that like this: * * ```json * { * "filters": [{"field": "subscriber.tags", "operator": "contains", "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40j"}], * "groups": [ * { * "filters": [{"field": "subscriber.tags", "operator": "contains", "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40k"}, {"field": "subscriber.tags", "operator": "contains", "value": "sub_tag_0j6hb7h40j6hb7h40j6hb7h40m"}], * "groups": [], * "predicate": "and" * } * ], * "predicate": "or" * } * ``` * * You can read more about the specific filter construction in the [Filter documentation](/api-emails-filter). */ FilterGroup: { /** * Filters * @description The leaf-level filters to apply to the audience. */ filters: (components["schemas"]["Filter"])[]; /** * Groups * @description The nested groups to apply to the audience. */ groups: (components["schemas"]["FilterGroup"])[]; /** * Predicate * @description The logical operator to use when combining filters (either 'and' or 'or'). * @enum {string} */ predicate: "and" | "or"; }; /** * Operator * @description An enumeration. * @enum {string} */ Operator: "equals" | "not_equals" | "contains" | "not_contains" | "is_empty" | "is_not_empty" | "greater_than" | "less_than"; /** * Timing * @description Controls when an automation's action executes after the trigger fires. */ Timing: { /** * Time * @description Whether the action should execute immediately or after a delay. * @enum {string} */ time: "immediate" | "delay"; /** @description The delay configuration. Required when `time` is `delay`; null when `time` is `immediate`. */ delay?: components["schemas"]["Delay"] | null; }; /** * AutomationCreationErrorCode * @description Represents the type of error that occurred when creating an automation. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ AutomationCreationErrorCode: "delay_invalid" | "filter_invalid__tag" | "filter_invalid" | "action_invalid" | "filter_invalid__field" | "invalid_newsletter_id" | "trigger_action_invalid" | "action_invalid__missing_body_or_subject"; /** ErrorMessage[AutomationCreationErrorCode] */ ErrorMessage_AutomationCreationErrorCode_: { /** @description The error code. */ code?: components["schemas"]["AutomationCreationErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * ActionInput * @description Request payload for an action to perform when the automation's trigger fires. */ ActionInput: { /** @description The type of action to perform. */ type: components["schemas"]["AutomationActionType"]; /** * Metadata * @description Configuration specific to the action type. */ metadata?: { [key: string]: unknown | undefined; }; /** @description When to execute this action. Defaults to immediate if not specified. */ timing?: components["schemas"]["TimingInput"] | null; }; /** AutomationInput */ AutomationInput: { /** * Name * @description The name of the automation. */ name: string; /** @description The event that causes this automation to run. */ trigger: components["schemas"]["ExternalEventType"]; /** * Actions * @description The actions to perform when the trigger fires. */ actions: (components["schemas"]["ActionInput"])[]; /** @description Conditions that must be met for the automation to run. Omit or pass null for no filter. */ filters?: components["schemas"]["FilterGroup"] | null; /** * Metadata * @description Additional metadata for the automation. */ metadata?: { [key: string]: unknown | undefined; }; /** * Should Evaluate Filter After Delay * @description If true, filters are re-evaluated after the delay has passed. * @default false */ should_evaluate_filter_after_delay?: boolean; }; /** * DelayInput * @description Request payload configuration for delaying an automation action. */ DelayInput: { /** * Value * @description The number of time units to delay. */ value: string; /** * Unit * @description The unit of time for the delay. * @enum {string} */ unit: "minutes" | "hours" | "days" | "weeks"; /** * Time Of Day * @description If set, the action will be executed at this time of day after the delay has passed. */ time_of_day?: ("morning" | "evening" | "") | null; }; /** * TimingInput * @description Request payload controls for when an automation action executes. */ TimingInput: { /** * Time * @description Whether the action should execute immediately or after a delay. * @enum {string} */ time: "immediate" | "delay"; /** @description The delay configuration. Required when `time` is `delay`; null when `time` is `immediate`. */ delay?: components["schemas"]["DelayInput"] | null; }; /** AutomationUpdateInput */ AutomationUpdateInput: { /** * Name * @description The name of the automation. */ name?: string | null; /** @description Whether the automation is enabled or disabled. */ status?: components["schemas"]["AutomationStatus"] | null; /** @description The event that causes this automation to run. */ trigger?: components["schemas"]["ExternalEventType"] | null; /** @description When to execute the automation's actions. */ timing?: components["schemas"]["TimingInput"] | null; /** * Actions * @description The actions to perform when the trigger fires. */ actions?: (components["schemas"]["ActionInput"])[] | null; /** @description Conditions that must be met for the automation to run. */ filters?: components["schemas"]["FilterGroup"] | null; /** * Metadata * @description Additional metadata for the automation. */ metadata?: ({ [key: string]: unknown | undefined; }) | null; /** * Should Evaluate Filter After Delay * @description If true, filters are re-evaluated after the delay has passed. */ should_evaluate_filter_after_delay?: boolean | null; }; /** Analytics */ Analytics: { /** * Recipients * @description The number of subscribers the email was dispatched to. * @default 0 */ recipients?: number; /** * Deliveries * @description The number of successful deliveries (recipients minus failures). * @default 0 */ deliveries?: number; /** * Opens * @description The number of unique opens recorded. * @default 0 */ opens?: number; /** * Clicks * @description The number of unique link clicks recorded. * @default 0 */ clicks?: number; /** * Temporary Failures * @description The number of temporary delivery failures (e.g. soft bounces). * @default 0 */ temporary_failures?: number; /** * Permanent Failures * @description The number of permanent delivery failures (e.g. hard bounces). * @default 0 */ permanent_failures?: number; /** * Unsubscriptions * @description The number of subscribers who unsubscribed after receiving this email. * @default 0 */ unsubscriptions?: number; /** * Complaints * @description The number of spam complaints recorded against this email. * @default 0 */ complaints?: number; /** * Survey Responses * @description The number of survey responses submitted from this email. * @default 0 */ survey_responses?: number; /** * Webmentions * @description The number of inbound webmentions received for this email. * @default 0 */ webmentions?: number; /** * Page Views Lifetime * @description The total number of archive page views for this email since publication. * @default 0 */ page_views_lifetime?: number; /** * Page Views 30 * @description The number of archive page views in the last 30 days. * @default 0 */ page_views_30?: number; /** * Page Views 7 * @description The number of archive page views in the last 7 days. * @default 0 */ page_views_7?: number; /** * Subscriptions * @description The number of new subscribers attributed to this email. * @default 0 */ subscriptions?: number; /** * Paid Subscriptions * @description The number of new paid subscribers attributed to this email. * @default 0 */ paid_subscriptions?: number; /** * Replies * @description The number of reply emails received from subscribers. * @default 0 */ replies?: number; /** * Comments * @description The number of comments posted on this email. * @default 0 */ comments?: number; /** * Social Mentions * @description The number of social media mentions of this email. * @default 0 */ social_mentions?: number; /** * Temporary Failure Breakdown * @description Breakdown of temporary failures by reason code, sorted by count descending. */ temporary_failure_breakdown?: (components["schemas"]["FailureBreakdownItem"])[]; /** * Permanent Failure Breakdown * @description Breakdown of permanent failures by reason code, sorted by count descending. */ permanent_failure_breakdown?: (components["schemas"]["FailureBreakdownItem"])[]; }; /** * FailureBreakdownItem * @description A single failure reason with its count. */ FailureBreakdownItem: { /** * Code * @description The failure reason code (e.g. 'hard_bounce', 'spam') */ code: string; /** * Count * @description Number of failures with this reason */ count: number; }; /** Book */ Book: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Title * @description The title of the book. */ title: string; /** * Url * @description The URL where the book can be purchased or viewed. * @default */ url?: string; /** * Image Url * @description The URL of the book's cover image. * @default */ image_url?: string; /** * Description * @description A description of the book. * @default */ description?: string; /** * Year * @description The year the book was published. */ year?: number | null; /** * Isbn * @description The ISBN of the book. * @default */ isbn?: string; /** * Shared * @description Whether the book is displayed publicly on the archive. * @default true */ shared?: boolean; }; /** BookInput */ BookInput: { /** * Title * @description The title of the book. */ title: string; /** * Url * @description The URL where the book can be purchased or viewed. * @default */ url?: string; /** * Image Url * @description The URL of the book's cover image. * @default */ image_url?: string; /** * Description * @description A description of the book. * @default */ description?: string; /** * Year * @description The year the book was published. */ year?: number | null; /** * Isbn * @description The ISBN of the book. * @default */ isbn?: string; /** * Shared * @description Whether the book is displayed publicly on the archive. * @default true */ shared?: boolean; }; /** BookUpdateInput */ BookUpdateInput: { /** * Title * @description The title of the book. */ title?: string | null; /** * Url * @description The URL where the book can be purchased or viewed. */ url?: string | null; /** * Image Url * @description The URL of the book's cover image. */ image_url?: string | null; /** * Description * @description A description of the book. */ description?: string | null; /** * Year * @description The year the book was published. */ year?: number | null; /** * Isbn * @description The ISBN of the book. */ isbn?: string | null; /** * Shared * @description Whether the book is displayed publicly on the archive. */ shared?: boolean | null; }; /** * BulkAction * @description A bulk action represents, well, a bulk action. It is used to perform * actions on a large number of objects at once. For example, you can * use it to delete a large number of emails, or to unsubscribe a large * number of subscribers. The actions within a bulk action are processed * serially by Buttondown; this should be considered an ergonomic way to * batch API calls across the network rather than a net-new piece of functionality * in of itself. */ BulkAction: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * @description The type of bulk action to perform. * @example delete_emails */ type: components["schemas"]["BulkActionType"]; /** * Metadata * @description Parameters for the bulk action. The exact shape depends on `type` — typically an `ids` list of object IDs to act on. * @example { * "ids": [ * "611c8825-6f21-4544-bb47-9f50453e9cb0", * "418c701a-efe3-4e3d-a404-e635a2f28775" * ] * } */ metadata: { [key: string]: (string | (string)[] | ({ [key: string]: unknown | undefined; })) | undefined; }; /** @description The current processing status of the bulk action. */ status: components["schemas"]["BulkActionStatus"]; /** * Completion Date * @description The date and time at which the bulk action was completed. */ completion_date?: string | null; }; /** BulkActionInput */ BulkActionInput: { /** * @description The type of bulk action to perform. * @example delete_emails */ type: components["schemas"]["BulkActionType"]; /** * Metadata * @description Parameters for the bulk action. The exact shape depends on `type` — typically an `ids` list of object IDs to act on. * @example { * "ids": [ * "611c8825-6f21-4544-bb47-9f50453e9cb0", * "418c701a-efe3-4e3d-a404-e635a2f28775" * ] * } */ metadata: { [key: string]: (string | (string)[] | ({ [key: string]: unknown | undefined; })) | undefined; }; }; /** * ArchivalMode * @description Governs who can view this email in the archive. * * `ARCHIVE_ONLY` is the odd one out: the email is publicly archived but * is not email content at all (e.g. an imported blog post), so it is * excluded from email-rendering contexts like "recent issues" widgets. * @enum {string} */ ArchivalMode: "archive_only" | "disabled" | "enabled" | "enabled_for_paid_subscribers" | "enabled_for_subscribers"; /** * Callout * @description Surfacing-time flags about an email that the UI uses to render contextual * callouts (e.g. in the analytics panel). Computed on read; not persisted. * @enum {string} */ Callout: "first_send_on_sending_domain"; /** * Comment * @description Comments are a way for subscribers to interact with newsletters. They're a way to * provide feedback, ask questions, and generally engage with the content of an email. * Comments exist in a tree structure; comments that reply to other comments are * considered "children" of the parent comment. */ Comment: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Email Id * @description The ID of the email this comment is attached to. */ email_id: string; /** * Subscriber Id * @description The ID of the subscriber who posted the comment, or null if posted by the newsletter author. */ subscriber_id?: string | null; /** * Parent Id * @description The ID of the parent comment, if this comment is a reply to another comment. */ parent_id?: string | null; /** * Text * @description The text content of the comment. */ text: string; /** @description The moderation status of the comment (e.g. `active`, `spammy`). */ status: components["schemas"]["CommentStatus"]; subscriber?: components["schemas"]["Subscriber"] | null; email?: components["schemas"]["Email"] | null; }; /** * Email * @description Emails are why you're here on Buttondown, right? * Creating an email via the API is just like creating one in the interface; * it will instantly trigger sending actual emails, * based on the tags and email type you provide. * * Relevant changes to the schema, and the [versions](https://docs.buttondown.com/api-versioning) they shipped in: * * - 2024-08-15: unshipped the `included_tags` and `excluded_tags` fields. * - 2024-12-30: unshipped the `is_comments_disabled` field, and replaced it with a more flexible `commenting_mode` field. * - 2025-09-23: increased the maximum length of the `subject` field from 1000 to 2000 characters. */ Email: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Absolute Url * @description The canonical web URL of the email on the newsletter's archive. */ absolute_url: string; /** @description Aggregate analytics for the email. Null until the email has been sent. */ analytics?: components["schemas"]["Analytics"] | null; /** * Callouts * @description A list of callouts that apply to this email — surfaced in the UI alongside analytics to flag context the reader should know about (e.g., first send on a custom sending domain). */ callouts?: (components["schemas"]["Callout"])[]; /** * Attachments * @description A list of attachment IDs present on the email. (See [Attachments](https://docs.buttondown.com/api-attachments-introduction) for more information.) */ attachments?: (string)[] | null; /** * Body * @description The body of the email, in either HTML or markdown format. Buttondown attempts to intelligently detect the format of the body automatically, but you can also specify the format explicitly by prepending the text with the `buttondown-editor-mode` comment: `` or ``. */ body: string; /** * Canonical Url * @description The URL of the original source of the content. */ canonical_url: string; /** @description Controls whether subscribers can comment on this email. */ commenting_mode: components["schemas"]["EmailCommentingMode"]; /** * Description * @description A human-readable description of the email, used for archives and SEO. */ description: string; /** @description Controls who can view this email in the archive. */ archival_mode: components["schemas"]["ArchivalMode"]; /** * @deprecated * @description The type of email. Defaults to `PUBLIC`. Deprecated: this is a legacy single-axis view derived from `archival_mode` (archive visibility) and `filters` (audience); prefer setting those directly. Because it is derived, it does not always round-trip: writing it alongside an explicit `archival_mode` that disagrees will report the value implied by the two underlying fields, and writing a value that already matches the derived one is a no-op. * @default public */ email_type?: components["schemas"]["EmailType"]; /** * Featured * @description Designated whether or not this email should be highlighted within the archives. */ featured: boolean; /** @description Tag-based filter rules determining which subscribers receive this email. */ filters: components["schemas"]["FilterGroup"]; /** * Image * @description A primary image URL used when previewing the email on the web or in other contexts. */ image: string; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: { [key: string]: unknown | undefined; }; /** * Modification Date * Format: date-time * @description The date and time at which the object was last modified. */ modification_date: string; /** * Publish Date * @description The date and time at which the email should be published in the future (for scheduled emails), or the date and time at which the email was published (for sent emails). */ publish_date?: string | null; /** * Related Email Ids * @description A list of email IDs that are related to this email. Related emails are shown at the bottom of the email and archive pages. */ related_email_ids: (string)[]; /** * Secondary Id * @description An informal 'number' for the email, used in some templates ('This was issue #123'). */ secondary_id?: number | null; /** * Should Trigger Pay Per Email Billing * @description Whether this email should trigger pay-per-email billing for paid subscribers. Use this to differentiate between free updates and premium newsletters. */ should_trigger_pay_per_email_billing: boolean; /** * Slug * @description A short, human-readable identifier for the email, used in the archive URL. * @example welcome-to-the-newsletter */ slug?: string | null; /** * @description The source of the email. * @example app */ source: components["schemas"]["EmailSource"]; /** * @description The current status of the email. * @example draft */ status: components["schemas"]["EmailStatus"]; /** * Subject * @description The subject line for the email. */ subject: string; /** @description If the email has been suppressed from sending, the reason why. */ suppression_reason?: components["schemas"]["EmailSuppressionReason"] | null; /** @description If present, this template overrides your newsletter's default email template. */ template?: components["schemas"]["NewsletterEmailTemplate"] | null; }; /** EmailTransition */ EmailTransition: { /** * Date * Format: date-time * @description When the email address change took effect. */ date: string; /** * Old Email Address * @description The subscriber's previous email address, or null for the initial address. */ old_email_address?: string | null; /** * New Email Address * @description The subscriber's email address after the transition. */ new_email_address: string; }; /** FirewallReason */ FirewallReason: { /** @description The code of the firewall facet that flagged this subscriber. */ code: components["schemas"]["FirewallReasonCode"]; /** * Reason * @description Human-readable explanation for why we flagged the subscriber. */ reason: string; }; /** * FirewallReasonCode * @description An enumeration. * @enum {string} */ FirewallReasonCode: "email_address_capital_letters" | "email_address_contains_prohibited_string" | "email_address_domain_burst" | "email_address_domain_reputation" | "email_address_extant_subscriber_count" | "email_address_has_gravatar" | "email_address_local_part_has_many_periods" | "email_address_local_part_looks_generated" | "email_address_malformed" | "email_address_mx_record_is_valid" | "email_address_noreply_local_part" | "email_address_plus_single_number" | "email_address_plus_variant_burst" | "email_address_previous_evaluation" | "email_address_reputation" | "email_address_sandbox_test" | "email_address_tied_to_account" | "email_address_typo" | "embedded_form_honeypot" | "fingerprint_missing" | "ip_address_country_risk" | "ip_address_datacenter" | "ip_address_extant_subscriber_count" | "ip_address_previous_evaluation" | "ip_address_reputation" | "newsletter_has_prohibited_string" | "newsletter_trust" | "project_honeypot" | "registration_without_prior_page_visit" | "subscriber_import_trusted_origin" | "text_contains_malicious_url" | "text_contains_prohibited_string" | "turnstile_response_token_is_valid" | "user_agent_known" | "username_shannon_entropy"; /** * StripeCoupon * @description Coupons let you offer discounts to subscribers who pay for your newsletter. * Buttondown's coupons are backed by Stripe, so each coupon maps to a coupon * on your connected Stripe account. Use them to run promotions—for example, a * percentage off a paid subscription. */ StripeCoupon: { /** * Coupon Id * @description The Stripe coupon ID (e.g. `coupon_...`). */ coupon_id: string; /** * Percent Off * @description The percentage discount applied by the coupon, if any. */ percent_off?: string | null; /** * Amount Off * @description The fixed amount discount applied by the coupon, in the smallest currency unit (e.g. cents), if any. */ amount_off?: number | null; /** * Name * @description The display name of the coupon. */ name?: string | null; }; /** * Subscriber * @description Subscribers are the main way you collect email addresses and * recipients on Buttondown. They're what you see on your * [subscribers page](https://buttondown.com/subscribers). * * Relevant changes to the schema, and the [versions](https://docs.buttondown.com/api-versioning) they shipped in: * * - 2024-08-01: renamed `subscriber_type` and `email` to `type` and `email_address` respectively. * - 2024-07-13: removed `external_url` in favor of `absolute_url`. */ Subscriber: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Avatar Url * @description URL of the subscriber's avatar image (e.g. a Gravatar URL), if available. */ avatar_url?: string | null; /** * Bounce Date * @description The date of the subscriber's most recent bounce event. May be set even if the subscriber has not yet been marked as undeliverable. */ bounce_date?: string | null; /** @description The reason of the subscriber's most recent bounce event. May be set even if the subscriber has not yet been marked as undeliverable. */ bounce_reason?: components["schemas"]["SubscriberUndeliverabilityReason"] | null; /** * Churn Date * @description When the subscriber cancelled their paid subscription, if applicable. */ churn_date?: string | null; /** * Commenting Disabled * @description Whether this subscriber is prevented from commenting. * @default false */ commenting_disabled?: boolean; /** * Country * @description The ISO 3166-1 alpha-2 country code inferred from the subscriber's IP address at signup, if available. * @example US */ country?: string | null; /** * Email Address * @description The email address of the subscriber. * @example telemachus@buttondown.email */ email_address: string; /** * Gift Subscription End Date * @description When the subscriber's gift subscription expires, if applicable. */ gift_subscription_end_date?: string | null; /** * Gift Subscription Message * @description A custom message that was sent to the subscriber when the gift subscription was created. */ gift_subscription_message?: string | null; /** * Ip Address * @description The IP address recorded when the subscriber signed up, if available. */ ip_address?: string | null; /** * Last Click Date * @description When the subscriber most recently clicked a link in an email. */ last_click_date?: string | null; /** * Last Open Date * @description When the subscriber most recently opened an email. */ last_open_date?: string | null; /** * Delivered Count * @description The number of distinct emails — both broadcasts and automation sends — delivered to this subscriber. Cached and refreshed periodically, so it may lag recent activity. * @example 12 */ delivered_count?: number | null; /** * Open Count * @description The subscriber's open count. * @example 7 */ open_count?: number | null; /** * Clicked Count * @description The subscriber's clicked count. * @example 3 */ clicked_count?: number | null; /** * Open Rate * @description The subscriber's open rate, computed from engagement counts. Null if delivered_count is 0 or null. * @example 0.5833 */ open_rate?: number | null; /** * Click Rate * @description The subscriber's click rate, computed from engagement counts. Null if delivered_count is 0 or null. * @example 0.25 */ click_rate?: number | null; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: { [key: string]: unknown | undefined; }; /** * Notes * @description Any notes you want to attach to the subscriber. These are not publicly visible. * @default */ notes?: string; /** * Purchased By * @description The email address of the individual who purchased this subscription on behalf of the subscriber. */ purchased_by?: string | null; /** * Purchased Message * @description A custom message that was sent to the subscriber when the subscription was purchased on behalf of the subscriber. */ purchased_message?: string | null; /** * Referral Code * @description The subscriber's unique referral code, used to attribute referred signups. */ referral_code: string; /** * Referrer Url * @description The URL the subscriber was referred from (e.g. where they submitted the subscription form). * @default */ referrer_url?: string; /** * Risk Score * @description The risk score of the subscriber. Positive numbers represent a higher risk; negative numbers represent a lower risk. */ risk_score?: number | null; /** * Secondary Id * @description A human-readable sequential identifier, unique within the newsletter. */ secondary_id: number; /** @description Where the subscriber signed up from (e.g. `api`, `import`, `form`). */ source: components["schemas"]["SubscriberSource"]; /** @description The Stripe coupon applied to the subscriber's paid subscription, if any. */ stripe_coupon?: components["schemas"]["StripeCoupon"] | null; /** * Stripe Customer Id * @description The Stripe customer ID associated with the subscriber, if any. */ stripe_customer_id?: string | null; /** * Subscriber Import Id * @description The ID of the [subscriber import](https://docs.buttondown.com/importing-subscribers) that created this subscriber, if any. */ subscriber_import_id?: string | null; /** * Tags * @description A list of [tag](https://docs.buttondown.com/api-tags-introduction) names applied to the subscriber. Tags that don't already exist will be created, which requires a plan that includes tags (Basic or higher). */ tags: (string)[]; /** * Transitions * @description The history of subscriber type transitions (e.g. `regular` → `premium`). * @default [] */ transitions?: (components["schemas"]["Transition"])[]; /** * Email Transitions * @description The history of email address changes for this subscriber. * @default [] */ email_transitions?: (components["schemas"]["EmailTransition"])[]; /** * Form Id * @description The ID of the [registration form](https://docs.buttondown.com/registration-forms) the subscriber signed up through, if any. */ form_id?: string | null; /** * Firewall Reasons * @description Information collected by Buttondown's firewall about this subscriber. See [the firewall](https://docs.buttondown.com/firewall) for more information. */ firewall_reasons?: (components["schemas"]["FirewallReason"])[]; /** @description The subscriber's lifecycle state. One of: `blocked` (blocked by the newsletter), `churned` (previously paid, subscription ended), `churning` (paying but won't renew), `complained` (marked an email as spam), `gifted` (granted free premium access by the newsletter), `past_due` (paid subscription with an overdue invoice), `paused` (premium subscription paused), `premium` (paying subscriber), `regular` (active free subscriber), `removed` (removed by the newsletter), `trialed` (temporarily enrolled in premium), `unactivated` (pending double opt-in confirmation), `undeliverable` (determined undeliverable), `unpaid` (has not paid yet), `unsubscribed` (voluntarily unsubscribed), `upcoming` (paid subscription that has not started yet). Subscribers with `premium`, `gifted`, `trialed`, or `churning` have access to premium content; use these to distinguish paid from free subscribers. */ type: components["schemas"]["SubscriberType"]; /** * Undeliverability Date * @description When the subscriber was marked as undeliverable, if applicable. */ undeliverability_date?: string | null; /** @description The reason the subscriber is undeliverable. (Only populated for undeliverable subscribers.) */ undeliverability_reason?: components["schemas"]["SubscriberUndeliverabilityReason"] | null; /** * Unsubscription Date * @description When the subscriber unsubscribed, if applicable. */ unsubscription_date?: string | null; /** * Unsubscription Reason * @description Free-text reason the subscriber unsubscribed, if provided. */ unsubscription_reason?: string | null; /** * Upgrade Date * @description When the subscriber upgraded to a paid subscription, if applicable. */ upgrade_date?: string | null; /** * Utm Campaign * @description The UTM campaign the subscriber was attributed to at signup. */ utm_campaign: string; /** * Utm Medium * @description The UTM medium the subscriber was attributed to at signup. */ utm_medium: string; /** * Utm Source * @description The UTM source the subscriber was attributed to at signup. */ utm_source: string; /** * Stripe Customer * @description If expanded, the Stripe customer associated with this subscriber. */ stripe_customer?: ({ [key: string]: unknown | undefined; }) | null; /** * Stripe Subscription * @description If expanded, the Stripe subscription backing this subscriber's paid subscription. */ stripe_subscription?: ({ [key: string]: unknown | undefined; }) | null; }; /** Transition */ Transition: { /** * Date * Format: date-time * @description When the subscriber transitioned to `type`. */ date: string; /** @description The subscriber type the subscriber transitioned to at `date`. */ type: components["schemas"]["SubscriberType"]; }; /** CommentInput */ CommentInput: { /** * Text * @description The text content of the comment. */ text: string; /** * Parent Id * @description The ID of the parent comment, if this comment is a reply to another comment. */ parent_id?: string | null; /** * Email Id * @description The ID of the email this comment is for. Required if parent_id is not provided. */ email_id?: string | null; /** * Subscriber Id * @description The ID of the subscriber to attribute the comment to. If not provided, the comment is attributed to the newsletter author. */ subscriber_id?: string | null; }; /** CommentUpdateInput */ CommentUpdateInput: { /** * Status * @description The new status for the comment. Use 'active' to approve or 'spammy' to mark as spam. * @enum {string} */ status: "active" | "spammy"; }; /** * EmailCreationErrorCode * @description Represents the type of error that occurred when creating an email. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ EmailCreationErrorCode: "body_contains_frontmatter" | "email_duplicate" | "email_not_confirmed" | "body_invalid" | "canonical_url_invalid" | "email_invalid" | "slug_invalid" | "subject_invalid" | "pay_per_email_billing_locked" | "publish_date_invalid" | "publish_date_missing" | "sending_requires_confirmation" | "status_invalid" | "tag_invalid"; /** ErrorMessage[EmailCreationErrorCode] */ ErrorMessage_EmailCreationErrorCode_: { /** @description The error code. */ code?: components["schemas"]["EmailCreationErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** EmailFilter */ EmailFilter: { /** * Field * @description The subscriber attribute to evaluate. Must be a recognized field or a `subscriber.metadata.*` path. */ field: ("subscriber.churn_date" | "subscriber.click_rate" | "subscriber.last_click_date" | "subscriber.last_open_date" | "subscriber.open_rate" | "subscriber.price" | "subscriber.source" | "subscriber.status" | "subscriber.subscription_date" | "subscriber.tags" | "subscriber.upgrade_date") | string; operator: components["schemas"]["Operator"]; /** * Value * @description The value to compare the field against. */ value: string; }; /** EmailFilterGroup */ EmailFilterGroup: { /** * Filters * @description The leaf-level filters to apply to the audience. */ filters: (components["schemas"]["EmailFilter"])[]; /** * Groups * @description The nested groups to apply to the audience. */ groups: (components["schemas"]["EmailFilterGroup"])[]; /** * Predicate * @description The logical operator to use when combining filters. * @enum {string} */ predicate: "and" | "or"; }; /** EmailInput */ EmailInput: { /** * Attachments * @description A list of attachment IDs present on the email. (See [Attachments](https://docs.buttondown.com/api-attachments-introduction) for more information.) * @default [] * @example [ * "att_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ attachments?: (string)[]; /** * Publish Date * @description The date and time at which the email should be published in the future (for scheduled emails), or the date and time at which the email was published (for sent emails). */ publish_date?: string | null; /** * Subject * @description The subject line for the email. * @example The subject line for the email */ subject: string; /** * Slug * @description A short, human-readable identifier for the email, used in the archive URL. * @example hello-world */ slug?: string | null; /** * Description * @description A human-readable description of the email, used for archives and SEO. * @default */ description?: string; /** * Canonical Url * @description The URL of the original source of the content. * @default */ canonical_url?: string; /** * Image * @description A primary image URL used when previewing the email on the web or in other contexts. * @default */ image?: string; /** * Body * @description The body of the email, in either HTML or markdown format. Buttondown attempts to intelligently detect the format of the body automatically, but you can also specify the format explicitly by prepending the text with the `buttondown-editor-mode` comment: `` or ``. * @default * @example This is an example of the body of an email. */ body?: string; /** * @description Controls who can view this email in the archive. * @default enabled */ archival_mode?: components["schemas"]["ArchivalMode"]; /** * @deprecated * @description The type of email. Defaults to `PUBLIC`. Deprecated: this is a legacy single-axis view derived from `archival_mode` (archive visibility) and `filters` (audience); prefer setting those directly. Because it is derived, it does not always round-trip: writing it alongside an explicit `archival_mode` that disagrees will report the value implied by the two underlying fields, and writing a value that already matches the derived one is a no-op. * @default public */ email_type?: components["schemas"]["EmailType"]; /** * @description The status of the email (e.g. `draft`, `about_to_send`, `sent`, `scheduled`). * @default about_to_send */ status?: components["schemas"]["EmailStatus"]; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: { [key: string]: unknown | undefined; }; /** * Secondary Id * @description An informal 'number' for the email, used in some templates (e.g. 'This was issue #123'). */ secondary_id?: number | null; /** * @description Tag-based filter rules determining which subscribers receive this email. * @default { * "filters": [], * "groups": [], * "predicate": "and" * } */ filters?: components["schemas"]["EmailFilterGroup"]; /** @description If present, this template overrides your newsletter's default email template. */ template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * @description Controls whether subscribers can comment on this email. * @default enabled */ commenting_mode?: components["schemas"]["EmailCommentingMode"]; /** * Related Email Ids * @description IDs of emails related to this one. Shown at the bottom of the email and archive pages. * @example [ * "em_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ related_email_ids?: (string)[]; /** * Featured * @description Designated whether or not this email should be highlighted within the archives. * @default false */ featured?: boolean; /** * Should Trigger Pay Per Email Billing * @description Whether this email should trigger pay-per-email billing for paid subscribers. Use this to differentiate between free updates and premium newsletters. * @default false */ should_trigger_pay_per_email_billing?: boolean; }; /** * EmailListErrorCode * @description Represents the type of error that occurred when listing emails. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ EmailListErrorCode: "creation_date_invalid" | "publish_date_invalid"; /** ErrorMessage[EmailListErrorCode] */ ErrorMessage_EmailListErrorCode_: { /** @description The error code. */ code?: components["schemas"]["EmailListErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** EmailUpdateInput */ EmailUpdateInput: { /** * Attachments * @description A list of attachment IDs present on the email. (See [Attachments](https://docs.buttondown.com/api-attachments-introduction) for more information.) * @example [ * "att_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ attachments?: (string)[] | null; /** * Publish Date * @description The date and time at which the email should be published in the future (for scheduled emails), or the date and time at which the email was published (for sent emails). Pass `"none"` to clear a scheduled date. */ publish_date?: string | "none" | null; /** * Subject * @description The subject line for the email. * @example The subject line for the email */ subject?: string | null; /** * Description * @description A human-readable description of the email, used for archives and SEO. */ description?: string | null; /** * Canonical Url * @description The URL of the original source of the content. * @example https://sheinhardtwig.com/2025/01/17/our-nbc-partnership */ canonical_url?: string | null; /** * Body * @description The body of the email, in either HTML or markdown format. Buttondown attempts to intelligently detect the format of the body automatically, but you can also specify the format explicitly by prepending the text with the `buttondown-editor-mode` comment: `` or ``. * @example This is an example of the body of an email. */ body?: string | null; /** @description Controls who can view this email in the archive. */ archival_mode?: components["schemas"]["ArchivalMode"] | null; /** * @deprecated * @description The type of email. Defaults to `PUBLIC`. Deprecated: this is a legacy single-axis view derived from `archival_mode` (archive visibility) and `filters` (audience); prefer setting those directly. Because it is derived, it does not always round-trip: writing it alongside an explicit `archival_mode` that disagrees will report the value implied by the two underlying fields, and writing a value that already matches the derived one is a no-op. */ email_type?: components["schemas"]["EmailType"] | null; /** @description The status of the email (e.g. `draft`, `about_to_send`, `sent`, `scheduled`). */ status?: components["schemas"]["EmailStatus"] | null; /** @description If the email has been suppressed from sending, the reason why. */ suppression_reason?: components["schemas"]["EmailSuppressionReason"] | null; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: ({ [key: string]: unknown | undefined; }) | null; /** * Image * @description A primary image URL used when previewing the email on the web or in other contexts. * @default */ image?: string; /** * Slug * @description A short, human-readable identifier for the email, used in the archive URL. * @example hello-world */ slug?: string | null; /** * Secondary Id * @description An informal 'number' for the email, used in some templates (e.g. 'This was issue #123'). */ secondary_id?: number | null; /** @description Tag-based filter rules determining which subscribers receive this email. */ filters?: components["schemas"]["EmailFilterGroup"] | null; /** * Template * @description If present, this template overrides your newsletter's default email template. Pass `"none"` to clear an override. */ template?: components["schemas"]["NewsletterEmailTemplate"] | "none" | null; /** @description Controls whether subscribers can comment on this email. */ commenting_mode?: components["schemas"]["EmailCommentingMode"] | null; /** * Related Email Ids * @description IDs of emails related to this one. Shown at the bottom of the email and archive pages. * @example [ * "em_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ related_email_ids?: (string)[] | null; /** * Featured * @description Designated whether or not this email should be highlighted within the archives. */ featured?: boolean | null; /** * Should Trigger Pay Per Email Billing * @description Whether this email should trigger pay-per-email billing for paid subscribers. Use this to differentiate between free updates and premium newsletters. */ should_trigger_pay_per_email_billing?: boolean | null; }; /** * AccessLevel * @description An enumeration. * @enum {string} */ AccessLevel: "none" | "read" | "write"; /** History */ History: { /** * History Id * @description A monotonically increasing history entry ID. */ history_id: number; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Value * @description The field's value at the time of this history entry. */ value: string; /** * User Id * @description The ID of the user who made this change, if attributable. */ user_id?: string | null; /** @description If expanded, the user who made this change. */ user?: components["schemas"]["User"] | null; }; /** Permissions */ Permissions: { /** * @description Access level for subscriber management. * @default none */ subscriber?: components["schemas"]["AccessLevel"]; /** * @description Access level for email management. * @default none */ email?: components["schemas"]["AccessLevel"]; /** * @description Access level for sending emails. * @default none */ sending?: components["schemas"]["AccessLevel"]; /** * @description Access level for newsletter styling. * @default none */ styling?: components["schemas"]["AccessLevel"]; /** * @description Access level for account administration. * @default none */ administrivia?: components["schemas"]["AccessLevel"]; /** * @description Access level for automation management. * @default none */ automations?: components["schemas"]["AccessLevel"]; /** * @description Access level for survey management. * @default none */ surveys?: components["schemas"]["AccessLevel"]; /** * @description Access level for form management. * @default none */ forms?: components["schemas"]["AccessLevel"]; }; /** User */ User: { permissions: components["schemas"]["Permissions"]; /** * Email Address * @description The email address of the user. */ email_address: string; /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** @description The status of the user's invitation (e.g. `pending`, `accepted`). */ status: components["schemas"]["InvitationStatus"]; /** * Last Logged In * @description When the user last logged in, or null if they haven't accepted the invitation. */ last_logged_in?: string | null; }; /** Render */ Render: { /** * Content * @description The rendered HTML for the specified target format. */ content: string; }; /** SendDraftInput */ SendDraftInput: { /** * Subscribers * @description A list of subscriber ids to which to send the email. * @example [ * "sub_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ subscribers?: (string)[] | null; /** * Recipients * @description A list of email addresses to send the email to. * @example [ * "telemachus@buttondown.email" * ] */ recipients?: (string)[] | null; }; /** * EmailEventType * @description The type of a subscriber event, such as a delivery, open, click, or reply. * @enum {string} */ EmailEventType: "bounced" | "clicked" | "complained" | "delivered" | "opened" | "rejected" | "replied" | "unsubscribed"; /** EmailEvent */ EmailEvent: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Subscriber Id * @description The ID of the subscriber the event is attributed to, if any. */ subscriber_id?: string | null; /** * Email Id * @description The ID of the email the event is attributed to, if any. */ email_id?: string | null; /** * Automation Id * @description The ID of the automation that sent the email, if any. */ automation_id?: string | null; /** * Metadata * @description Event-type-specific metadata (e.g. clicked URL, bounce reason). */ metadata: { [key: string]: string | undefined; }; /** @description The type of event (e.g. `delivered`, `opened`, `clicked`, `unsubscribed`). */ event_type: components["schemas"]["EmailEventType"]; subscriber?: components["schemas"]["Subscriber"] | null; email?: components["schemas"]["Email"] | null; automation?: components["schemas"]["Automation"] | null; }; /** * Export * @description Some software applications may want programmatic access to their newsletter exports. * This assists with a few niche use cases, such as regular backups or data ingestion * (into a data warehouse), or post-publishing processes that hinge on email events. * * In general, you probably won't _need_ to use this endpoint unless you * _absolutely_ need to use this endpoint. * * To browse the contents of a given export collection, refer to the [Data exports](https://docs.buttondown.com/data-exports-subscriber) section * of the documentation. */ Export: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Collections * @description The [collections](https://docs.buttondown.com/api-exports-collections) of objects to export. * @example [ * "subscribers" * ] */ collections: (components["schemas"]["ExportCollection"])[]; /** * Parameters * @description Parameters to pass to the exporter. These are specific to the collection and format, and constrain the export. * @example { * "status": "active" * } */ parameters?: ({ [key: string]: unknown | undefined; }) | null; /** * @description The [format](https://docs.buttondown.com/api-exports-format) of the export files. * @default csv * @example csv */ format?: components["schemas"]["ExportFormat"]; /** * Columns * @description If provided, the export will only include these columns. * @example [ * "id", * "email" * ] */ columns?: (string)[] | null; /** * Url * @description The URL of the export file. This is only available after the export has completed. */ url?: string | null; /** * Completion Date * @description The date and time the export completed. */ completion_date?: string | null; /** * @description The status of the export. * @example not_started */ status: components["schemas"]["ExportStatus"]; }; /** * CreateExportErrorCode * @description An enumeration. * @enum {string} */ CreateExportErrorCode: "collection_empty_invalid" | "columns_empty_invalid" | "columns_invalid"; /** ErrorMessage[CreateExportErrorCode] */ ErrorMessage_CreateExportErrorCode_: { /** @description The error code. */ code?: components["schemas"]["CreateExportErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** ExportInput */ ExportInput: { /** * Collections * @description The [collections](https://docs.buttondown.com/api-exports-collections) of objects to export. * @example [ * "subscribers" * ] */ collections: (components["schemas"]["ExportCollection"])[]; /** * Parameters * @description Parameters to pass to the exporter. These are specific to the collection and format, and constrain the export. * @example { * "status": "active" * } */ parameters?: ({ [key: string]: unknown | undefined; }) | null; /** * @description The [format](https://docs.buttondown.com/api-exports-format) of the export files. * @default csv * @example csv */ format?: components["schemas"]["ExportFormat"]; /** * Columns * @description If provided, the export will only include these columns. * @example [ * "id", * "email" * ] */ columns?: (string)[] | null; }; /** * ExternalFeed * @description An automation is a one-to-one mapping between an external RSS feed and an action * to be performed when new items are detected in that feed. Right now, Buttondown offers * two actions: * * - Send an email * - Create an email but save it as a draft to be sent out manually * * The automation is configured with a cadence, which is the frequency at which the * automation will be run. The cadence can be one of the following: * * - Run the automation every time a new item is detected in the feed * - Run the automation once per week * - Run the automation once per month */ ExternalFeed: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Last Checked Date * @description The most recent date and time this feed was checked for new items. */ last_checked_date?: string | null; /** @description The current status of the external feed automation. */ status: components["schemas"]["ExternalFeedAutomationStatus"]; /** * Error * @description A human-readable explanation of why this feed is failing, if it is. Null when the feed is reachable. */ error?: string | null; /** @description Whether feed items are sent immediately or drafted for manual review. */ behavior: components["schemas"]["ExternalFeedAutomationBehavior"]; /** * @description How frequently this feed should create or draft emails. * @example daily */ cadence: components["schemas"]["ExternalFeedAutomationCadence"]; /** * Cadence Metadata * @description Additional scheduling details for the selected cadence. `time` is required for `daily`/`weekly`/`monthly` cadences; `weekday` is required for `weekly`; `monthday` is required for `monthly`. See the [cadence metadata reference](https://docs.buttondown.com/api-external-feed-cadence-metadata) for allowed values. */ cadence_metadata: { [key: string]: string | undefined; }; /** @description Tag-based filtering rules used to decide which subscribers receive feed-generated emails. */ filters: components["schemas"]["FilterGroup"]; /** * Url * @description The URL of the RSS feed to poll for new items. */ url: string; /** * Subject * @description The subject line template for emails generated from this feed. */ subject: string; /** * Body * @description The body template for emails generated from this feed. */ body: string; /** * Label * @description An optional internal label for this feed. */ label: string; /** * Metadata * @description Metadata to be passed to emails rendered by this RSS feed. * @example { * "foo": "bar" * } */ metadata?: { [key: string]: unknown | undefined; }; /** * Skip Old Items * @description Skip items with publish date older than one day from when they're discovered */ skip_old_items: boolean; }; /** CadenceMetadata */ CadenceMetadata: { /** * Time * @description Hour of the day (0-23, as a string) when emails should be generated. * @example 9 */ time?: string | null; /** * Weekday * @description Day of the week when emails should be generated. Required when cadence is `weekly`. */ weekday?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday") | null; /** * Monthday * @description Day of the month when emails should be generated. Accepts a numeric day (`1`-`31`, clamped to the last day for shorter months), a weekday name (first such day of the month), `firstday`, or `lastday`. Required when cadence is `monthly`. */ monthday?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday" | "firstday" | "lastday") | string | null; }; /** ExternalFeedInput */ ExternalFeedInput: { /** * Url * @description The URL of the RSS feed to poll for new items. * @example http://lorem-rss.herokuapp.com/feed */ url: string; /** * @description The [behavior](https://docs.buttondown.com/api-external-feed-behavior) of the external feed. * @example draft */ behavior: components["schemas"]["ExternalFeedAutomationBehavior"]; /** * @description How frequently this feed should create or draft emails. * @example daily */ cadence: components["schemas"]["ExternalFeedAutomationCadence"]; /** @description Additional scheduling details for the selected cadence. `time` is required for `daily`/`weekly`/`monthly` cadences; `weekday` is required for `weekly`; `monthday` is required for `monthly`. See the [cadence metadata reference](https://docs.buttondown.com/api-external-feed-cadence-metadata) for allowed values. */ cadence_metadata?: components["schemas"]["CadenceMetadata"]; /** @description Tag-based filtering rules used to decide which subscribers receive feed-generated emails. */ filters: components["schemas"]["FilterGroup"]; /** * Subject * @description The subject line template for emails generated from this feed. */ subject: string; /** * Body * @description The body template for emails generated from this feed. */ body: string; /** * Label * @description An optional internal label for this feed. * @default */ label?: string; /** * Metadata * @description Metadata to be passed to emails rendered by this RSS feed. * @example { * "foo": "bar" * } */ metadata?: { [key: string]: unknown | undefined; }; /** * Skip Old Items * @description Skip items with publish date older than one day from when they're discovered * @default false */ skip_old_items?: boolean; }; /** ExternalFeedUpdateInput */ ExternalFeedUpdateInput: { behavior?: components["schemas"]["ExternalFeedAutomationBehavior"] | null; cadence?: components["schemas"]["ExternalFeedAutomationCadence"] | null; /** @description Additional scheduling details for the selected cadence. `time` is required for `daily`/`weekly`/`monthly` cadences; `weekday` is required for `weekly`; `monthday` is required for `monthly`. See the [cadence metadata reference](https://docs.buttondown.com/api-external-feed-cadence-metadata) for allowed values. */ cadence_metadata?: components["schemas"]["CadenceMetadata"] | null; filters?: components["schemas"]["FilterGroup"] | null; /** Subject */ subject?: string | null; /** Body */ body?: string | null; /** * Label * @description An optional internal label for this feed. */ label?: string | null; /** * Status * @description The current status of the external feed automation. */ status?: ("active" | "failing" | "inactive") | null; /** * Metadata * @description Metadata to be passed to emails rendered by this RSS feed. * @example { * "foo": "bar" * } */ metadata?: ({ [key: string]: unknown | undefined; }) | null; /** * Skip Old Items * @description Skip items with publish date older than one day from when they're discovered */ skip_old_items?: boolean | null; }; /** Empty */ Empty: Record; /** * ExternalFeedItem * @description An external feed item is a single item in an external RSS feed. It is created * automatically by Buttondown when a new item is detected in an external feed. External feed * items are immutable and cannot be modified or deleted. */ ExternalFeedItem: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** @description The processing status of this feed item. */ status: components["schemas"]["ExternalFeedItemStatus"]; /** * Url * @description The canonical URL of the feed item. */ url: string; /** * Publish Date * Format: date-time * @description The publication date parsed from the feed item. */ publish_date: string; /** * Title * @description The title of the feed item. */ title: string; /** * Description * @description The description excerpt parsed from the feed item. */ description: string; /** * Content * @description The full content parsed from the feed item. */ content: string; /** * Author * @description The author name parsed from the feed item. */ author: string; /** * Email Id * @description The ID of the generated email for this feed item, if one exists. */ email_id?: string | null; /** @description If expanded, the email generated from this feed item. */ email?: components["schemas"]["Email"] | null; }; /** Form */ Form: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Title * @description The human-readable title of the form, shown in the UI and on the hosted form page. */ title: string; /** * Slug * @description A URL-safe identifier used in the form's hosted URL (e.g. `/forms/{slug}`). Must be unique per newsletter. */ slug: string; /** * Body * @description Markdown body rendered above the subscribe fields on the hosted form page. */ body: string; /** * Css * @description Custom CSS applied to the hosted form page. */ css: string; /** * Success Body * @description Markdown shown to the subscriber after a successful submission. */ success_body: string; /** * Surveys * @description IDs of surveys to attach to this form. Responses are associated with the submitting subscriber. */ surveys: (string)[]; /** * Tags * @description UUIDs or TypeIDs of tags applied to subscribers who sign up through this form. * @example [ * "sub_tag_0k28edc3fw896bp4mrhc535z5k" * ] */ tags: (string)[]; /** * Admin * @description If true, the form acts as an admin-only signup form — it skips confirmation and can accept additional subscriber fields. */ admin: boolean; /** @description The status of the form. Only `active` forms accept submissions. */ status: components["schemas"]["FormStatus"]; /** * Subscriber Count * @description The number of subscribers who signed up through this form. */ subscriber_count: number; /** * Confirmed Subscriber Count * @description The number of confirmed subscribers who signed up through this form. */ confirmed_subscriber_count: number; /** * Page View Count * @description The number of page views for this form. */ page_view_count: number; }; /** * CreateFormErrorCode * @description Represents the type of error that occurred when creating a form. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ CreateFormErrorCode: "slug_already_exists" | "tag_not_found"; /** ErrorMessage[CreateFormErrorCode] */ ErrorMessage_CreateFormErrorCode_: { /** @description The error code. */ code?: components["schemas"]["CreateFormErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** FormInput */ FormInput: { /** * Title * @description The human-readable title of the form, shown in the UI and on the hosted form page. * @example Contact Form */ title: string; /** * Slug * @description A URL-safe identifier used in the form's hosted URL (e.g. `/forms/{slug}`). Must be unique per newsletter. * @example contact */ slug: string; /** * Body * @description Markdown body rendered above the subscribe fields on the hosted form page. * @default * @example */ body?: string; /** * Css * @description Custom CSS applied to the hosted form page. * @default * @example */ css?: string; /** * Success Body * @description Markdown shown to the subscriber after a successful submission. * @default * @example Thank you for your submission! */ success_body?: string; /** * Surveys * @description IDs of surveys to attach to this form. Responses are associated with the submitting subscriber. * @example [ * "srv_01h8abcdefghjkmnpqrstvwxyz" * ] */ surveys?: (string)[]; /** * Tags * @description UUIDs or TypeIDs of tags applied to subscribers who sign up through this form. * @example [ * "sub_tag_0k28edc3fw896bp4mrhc535z5k" * ] */ tags?: (string)[]; /** * Admin * @description If true, the form acts as an admin-only signup form — it skips confirmation and can accept additional subscriber fields. * @default false * @example false */ admin?: boolean; /** * @description The status of the form. Only `active` forms accept submissions. * @default active * @example active */ status?: components["schemas"]["FormStatus"]; }; /** FormUpdateInput */ FormUpdateInput: { /** * Title * @description The human-readable title of the form, shown in the UI and on the hosted form page. */ title?: string | null; /** * Slug * @description A URL-safe identifier used in the form's hosted URL (e.g. `/forms/{slug}`). Must be unique per newsletter. */ slug?: string | null; /** * Body * @description Markdown body rendered above the subscribe fields on the hosted form page. */ body?: string | null; /** * Css * @description Custom CSS applied to the hosted form page. */ css?: string | null; /** * Success Body * @description Markdown shown to the subscriber after a successful submission. */ success_body?: string | null; /** * Surveys * @description IDs of surveys to attach to this form. Responses are associated with the submitting subscriber. * @example [ * "srv_01h8abcdefghjkmnpqrstvwxyz" * ] */ surveys?: (string)[] | null; /** * Tags * @description UUIDs or TypeIDs of tags applied to subscribers who sign up through this form. * @example [ * "sub_tag_0k28edc3fw896bp4mrhc535z5k" * ] */ tags?: (string)[] | null; /** * Admin * @description If true, the form acts as an admin-only signup form — it skips confirmation and can accept additional subscriber fields. */ admin?: boolean | null; /** @description The status of the form. Only `active` forms accept submissions. */ status?: components["schemas"]["FormStatus"] | null; }; /** * Image * @description Images are, well, images! Buttondown allows you to upload images to its secure * S3 bucket and do with them what you will. This is sort of an odd duck of an * API, to be sure, but if you want to be able to do things like draft * and send emails completely on your iPad you need a surefire way of creating images. */ Image: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Image * @description The URL of the image. * @example https://placecats.com/408/287 */ image: string; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: { [key: string]: unknown | undefined; }; }; /** ImageUpdateInput */ ImageUpdateInput: { /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: { [key: string]: unknown | undefined; }; }; /** * Import * @description Imports let you bring data into Buttondown in bulk by uploading a file. * Currently, subscriber imports are supported. */ Import: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** @description The type of import. */ type: components["schemas"]["ImportType"]; /** @description The current status of the import. */ status: components["schemas"]["ImportStatus"]; /** @description The detected source of the import file. */ source: components["schemas"]["ImportSource"]; /** * Label * @description An optional label for the import. */ label?: string | null; /** * Metadata * @description Metadata about the import, such as detected column mappings. */ metadata?: { [key: string]: unknown | undefined; }; /** @description The results of the import, available after completion. */ results?: components["schemas"]["ImportResult"] | null; }; /** ImportResult */ ImportResult: { /** * New Subscribers * @description The number of new subscribers created by the import. */ new_subscribers?: number | null; /** * Updated Subscribers * @description The number of existing subscribers updated by the import. */ updated_subscribers?: number | null; /** * Existing Subscribers * @description The number of subscribers that already existed and were skipped. */ existing_subscribers?: number | null; /** * Reason To Bad Subscribers * @description A mapping of error reasons to the list of email addresses that failed for that reason. */ reason_to_bad_subscribers?: { [key: string]: (string)[] | undefined; }; /** * New Tags * @description The number of new tags created by the import. */ new_tags?: number | null; }; /** * ImportSource * @description An enumeration. * @enum {string} */ ImportSource: "bare" | "beehiiv" | "buttondown" | "custom" | "flodesk" | "ghost" | "google" | "mailchimp" | "mailerlite" | "memberful" | "pencilbooth" | "sender_dot_net" | "sendy" | "shopify" | "sparkloop" | "squarespace" | "standard" | "substack" | "tinyletter"; /** * ImportStatus * @description An enumeration. * @enum {string} */ ImportStatus: "failed" | "in_progress" | "no_op" | "not_started" | "succeeded" | "validating"; /** * ImportType * @description An enumeration. * @enum {string} */ ImportType: "subscriber_import"; /** * CreateImportErrorCode * @description An enumeration. * @enum {string} */ CreateImportErrorCode: "import_failure" | "invalid_file_type" | "malformed_csv"; /** ErrorMessage[CreateImportErrorCode] */ ErrorMessage_CreateImportErrorCode_: { /** @description The error code. */ code?: components["schemas"]["CreateImportErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** UpdateImportInput */ UpdateImportInput: { /** * Label * @description An optional label for the import. * @example June 2025 migration */ label?: string | null; /** * Metadata * @description Metadata about the import, such as detected column mappings. * @example { * "email_column": 0, * "metadata_columns": { * "name": 1 * } * } */ metadata?: ({ [key: string]: unknown | undefined; }) | null; /** * @description Override the detected source. Only allowed before the import starts; set to 'custom' to have the import read the column mappings in `metadata` instead of the detected source's own column knowledge. * @example custom */ source?: components["schemas"]["ImportSource"] | null; /** * Status * @description The status of the import. Set to 'in_progress' to begin executing the import. * @example in_progress */ status?: "in_progress" | null; }; /** * HostingDomainStatus * @description The DNS verification status of a newsletter's custom hosting domain. * @enum {string} */ HostingDomainStatus: "none" | "invalid" | "valid"; /** * Newsletter * @description You will likely not need to interact with your newsletter settings * programmatically, but if you do, this is the endpoint for you. You can * create, update, and list newsletters via the API; this is ideal for * integrating with Buttondown as a headless email or newsletter provider * (e.g. for a SaaS product.) */ Newsletter: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Announcement Bar Background Color * @description The background color for the announcement bar on your archive page. Must be a valid hex color code. * @default */ announcement_bar_background_color?: string; /** * Announcement Bar Text * @description Text displayed in the announcement bar on your archive page. Useful for promotions, updates, or calls to action. * @default */ announcement_bar_text?: string; /** * @description Controls who sees the announcement bar on your archive page. * @default disabled * @enum {unknown} */ announcement_bar_visibility?: "disabled" | "everyone" | "free_only" | "logged_out_only" | "paid_only"; /** * Api Key * Format: uuid * @description The API key for this newsletter, used for authenticating API requests. */ api_key: string; /** * @description The visual theme for your newsletter's archive page. See [archive themes](https://docs.buttondown.com/customizing-web-design) for previews. * @default modern * @enum {unknown} */ archive_theme?: "classic" | "modern" | "arbus" | "lovelace" | "myrna"; /** * @description The auditing mode for your newsletter, which controls spam and abuse protection. See [the Firewall](https://docs.buttondown.com/firewall) for more information. * @enum {unknown} */ auditing_mode?: "disabled" | "enabled" | "aggressive"; /** * Css * @description Custom CSS styling applied to your newsletter emails. See [CSS customization](https://docs.buttondown.com/customizing-email-design#adding-custom-css) for more information. * @default */ css?: string; /** * Custom Churn Email Body * @description Custom body content for the email sent when a paid subscriber cancels. Supports template tags like `{{ subscriber.email }}` and `{{ newsletter.name }}`. * @default */ custom_churn_email_body?: string; /** * Custom Churn Email Subject * @description Custom subject line for the email sent when a paid subscriber cancels. Supports template tags like `{{ newsletter.name }}`. * @default */ custom_churn_email_subject?: string; /** @description The email template to use for churn emails. If not set, uses the newsletter's default template. */ custom_churn_email_template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Custom Email Template * @description The identifier for a custom email template. See [email templates](https://docs.buttondown.com/customizing-email-design#buttondowns-default-templates) for available options. */ custom_email_template?: string | null; /** * Custom Expired Trial Notification Body * @description Custom body content for the email sent when a subscriber's free trial expires. Supports template tags. * @default */ custom_expired_trial_notification_body?: string; /** * Custom Expired Trial Notification Subject * @description Custom subject line for the email sent when a subscriber's free trial expires. Supports template tags. * @default */ custom_expired_trial_notification_subject?: string; /** * Custom Gift Subscription Email Body * @description Custom body content for the email sent when someone receives a gift subscription. Supports template tags. * @default */ custom_gift_subscription_email_body?: string; /** * Custom Gift Subscription Email Subject * @description Custom subject line for the email sent when someone receives a gift subscription. Supports template tags. * @default */ custom_gift_subscription_email_subject?: string; /** * Custom Gift Unsubscription Email Body * @description Custom body content for the email sent when a gift subscription ends. Supports template tags. * @default */ custom_gift_unsubscription_email_body?: string; /** * Custom Gift Unsubscription Email Subject * @description Custom subject line for the email sent when a gift subscription ends. Supports template tags. * @default */ custom_gift_unsubscription_email_subject?: string; /** @description The email template to use for gift unsubscription emails. If not set, uses the newsletter's default template. */ custom_gift_unsubscription_email_template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Custom Premium Confirmation Email Body * @description Custom body content for the email sent when a subscriber upgrades to a paid plan. Supports template tags. * @default */ custom_premium_confirmation_email_body?: string; /** * Custom Premium Confirmation Email Subject * @description Custom subject line for the email sent when a subscriber upgrades to a paid plan. Supports template tags. * @default */ custom_premium_confirmation_email_subject?: string; /** @description The email template to use for premium confirmation emails. If not set, uses the newsletter's default template. */ custom_premium_confirmation_email_template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Custom Subscription Confirmation Email Subject * @description Custom subject line for the double opt-in confirmation email sent to new subscribers. Supports template tags. * @default */ custom_subscription_confirmation_email_subject?: string; /** @description The email template to use for subscription confirmation emails. If not set, uses the newsletter's default template. */ custom_subscription_confirmation_email_template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Custom Subscription Confirmation Email Text * @description Custom body content for the double opt-in confirmation email. Must contain `{{ confirmation_url }}` as an HTML or Markdown link. * @default */ custom_subscription_confirmation_email_text?: string; /** * Custom Subscription Confirmation Reminder Email Subject * @description Custom subject line for the reminder email sent to subscribers who haven't confirmed. Supports template tags. * @default */ custom_subscription_confirmation_reminder_email_subject?: string; /** * Custom Subscription Confirmation Reminder Email Text * @description Custom body content for the reminder email sent to subscribers who haven't confirmed. Supports template tags. * @default */ custom_subscription_confirmation_reminder_email_text?: string; /** * Custom Subscription Confirmed Email Subject * @description Custom subject line for the email sent after a subscriber confirms their subscription. Supports template tags. * @default */ custom_subscription_confirmed_email_subject?: string; /** * Custom Subscription Confirmed Email Text * @description Custom body content for the email sent after a subscriber confirms their subscription. Supports template tags. * @default */ custom_subscription_confirmed_email_text?: string; /** * Description * @description A brief description of your newsletter, displayed on your public archive page and used for SEO. */ description: string; /** * Domain * @description The custom domain where your newsletter archives are hosted (e.g., 'newsletter.example.com'). See [custom domains](https://docs.buttondown.com/hosting-on-a-custom-domain) for setup instructions. * @default */ domain?: string; /** * Email Address * @description The 'From' email address used when sending your newsletter. Must be verified before use. * @default */ email_address?: string; /** * Email Domain * @description The custom domain from which your newsletter emails are sent (e.g., 'mail.example.com'). See [sending domains](https://docs.buttondown.com/sending-from-a-custom-domain) for setup instructions. * @default */ email_domain?: string; /** * Enabled Features * @description A list of features enabled for your newsletter. Common values include 'archives', 'portal', 'surveys', 'comments', 'paid_subscriptions', 'automations', 'webhooks', 'tracking', and 'referrals'. * @default [] */ enabled_features?: (string)[]; /** * Footer * @description HTML content displayed at the bottom of your newsletter emails. Supports [template tags](https://docs.buttondown.com/template-tags). * @default */ footer?: string; /** * From Name * @description The display name shown in the 'From' field of your emails (e.g., 'Jane from Acme Newsletter'). * @default */ from_name?: string; /** * Header * @description HTML content displayed at the top of your newsletter emails. Supports [template tags](https://docs.buttondown.com/template-tags). * @default */ header?: string; /** * @description The DNS verification status of your custom hosting domain. Read-only; see `/newsletters/{id}/hosting-domain` for the underlying records. * @default none */ hosting_domain_status?: components["schemas"]["HostingDomainStatus"]; /** * Icon * @description URL to your newsletter's icon image, used as a favicon and in various UI contexts. */ icon?: string | null; /** * Icon Alt Text * @description Alt text for the newsletter icon, used by screen readers and shown when the image cannot load. * @default */ icon_alt_text?: string; /** * Image * @description URL to your newsletter's header or branding image, displayed on archive pages and in social previews. */ image?: string | null; /** * @description The language/locale for your newsletter's UI elements (confirmation emails, unsubscribe pages, etc.). See [localization](https://docs.buttondown.com/localization) for supported locales. * @default en */ locale?: components["schemas"]["NewsletterLocale"]; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: { [key: string]: unknown | undefined; }; /** * Name * @description The display name of your newsletter, shown to subscribers and on your archive page. */ name: string; /** * Reply To Address * @description An alternative email address that receives replies to your newsletter emails, instead of the sending address. * @default */ reply_to_address?: string; /** * @description The DNS verification status of your custom sending domain. Read-only; see `/newsletters/{id}/sending-domain` for the underlying records. * @default none */ sending_domain_status?: components["schemas"]["SendingDomainStatus"]; /** * Sharing Networks * @description A list of social networks to show share buttons for on your archive pages. * @default [] */ sharing_networks?: (string)[]; /** * Socials * @description A list of social media accounts linked to your newsletter, displayed on your archive page. Each entry has a `type`, `url`, and optional `label`. * @default [] */ socials?: (components["schemas"]["SocialAccountSchema"])[]; /** * Sort * @description The default sorting method for listing subscribers or messages. Example values: 'creation_date', '-creation_date', 'email_address'. * @default creation_date */ sort?: string; /** * Subscription Confirmation Redirect Url * @description A URL to redirect subscribers to after they confirm their subscription via double opt-in. * @default */ subscription_confirmation_redirect_url?: string; /** * Subscription Redirect Url * @description A URL to redirect subscribers to immediately after they submit the subscription form (before confirmation). * @default */ subscription_redirect_url?: string; /** * @description The default email template for your newsletter. See [email templates](https://docs.buttondown.com/customizing-email-design#buttondowns-default-templates) for available options. * @default modern */ template?: components["schemas"]["NewsletterEmailTemplate"]; /** * Test Mode * @description Whether test mode is enabled. When enabled, emails are not actually sent to subscribers, useful for testing automations and workflows. * @default false */ test_mode?: boolean; /** * Theme Configuration * @description Custom theme configuration (variables) for your newsletter. These can be referenced in your CSS and templates to maintain consistent styling. * @default {} */ theme_configuration?: { [key: string]: string | undefined; }; /** * Timezone * @description The timezone used for scheduling and displaying dates in your newsletter (e.g., 'America/New_York', 'Europe/London'). * @default Etc/UTC */ timezone?: string; /** * Tint Color * @description The accent color for your newsletter's emails, applied to links and buttons. Your archive's accent color is set separately, by its theme. Must be a valid hex color code. * @default #0069FF */ tint_color?: string; /** * Username * @description The unique URL-safe identifier for your newsletter, used in your archive URL (e.g., 'buttondown.com/username'). */ username: string; /** * Web Css * @description Custom CSS styling applied to your newsletter's web presence (archive pages, subscription forms, etc.). * @default */ web_css?: string; }; /** * SendingDomainStatus * @description The DNS verification status of a newsletter's custom sending domain. * @enum {string} */ SendingDomainStatus: "none" | "invalid" | "awaiting_ssl" | "failing" | "deliberately_cold" | "valid"; /** SocialAccountSchema */ SocialAccountSchema: { /** @description The type of social media account. */ type: components["schemas"]["SocialAccountType"]; /** * Url * @description The URL of the social media profile. */ url: string; /** * Label * @description An optional display label for the social media account. */ label?: string | null; }; /** * SocialAccountType * @description An enumeration. * @enum {string} */ SocialAccountType: "generic" | "ao3" | "arena" | "bandcamp" | "behance" | "bluesky" | "bookbub" | "bookshop" | "discord" | "etsy" | "facebook" | "github" | "goodreads" | "gumroad" | "instagram" | "itchio" | "kofi" | "letterboxd" | "linkedin" | "linktree" | "mastodon" | "medium" | "patreon" | "pinterest" | "reddit" | "soundcloud" | "spotify" | "steam" | "substack" | "telegram" | "threads" | "tiktok" | "tumblr" | "twitch" | "twitter" | "vimeo" | "youtube"; /** * CreateNewsletterErrorCode * @description Represents the type of error that occurred when creating a newsletter. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ CreateNewsletterErrorCode: "domain_incorrect" | "domain_path" | "domain_protocol" | "email_domain_conflicts_with_hosting_domain" | "email_domain_contains_at" | "email_domain_incorrect" | "email_domain_path" | "email_domain_protocol" | "email_domain_used_by_other_account" | "invalid_metadata" | "username_already_exists" | "username_malformed" | "username_reserved" | "username_too_short"; /** ErrorMessage[CreateNewsletterErrorCode] */ ErrorMessage_CreateNewsletterErrorCode_: { /** @description The error code. */ code?: components["schemas"]["CreateNewsletterErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** NewsletterInput */ NewsletterInput: { /** * Announcement Bar Background Color * @description The background color for the announcement bar on your archive page. Must be a valid hex color code. * @default * @example #FF6600 */ announcement_bar_background_color?: string | string; /** * Announcement Bar Text * @description Text displayed in the announcement bar on your archive page. Useful for promotions, updates, or calls to action. * @default * @example Subscribe to get 20% off your first order! */ announcement_bar_text?: string; /** * @description Controls who sees the announcement bar on your archive page. * @default disabled * @example everyone * @enum {unknown} */ announcement_bar_visibility?: "disabled" | "everyone" | "free_only" | "logged_out_only" | "paid_only"; /** * @description The visual theme for your newsletter's archive page. See [archive themes](https://docs.buttondown.com/customizing-web-design) for previews. * @default modern * @example modern */ archive_theme?: components["schemas"]["NewsletterArchiveTheme"]; /** * @description The auditing mode for your newsletter, which controls spam and abuse protection. See [the Firewall](https://docs.buttondown.com/firewall) for more information. * @example enabled */ auditing_mode?: components["schemas"]["NewsletterAuditingMode"] | null; /** * Css * @description Custom CSS styling applied to your newsletter emails. See [CSS customization](https://docs.buttondown.com/customizing-email-design#adding-custom-css) for more information. * @default * @example .header { color: #000; } */ css?: string; /** * Custom Email Template * @description The identifier for a custom email template. See [email templates](https://docs.buttondown.com/customizing-email-design#buttondowns-default-templates) for available options. * @example modern */ custom_email_template?: string | null; /** * Description * @description A brief description of your newsletter, displayed on your public archive page and used for SEO. * @example Stay up to date with the latest trends in wigs and hairpieces */ description: string; /** * Domain * @description The custom domain where your newsletter archives are hosted (e.g., 'newsletter.example.com'). See [custom domains](https://docs.buttondown.com/hosting-on-a-custom-domain) for setup instructions. * @default * @example sheinhardt.com */ domain?: string; /** * Email Address * @description The 'From' email address used when sending your newsletter. Must be verified before use. * @example newsletter@sheinhardt.com */ email_address?: string | null; /** * Email Domain * @description The custom domain from which your newsletter emails are sent (e.g., 'mail.example.com'). See [sending domains](https://docs.buttondown.com/sending-from-a-custom-domain) for setup instructions. * @default * @example mail.sheinhardt.com */ email_domain?: string; /** * Enabled Features * @description A list of features enabled for your newsletter. Common values include 'archives', 'portal', 'surveys', 'comments', 'paid_subscriptions', 'automations', 'webhooks', 'tracking', and 'referrals'. * @default [] * @example [ * "archives", * "portal", * "surveys" * ] */ enabled_features?: (string)[]; /** * Footer * @description HTML content displayed at the bottom of your newsletter emails. Supports [template tags](https://docs.buttondown.com/template-tags). * @default * @example

Thanks for reading!

*/ footer?: string; /** * From Name * @description The display name shown in the 'From' field of your emails (e.g., 'Jane from Acme Newsletter'). * @default * @example Sheinhardt Wig Company */ from_name?: string; /** * Header * @description HTML content displayed at the top of your newsletter emails. Supports [template tags](https://docs.buttondown.com/template-tags). * @default * @example

Welcome to our newsletter!

*/ header?: string; /** * Icon * @description URL to your newsletter's icon image, used as a favicon and in various UI contexts. * @default * @example https://example.com/icon.png */ icon?: string; /** * Icon Alt Text * @description Alt text for the newsletter icon, used by screen readers and shown when the image cannot load. * @default */ icon_alt_text?: string; /** * Image * @description URL to your newsletter's header or branding image, displayed on archive pages and in social previews. * @default * @example https://example.com/header.jpg */ image?: string; /** * @description The language/locale for your newsletter's UI elements (confirmation emails, unsubscribe pages, etc.). See [localization](https://docs.buttondown.com/localization) for supported locales. * @default en * @example en */ locale?: components["schemas"]["NewsletterLocale"]; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} * @example { * "source": "my-app", * "tier": "pro" * } */ metadata?: { [key: string]: unknown | undefined; }; /** * Name * @description The display name of your newsletter, shown to subscribers and on your archive page. * @example Sheinhardt Wig Company */ name: string; /** * Reply To Address * @description An alternative email address that receives replies to your newsletter emails, instead of the sending address. * @example newsletter@sheinhardt.com */ reply_to_address?: string | null; /** * Socials * @description A list of social media accounts linked to your newsletter, displayed on your archive page. Each entry has a `type`, `url`, and optional `label`. * @default [] * @example [ * { * "label": null, * "type": "twitter", * "url": "https://x.com/sheinhardt" * } * ] */ socials?: (components["schemas"]["SocialAccountSchema"])[]; /** * Subscription Confirmation Redirect Url * @description A URL to redirect subscribers to after they confirm their subscription via double opt-in. * @default * @example https://example.com/confirmed */ subscription_confirmation_redirect_url?: string; /** * Subscription Redirect Url * @description A URL to redirect subscribers to immediately after they submit the subscription form (before confirmation). * @default * @example https://example.com/thanks */ subscription_redirect_url?: string; /** * @description The default email template for your newsletter. See [email templates](https://docs.buttondown.com/customizing-email-design#buttondowns-default-templates) for available options. * @default modern * @example modern */ template?: components["schemas"]["NewsletterEmailTemplate"]; /** * Test Mode * @description Whether test mode is enabled. When enabled, emails are not actually sent to subscribers, useful for testing automations and workflows. */ test_mode?: boolean | null; /** * Theme Configuration * @description Custom theme configuration (variables) for your newsletter. These can be referenced in your CSS and templates to maintain consistent styling. * @default {} * @example { * "primary-color": "#0069FF" * } */ theme_configuration?: { [key: string]: string | undefined; }; /** * Timezone * @description The timezone used for scheduling and displaying dates in your newsletter (e.g., 'America/New_York', 'Europe/London'). * @default Etc/UTC * @example America/New_York */ timezone?: string; /** * Tint Color * @description The accent color for your newsletter's emails, applied to links and buttons. Your archive's accent color is set separately, by its theme. Must be a valid hex color code. * @default #0069FF * @example #0069FF */ tint_color?: string; /** * Username * @description The unique URL-safe identifier for your newsletter, used in your archive URL (e.g., 'buttondown.com/username'). * @example sheinhardt */ username: string; /** * Web Css * @description Custom CSS styling applied to your newsletter's web presence (archive pages, subscription forms, etc.). * @default * @example .container { max-width: 800px; } */ web_css?: string; }; /** NewsletterUpdateInput */ NewsletterUpdateInput: { /** * Announcement Bar Background Color * @description The background color for the announcement bar on your archive page. Must be a valid hex color code. * @example #FF6600 */ announcement_bar_background_color?: string | string | null; /** * Announcement Bar Text * @description Text displayed in the announcement bar on your archive page. Useful for promotions, updates, or calls to action. * @example Subscribe to get 20% off your first order! */ announcement_bar_text?: string | null; /** * @description Controls who sees the announcement bar on your archive page. * @example everyone * @enum {unknown} */ announcement_bar_visibility?: "disabled" | "everyone" | "free_only" | "logged_out_only" | "paid_only"; /** * @description The visual theme for your newsletter's archive page. See [archive themes](https://docs.buttondown.com/customizing-web-design) for previews. * @example modern */ archive_theme?: components["schemas"]["NewsletterArchiveTheme"] | null; /** * @description The auditing mode for your newsletter, which controls spam and abuse protection. See [the Firewall](https://docs.buttondown.com/firewall) for more information. * @example enabled */ auditing_mode?: components["schemas"]["NewsletterAuditingMode"] | null; /** * Css * @description Custom CSS styling applied to your newsletter emails. See [CSS customization](https://docs.buttondown.com/customizing-email-design#adding-custom-css) for more information. * @example .header { color: #000; } */ css?: string | null; /** * Custom Churn Email Body * @description Custom body content for the email sent when a paid subscriber cancels. Supports template tags like `{{ subscriber.email }}` and `{{ newsletter.name }}`. * @example Hi {{ subscriber.email }}, * * We're sorry to see you go! */ custom_churn_email_body?: string | null; /** * Custom Churn Email Subject * @description Custom subject line for the email sent when a paid subscriber cancels. Supports template tags like `{{ newsletter.name }}`. * @example You've canceled your premium subscription to {{ newsletter.name }} */ custom_churn_email_subject?: string | null; /** * @description The email template to use for churn emails. If not set, uses the newsletter's default template. * @example modern */ custom_churn_email_template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Custom Email Template * @description The identifier for a custom email template. See [email templates](https://docs.buttondown.com/customizing-email-design#buttondowns-default-templates) for available options. * @example modern */ custom_email_template?: string | null; /** * Custom Expired Trial Notification Body * @description Custom body content for the email sent when a subscriber's free trial expires. Supports template tags. */ custom_expired_trial_notification_body?: string | null; /** * Custom Expired Trial Notification Subject * @description Custom subject line for the email sent when a subscriber's free trial expires. Supports template tags. */ custom_expired_trial_notification_subject?: string | null; /** * Custom Gift Subscription Email Body * @description Custom body content for the email sent when someone receives a gift subscription. Supports template tags. */ custom_gift_subscription_email_body?: string | null; /** * Custom Gift Subscription Email Subject * @description Custom subject line for the email sent when someone receives a gift subscription. Supports template tags. */ custom_gift_subscription_email_subject?: string | null; /** * Custom Gift Unsubscription Email Body * @description Custom body content for the email sent when a gift subscription ends. Supports template tags. */ custom_gift_unsubscription_email_body?: string | null; /** * Custom Gift Unsubscription Email Subject * @description Custom subject line for the email sent when a gift subscription ends. Supports template tags. */ custom_gift_unsubscription_email_subject?: string | null; /** * @description The email template to use for gift unsubscription emails. If not set, uses the newsletter's default template. * @example modern */ custom_gift_unsubscription_email_template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Custom Premium Confirmation Email Body * @description Custom body content for the email sent when a subscriber upgrades to a paid plan. Supports template tags. */ custom_premium_confirmation_email_body?: string | null; /** * Custom Premium Confirmation Email Subject * @description Custom subject line for the email sent when a subscriber upgrades to a paid plan. Supports template tags. */ custom_premium_confirmation_email_subject?: string | null; /** * @description The email template to use for premium confirmation emails. If not set, uses the newsletter's default template. * @example modern */ custom_premium_confirmation_email_template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Custom Subscription Confirmation Email Subject * @description Custom subject line for the double opt-in confirmation email sent to new subscribers. Supports template tags. */ custom_subscription_confirmation_email_subject?: string | null; /** * Custom Subscription Confirmation Email Text * @description Custom body content for the double opt-in confirmation email. Must contain `{{ confirmation_url }}` as an HTML or Markdown link. */ custom_subscription_confirmation_email_text?: string | null; /** * @description The email template to use for subscription confirmation emails. If not set, uses the newsletter's default template. * @example modern */ custom_subscription_confirmation_email_template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Custom Subscription Confirmation Reminder Email Subject * @description Custom subject line for the reminder email sent to subscribers who haven't confirmed. Supports template tags. */ custom_subscription_confirmation_reminder_email_subject?: string | null; /** * Custom Subscription Confirmation Reminder Email Text * @description Custom body content for the reminder email sent to subscribers who haven't confirmed. Supports template tags. */ custom_subscription_confirmation_reminder_email_text?: string | null; /** * Custom Subscription Confirmed Email Subject * @description Custom subject line for the email sent after a subscriber confirms their subscription. Supports template tags. */ custom_subscription_confirmed_email_subject?: string | null; /** * Custom Subscription Confirmed Email Text * @description Custom body content for the email sent after a subscriber confirms their subscription. Supports template tags. */ custom_subscription_confirmed_email_text?: string | null; /** * Description * @description A brief description of your newsletter, displayed on your public archive page and used for SEO. * @example Stay up to date with the latest trends in wigs and hairpieces */ description?: string | null; /** * Domain * @description The custom domain where your newsletter archives are hosted (e.g., 'newsletter.example.com'). See [custom domains](https://docs.buttondown.com/hosting-on-a-custom-domain) for setup instructions. * @example sheinhardt.com */ domain?: string | null; /** * Email Address * @description The 'From' email address used when sending your newsletter. Must be verified before use. * @example newsletter@sheinhardt.com */ email_address?: string | null; /** * Email Domain * @description The custom domain from which your newsletter emails are sent (e.g., 'mail.example.com'). See [sending domains](https://docs.buttondown.com/sending-from-a-custom-domain) for setup instructions. * @example mail.sheinhardt.com */ email_domain?: string | null; /** * Enabled Features * @description A list of features enabled for your newsletter. Common values include 'archives', 'portal', 'surveys', 'comments', 'paid_subscriptions', 'automations', 'webhooks', 'tracking', and 'referrals'. * @example [ * "archives", * "portal", * "surveys" * ] */ enabled_features?: (string)[] | null; /** * Footer * @description HTML content displayed at the bottom of your newsletter emails. Supports [template tags](https://docs.buttondown.com/template-tags). * @example

Thanks for reading!

*/ footer?: string | null; /** * From Name * @description The display name shown in the 'From' field of your emails (e.g., 'Jane from Acme Newsletter'). * @example Sheinhardt Wig Company */ from_name?: string | null; /** * Header * @description HTML content displayed at the top of your newsletter emails. Supports [template tags](https://docs.buttondown.com/template-tags). * @example

Welcome to our newsletter!

*/ header?: string | null; /** * Icon * @description URL to your newsletter's icon image, used as a favicon and in various UI contexts. * @example https://example.com/icon.png */ icon?: string | null; /** * Icon Alt Text * @description Alt text for the newsletter icon, used by screen readers and shown when the image cannot load. */ icon_alt_text?: string | null; /** * Image * @description URL to your newsletter's header or branding image, displayed on archive pages and in social previews. * @example https://example.com/header.jpg */ image?: string | null; /** * @description The language/locale for your newsletter's UI elements (confirmation emails, unsubscribe pages, etc.). See [localization](https://docs.buttondown.com/localization) for supported locales. * @example en */ locale?: components["schemas"]["NewsletterLocale"] | null; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @example { * "source": "my-app", * "tier": "pro" * } */ metadata?: ({ [key: string]: unknown | undefined; }) | null; /** * Name * @description The display name of your newsletter, shown to subscribers and on your archive page. * @example Sheinhardt Wig Company */ name?: string | null; /** * Reply To Address * @description An alternative email address that receives replies to your newsletter emails, instead of the sending address. * @example newsletter@sheinhardt.com */ reply_to_address?: string | null; /** * Socials * @description A list of social media accounts linked to your newsletter, displayed on your archive page. Each entry has a `type`, `url`, and optional `label`. * @example [ * { * "label": null, * "type": "twitter", * "url": "https://x.com/sheinhardt" * } * ] */ socials?: (components["schemas"]["SocialAccountSchema"])[] | null; /** * Subscription Confirmation Redirect Url * @description A URL to redirect subscribers to after they confirm their subscription via double opt-in. * @example https://example.com/confirmed */ subscription_confirmation_redirect_url?: string | null; /** * Subscription Redirect Url * @description A URL to redirect subscribers to immediately after they submit the subscription form (before confirmation). * @example https://example.com/thanks */ subscription_redirect_url?: string | null; /** * @description The default email template for your newsletter. See [email templates](https://docs.buttondown.com/customizing-email-design#buttondowns-default-templates) for available options. * @example modern */ template?: components["schemas"]["NewsletterEmailTemplate"] | null; /** * Test Mode * @description Whether test mode is enabled. When enabled, emails are not actually sent to subscribers, useful for testing automations and workflows. */ test_mode?: boolean | null; /** * Theme Configuration * @description Custom theme configuration (variables) for your newsletter. These can be referenced in your CSS and templates to maintain consistent styling. * @example { * "primary-color": "#0069FF" * } */ theme_configuration?: ({ [key: string]: string | undefined; }) | null; /** * Timezone * @description The timezone used for scheduling and displaying dates in your newsletter (e.g., 'America/New_York', 'Europe/London'). * @example America/New_York */ timezone?: string | null; /** * Tint Color * @description The accent color for your newsletter's emails, applied to links and buttons. Your archive's accent color is set separately, by its theme. Must be a valid hex color code. * @example #0069FF */ tint_color?: string | null; /** * Username * @description The unique URL-safe identifier for your newsletter, used in your archive URL (e.g., 'buttondown.com/username'). * @example sheinhardt */ username?: string | null; /** * Web Css * @description Custom CSS styling applied to your newsletter's web presence (archive pages, subscription forms, etc.). * @example .container { max-width: 800px; } */ web_css?: string | null; }; /** ApexAliasProvider */ ApexAliasProvider: { /** * Id * @description Stable identifier for the DNS provider (e.g. `cloudflare`). */ id: string; /** * Name * @description Human-readable name of the DNS provider. */ name: string; /** * Apex Alias Support * @description How the provider supports pointing an apex/root domain at a CNAME target (e.g. CNAME flattening or ALIAS records). */ apex_alias_support: string; /** * Wording Kind * @description Which copy variant to show for this provider's setup instructions. */ wording_kind: string; /** * Nameserver Regexes * @description Patterns matched against a domain's nameservers to detect this provider. */ nameserver_regexes: (string)[]; /** * Support Doc Url * @description Link to the provider's own DNS documentation, when available. */ support_doc_url: string | null; /** * Side Notes * @description Provider-specific caveats to surface alongside the setup guidance. */ side_notes: string; /** * Buttondown Guide Url * @description A first-party Buttondown setup guide for this provider, when one exists. */ buttondown_guide_url?: string | null; /** * Supports Nameserver Delegation * @description Whether the provider lets customers delegate a child zone with NS records. * @default true */ supports_nameserver_delegation?: boolean; /** @description How the provider's own record editor lays out a DNS record, when we've mapped it. */ record_editor?: components["schemas"]["RecordEditor"] | null; }; /** RecordEditor */ RecordEditor: { /** * Dns Page Url * @description Link to the provider's DNS records page for this domain, or to its dashboard when the provider has no per-domain link. */ dns_page_url: string; /** * Location * @description The steps through the provider's dashboard to its record editor. */ location: (string)[]; /** * Host Label * @description What the provider calls the host field in its record editor. */ host_label: string; /** * Value Label * @description What the provider calls the value field in its record editor. */ value_label: string; /** * Apex Host * @description What the provider expects in the host field for the root domain; empty means leave it blank. */ apex_host: string; }; /** RequirementRecord */ RequirementRecord: { /** * Record Type * @description The DNS record type to create (e.g. `CNAME`, `TXT`, `MX`). */ record_type: string; /** * Name * @description The host/name the DNS record should be created at. */ name: string; /** * Is Valid * @description Whether the record is currently present and correct in DNS. */ is_valid: boolean; /** * Required Value * @description The value the DNS record must point to. */ required_value: string; /** * Current Values * @description The values currently observed at this record, if any. */ current_values: (string)[]; /** * Context * @description `manual` if the customer must create this record themselves; `managed` if Buttondown provisions it. * @enum {string} */ context: "managed" | "manual"; }; /** SendingDomainRecord */ SendingDomainRecord: { /** * Id * @description The ESP-side identifier for the domain, when available. */ id: string; /** * Domain * @description The custom sending domain being verified. */ domain: string; status: components["schemas"]["SendingDomainStatus"]; /** * Warnings * @description Human-readable warnings about the domain's DNS setup (e.g. a record left proxied through Cloudflare). */ warnings: (Record)[]; /** * Requirements * @description The DNS records required for the domain, each with its current verification state. */ requirements: (components["schemas"]["RequirementRecord"])[]; /** * Existing Mail Provider * @description The third-party mail provider already handling this domain's inbound mail, when detected; its MX record is then omitted from `requirements`. */ existing_mail_provider?: string | null; detected_dns_provider?: components["schemas"]["ApexAliasProvider"] | null; /** * Checked Date * @description When the record was last computed. Null until the first verification completes. */ checked_date?: string | null; /** * Is Checking * @description Whether a background re-verification is currently in flight. Clients poll while this is true. * @default false */ is_checking?: boolean; }; /** HostingDomainRecord */ HostingDomainRecord: { /** * Domain * @description The custom hosting domain being verified. */ domain: string; /** * Record Type * @description The DNS record type the domain should use (typically `CNAME`). */ record_type: string; /** * Data * @description The record values currently observed at the domain, if any. */ data: (string)[]; /** * Nameservers * @description The domain's nameservers, used to detect its DNS provider. */ nameservers?: (string)[]; apex_alias_provider?: components["schemas"]["ApexAliasProvider"] | null; status: components["schemas"]["HostingDomainStatus"]; }; /** Note */ Note: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Body * @description The text content of the note. * @example This subscriber upgraded to a paid plan. */ body: string; /** * Model Type * @description The type of object this note is attached to (e.g., 'email', 'subscriber'). * @example email * @enum {string} */ model_type: "automation" | "comment" | "conversation" | "email" | "external_feed" | "invitation" | "socialmention" | "stripe_customer" | "subscriber" | "survey" | "tag" | "webmention"; /** * Model Id * @description The UUID or TypeID of the object this note is attached to. * @example 13121cd6-0dfc-424c-bb12-988b0a32fcb3 */ model_id: string; /** Metadata */ metadata: { [key: string]: unknown | undefined; }; /** * Source * @description The source of the note. If the note was created by a Buttondown admin, this will be 'admin'; otherwise, it will be 'user'. * @example admin * @enum {string} */ source: "admin" | "user"; /** User Id */ user_id?: string | null; user?: components["schemas"]["User"] | null; }; /** NoteInput */ NoteInput: { /** * Body * @description The text content of the note. * @example This subscriber upgraded to a paid plan. */ body: string; /** * Model Type * @description The type of object this note is attached to (e.g., 'email', 'subscriber'). * @example email * @enum {string} */ model_type: "automation" | "comment" | "conversation" | "email" | "external_feed" | "invitation" | "socialmention" | "stripe_customer" | "subscriber" | "survey" | "tag" | "webmention"; /** * Model Id * @description The UUID or TypeID of the object this note is attached to. * @example 13121cd6-0dfc-424c-bb12-988b0a32fcb3 */ model_id: string; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: { [key: string]: unknown | undefined; }; }; /** Price */ Price: { /** * Amount * @description The price amount in the smallest currency unit (e.g. cents). */ amount?: number | null; /** * Cadence * @description The billing cadence for this price. * @enum {string} */ cadence: "year" | "month" | "one-time" | "email" | "week"; /** * Currency * @description The three-letter ISO currency code (e.g. 'usd'). */ currency: string; /** * Description * @description An optional human-readable description of the price. */ description?: string | null; /** * Maximum Amount * @description The maximum amount for pay-what-you-want prices. */ maximum_amount?: number | null; /** * Minimum Amount * @description The minimum amount for pay-what-you-want prices. */ minimum_amount?: number | null; /** * Product Id * @description The ID of the Stripe product this price belongs to. */ product_id?: string | null; /** * Style * @description The pricing style: 'fixed', 'pay-what-you-want', or 'usage-based'. * @enum {string} */ style: "pay-what-you-want" | "fixed" | "usage-based"; /** * Suggested Amount * @description The suggested amount for pay-what-you-want prices. */ suggested_amount?: number | null; /** * Id * @description The unique identifier of the price. */ id: string; product?: components["schemas"]["Product"] | null; }; /** Product */ Product: { /** * Id * @description The unique identifier of the product. */ id: string; /** * Product Id * @description The Stripe product ID. */ product_id: string; /** * Name * @description The name of the product. */ name: string; /** * Creation Date * @description The date the product was created in Stripe. */ creation_date: string; /** * Active * @description Whether the product is currently active. */ active: boolean; /** * Default Price * @description The ID of the default price for this product. */ default_price?: string | null; }; /** ErrorMessage[ListPricesErrorCode] */ ErrorMessage_ListPricesErrorCode_: { /** @description The error code. */ code?: components["schemas"]["ListPricesErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * ListPricesErrorCode * @description Represents the type of error that occurred when listing a price. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ ListPricesErrorCode: "paid_subscriptions_uninitialized"; /** * CreatePriceErrorCode * @description Represents the type of error that occurred when listing a price. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ CreatePriceErrorCode: "invalid_amount" | "maximum_amount_too_high" | "minimum_amount_not_less_than_maximum" | "paid_subscriptions_uninitialized" | "product_deleted" | "suggested_amount_out_of_range"; /** ErrorMessage[CreatePriceErrorCode] */ ErrorMessage_CreatePriceErrorCode_: { /** @description The error code. */ code?: components["schemas"]["CreatePriceErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** PriceInput */ PriceInput: { /** * Amount * @description The price amount in the smallest currency unit (e.g. cents). */ amount?: number | null; /** * Cadence * @description The billing cadence for this price. * @enum {string} */ cadence: "year" | "month" | "one-time" | "email" | "week"; /** * Currency * @description The three-letter ISO currency code (e.g. 'usd'). */ currency: string; /** * Description * @description An optional human-readable description of the price. */ description?: string | null; /** * Maximum Amount * @description The maximum amount for pay-what-you-want prices. */ maximum_amount?: number | null; /** * Minimum Amount * @description The minimum amount for pay-what-you-want prices. */ minimum_amount?: number | null; /** * Product Id * @description The ID of the Stripe product this price belongs to. */ product_id?: string | null; /** * Style * @description The pricing style: 'fixed', 'pay-what-you-want', or 'usage-based'. * @enum {string} */ style: "pay-what-you-want" | "fixed" | "usage-based"; /** * Suggested Amount * @description The suggested amount for pay-what-you-want prices. */ suggested_amount?: number | null; }; /** * ArchivePriceErrorCode * @description Represents the type of error that occurred when archiving a price. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ ArchivePriceErrorCode: "default_price"; /** ErrorMessage[ArchivePriceErrorCode] */ ErrorMessage_ArchivePriceErrorCode_: { /** @description The error code. */ code?: components["schemas"]["ArchivePriceErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * PublicEmail * @description Public email schema for email search results. */ PublicEmail: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** Subject */ subject: string; /** Slug */ slug?: string | null; /** Publish Date */ publish_date?: string | null; /** Description */ description: string; /** Absolute Url */ absolute_url: string; }; /** * Segment * @description A saved, reusable audience — a named set of subscriber filters that can * be applied as the audience of an email. */ Segment: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Name * @description A human-readable name for the segment. */ name: string; /** * Description * @description An optional free-form description of the segment, shown alongside its name when picking an email's audience. */ description: string; /** @description The tag- and metadata-based filter rules defining which subscribers belong to this segment. */ filters: components["schemas"]["EmailFilterGroup"]; }; /** ErrorMessage[SegmentErrorCode] */ ErrorMessage_SegmentErrorCode_: { /** @description The error code. */ code?: components["schemas"]["SegmentErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * SegmentErrorCode * @description Error codes returned when creating or updating a segment fails. * @enum {string} */ SegmentErrorCode: "name_already_exists"; /** * SegmentInput * @description Input schema for creating a new segment. */ SegmentInput: { /** * Name * @description A human-readable name for the segment. * @example Executives */ name: string; /** * Description * @description An optional free-form description of the segment, shown alongside its name when picking an email's audience. * @default * @example Leadership at customer accounts */ description?: string; /** @description The tag- and metadata-based filter rules defining which subscribers belong to this segment. */ filters: components["schemas"]["EmailFilterGroup"]; }; /** * SegmentUpdateInput * @description Input schema for updating an existing segment. All fields are optional. */ SegmentUpdateInput: { /** * Name * @description A human-readable name for the segment. * @example Executives */ name?: string | null; /** * Description * @description An optional free-form description of the segment, shown alongside its name when picking an email's audience. * @example Leadership at customer accounts */ description?: string | null; /** @description The tag- and metadata-based filter rules defining which subscribers belong to this segment. */ filters?: components["schemas"]["EmailFilterGroup"] | null; }; /** Snippet */ Snippet: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Identifier * @description A unique, newsletter-scoped slug used to reference the snippet inside email content (e.g. `{{ snippets.footer }}`). Must be unique per newsletter. */ identifier: string; /** * Name * @description A human-readable name for the snippet, shown in the Buttondown UI. */ name: string; /** * Content * @description The body of the snippet, substituted wherever the snippet is referenced. Interpreted according to `mode`. */ content: string; /** @description The editor mode for the snippet, which controls how `content` is rendered: `fancy` (rich text, stored as HTML), `plaintext` (Markdown), or `naked` (raw HTML with no processing). */ mode: components["schemas"]["SnippetMode"]; /** * Reference Count * @description The number of emails that currently reference this snippet. * @default 0 */ reference_count?: number; }; /** SnippetInput */ SnippetInput: { /** * Identifier * @description A unique, newsletter-scoped slug used to reference the snippet inside email content (e.g. `{{ snippets.footer }}`). Must be unique per newsletter. * @example footer */ identifier: string; /** * Name * @description A human-readable name for the snippet, shown in the Buttondown UI. * @example Footer */ name: string; /** * Content * @description The body of the snippet, substituted wherever the snippet is referenced. Interpreted according to `mode`. * @default * @example Thanks for reading! */ content?: string; /** * @description The editor mode for the snippet, which controls how `content` is rendered: `fancy` (rich text, stored as HTML), `plaintext` (Markdown), or `naked` (raw HTML with no processing). * @default fancy * @example fancy */ mode?: components["schemas"]["SnippetMode"]; }; /** SnippetUpdateInput */ SnippetUpdateInput: { /** * Identifier * @description A unique, newsletter-scoped slug used to reference the snippet inside email content (e.g. `{{ snippets.footer }}`). Must be unique per newsletter. * @example footer */ identifier?: string | null; /** * Name * @description A human-readable name for the snippet, shown in the Buttondown UI. * @example Footer */ name?: string | null; /** * Content * @description The body of the snippet, substituted wherever the snippet is referenced. Interpreted according to `mode`. * @example Thanks for reading! */ content?: string | null; /** * @description The editor mode for the snippet, which controls how `content` is rendered: `fancy` (rich text, stored as HTML), `plaintext` (Markdown), or `naked` (raw HTML with no processing). * @example fancy */ mode?: components["schemas"]["SnippetMode"] | null; }; /** * CollisionBehavior * @description An enumeration. * @enum {string} */ CollisionBehavior: "no_op" | "add" | "overwrite" | "fail"; /** ErrorMessage[SubscriberInput.ValidationErrorCode] */ ErrorMessage_ValidationErrorCode_: { /** @description The error code. */ code?: components["schemas"]["SubscriberInputValidationErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** SubscriberInput */ SubscriberInput: { /** * Email Address * Format: email * @description The email address of the subscriber. * @example telemachus@buttondown.email */ email_address: string; /** * Notes * @description Any notes you want to attach to the subscriber. These are not publicly visible. * @default * @example One of our first subscribers! */ notes?: string; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: { [key: string]: unknown | undefined; }; /** * Tags * @description A list of [tag](https://docs.buttondown.com/api-tags-introduction) names applied to the subscriber. Tags that don't already exist will be created, which requires a plan that includes tags (Basic or higher). * @default [] */ tags?: (string)[]; /** * Referrer Url * @description The URL the subscriber was referred from (e.g. where they submitted the subscription form). * @default */ referrer_url?: string; /** * Utm Campaign * @description The UTM campaign the subscriber was attributed to at signup. * @default */ utm_campaign?: string; /** * Utm Medium * @description The UTM medium the subscriber was attributed to at signup. * @default */ utm_medium?: string; /** * Utm Source * @description The UTM source the subscriber was attributed to at signup. * @default */ utm_source?: string; /** * Referring Subscriber Id * @description The ID of the subscriber that referred this subscriber. */ referring_subscriber_id?: string | null; /** * @description The subscriber's lifecycle state. One of: `blocked` (blocked by the newsletter), `churned` (previously paid, subscription ended), `churning` (paying but won't renew), `complained` (marked an email as spam), `gifted` (granted free premium access by the newsletter), `past_due` (paid subscription with an overdue invoice), `paused` (premium subscription paused), `premium` (paying subscriber), `regular` (active free subscriber), `removed` (removed by the newsletter), `trialed` (temporarily enrolled in premium), `unactivated` (pending double opt-in confirmation), `undeliverable` (determined undeliverable), `unpaid` (has not paid yet), `unsubscribed` (voluntarily unsubscribed), `upcoming` (paid subscription that has not started yet). Subscribers with `premium`, `gifted`, `trialed`, or `churning` have access to premium content; use these to distinguish paid from free subscribers. * @example regular */ type?: components["schemas"]["SubscriberType"] | null; /** * Ip Address * @description The IP address of the subscriber. If provided, we will use this IP address to determine the subscriber's location and validate their legitimacy. * @example 127.0.0.1 */ ip_address?: string | null; }; /** ErrorMessage[ListSubscribersErrorCode] */ ErrorMessage_ListSubscribersErrorCode_: { /** @description The error code. */ code?: components["schemas"]["ListSubscribersErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * ListSubscribersErrorCode * @description Represents the type of error that occurred when listing subscribers. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ ListSubscribersErrorCode: "invalid_tag" | "date_invalid" | "invalid_ordering"; /** ErrorMessage[UpdateSubscriberErrorCode] */ ErrorMessage_UpdateSubscriberErrorCode_: { /** @description The error code. */ code?: components["schemas"]["UpdateSubscriberErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * UpdateSubscriberErrorCode * @description Represents the type of error that occurred when updating a subscriber. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ UpdateSubscriberErrorCode: "email_already_exists" | "email_invalid" | "email_has_been_changed_too_many_times" | "firewall_blocked" | "metadata_invalid" | "subscriber_type_invalid" | "tag_invalid"; /** SubscriberUpdateInput */ SubscriberUpdateInput: { /** * Commenting Disabled * @description Whether this subscriber is prevented from commenting. */ commenting_disabled?: boolean | null; /** * Email Address * @description The email address of the subscriber. * @example telemachus@buttondown.email */ email_address?: string | null; /** * Notes * @description Any notes you want to attach to the subscriber. These are not publicly visible. * @example One of our first subscribers! */ notes?: string | null; /** * Metadata * @description A structured key-value blob that you can use to store arbitrary data on the object. Metadata can be nested — you can store objects and arrays within your metadata. (You can [read more about metadata.](https://docs.buttondown.com/metadata)) * @default {} */ metadata?: ({ [key: string]: unknown | undefined; }) | null; /** * Tags * @description A list of [tag](https://docs.buttondown.com/api-tags-introduction) names applied to the subscriber. Tags that don't already exist will be created, which requires a plan that includes tags (Basic or higher). */ tags?: (string)[] | null; /** * Referrer Url * @description The URL the subscriber was referred from (e.g. where they submitted the subscription form). * @default */ referrer_url?: string | null; /** @description The subscriber's lifecycle state. One of: `blocked` (blocked by the newsletter), `churned` (previously paid, subscription ended), `churning` (paying but won't renew), `complained` (marked an email as spam), `gifted` (granted free premium access by the newsletter), `past_due` (paid subscription with an overdue invoice), `paused` (premium subscription paused), `premium` (paying subscriber), `regular` (active free subscriber), `removed` (removed by the newsletter), `trialed` (temporarily enrolled in premium), `unactivated` (pending double opt-in confirmation), `undeliverable` (determined undeliverable), `unpaid` (has not paid yet), `unsubscribed` (voluntarily unsubscribed), `upcoming` (paid subscription that has not started yet). Subscribers with `premium`, `gifted`, `trialed`, or `churning` have access to premium content; use these to distinguish paid from free subscribers. */ type?: components["schemas"]["SubscriberType"] | null; /** * Unsubscription Reason * @description Free-text reason the subscriber unsubscribed, if provided. */ unsubscription_reason?: string | null; /** * Email Which Prompted Unsubscription Id * @description The ID of the email that prompted the subscriber to unsubscribe, if any. */ email_which_prompted_unsubscription_id?: string | null; }; /** * AutomationAttemptError * @description Error codes for skipped or failed automation attempts. * @enum {string} */ AutomationAttemptError: "action_malformed" | "action_malformed__missing_recipient" | "action_malformed__missing_tag_ids" | "action_malformed__missing_url" | "action_malformed__unsupported_action_type" | "EMAIL_ALREADY_SENT" | "EMAIL_DOES_NOT_EXIST" | "EMAIL_EMPTY" | "EMAIL_INVALID_STATUS" | "event_malformed" | "ID_DOES_NOT_EXIST" | "INVALID_SUBSCRIBER" | "arena.misconfigured" | "bluesky.misconfigured" | "misconfigured__discord" | "misconfigured__github" | "misconfigured__linkedin" | "mastodon.misconfigured" | "misconfigured__shopify" | "tumblr.misconfigured" | "twitter.misconfigured" | "NEWSLETTER_DISABLED" | "not_found" | "rate_limit" | "unauthorized" | "stripe_subscription_does_not_exist" | "SUBSCRIBER_INVALID" | "TAG_ALREADY_EXISTS" | "unexpected_error"; /** AutomationForSubscriber */ AutomationForSubscriber: { /** * Id * @description The ID of this automation attempt. */ id: string; /** * Name * @description The name of the automation that was triggered. */ name: string; /** @description The status of the automation attempt (e.g. `pending`, `completed`, `skipped`). */ status: components["schemas"]["AutomationAttemptStatus"]; /** * Automation Id * @description The ID of the automation that was triggered. */ automation_id: string; /** * Execution Date * Format: date-time * @description When the automation attempt is scheduled to execute (or executed). */ execution_date: string; /** * Actions * @description The resolved actions the automation will take for this subscriber. */ actions: ({ [key: string]: unknown | undefined; })[]; /** @description Code for why the attempt was skipped or failed; null when it succeeded, hasn't run yet, or was skipped by hand. */ error?: components["schemas"]["AutomationAttemptError"] | null; }; /** ErrorMessage[UpdateAutomationAttemptErrorCode] */ ErrorMessage_UpdateAutomationAttemptErrorCode_: { /** @description The error code. */ code?: components["schemas"]["UpdateAutomationAttemptErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * UpdateAutomationAttemptErrorCode * @description Represents the type of error that occurred when updating an automation attempt. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ UpdateAutomationAttemptErrorCode: "automation_attempt_not_found" | "invalid_status"; /** AutomationAttemptUpdateInput */ AutomationAttemptUpdateInput: { /** * Status * @description The status to set for the automation attempt. Only 'skipped' is allowed. * @constant */ status: "skipped"; }; /** Response */ Response: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Answer * @description The answer given to the survey. */ answer: string; /** * Text * @description Optional text included by the subscriber with the response. Subscribers are only prompted to supply a text response if the `is_freeform_response_enabled` field is set to `true` on the survey. */ text: string; /** * Survey Id * @description The ID of the survey this response was submitted to. */ survey_id: string; /** * Subscriber Id * @description The ID of the subscriber who submitted this response. */ subscriber_id: string; /** * Email Id * @description The ID of the email where this response was submitted, if any. */ email_id?: string | null; /** * Automation Id * @description The ID of the automation where this response was submitted, if any. */ automation_id?: string | null; /** * Source * @description For responses not tied to an email or automation, the origin the survey was answered from (e.g. a `transactional:*` template). Null otherwise. */ source?: string | null; subscriber?: components["schemas"]["Subscriber"] | null; survey?: components["schemas"]["Survey"] | null; email?: components["schemas"]["Email"] | null; automation?: components["schemas"]["Automation"] | null; }; /** * Survey * @description Surveys let you ask your subscribers a question—and personalize future * emails based on their answers. You can attach a survey to any email and read * back the responses via the API. */ Survey: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Identifier * @description A newsletter-scoped slug used to reference this survey when embedding it in emails. */ identifier: string; /** * Question * @description The survey question shown to subscribers. */ question: string; /** * Response Count * @description The total number of responses this survey has received. */ response_count: number; /** * Answers * @description The list of pre-defined answer choices. Order is preserved unless `randomize_answers` is true. */ answers: (string)[]; /** * Notes * @description Internal notes about the survey. Not shown to subscribers. */ notes: string; /** * Randomize Answers * @description If true, the order of `answers` is shuffled each time the survey is rendered. */ randomize_answers: boolean; /** @description How often a given subscriber can respond — e.g. `once` (single response per subscriber) or `unlimited`. */ response_cadence: components["schemas"]["SurveyResponseCadence"]; /** @description The lifecycle status of the survey (e.g. `active`, `archived`). */ status: components["schemas"]["SurveyStatus"]; /** * Is Freeform Response Enabled * @description If true, subscribers can provide a freeform text response in addition to (or instead of) picking from `answers`. */ is_freeform_response_enabled: boolean; /** @description The UI control used to collect responses (e.g. `radio`, `checkbox`). */ input_type: components["schemas"]["SurveyInputType"]; }; /** * CreateSurveyResponseErrorCode * @description An enumeration. * @enum {string} */ CreateSurveyResponseErrorCode: "invalid_input"; /** ErrorMessage[CreateSurveyResponseErrorCode] */ ErrorMessage_CreateSurveyResponseErrorCode_: { /** @description The error code. */ code?: components["schemas"]["CreateSurveyResponseErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** ResponseInput */ ResponseInput: { /** * Subscriber Id * @description The subscriber who submitted the response. * @example [ * "sub_01jv2m9q8r7s6t5w4x3y2z1abc" * ] */ subscriber_id: string; /** * Survey Id * @description The survey being answered. * @example [ * "srv_01jv2m9q8r7s6t5w4x3y2z1abc" * ] */ survey_id: string; /** * Email Id * @description The email ID, automation ID, or arbitrary source string where the survey was answered. * @example em_01jv2m9q8r7s6t5w4x3y2z1abc */ email_id: string; /** * Answer * @description The 1-based index of the selected answer in the survey's `answers` list. * @example 1 */ answer: number; }; /** ResponseUpdateInput */ ResponseUpdateInput: { /** * Text * @description The text response to update. Only applicable if the survey has freeform responses enabled. */ text?: string | null; }; /** * CreateSurveyErrorCode * @description Represents the type of error that occurred when creating a survey. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ CreateSurveyErrorCode: "identifier_already_exists"; /** ErrorMessage[CreateSurveyErrorCode] */ ErrorMessage_CreateSurveyErrorCode_: { /** @description The error code. */ code?: components["schemas"]["CreateSurveyErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** SurveyInput */ SurveyInput: { /** * Identifier * @description A newsletter-scoped slug used to reference this survey when embedding it in emails. * @example color */ identifier: string; /** * Question * @description The survey question shown to subscribers. * @example What's your favorite color? */ question: string; /** * Answers * @description The list of pre-defined answer choices. Order is preserved unless `randomize_answers` is true. * @example [ * "Red", * "Green", * "Blue" * ] */ answers: (string)[]; /** * Notes * @description Internal notes about the survey. Not shown to subscribers. * @default * @example */ notes?: string; /** * @description How often a given subscriber can respond — e.g. `once` (single response per subscriber) or `unlimited`. * @default once * @example once */ response_cadence?: components["schemas"]["SurveyResponseCadence"]; /** * Is Freeform Response Enabled * @description If true, subscribers can provide a freeform text response in addition to (or instead of) picking from `answers`. * @default false * @example false */ is_freeform_response_enabled?: boolean; /** * @description The UI control used to collect responses (e.g. `radio`, `checkbox`). * @default radio * @example radio */ input_type?: components["schemas"]["SurveyInputType"]; /** * Randomize Answers * @description If true, the order of `answers` is shuffled each time the survey is rendered. * @default false * @example false */ randomize_answers?: boolean; }; /** ErrorMessage[UpdateSurveyErrorCode] */ ErrorMessage_UpdateSurveyErrorCode_: { /** @description The error code. */ code?: components["schemas"]["UpdateSurveyErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * UpdateSurveyErrorCode * @description An enumeration. * @enum {string} */ UpdateSurveyErrorCode: "survey_has_responses"; /** SurveyUpdateInput */ SurveyUpdateInput: { /** * Notes * @description Internal notes about the survey. Not shown to subscribers. */ notes?: string | null; /** * Answers * @description The list of pre-defined answer choices. Order is preserved unless `randomize_answers` is true. * @example [ * "Red", * "Green", * "Blue" * ] */ answers?: (string)[] | null; /** * @description How often a given subscriber can respond — e.g. `once` (single response per subscriber) or `unlimited`. * @example once */ response_cadence?: components["schemas"]["SurveyResponseCadence"] | null; /** @description The lifecycle status of the survey (e.g. `active`, `archived`). */ status?: components["schemas"]["SurveyStatus"] | null; /** * Is Freeform Response Enabled * @description If true, subscribers can provide a freeform text response in addition to (or instead of) picking from `answers`. * @default false */ is_freeform_response_enabled?: boolean | null; /** @description The UI control used to collect responses (e.g. `radio`, `checkbox`). */ input_type?: components["schemas"]["SurveyInputType"] | null; /** * Randomize Answers * @description If true, the order of `answers` is shuffled each time the survey is rendered. */ randomize_answers?: boolean | null; }; /** * Tag * @description Tags are a way to organize your subscribers. You can create, update, and * delete tags via the API. You can also list all tags for a given newsletter. * * Tags don't have any strict functionality on their own, but you can send emails * to subscribers with a given tag (or to all subscribers _without_ a given tag.) */ Tag: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Name * @description The name of the tag. */ name: string; /** * Color * @description The hex color code associated with the tag. */ color: string; /** * Description * @description An internal description of the tag, only visible to the newsletter author. */ description?: string | null; /** * Public Description * @description A public-facing description of the tag, visible to subscribers in the subscriber portal. */ public_description?: string | null; /** * Subscriber Editable * @description If true, subscribers can add or remove this tag from their own profile via the subscriber portal. */ subscriber_editable: boolean; /** * Secondary Id * @description The secondary ID of the tag, used as a human-readable numeric identifier. */ secondary_id: number; }; /** ErrorMessage[TagErrorCode] */ ErrorMessage_TagErrorCode_: { /** @description The error code. */ code?: components["schemas"]["TagErrorCode"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * TagErrorCode * @description Error codes returned when creating or updating a tag fails. * @enum {string} */ TagErrorCode: "feature_disabled" | "name_already_exists" | "name_blank" | "name_invalid" | "name_too_long"; /** * TagInput * @description Input schema for creating a new tag. */ TagInput: { /** * Name * @description The name of the tag. * @example VIP */ name: string; /** * Color * @description The hex color code associated with the tag. * @example #FFD700 */ color: string; /** * Description * @description An internal description of the tag, only visible to the newsletter author. */ description?: string | null; /** * Public Description * @description A public-facing description of the tag, visible to subscribers in the subscriber portal. */ public_description?: string | null; /** * Subscriber Editable * @description If true, subscribers can add or remove this tag from their own profile via the subscriber portal. * @default false * @example false */ subscriber_editable?: boolean; }; /** * TagUpdateInput * @description Input schema for updating an existing tag. All fields are optional. */ TagUpdateInput: { /** * Name * @description The name of the tag. * @example VIP */ name?: string | null; /** * Color * @description The hex color code associated with the tag. * @example #FFD700 */ color?: string | null; /** * Description * @description An internal description of the tag, only visible to the newsletter author. */ description?: string | null; /** * Public Description * @description A public-facing description of the tag, visible to subscribers in the subscriber portal. */ public_description?: string | null; /** * Secondary Id * @description The secondary ID of the tag, used as a human-readable numeric identifier. */ secondary_id?: number | null; /** * Subscriber Editable * @description If true, subscribers can add or remove this tag from their own profile via the subscriber portal. */ subscriber_editable?: boolean | null; }; /** * TagAnalytics * @description Analytics data associated with a given tag. */ TagAnalytics: { /** * Created Subscribers * @description The number of subscribers who have been created with this tag. */ created_subscribers: number; /** * Click Rate * @description The click rate of emails sent to subscribers with this tag. */ click_rate: number; /** * Open Rate * @description The open rate of emails sent to subscribers with this tag. */ open_rate: number; }; /** ErrorMessage[Failure] */ ErrorMessage_Failure_: { /** @description The error code. */ code?: components["schemas"]["Failure"]; /** * Detail * @description A human-readable description of the error. */ detail: string; /** * Metadata * @description Additional context about the error. When present, a `documentation_url` key links to docs explaining how to resolve it. * @default {} */ metadata?: { [key: string]: string | undefined; }; }; /** * Failure * @description An enumeration. * @enum {string} */ Failure: "email_already_exists"; /** UserInput */ UserInput: { permissions: components["schemas"]["Permissions"]; /** * Email Address * @description The email address of the user. */ email_address: string; }; /** UserUpdateInput */ UserUpdateInput: { permissions: components["schemas"]["Permissions"]; }; /** * Webhook * @description Webhooks are used to notify external services of events that occur in the * system. For example, when a newsletter is sent, a webhook can be used to * notify an external service that the newsletter has been sent. */ Webhook: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** @description Whether the webhook is enabled or not. */ status: components["schemas"]["WebhookStatus"]; /** * Event Types * @description The types of event for which the webhook will be triggered. */ event_types: (components["schemas"]["ExternalEventType"])[]; /** * Url * @description The URL to which the webhook will send POST requests. */ url: string; /** * Description * @description An optional description of the webhook, for reference. * @default */ description?: string; /** * Signing Key * @description Optional HMAC signing key for webhook verification. When set, webhook requests will include an X-Buttondown-Signature header with sha256=. * @default */ signing_key?: string; }; /** * WebhookStatus * @description The status of a webhook. * @enum {string} */ WebhookStatus: "enabled" | "disabled"; /** WebhookInput */ WebhookInput: { /** * @description Whether the webhook is enabled or not. * @default enabled * @example [ * "enabled" * ] */ status?: components["schemas"]["WebhookStatus"]; /** * Event Types * @description The types of event for which the webhook will be triggered. * @example [ * [ * "email.created", * "email.sent" * ] * ] */ event_types: (components["schemas"]["ExternalEventType"])[]; /** * Url * Format: uri * @description The URL to which the webhook will send POST requests. * @example [ * "https://my.api/webhook" * ] */ url: string; /** * Description * @description An optional description of the webhook, for reference. * @default * @example [ * "Trigger when an email is created to notify in Slack." * ] */ description?: string; /** * Signing Key * @description Optional HMAC signing key for webhook verification. When set, webhook requests will include an X-Buttondown-Signature header with sha256=. * @default * @example [ * "" * ] */ signing_key?: string; }; /** * WebhookAttemptStatus * @description An enumeration. * @enum {string} */ WebhookAttemptStatus: "unattempted" | "successful" | "failed"; /** WebhookAttemptOutput */ WebhookAttemptOutput: { /** * Id * @description A unique TypeID associated with the object. */ id: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Status * @description The status of the webhook attempt. * @example [ * "successful" * ] */ status: string; /** * Event Type * @description The type of the event that triggered the attempt. * @example [ * "subscriber.created" * ] */ event_type?: string | null; /** * Error Message * @description The failure reason, if the attempt failed. Includes the response status code and a snippet of the response body when the endpoint returned a non-2xx response. * @example [ * "WebhookFailedError: Webhook returned 401: invalid signature" * ] */ error_message?: string | null; /** * Attempt Count * @description The number of times this attempt has been retried. * @default 0 * @example [ * 1 * ] */ attempt_count?: number; /** * Completion Date * @description When the attempt finished, if it has. * @example [ * "2026-04-27T05:25:19.819Z" * ] */ completion_date?: string | null; /** * Duration Ms * @description How long the HTTP request took, in milliseconds. * @example [ * 412 * ] */ duration_ms?: number | null; }; /** * ExcludableField * @description Represents a field on the Email model that can be excluded from * the API response. * @enum {string} */ EmailExcludableField: "body"; /** * Status * @description An enumeration. * @enum {string} */ AdvertisingSKUStatus: "active" | "inactive"; /** * Status * @description An enumeration. * @enum {string} */ AdvertisingSlotStatus: "expired" | "executed" | "finalized" | "held" | "open" | "sold"; /** * Status * @description An enumeration. * @enum {string} */ CommentStatus: "pending" | "active" | "spammy"; /** * Source * @description Represents the original provenance of an email. This value is not exposed * to subscribers, but does determine some behavior of the email (e.g. whether * or not analytics can be calculated.) * @enum {string} */ EmailSource: "api" | "import" | "app" | "external_feed" | "smtp"; /** * Status * @description Represents the state of an email. * * No action is required to move from one state or another; Buttondown * internally handles the transitions, and exposing the status is for * observability purposes only. * @enum {string} */ EmailStatus: "draft" | "managed_by_rss" | "about_to_send" | "scheduled" | "in_flight" | "paused" | "deleted" | "errored" | "sent" | "partially_sent" | "imported" | "throttled" | "resending" | "transactional" | "suppressed"; /** * Type * @description The legacy single-axis representation of an email's audience and * archive visibility. No longer stored: `filters` owns the audience * axis and `archival_mode` owns the archive axis, and the deprecated * API field is derived from those (see `email_type` below). * @enum {string} */ EmailType: "public" | "private" | "premium" | "free" | "churned" | "archival"; /** * Source * @description Represents the original provenance of a subscriber. This value is not exposed * to subscribers; it's only used for internal tracking purposes and governs some * of the behavior of the subscriber (i.e. whether or not to require double * opt-in.) * @enum {string} */ SubscriberSource: "admin" | "api" | "carrd" | "comment" | "embedded_form" | "form" | "import" | "memberful" | "netlify" | "organic" | "patreon" | "shopify" | "stripe" | "user" | "zapier"; /** * Type * @description Represents the state of a subscriber and what emails they * should or should not be receiving. This type is meant to be fully expressive * so as to consolidate the logic of determining what emails a subscriber should * receive into a single place. * * Note that the only types that can be set programmatically are REGULAR, UNSUBSCRIBED, * GIFTED and UNPAID. All other types are meant to be user-visible and cannot * be set programmatically. * @enum {string} */ SubscriberType: "blocked" | "complained" | "churning" | "churned" | "gifted" | "unactivated" | "unpaid" | "undeliverable" | "premium" | "past_due" | "paused" | "regular" | "removed" | "trialed" | "unsubscribed" | "upcoming"; /** * Status * @description An enumeration. * @enum {string} */ AutomationStatus: "active" | "inactive"; /** * Type * @description Various types of events that are recorded by Buttondown, both in terms of exogenous systems * like Stripe and Memberful, and endogenous ones like email opens and clicks. (In general, if anything * important ever happens that could be relevant to your newsletter, we have an event type for it!) * * These event types power lots of things within Buttondown. They're used to trigger automations, webhooks, * and analytics. * * (Note that the `/v1/events` API speaks an older, shorter vocabulary for subscriber engagement — * `clicked` rather than `subscriber.clicked` — a relic of a previous events system. Each of those * names maps onto one of the `subscriber.*` types below.) * * In general, our event namespacing tries to hew to the following pattern: * * `..` * * When wondering which object we are referring to, default to the _more granular_ object. * * For instance, an email being sent to a subscriber is `subscriber.delivered`, not `email.sent`. * @enum {string} */ ExternalEventType: "advertising_slot.inquiry" | "advertising_slot.purchased" | "automation.invoked" | "date.day.started" | "date.month.started" | "date.week.started" | "date.year.started" | "bigcommerce.customer.created" | "bigcommerce.customer.updated" | "bigcommerce.order.created" | "bigcommerce.order.updated" | "email.created" | "email.deleted" | "email.send.started" | "email.sent" | "email.status.changed" | "email.updated" | "external_feed_item.created" | "export.completed" | "export.created" | "export.failed" | "firewall.blocked" | "mention.created" | "memberful.member.updated" | "memberful.subscription.created" | "memberful.subscription.deleted" | "note.created" | "note.deleted" | "patreon.member.updated" | "patreon.membership.created" | "patreon.membership.deleted" | "shopify.customer.created" | "shopify.customer.updated" | "social_mention.created" | "stripe.checkout.session.completed" | "stripe.customer.updated" | "stripe.invoice.upcoming" | "stripe.subscription.activated" | "stripe.subscription.churning" | "stripe.subscription.deactivated" | "subscriber.activation_bounced" | "subscriber.activation_clicked" | "subscriber.activation_complained" | "subscriber.activation_deferred" | "subscriber.activation_delivered" | "subscriber.activation_opened" | "subscriber.activation_rejected" | "subscriber.bounced" | "subscriber.changed_email" | "subscriber.churned" | "subscriber.clicked" | "subscriber.commented" | "subscriber.complained" | "subscriber.confirmed" | "subscriber.created" | "subscriber.deferred" | "subscriber.deleted" | "subscriber.delivered" | "subscriber.dropped_from_import" | "subscriber.imported" | "subscriber.opened" | "subscriber.paid" | "subscriber.paused" | "subscriber.resumed" | "subscriber.referred" | "subscriber.referred.paid" | "subscriber.rejected" | "subscriber.replied" | "subscriber.sent" | "subscriber.responded_to_survey" | "subscriber.tags.changed" | "subscriber.trial_ended" | "subscriber.trial_started" | "subscriber.type.changed" | "subscriber.unsubscribed" | "subscriber.updated" | "subscriber.viewed_checkout_page" | "survey.cleared_responses" | "survey.created" | "survey.deleted" | "survey.updated" | "form.created" | "form.deleted" | "form.updated"; /** * Status * @description The status of a given item (meaning a distinct URL) within an RSS feed. * @enum {string} */ ExternalFeedItemStatus: "unprocessed" | "irrelevant" | "errored" | "skipped" | "queued" | "processed"; /** * Status * @description An enumeration. * @enum {string} */ SurveyStatus: "active" | "inactive"; /** * ActionType * @description The action that is triggered when the automation is successfully run. * @enum {string} */ AutomationActionType: "add_tags" | "remove_tags" | "send_email" | "add_metadata" | "remove_metadata" | "change_email_address" | "gift_premium_subscription" | "ungift_premium_subscription" | "send_discord_invitation" | "send_github_invitation" | "create_subscriber" | "unsubscribe_subscriber" | "shopify_unsubscribe" | "shopify_resubscribe" | "shopify_set_tags" | "shopify_create_customer" | "send_notification" | "forward_reply" | "create_arena_post" | "create_bluesky_post" | "create_linkedin_post" | "create_mastodon_post" | "create_tumblr_post" | "create_twitter_post" | "create_export" | "create_gift_subscriber" | "send_post_request" | "send_confirmation_reminder" | "update_email_type"; /** * AnnouncementBarVisibility * @description An enumeration. * @enum {string} */ NewsletterAnnouncementBarVisibility: "disabled" | "everyone" | "free_only" | "logged_out_only" | "paid_only"; /** * ArchiveTheme * @description An enumeration. * @enum {string} */ NewsletterArchiveTheme: "classic" | "modern" | "arbus" | "lovelace" | "myrna"; /** * AuditingMode * @description An enumeration. * @enum {string} */ NewsletterAuditingMode: "disabled" | "enabled" | "aggressive"; /** * Behavior * @description An enumeration. * @enum {string} */ ExternalFeedAutomationBehavior: "draft" | "emails"; /** * Cadence * @description An enumeration. * @enum {string} */ ExternalFeedAutomationCadence: "every" | "daily" | "weekly" | "monthly"; /** * Collection * @description A group of data that can be exported in an export. * @enum {string} */ ExportCollection: "subscribers" | "emails" | "events" | "referrals" | "surveys" | "comments" | "requests" | "mentions" | "conversations" | "images" | "stripe_subscriptions" | "stripe_products" | "stripe_customers" | "stripe_prices" | "stripe_charges"; /** * CommentingMode * @description Governs who can comment on this email. * * This enum replaces the `is_comments_disabled` field, which has been deprecated. (Also note that this field may be superseded by newsletter-level settings; for instance, "enabled" is an invalid and inert value if the newsletter itself has comments disabled.) * @enum {string} */ EmailCommentingMode: "disabled" | "enabled" | "enabled_for_paid_subscribers"; /** * EmailTemplate * @description Represents the template of an email. * * Each template has a different layout/style; you can view screenshots and examples [in the docs](https://docs.buttondown.com/customizing-email-design#buttondowns-default-templates). * @enum {string} */ NewsletterEmailTemplate: "classic" | "custom" | "modern" | "plaintext" | "naked"; /** * Format * @description An enumeration. * @enum {string} */ ExportFormat: "csv" | "json"; /** * InputType * @description An enumeration. * @enum {string} */ SurveyInputType: "radio" | "checkbox" | "text"; /** * Locale * @description An enumeration. * @enum {string} */ NewsletterLocale: "cs-CZ" | "nl-NL" | "en-AU" | "en-CA" | "en-GB" | "en" | "et" | "fi-FI" | "fr" | "de" | "it" | "ja-JP" | "ne" | "nb-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru" | "es" | "tr" | "sv-SE"; /** * Mode * @description An enumeration. * @enum {string} */ SnippetMode: "fancy" | "naked" | "plaintext"; /** * ResponseCadence * @description An enumeration. * @enum {string} */ SurveyResponseCadence: "once" | "once_per_email"; /** * SuppressionReason * @description Represents the reason an email was suppressed. * @enum {string} */ EmailSuppressionReason: "law_enforcement" | "internal_auditing"; /** * UndeliverabilityReason * @description The reason Buttondown has marked the subscriber as undeliverable. * Undeliverable subscribers are not sent emails, and may be periodically removed from the system (or restored, if the reason is no longer valid.) * * These reasons are grouped into three categories: * - PermanentFailure ("Failed (recipient)"): Address-based issues where the recipient is truly unreachable. * Includes: HARD_BOUNCE * - MessageFailure ("Failed (message)"): Message/sender problems where future emails may succeed. * Includes: ACCESS_DENIED, AUTHENTICATION_ISSUE, DELIVERY_EXPIRED, DOMAIN_BLOCKED, EMAIL_BLOCKED, * IP_BLOCKED, ON_ESP_DENYLIST, OUT_OF_STORAGE, PROBLEMATIC_URL, SPAM * - Deferral (not shown to customers): Transient delivery issues that will be retried. * Includes: RATE_LIMITED, TRANSIENT * @enum {string} */ SubscriberUndeliverabilityReason: "access_denied" | "authentication_issue" | "delivery_expired" | "domain_blocked" | "email_blocked" | "hard_bounce" | "ip_blocked" | "ip_undeliverable" | "malformed" | "on_esp_denylist" | "other" | "out_of_storage" | "problematic_url" | "rate_limited" | "spam" | "transient" | "disabled" | "does_not_exist" | "spf_failed" | "unreachable"; /** Page[AdvertisingUnit] */ AdvertisingUnitPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["AdvertisingUnit"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[AdvertisingSlot] */ AdvertisingSlotPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["AdvertisingSlot"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Attachment] */ AttachmentPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Attachment"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Automation] */ AutomationPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Automation"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Book] */ BookPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Book"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Comment] */ CommentPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Comment"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[StripeCoupon] */ StripeCouponPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["StripeCoupon"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Email] */ EmailPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Email"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[History] */ HistoryPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["History"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[EmailEvent] */ EmailEventPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["EmailEvent"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Export] */ ExportPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Export"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[ExternalFeed] */ ExternalFeedPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["ExternalFeed"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[ExternalFeedItem] */ ExternalFeedItemPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["ExternalFeedItem"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Form] */ FormPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Form"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Image] */ ImagePage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Image"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Import] */ ImportPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Import"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Newsletter] */ NewsletterPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Newsletter"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Note] */ NotePage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Note"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Price] */ PricePage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Price"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[PublicEmail] */ PublicEmailPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["PublicEmail"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Segment] */ SegmentPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Segment"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Snippet] */ SnippetPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Snippet"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Subscriber] */ SubscriberPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Subscriber"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[AutomationForSubscriber] */ AutomationForSubscriberPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["AutomationForSubscriber"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[UnexpandableStripeSubscription] */ StripeSubscriptionPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["StripeSubscription"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Response] */ ResponsePage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Response"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Survey] */ SurveyPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Survey"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Tag] */ TagPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Tag"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[User] */ UserPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["User"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[Webhook] */ WebhookPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["Webhook"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** Page[WebhookAttemptOutput] */ WebhookAttemptOutputPage: { /** * Results * @description The list of results for this page. */ results: (components["schemas"]["WebhookAttemptOutput"])[]; /** * Next * @description The URL to the next page of results, if any. */ next?: string | null; /** * Previous * @description The URL to the previous page of results, if any. */ previous?: string | null; /** * Count * @description The total number of results across all pages. */ count: number; }; /** StripeSubscription */ StripeSubscription: { /** * Subscription Id * @description The Stripe subscription ID (e.g. `sub_...`). */ subscription_id: string; /** * Url * @description A deep link to the subscription in the Stripe dashboard. */ url: string; /** * Creation Date * Format: date-time * @description The date and time at which the object was first created. */ creation_date: string; /** * Ending Date * @description When the subscription ended, or null if still active. */ ending_date?: string | null; /** * Amount * @description The subscription amount in the smallest currency unit (e.g. cents). Null for tiered-pricing plans. */ amount?: number | null; /** * Currency * @description The three-letter ISO currency code (e.g. `usd`). */ currency: string; /** * Cadence * @description The billing cadence (e.g. `month`, `year`). */ cadence: string; /** * Status * @description The Stripe subscription status (e.g. `active`, `canceled`, `past_due`). */ status: string; /** * Application Fee Percent * @description The application fee percent for the subscription. */ application_fee_percent?: number | null; /** * Source * @description Buttondown attempts to detect the source of a subscription, but this is not always possible. */ source?: ("substack" | "buttondown") | null; /** * Product * @description The name of the product which the subscriber is subscribed to. (You can override this by setting the `buttondown_template_facing_id` metadata on the product in Stripe.) */ product?: string | null; }; /** * ValidationErrorCode * @description Represents the type of error that occurred when validating subscriber input. * * Human-readable error messages are provided in the `detail` field of the response; * these values are meant to be parseable by code or client logic. * @enum {string} */ SubscriberInputValidationErrorCode: "currency_mismatch" | "email_already_exists" | "email_blocked" | "email_empty" | "email_invalid" | "invalid_input" | "ip_address_spammy" | "metadata_invalid" | "newsletter_not_accepting_subscribers" | "payment_failed" | "promo_code_invalid" | "rate_limited" | "subscriber_already_exists" | "subscriber_already_premium" | "subscriber_blocked" | "subscriber_id_invalid" | "subscriber_suppressed" | "tag_invalid"; /** * APIRequestSource * @description An enumeration. * @enum {string} */ APIRequestSource: "api" | "app" | "axios" | "carrd" | "claude" | "cli" | "curl" | "cursor" | "gemini" | "go" | "llm" | "make" | "netlify" | "node" | "openai" | "perplexity" | "pipedream" | "powershell" | "python" | "ruby" | "windsurf" | "wordpress" | "zapier"; /** * AutomationAttemptStatus * @description An enumeration. * @enum {string} */ AutomationAttemptStatus: "unprocessed" | "processed" | "failed" | "pending" | "skipped"; /** * BulkActionStatus * @description Represents the status of a bulk action. * * No action is required to move from one state or another; Buttondown * internally handles the transitions, and exposing the status is for * observability purposes only. * @enum {string} */ BulkActionStatus: "not_started" | "in_progress" | "processed" | "failed"; /** * BulkActionType * @description Represents the action being performed on a bulk of objects. * * (Not to be coy, but these names should be self-explanatory.) * @enum {string} */ BulkActionType: "add_notes" | "apply_tags" | "apply_metadata" | "rename_metadata" | "ban_subscribers" | "delete_subscribers" | "gift_subscribers" | "ungift_subscribers" | "reactivate_subscribers" | "mark_subscribers_as_not_spammy" | "resubscribe_subscribers" | "send_emails" | "unban_subscribers" | "send_reminders" | "unsubscribe_subscribers" | "delete_attachments" | "delete_emails" | "delete_images" | "update_email_types" | "update_archival_modes" | "update_commenting_modes" | "mark_inbox_items_read" | "delete_inbox_items" | "change_tags_colors" | "delete_comments" | "delete_surveys" | "delete_survey_responses" | "delete_tags" | "mark_comments_as_active" | "mark_comments_as_spammy" | "replay_events" | "update_survey_statuses" | "cancel_stripe_subscriptions" | "modify_stripe_subscriptions" | "pause_stripe_subscriptions"; /** * ExportStatus * @description Represents the status of an export. * * No action is required to move from one state or another; Buttondown * internally handles the transitions, and exposing the status is for * observability purposes only. * @enum {string} */ ExportStatus: "error" | "in_progress" | "not_started" | "ready"; /** * ExternalFeedAutomationStatus * @description Represents the status of the automation, and whether or not it is active. Inactive automations will not be processed. Deleted automations will not be processed. * @enum {string} */ ExternalFeedAutomationStatus: "active" | "failing" | "inactive" | "deleted"; /** * FormStatus * @description An enumeration. * @enum {string} */ FormStatus: "active" | "inactive"; /** * InvitationStatus * @description An enumeration. * @enum {string} */ InvitationStatus: "pending" | "accepted" | "declined" | "revoked" | "owner"; /** * WebhookEvent * @description The payload Buttondown delivers to a configured webhook URL when a subscribed event fires. */ WebhookEvent: { /** * Id * @description The unique TypeID of the event that triggered this delivery. * @example ext_evt_00000000000000000000000000 */ id: string; /** @description The type of event that triggered this delivery. */ event_type: components["schemas"]["ExternalEventType"]; /** * Data * @description Event-specific metadata. The shape varies by `event_type`. Accounts with more than one newsletter also receive a `newsletter` ID to disambiguate which one the event belongs to. */ data: { [key: string]: unknown | undefined; }; }; }; responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } export type external = Record; export interface operations { /** * Get Account * @description Retrieve the account associated with the current API key */ get_account: { responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Account"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Advertising Units * @description List all advertising units */ list_advertising_units: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["AdvertisingUnitPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Advertising Unit * @description Create a new advertising unit */ create_advertising_unit: { requestBody: { content: { "application/json": components["schemas"]["AdvertisingUnitInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["AdvertisingUnit"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Advertising Unit * @description Delete an advertising unit */ delete_advertising_unit: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Advertising Unit * @description Update an advertising unit's properties */ update_advertising_unit: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["AdvertisingUnitUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["AdvertisingUnit"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Advertising Slots * @description List all advertising slots */ list_advertising_slots: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["AdvertisingSlotPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Advertising Slot * @description Update an advertising slot's sponsor content */ update_advertising_slot: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["AdvertisingSlotUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["AdvertisingSlot"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Api Request * @description Retrieve a specific API request by its ID */ retrieve_api_request: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["APIRequestDetail"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Api Requests * @description List all API requests */ list_api_requests: { parameters: { query: { /** @description If provided, only return requests made with the given [API key](https://docs.buttondown.com/api-authentication) ID(s). */ api_key_id?: (string)[]; /** * @description If provided, only return requests created after the given datetime. * @example 2024-01-01T00:00:00Z */ creation_date__gt?: string; /** * @description If provided, only return requests created before the given datetime. * @example 2024-12-31T23:59:59Z */ creation_date__lt?: string; /** @description If provided, only return requests created on or before the given date. */ date__end?: string; /** @description If provided, only return requests created on or after the given date. */ date__start?: string; /** * @description The maximum number of results to return per page. * @example 100 */ limit?: number; /** * @description If provided, only return requests with the given HTTP method(s). * @example [ * "GET", * "POST" * ] */ method?: (string)[]; /** @description If provided, only return requests matching the given API path(s). */ path?: (string)[]; /** * @description If provided, only return requests from the given source(s). * @example [ * "api" * ] */ source?: (components["schemas"]["APIRequestSource"])[]; /** * @description If provided, only return requests with the given HTTP status code(s). * @example [ * "200", * "404" * ] */ status_code?: (string)[]; /** @description If provided, only return requests made with the given [API version](https://docs.buttondown.com/api-versioning)(s). */ version?: ("2024-07-01" | "2024-08-01" | "2024-08-15" | "2024-09-30" | "2024-12-30" | "2025-01-02" | "2025-05-19" | "2025-06-01" | "2026-01-01" | "2026-04-01")[]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["APIRequestList"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Attachments * @description List all attachments */ list_attachments: { parameters: { query: { /** * @description If provided, only return attachments matching the given IDs. * @example [ * "att_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ ids?: (string)[]; /** @description The number of results per page. */ page_size?: number; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["AttachmentPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Attachment * @description Upload a new attachment */ create_attachment: { requestBody: { content: { "multipart/form-data": { /** * File * Format: binary */ file: string; /** Name */ name?: string | null; }; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Attachment"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Attachment * @description Retrieve an attachment */ retrieve_attachment: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Attachment"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Attachment * @description Delete an attachment */ delete_attachment: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Automations * @description List all automations */ list_automations: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["AutomationPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Automation * @description Create a new automation */ create_automation: { requestBody: { content: { "application/json": components["schemas"]["AutomationInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Automation"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_AutomationCreationErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Automation * @description Retrieve a specific automation by its ID */ retrieve_automation: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Automation"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Automation * @description Delete an automation */ delete_automation: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Automation * @description Update an automation's properties */ update_automation: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["AutomationUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Automation"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Invoke Automation * @description Manually trigger an automation */ invoke_automation: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: never; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Automation Analytics * @description Retrieve analytics data for an automation */ retrieve_automation_analytics: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Analytics"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Books * @description List all books for the authenticated newsletter */ list_books: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["BookPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Book * @description Create a new book */ create_book: { requestBody: { content: { "application/json": components["schemas"]["BookInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Book"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Book * @description Retrieve a specific book by its ID */ retrieve_book: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Book"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Book * @description Delete a book */ delete_book: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Book * @description Update a book's properties */ update_book: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["BookUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Book"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Bulk Action * @description Create a new bulk action */ create_bulk_action: { requestBody: { content: { "application/json": components["schemas"]["BulkActionInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["BulkAction"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Bulk Action * @description Retrieve the status of a bulk action */ retrieve_bulk_action: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["BulkAction"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Comments * @description List all comments */ list_comments: { parameters: { query: { /** @description If provided, only return comments created on or before the given date. */ date__end?: string; /** @description If provided, only return comments created on or after the given date. */ date__start?: string; /** * @description If provided, only return comments for the given [email(s)](https://docs.buttondown.com/api-emails-introduction). * @example [ * "em_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ email_id?: (string)[]; /** @description If provided, expand the given field. (Only supported fields: 'subscriber', 'email'). */ expand?: ("subscriber" | "email")[]; /** * @description The ordering to apply to the results. * @example -creation_date */ ordering?: "creation_date" | "-creation_date" | "email" | "-email" | "subscriber" | "-subscriber"; /** * @description If provided, only return comments that are replies to the given parent comment. * @example [ * "com_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ parent_id?: string; /** * @description If provided, only return comments with the given status(es); otherwise only active comments are returned. Only the newsletter owner can filter by status; subscribers always see active comments. * @example [ * "active" * ] */ status?: (components["schemas"]["CommentStatus"])[]; /** * @description If provided, only return comments for the given [subscriber](https://docs.buttondown.com/api-subscribers-introduction). * @example [ * "sub_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ subscriber_id?: string; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["CommentPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Comment * @description Create a new comment or reply to an existing comment. If subscriber_id is provided, the comment is attributed to that subscriber; otherwise it is attributed to the newsletter author. */ create_comment: { requestBody: { content: { "application/json": components["schemas"]["CommentInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Comment"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Comment * @description Retrieve a specific comment by its ID */ retrieve_comment: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Comment"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Comment * @description Delete a comment. Only the comment owner (subscriber) or the newsletter author can delete a comment. */ delete_comment: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Comment * @description Update a comment's status. Only the newsletter owner can call this. */ update_comment: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["CommentUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Comment"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Coupons * @description List all Stripe coupons */ list_coupons: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["StripeCouponPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Emails * @description List all emails */ list_emails: { parameters: { query: { /** @description If provided, only return [emails](https://docs.buttondown.com/api-emails-introduction) with the given status. */ status?: (components["schemas"]["EmailStatus"])[]; /** * @description If provided, only return [emails](https://docs.buttondown.com/api-emails-introduction) without the given status. * @example [ * "draft" * ] */ "-status"?: (components["schemas"]["EmailStatus"])[]; /** @description If provided, only return emails with the given IDs. */ ids?: (string)[]; /** * @description The ordering to apply to the results. * @example -publish_date */ ordering?: "creation_date" | "-creation_date" | "status" | "-status" | "publish_date" | "-publish_date" | "subject" | "-subject" | "email_type" | "-email_type" | "modification_date" | "-modification_date" | "clicks" | "-clicks" | "opens" | "-opens" | "click_rate" | "-click_rate" | "open_rate" | "-open_rate" | "page_views_lifetime" | "-page_views_lifetime" | "page_views_30" | "-page_views_30" | "page_views_7" | "-page_views_7" | "webmentions" | "-webmentions" | "subscriptions" | "-subscriptions" | "paid_subscriptions" | "-paid_subscriptions" | "unsubscriptions" | "-unsubscriptions" | "replies" | "-replies" | "comments" | "-comments" | "social_mentions" | "-social_mentions" | "permanent_failure_rate" | "-permanent_failure_rate" | "complaint_rate" | "-complaint_rate"; /** @description If provided, only return emails created after the given date. */ creation_date__start?: string; /** @description If provided, only return emails created before the given date. */ creation_date__end?: string; /** @description If provided, only return emails published after the given date. */ publish_date__start?: string; /** @description If provided, only return emails published before the given date. */ publish_date__end?: string; /** * @description If provided, exclude the given field(s) from the response. This can improve performance for large responses. * @example [ * "body" * ] */ excluded_fields?: (components["schemas"]["EmailExcludableField"])[]; /** * @description If provided, only return emails from the given source(s). * @example [ * "api" * ] */ source?: (components["schemas"]["EmailSource"])[]; /** @description If provided, only return emails with the given archival mode. */ archival_mode?: (components["schemas"]["ArchivalMode"])[]; /** * @deprecated * @description The type of emails to return. Defaults to all types. */ email_type?: (components["schemas"]["EmailType"])[]; /** @description If provided, only return emails with a subject that contains the given string. */ subject?: string; /** @description If provided, only return emails with the given attachments. */ attachments?: (string)[]; /** @description If provided, only return emails that reference the given [snippets](https://docs.buttondown.com/api-snippets-introduction). */ snippet_id?: (string)[]; /** * @description If provided, only return emails with at least this many deliveries. * @example 100 */ deliveries__start?: number; /** * @description If provided, only return emails with at most this many deliveries. * @example 1000 */ deliveries__end?: number; /** * @description If provided, only return emails with a click rate greater than or equal to the given value. * @example 0.1 */ click_rate__start?: number; /** * @description If provided, only return emails with a click rate less than or equal to the given value. * @example 0.5 */ click_rate__end?: number; /** * @description If provided, only return emails with an open rate greater than or equal to the given value. * @example 0.2 */ open_rate__start?: number; /** * @description If provided, only return emails with an open rate less than or equal to the given value. * @example 0.8 */ open_rate__end?: number; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["EmailPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_EmailListErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: never; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Email * @description Create a new email */ create_email: { requestBody: { content: { "application/json": components["schemas"]["EmailInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Email"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_EmailCreationErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Email * @description Retrieve a specific email by its ID */ retrieve_email: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Email"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Email * @description Delete an email */ delete_email: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Email * @description Update an email's properties */ update_email: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["EmailUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Email"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Email History * @description Retrieve the edit history for a specific email */ retrieve_email_history: { parameters: { query: { /** @description If provided, expand the given field. */ expand?: ("user")[]; /** @description The field to retrieve history for. */ field: string; /** * @description The page number of the paginated response. * @example 1 */ page?: number; /** @description The ordering to apply to the results. */ ordering?: "creation_date" | "-creation_date"; /** @description If provided, only return history entries matching the given query. */ query?: string; /** @description The number of results per page. */ page_size?: number; }; path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["HistoryPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Email History By Id * @description Retrieve a specific historical version of an email's body */ retrieve_email_history_by_id: { parameters: { query: { /** @description If provided, expand the given field. */ expand?: ("user")[]; }; path: { id: string; history_id: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["History"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Email Analytics * @description Retrieve analytics for a specific email */ retrieve_email_analytics: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Analytics"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Email Renders * @description Retrieve rendered HTML for a specific email */ retrieve_email_renders: { parameters: { query: { /** @description The target format for the rendered HTML. Use 'email' for rendered_html_for_email or 'html' for rendered_html_for_web. */ target: "email" | "html"; }; path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Render"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Send Draft * @description Send a draft email to specific recipients */ send_draft: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["SendDraftInput"]; }; }; responses: { /** @description OK */ 200: never; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Publish Email * @description Publish an email */ publish_email: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["EmailUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Email"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Events * @description List all events */ list_events: { parameters: { query: { /** @description If provided, only return events of the given type (e.g. `delivered`, `opened`, `clicked`). */ event_type?: components["schemas"]["EmailEventType"]; /** @description The ordering to apply to the results. */ ordering?: "creation_date" | "-creation_date"; /** @description If provided, expand the given field. (Only supported field: 'subscriber'). */ expand?: ("automation" | "subscriber" | "email")[]; /** @description If provided, only return events for the given email. */ email_id?: string; /** @description If provided, only return events for the given automation. */ automation_id?: string; /** @description If provided, only return events for the given subscriber. */ subscriber_id?: string; /** @description The number of results per page. */ page_size?: number; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["EmailEventPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Get Event * @description Retrieve a specific event by its ID */ get_event: { parameters: { query: { /** @description If provided, expand the given field. (Only supported field: 'subscriber'). */ expand?: ("automation" | "subscriber" | "email")[]; }; path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["EmailEvent"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Exports * @description List all exports */ list_exports: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["ExportPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Export * @description Create a new data export */ create_export: { requestBody: { content: { "application/json": components["schemas"]["ExportInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Export"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_CreateExportErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Export * @description Retrieve a specific export by its ID */ retrieve_export: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Export"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List External Feed * @description List all external feeds */ list_external_feed: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["ExternalFeedPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create External Feed * @description Create a new external feed */ create_external_feed: { requestBody: { content: { "application/json": components["schemas"]["ExternalFeedInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["ExternalFeed"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve External Feed * @description Retrieve a specific external feed by its ID */ retrieve_external_feed: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["ExternalFeed"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete External Feed * @description Delete an external feed */ delete_external_feed: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update External Feed * @description Update an external feed's properties */ update_external_feed: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["ExternalFeedUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["ExternalFeed"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Items * @description Retrieve items from an external feed */ retrieve_items: { parameters: { query: { /** @description If provided, expand the given field. */ expand?: ("email")[]; /** @description The page number of the paginated response. */ page?: number; }; path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["ExternalFeedItemPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Poll Items * @description Poll for new items in an external feed */ poll_items: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Empty"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Forms * @description List all forms */ list_forms: { parameters: { query: { /** * @description If provided, only return forms with the given status. * @example [ * "active" * ] */ status?: (components["schemas"]["FormStatus"])[]; /** * @description If provided, only return forms without the given status. * @example [ * "disabled" * ] */ "-status"?: (components["schemas"]["FormStatus"])[]; /** @description If provided, filter by admin-only flag. */ admin?: boolean; /** * @description The ordering to apply to the results. * @example -creation_date */ ordering?: "creation_date" | "-creation_date" | "title" | "-title" | "slug" | "-slug" | "status" | "-status"; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["FormPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Form * @description Create a new form */ create_form: { requestBody: { content: { "application/json": components["schemas"]["FormInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Form"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_CreateFormErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Form * @description Retrieve a specific form by its ID */ retrieve_form: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Form"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Form * @description Delete a form */ delete_form: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Form * @description Update a form's properties */ update_form: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["FormUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Form"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Images * @description List all uploaded images */ list_images: { parameters: { query: { /** * @description If provided, only return images matching the given IDs. * @example [ * "img_01h8xg4j3k2m1n0p9q8r7s6t5v" * ] */ ids?: (string)[]; /** @description The page number to return. */ page?: number; /** @description The number of results per page. */ page_size?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["ImagePage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Image * @description Upload an image */ create_image: { requestBody: { content: { "multipart/form-data": { /** * Image * Format: binary */ image: string; /** * Metadata * @default {} */ metadata?: string; }; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Image"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Image * @description Delete an uploaded image */ delete_image: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Image * @description Update an image's metadata */ update_image: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["ImageUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Image"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Imports * @description List all imports */ list_imports: { parameters: { query: { /** @description The ordering to apply to the results. */ ordering?: "creation_date" | "-creation_date"; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["ImportPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Import * @description Create a new import by uploading a file */ create_import: { requestBody: { content: { "multipart/form-data": { /** * File * Format: binary */ file: string; /** Metadata */ metadata?: string | null; }; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Import"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_CreateImportErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Import * @description Retrieve a specific import by its ID */ retrieve_import: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Import"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Import * @description Delete an import */ delete_import: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Import * @description Update an import's properties */ update_import: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["UpdateImportInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Import"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Newsletters * @description List all newsletters */ list_newsletters: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["NewsletterPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Newsletter * @description Create a new newsletter */ create_newsletter: { requestBody: { content: { "application/json": components["schemas"]["NewsletterInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Newsletter"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_CreateNewsletterErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Newsletter * @description Retrieve a specific newsletter by its ID */ retrieve_newsletter: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Newsletter"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Newsletter * @description Delete a newsletter */ delete_newsletter: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Newsletter * @description Update a newsletter's settings */ update_newsletter: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["NewsletterUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Newsletter"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Sending Domain * @description Retrieve the DNS verification status and required records for a newsletter's custom sending domain. While `is_checking` is true, a background re-verification is in flight; poll until it flips to false. Pass `force=true` to trigger a re-check. */ retrieve_sending_domain: { parameters: { query: { /** @description When true, trigger a fresh DNS re-verification instead of serving the last-known record. */ force?: boolean; }; path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["SendingDomainRecord"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Hosting Domain * @description Retrieve the DNS verification status for a newsletter's custom hosting domain. This synchronously re-verifies the domain's DNS records. */ retrieve_hosting_domain: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["HostingDomainRecord"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Notes * @description List all notes */ list_notes: { parameters: { query: { /** @description Filter notes by the type of object they are attached to. */ model_type?: "automation" | "comment" | "conversation" | "email" | "external_feed" | "invitation" | "socialmention" | "stripe_customer" | "subscriber" | "survey" | "tag" | "webmention"; /** @description Filter notes by the UUID or TypeID of the object they are attached to. */ model_id?: string; /** @description If provided, expand the given field. */ expand?: ("user")[]; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["NotePage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Note Endpoint * @description Create a new note */ create_note_endpoint: { requestBody: { content: { "application/json": components["schemas"]["NoteInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Note"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Note Endpoint * @description Delete a note */ delete_note_endpoint: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Ping * @description Check if the API is reachable and your credentials are valid */ ping: { responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Empty"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Prices * @description List all prices */ list_prices: { parameters: { query: { /** @description If provided, expand the given field. */ expand?: ("product")[]; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["PricePage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_ListPricesErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Price * @description Create a new price */ create_price: { requestBody: { content: { "application/json": components["schemas"]["PriceInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Price"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_CreatePriceErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Price * @description Archive a price, making it unavailable for new subscriptions. Stripe prices cannot be deleted outright; archiving deactivates the price while leaving existing subscriptions on it untouched. */ delete_price: { parameters: { path: { price_id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_ArchivePriceErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Search public emails * @description Search and list public emails for a newsletter. No authentication required. */ list_public_emails: { parameters: { query: { /** @description If provided, only return emails matching the given query. */ q?: string; /** @description The page number to return. */ page?: number; }; path: { username: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["PublicEmailPage"]; }; }; /** @description Not Found */ 404: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Segments * @description List all segments */ list_segments: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["SegmentPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Segment * @description Create a new segment */ create_segment: { requestBody: { content: { "application/json": components["schemas"]["SegmentInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Segment"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_SegmentErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Segment * @description Retrieve a specific segment by its ID */ retrieve_segment: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Segment"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Segment * @description Delete a segment */ delete_segment: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Segment * @description Update a segment's properties */ update_segment: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["SegmentUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Segment"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_SegmentErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Snippets * @description List all snippets */ list_snippets: { parameters: { query: { /** * @description The page number of the paginated response. * @example [ * 1 * ] */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["SnippetPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Snippet * @description Create a new snippet */ create_snippet: { requestBody: { content: { "application/json": components["schemas"]["SnippetInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Snippet"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Snippet * @description Retrieve a single snippet. */ retrieve_snippet: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Snippet"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Snippet * @description Delete a snippet. */ delete_snippet: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Snippet * @description Update a snippet. */ update_snippet: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["SnippetUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Snippet"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Subscribers * @description List all subscribers */ list_subscribers: { parameters: { query: { /** @description If provided, only return subscribers who last bounced on or before the given date. */ bounce_date__end?: string; /** @description If provided, only return subscribers who last bounced on or after the given date. */ bounce_date__start?: string; /** @description If provided, only return subscribers with the given bounce reason(s). */ bounce_reason?: (components["schemas"]["SubscriberUndeliverabilityReason"])[]; /** @description If provided, only return subscribers who churned on or before the given date. */ churn_date__end?: string; /** @description If provided, only return subscribers who churned on or after the given date. */ churn_date__start?: string; /** @description If provided, only return subscribers with the given coupon ID(s). */ coupon?: (string)[]; /** @description If provided, only return subscribers who are currently subscribed to the given price ID(s). */ current_price?: (string)[]; /** @description If provided, only return subscribers created before the given date. */ date__end?: string; /** @description If provided, only return subscribers created on or after the given date. */ date__start?: string; /** * @description If provided, only return subscribers whose email domain matches the given domain(s). * @example [ * "gmail.com" * ] */ domain?: (string)[]; /** @description If provided, only return subscribers whose email address contains the given string. */ email_address?: string | (string)[]; /** @description If provided, expand the given field. (Supported: 'stripe_customer', 'stripe_subscription'.) */ expand?: ("stripe_customer" | "stripe_subscription")[]; /** * @description If provided, only return subscribers that came through the given [form(s)](https://docs.buttondown.com/registration-forms). * @example [ * "form_abc123" * ] */ form?: (string)[]; /** @description If provided, only return subscribers with the given IDs. */ ids?: (string)[]; /** @description If provided, only return subscribers with the given IP address(es). */ ip_address?: (string)[]; /** @description If provided, only return subscribers whose last click was on or before the given date. */ last_click_date__end?: string; /** @description If provided, only return subscribers whose last click was on or after the given date. */ last_click_date__start?: string; /** @description If provided, only return subscribers whose last open was on or before the given date. */ last_open_date__end?: string; /** @description If provided, only return subscribers whose last open was on or after the given date. */ last_open_date__start?: string; /** * @description If provided, only return subscribers whose email domain does not match the given domain(s). * @example [ * "gmail.com" * ] */ "-domain"?: (string)[]; /** * @description If provided, only return subscribers without the given [tag](https://docs.buttondown.com/api-tags-introduction). * @example vip */ "-tag"?: string; /** @description If provided, only return subscribers without the given type. */ "-type"?: (components["schemas"]["SubscriberType"])[]; /** * @description The ordering to apply to the results. * @example -creation_date */ ordering?: string; /** @description If provided, only return subscribers who have at one point subscribed to the given price ID(s). */ price?: (string)[]; /** @description If provided, only return subscribers with the given referral code(s). */ referral_code?: (string)[]; /** @description If provided, only return subscribers whose referrer URL(s) contain the given string. */ referrer_url?: (string)[]; /** @description If provided, only return subscribers with an open rate less than or equal to the given value. */ open_rate__end?: number; /** @description If provided, only return subscribers with an open rate greater than or equal to the given value. */ open_rate__start?: number; /** @description If provided, only return subscribers with a click rate less than or equal to the given value. */ click_rate__end?: number; /** @description If provided, only return subscribers with a click rate greater than or equal to the given value. */ click_rate__start?: number; /** @description If provided, only return subscribers with a [risk score](https://docs.buttondown.com/firewall) less than or equal to the given value. */ risk_score__end?: number; /** @description If provided, only return subscribers with a [risk score](https://docs.buttondown.com/firewall) greater than or equal to the given value. */ risk_score__start?: number; /** * @description If provided, only return subscribers with the given source(s). * @example [ * "api" * ] */ source?: (components["schemas"]["SubscriberSource"])[]; /** * @description If provided, only return subscribers that were imported by the given subscriber import. * @example [ * "import_abc123" * ] */ subscriber_import?: (string)[]; /** @description If provided, only return subscribers with the given [tag(s)](https://docs.buttondown.com/api-tags-introduction). */ tag?: (string)[]; /** * @description If provided, only return subscribers with the given type. * @example [ * "regular" * ] */ type?: (components["schemas"]["SubscriberType"])[]; /** @description If provided, only return subscribers who became undeliverable on or before the given date. */ undeliverability_date__end?: string; /** @description If provided, only return subscribers who became undeliverable on or after the given date. */ undeliverability_date__start?: string; /** @description If provided, only return subscribers with the given undeliverability reason(s). */ undeliverability_reason?: (components["schemas"]["SubscriberUndeliverabilityReason"])[]; /** @description If provided, only return subscribers who unsubscribed on or before the given date. */ unsubscription_date__end?: string; /** @description If provided, only return subscribers who unsubscribed on or after the given date. */ unsubscription_date__start?: string; /** * @description If provided, only return subscribers with the given unsubscription reason(s). * @example [ * "no longer interested" * ] */ unsubscription_reason?: (string)[]; /** @description If provided, only return subscribers who upgraded on or before the given date. */ upgrade_date__end?: string; /** @description If provided, only return subscribers who upgraded on or after the given date. */ upgrade_date__start?: string; /** * @description If provided, only return subscribers with the given UTM campaign(s). * @example [ * "paid_campaign_2024" * ] */ utm_campaign?: (string)[]; /** * @description If provided, only return subscribers with the given UTM medium(s). * @example [ * "paid_campaign_2024" * ] */ utm_medium?: (string)[]; /** * @description If provided, only return subscribers with the given UTM source(s). * @example [ * "paid_campaign_2024" * ] */ utm_source?: (string)[]; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["SubscriberPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_ListSubscribersErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Subscriber * @description Create a new subscriber */ create_subscriber: { parameters: { header: { /** * @description The behavior to apply when a subscriber with the same email address already exists. * Defaults to "no_op", which will return a 400 error if a subscriber with the same email address already exists. Other values include: * * - "overwrite", which will overwrite the existing subscriber's data with the new one. This cannot change terminal subscriber types (unsubscribed, blocked, complained, undeliverable); those requests return a 400. * - "add", which will merge the new subscriber data into the existing one. For unsubscribed subscribers, this resubscribes them as regular when type is omitted, or as unactivated and sends a new confirmation email when type is "unactivated". An unsubscribed subscriber that has since been cleaned up is instead revived through your newsletter's confirmation settings when type is omitted. */ "X-Buttondown-Collision-Behavior"?: components["schemas"]["CollisionBehavior"]; /** @description Bypass the firewall for this subscriber creation. Subject to aggressive rate limiting (5 per hour per newsletter). */ "X-Buttondown-Bypass-Firewall"?: boolean; }; }; requestBody: { content: { "application/json": components["schemas"]["SubscriberInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Subscriber"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_ValidationErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Subscriber * @description Retrieve a specific subscriber by their ID or email address */ retrieve_subscriber: { parameters: { query: { /** @description If provided, expand the given field. */ expand?: ("stripe_customer" | "stripe_subscription")[]; }; path: { id_or_email: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Subscriber"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Subscriber * @description Delete a subscriber */ delete_subscriber: { parameters: { path: { id_or_email: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Subscriber * @description Update a subscriber's properties */ update_subscriber: { parameters: { path: { id_or_email: string; }; }; requestBody: { content: { "application/json": components["schemas"]["SubscriberUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Subscriber"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_UpdateSubscriberErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Send Reminder * @description Send a confirmation reminder email to an unactivated subscriber */ send_reminder: { parameters: { path: { id_or_email: string; }; }; responses: { /** @description OK */ 200: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Send Magic Link To Subscriber * @description Send a magic link email to a subscriber */ send_magic_link_to_subscriber: { parameters: { path: { id_or_email: string; }; }; responses: { /** @description OK */ 200: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Send Email To * @description Send a specific email to a specific subscriber */ send_email_to: { parameters: { path: { id_or_email: string; email_id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Empty"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Get Referrals * @description List subscribers referred by a specific subscriber */ get_referrals: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; path: { id_or_email: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["SubscriberPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Get Automations * @description List automation attempts for a specific subscriber */ get_automations: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; path: { id_or_email: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["AutomationForSubscriberPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Automation Attempt * @description Update the status of an automation attempt for a subscriber */ update_automation_attempt: { parameters: { path: { id_or_email: string; automation_attempt_id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["AutomationAttemptUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["AutomationForSubscriber"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_UpdateAutomationAttemptErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Get Stripe Subscriptions * @description List Stripe subscriptions for a specific subscriber */ get_stripe_subscriptions: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; path: { id_or_email: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["StripeSubscriptionPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Survey Responses * @description List all survey responses */ retrieve_survey_responses: { parameters: { query: { /** * @description If provided, only return responses submitted from the given email ID(s). * @example [ * "em_01jv2m9q8r7s6t5w4x3y2z1abc" * ] */ email_id?: (string)[]; /** * @description If provided, only return responses submitted from the given automation ID(s). * @example [ * "aut_01jv2m9q8r7s6t5w4x3y2z1abc" * ] */ automation_id?: (string)[]; /** * @description If provided, only return responses made by the given [subscriber(s)](https://docs.buttondown.com/api-subscribers-introduction). * @example [ * "sub_01jv2m9q8r7s6t5w4x3y2z1abc" * ] */ subscriber_id?: (string)[]; /** * @description If provided, only return responses submitted from the given arbitrary source string(s). * @example [ * "landing-page" * ] */ source?: (string)[]; /** * @description If provided, only return responses made to the given [survey(s)](https://docs.buttondown.com/api-surveys-introduction). * @example [ * "srv_01jv2m9q8r7s6t5w4x3y2z1abc" * ] */ survey_id?: (string)[]; /** @description If provided, only return responses made after the given date. */ creation_date__start?: string; /** @description If provided, only return responses made before the given date. */ creation_date__end?: string; /** @description If provided, expand the given field. */ expand?: ("email" | "subscriber" | "survey" | "automation")[]; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["ResponsePage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Survey Response * @description Create a new survey response */ create_survey_response: { requestBody: { content: { "application/json": components["schemas"]["ResponseInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Response"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_CreateSurveyResponseErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Survey Response * @description Update a survey response's text. Only the response owner (subscriber) can update their response. */ update_survey_response: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["ResponseUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Response"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Surveys * @description List all surveys */ list_surveys: { parameters: { query: { /** * @description If provided, only return surveys with the given status. * @example [ * "active" * ] */ status?: (components["schemas"]["SurveyStatus"])[]; /** * @description If provided, only return surveys without the given status. * @example [ * "inactive" * ] */ "-status"?: (components["schemas"]["SurveyStatus"])[]; /** * @description The ordering to apply to the results. * @example -creation_date */ ordering?: "creation_date" | "-creation_date" | "question" | "-question" | "identifier" | "-identifier" | "status" | "-status" | "response_count" | "-response_count"; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["SurveyPage"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Survey * @description Create a new survey */ create_survey: { requestBody: { content: { "application/json": components["schemas"]["SurveyInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Survey"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_CreateSurveyErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Survey * @description Retrieve a specific survey by its ID */ retrieve_survey: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Survey"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Survey * @description Delete a survey */ delete_survey: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Survey * @description Update a survey's properties */ update_survey: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["SurveyUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Survey"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_UpdateSurveyErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Tags * @description List all tags */ list_tags: { parameters: { query: { /** * @description If provided, only return tags matching the given IDs. * @example [ * "tag_abc123" * ] */ ids?: (string)[]; /** @description The number of results per page. */ page_size?: number; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["TagPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Tag * @description Create a new tag */ create_tag: { parameters: { header: { /** * @description The behavior to apply when a tag with the same name already exists. * Defaults to "no_op", which returns a 400 error. Set to "overwrite" to update the existing tag with the supplied values and return it with a 200 status code instead. */ "X-Buttondown-Collision-Behavior"?: "no_op" | "overwrite"; }; }; requestBody: { content: { "application/json": components["schemas"]["TagInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Tag"]; }; }; /** @description Created */ 201: { content: { "application/json": components["schemas"]["Tag"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_TagErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Tag * @description Retrieve a specific tag by its ID */ retrieve_tag: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Tag"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Tag * @description Delete a tag */ delete_tag: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Tag * @description Update a tag's properties */ update_tag: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["TagUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Tag"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_TagErrorCode_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Tag Analytics * @description Retrieve analytics for a specific tag */ retrieve_tag_analytics: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["TagAnalytics"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Users * @description List all users */ list_users: { parameters: { query: { /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["UserPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create User * @description Invite a new user to the newsletter */ create_user: { requestBody: { content: { "application/json": components["schemas"]["UserInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["User"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage_Failure_"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve User * @description Retrieve a specific user by its ID */ retrieve_user: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["User"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete User * @description Delete a user */ delete_user: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update User * @description Update a user's properties */ update_user: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["UserUpdateInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["User"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * List Webhooks * @description List all webhooks */ list_webhooks: { parameters: { query: { /** @description If provided, only return webhooks with the given status. */ status?: components["schemas"]["WebhookStatus"]; /** @description The page number of the paginated response. */ page?: number; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["WebhookPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Create Webhook * @description Create a new webhook */ create_webhook: { requestBody: { content: { "application/json": components["schemas"]["WebhookInput"]; }; }; responses: { /** @description Created */ 201: { content: { "application/json": components["schemas"]["Webhook"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Webhook * @description Retrieve a specific webhook by its ID */ retrieve_webhook: { parameters: { path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Webhook"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Delete Webhook * @description Delete a webhook */ delete_webhook: { parameters: { path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Update Webhook * @description Update a webhook's properties */ update_webhook: { parameters: { path: { id: string; }; }; requestBody: { content: { "application/json": components["schemas"]["WebhookInput"]; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["Webhook"]; }; }; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Retrieve Webhook Attempts * @description Retrieve webhook attempts for a specific webhook */ retrieve_webhook_attempts: { parameters: { query: { /** @description If provided, only return webhook attempts with the given status. */ status?: components["schemas"]["WebhookAttemptStatus"]; /** @description The page number of the paginated response. */ page?: number; }; path: { id: string; }; }; responses: { /** @description OK */ 200: { content: { "application/json": components["schemas"]["WebhookAttemptOutputPage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Forbidden */ 403: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Test Webhook * @description Send a test event to a webhook */ test_webhook: { parameters: { query: { /** @description The event type to send. Defaults to the webhook's first configured event type. */ event_type?: components["schemas"]["ExternalEventType"]; }; path: { id: string; }; }; responses: { /** @description No Content */ 204: never; /** @description Bad Request */ 400: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Unauthorized */ 401: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Not Found */ 404: { content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; /** @description Conflict */ 409: never; /** @description Unprocessable Content */ 422: { content: { "application/json": components["schemas"]["ValidationErrorMessage"]; }; }; /** @description Too Many Requests */ 429: { headers: { /** @description Seconds to wait before retrying. */ "Retry-After"?: number; /** @description Requests permitted per minute. */ "X-RateLimit-Limit"?: number; /** @description Requests remaining in the current window. */ "X-RateLimit-Remaining"?: number; /** @description Unix timestamp at which the window resets. */ "X-RateLimit-Reset"?: number; }; content: { "application/json": components["schemas"]["ErrorMessage"]; }; }; }; }; /** * Event notification * @description When an event you've subscribed to occurs, Buttondown sends an HTTP `POST` to your configured webhook URL. If the webhook has a signing key, the request carries an `X-Buttondown-Signature: sha256=` header — an HMAC-SHA256 of the raw request body keyed with your signing key. Respond with any 2xx status to acknowledge receipt; five consecutive non-2xx responses disable the webhook. */ webhook_event: { requestBody?: { content: { "application/json": components["schemas"]["WebhookEvent"]; }; }; responses: { /** @description Return any 2xx status to acknowledge the event. */ "2XX": never; }; }; }