{"openapi":"3.1.0","info":{"title":"Tirada API","version":"v1"},"servers":[{"url":"https://api.tirada.app"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (`trd_live_…`/`trd_test_…`) or session."}},"schemas":{"FeatureFlagList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/FeatureFlag"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"Pass it as `cursor` to get the next page; `null` on the last page."}},"required":["object","data","has_more","next_cursor"]},"FeatureFlag":{"type":"object","properties":{"object":{"type":"string","enum":["feature_flag"]},"key":{"type":"string","example":"platform.audit_log_export"},"description":{"type":"string"},"enabled":{"type":"boolean"},"source":{"type":"string","enum":["default","workspace","publication"]}},"required":["object","key","description","enabled","source"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","conflict_error","rate_limit_error","compliance_error","api_error"]},"code":{"type":"string","example":"invalid_id"},"message":{"type":"string"},"param":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string","example":"req_01jabcdefghjkmnpqrstvwxyz0"}},"required":["type","code","message","request_id"]}},"required":["error"]},"MagicLinkRequested":{"type":"object","properties":{"pairing":{"type":"object","properties":{"id":{"type":"string","example":"lpr_01jabcdefghjkmnpqrstvwxyz0"},"code":{"type":"integer","minimum":10,"maximum":99,"description":"Number to show on this screen."},"expires_at":{"type":"string"}},"required":["id","code","expires_at"]}},"required":["pairing"]},"MagicLinkRequest":{"type":"object","properties":{"email":{"type":"string","minLength":1,"maxLength":320,"example":"ana@example.com"},"redirect_to":{"type":"string","maxLength":2048,"description":"Dashboard path to open after login (relative: `/p/x/settings?tab=equipo`)."}},"required":["email"]},"MagicLinkPreview":{"type":"object","properties":{"account":{"type":"string","example":"a***@example.com"},"purpose":{"type":"string","enum":["user_login","user_reauth","reader_login"]},"pairing":{"type":["object","null"],"properties":{"choices":{"type":"array","items":{"type":"integer"}}},"required":["choices"],"description":"Numbers to choose from when a computer is waiting for this link."},"same_browser":{"type":"boolean"},"request":{"type":"object","properties":{"requested_at":{"type":"string"},"network":{"type":["string","null"],"example":"203.0.113.x"}},"required":["requested_at","network"],"description":"When and roughly from where the link was asked for (\"no fui yo\" if it was not you)."}},"required":["account","purpose","pairing","same_browser","request"]},"MagicLinkToken":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":256,"example":"ltk_01jabcdefghjkmnpqrstvwxyz0.<secret>"}},"required":["token"]},"MagicLinkConfirmed":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"redirect_to":{"type":["string","null"]}},"required":["session","redirect_to"]},"Session":{"type":"object","properties":{"id":{"type":"string","example":"ses_01jabcdefghjkmnpqrstvwxyz0"},"user":{"type":"object","properties":{"id":{"type":"string","example":"user_01jabcdefghjkmnpqrstvwxyz0"},"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","email","name"]},"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/SessionWorkspace"}},"workspace":{"allOf":[{"$ref":"#/components/schemas/SessionWorkspace"},{"type":["object","null"]}]},"authenticated_at":{"type":"string"},"recent_auth_until":{"type":"string"},"expires_at":{"type":"string"},"csrf_token":{"type":"string","description":"Send it as `X-CSRF-Token` on every mutation."}},"required":["id","user","workspaces","workspace","authenticated_at","recent_auth_until","expires_at","csrf_token"]},"SessionWorkspace":{"type":"object","properties":{"id":{"type":"string","example":"ws_01jabcdefghjkmnpqrstvwxyz0"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","contributor"]}},"required":["id","name","role"]},"PairingApproved":{"type":"object","properties":{"status":{"type":"string","enum":["approved"]}},"required":["status"]},"MagicLinkApproval":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":256,"example":"ltk_01jabcdefghjkmnpqrstvwxyz0.<secret>"},"code":{"type":"integer","minimum":0,"maximum":999}},"required":["token","code"]},"MagicLinkDenied":{"type":"object","properties":{"status":{"type":"string","enum":["denied"]}},"required":["status"]},"PairingClaim":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","closed"]}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","enum":["approved"]},"session":{"$ref":"#/components/schemas/Session"},"redirect_to":{"type":["string","null"]}},"required":["status","session","redirect_to"]}]},"Accepted":{"type":"object","properties":{"status":{"type":"string","enum":["accepted"]}},"required":["status"]},"ReauthenticateRequest":{"type":"object","properties":{"redirect_to":{"type":"string","maxLength":2048}}},"SelectedWorkspace":{"type":"object","properties":{"workspace":{"$ref":"#/components/schemas/SessionWorkspace"}},"required":["workspace"]},"SelectWorkspace":{"type":"object","properties":{"workspace_id":{"type":"string","description":"workspace ID","example":"ws_01jabcdefghjkmnpqrstvwxyz0"}},"required":["workspace_id"]},"SessionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SessionListItem"}}},"required":["object","data"]},"SessionListItem":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"last_seen_at":{"type":"string"},"ip":{"type":["string","null"]},"user_agent":{"type":["string","null"]},"current":{"type":"boolean"}},"required":["id","created_at","last_seen_at","ip","user_agent","current"]},"RevokedSessions":{"type":"object","properties":{"revoked":{"type":"integer"}},"required":["revoked"]},"RevokeAllSessions":{"type":"object","properties":{"keep_current":{"type":"boolean","default":false},"include_credentials":{"type":"boolean","default":false,"description":"Also suspend the API keys and webhook endpoints you created."}}},"Workspace":{"type":"object","properties":{"object":{"type":"string","enum":["workspace"]},"id":{"type":"string","example":"ws_01jabcdefghjkmnpqrstvwxyz0"},"name":{"type":"string"},"created_at":{"type":"string","example":"2026-10-15T09:30:00.000Z"}},"required":["object","id","name","created_at"]},"WorkspaceSummaryList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceSummary"}}},"required":["object","data"]},"WorkspaceSummary":{"type":"object","properties":{"object":{"type":"string","enum":["workspace"]},"id":{"type":"string","example":"ws_01jabcdefghjkmnpqrstvwxyz0"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","contributor"]}},"required":["object","id","name","role"]},"PublicationList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Publication"}}},"required":["object","data"]},"Publication":{"type":"object","properties":{"object":{"type":"string","enum":["publication"]},"id":{"type":"string","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"language":{"type":"string"},"timezone":{"type":"string"},"sender_name":{"type":"string"},"reply_to":{"type":["string","null"]},"double_opt_in_default":{"type":"boolean"},"created_at":{"type":"string","example":"2026-10-15T09:30:00.000Z"},"archived_at":{"type":["string","null"],"example":"2026-10-15T09:30:00.000Z"}},"required":["object","id","slug","name","description","language","timezone","sender_name","reply_to","double_opt_in_default","created_at","archived_at"]},"MemberList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Member"}}},"required":["object","data"]},"Member":{"type":"object","properties":{"object":{"type":"string","enum":["member"]},"id":{"type":"string","example":"mem_01jabcdefghjkmnpqrstvwxyz0"},"user_id":{"type":"string","example":"user_01jabcdefghjkmnpqrstvwxyz0"},"email":{"type":"string"},"name":{"type":["string","null"]},"role":{"type":"string","enum":["owner","admin","member","contributor"]},"joined_at":{"type":"string","example":"2026-10-15T09:30:00.000Z"},"publication_roles":{"type":"array","items":{"type":"object","properties":{"publication_id":{"type":"string","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"role":{"type":"string","enum":["admin","member","contributor","none"]}},"required":["publication_id","role"]}}},"required":["object","id","user_id","email","name","role","joined_at","publication_roles"]},"InvitationList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}}},"required":["object","data"]},"Invitation":{"type":"object","properties":{"object":{"type":"string","enum":["invitation"]},"id":{"type":"string","example":"inv_01jabcdefghjkmnpqrstvwxyz0"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","member","contributor"]},"publications":{"type":"array","items":{"type":"object","properties":{"publication_id":{"type":"string","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"role":{"type":"string","enum":["admin","member","contributor","none"]}},"required":["publication_id","role"]}},"status":{"type":"string","enum":["pending","accepted","revoked","expired"]},"invited_by":{"type":"string","example":"user_01jabcdefghjkmnpqrstvwxyz0"},"created_at":{"type":"string","example":"2026-10-15T09:30:00.000Z"},"expires_at":{"type":"string","example":"2026-10-15T09:30:00.000Z"}},"required":["object","id","email","role","publications","status","invited_by","created_at","expires_at"]},"InvitationAcceptance":{"type":"object","properties":{"object":{"type":"string","enum":["invitation_acceptance"]},"workspace":{"$ref":"#/components/schemas/Workspace"},"membership":{"type":"object","properties":{"id":{"type":"string","example":"mem_01jabcdefghjkmnpqrstvwxyz0"},"role":{"type":"string","enum":["admin","member","contributor"]}},"required":["id","role"]}},"required":["object","workspace","membership"]},"TrackedLinkList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/TrackedLink"}}},"required":["object","data"]},"TrackedLink":{"type":"object","properties":{"index":{"type":"integer"},"url":{"type":"string"},"block_id":{"type":["string","null"]},"clicks":{"$ref":"#/components/schemas/TrackingEngagementCounts"},"disabled":{"type":"boolean"}},"required":["index","url","block_id","clicks","disabled"]},"TrackingEngagementCounts":{"type":"object","properties":{"raw":{"type":"integer"},"verified":{"type":"integer"},"unique_verified":{"type":"integer"}},"required":["raw","verified","unique_verified"]},"DisabledTrackedLink":{"type":"object","properties":{"send_id":{"type":"string"},"link_index":{"type":"integer"},"disabled":{"type":"boolean","enum":[true]},"reason":{"type":"string","enum":["phishing","malware","abuse_report","other"]},"disabled_at":{"type":"string"}},"required":["send_id","link_index","disabled","reason","disabled_at"]},"DeliverabilityReport":{"type":"object","properties":{"publication_id":{"type":"string"},"window":{"type":"object","properties":{"from":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"to":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"days":{"type":"integer"}},"required":["from","to","days"]},"totals":{"type":"object","properties":{"accepted":{"type":"integer"},"delivered":{"type":"integer"},"hard_bounces":{"type":"integer"},"soft_bounces":{"type":"integer"},"complaints":{"type":"integer"},"rejected":{"type":"integer"},"deferred":{"type":"integer"}},"required":["accepted","delivered","hard_bounces","soft_bounces","complaints","rejected","deferred"]},"complaint_rate":{"type":"object","properties":{"numerator":{"type":"integer"},"denominator":{"type":"integer"},"rate":{"type":["number","null"]},"threshold":{"type":"object","properties":{"max_rate":{"type":"number"},"min_count":{"type":"integer"}},"required":["max_rate","min_count"]},"exceeded":{"type":"boolean"}},"required":["numerator","denominator","rate","threshold","exceeded"]},"hard_bounce_rate":{"type":"object","properties":{"numerator":{"type":"integer"},"denominator":{"type":"integer"},"rate":{"type":["number","null"]},"threshold":{"type":"object","properties":{"max_rate":{"type":"number"},"min_count":{"type":"integer"}},"required":["max_rate","min_count"]},"exceeded":{"type":"boolean"}},"required":["numerator","denominator","rate","threshold","exceeded"]},"bounces_by_class":{"type":"object","properties":{"hard_user_unknown":{"type":"integer"},"hard_mailbox_disabled":{"type":"integer"},"hard_null_mx":{"type":"integer"},"dns_permanent":{"type":"integer"},"dns_temporary":{"type":"integer"},"mailbox_full":{"type":"integer"},"throttled":{"type":"integer"},"greylisted":{"type":"integer"},"reputation_deferral":{"type":"integer"},"ip_block":{"type":"integer"},"reputation_block":{"type":"integer"},"policy_block":{"type":"integer"},"authentication_failure":{"type":"integer"},"content_block":{"type":"integer"},"message_too_large":{"type":"integer"},"transport":{"type":"integer"},"unclassified":{"type":"integer"}}},"reputation":{"type":"object","properties":{"state":{"type":"string","enum":["probation","standard","trusted"]},"since":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"under_review":{"type":"boolean"},"review_reason":{"type":["string","null"]}},"required":["state","since","under_review","review_reason"]},"active_trips":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"kst_01jabcdefghjkmnpqrstvwxyz0"},"level":{"type":"string","enum":["send","publication","workspace"]},"send_id":{"type":["string","null"],"format":"uuid","description":"Raw UUID (its codec lives in another module)."},"publication_id":{"type":["string","null"]},"metric":{"type":"string","enum":["complaint_rate","hard_bounce_rate"]},"rate":{"type":"number"},"threshold":{"type":"number"},"numerator":{"type":"integer"},"denominator":{"type":"integer"},"tripped_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"hold_id":{"type":"string"}},"required":["id","level","send_id","publication_id","metric","rate","threshold","numerator","denominator","tripped_at","hold_id"]}},"open_holds":{"type":"array","items":{"$ref":"#/components/schemas/ReviewHold"}},"suppressions":{"type":"object","properties":{"publication":{"type":"object","properties":{"hard_bounce":{"type":"integer"},"mailbox_full":{"type":"integer"},"dns":{"type":"integer"},"complaint":{"type":"integer"},"serial_complainer":{"type":"integer"},"spamtrap":{"type":"integer"},"sunset":{"type":"integer"},"legal":{"type":"integer"},"manual":{"type":"integer"},"abuse":{"type":"integer"},"unclassified_repeat":{"type":"integer"}}},"global_total":{"type":"integer","description":"Network suppressions among this publication’s subscribers (never their reasons)."}},"required":["publication","global_total"]},"by_mailbox_provider":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"delivered":{"type":"integer"},"hard_bounces":{"type":"integer"},"complaints":{"type":"integer"}},"required":["provider","delivered","hard_bounces","complaints"]}}},"required":["publication_id","window","totals","complaint_rate","hard_bounce_rate","bounces_by_class","reputation","active_trips","open_holds","suppressions","by_mailbox_provider"]},"ReviewHold":{"type":"object","properties":{"id":{"type":"string","example":"hold_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":["string","null"]},"reason":{"type":"string","enum":["kill_switch","import_review","import_halted","reputation","manual","first_send"]},"trip_id":{"type":["string","null"]},"import_id":{"type":["string","null"],"format":"uuid","description":"Raw UUID (its codec lives in another module)."},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"released_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"}},"required":["id","publication_id","reason","trip_id","import_id","created_at","released_at"]},"SuppressionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"Suppression":{"type":"object","properties":{"id":{"type":"string","example":"sup_01jabcdefghjkmnpqrstvwxyz0"},"layer":{"type":"string","enum":["publication"]},"publication_id":{"type":["string","null"]},"list_id":{"type":["string","null"]},"reader_id":{"type":["string","null"]},"email_hash":{"type":"string","description":"Keyed hash of the normalized address. Never the address."},"reason":{"type":"string","enum":["hard_bounce","mailbox_full","dns","complaint","serial_complainer","spamtrap","sunset","legal","manual","abuse","unclassified_repeat"]},"source":{"type":"string","example":"dashboard"},"permanent":{"type":"boolean"},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"strike_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"removed_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"removed_cause":{"type":["string","null"],"enum":["expired","lifted","resubscribed",null]},"liftable_by":{"type":"array","items":{"type":"string","enum":["creator","ops","verified_click","resubscription","expiry"]},"description":"Who could lift it now (`creator` enables the dashboard button)."}},"required":["id","layer","publication_id","list_id","reader_id","email_hash","reason","source","permanent","expires_at","strike_count","created_at","removed_at","removed_cause","liftable_by"]},"OpsReviewHoldList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/OpsReviewHold"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"OpsReviewHold":{"type":"object","properties":{"id":{"type":"string","example":"hold_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":["string","null"]},"reason":{"type":"string","enum":["kill_switch","import_review","import_halted","reputation","manual","first_send"]},"trip_id":{"type":["string","null"]},"import_id":{"type":["string","null"],"format":"uuid","description":"Raw UUID (its codec lives in another module)."},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"released_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"workspace_id":{"type":"string","example":"ws_01jabcdefghjkmnpqrstvwxyz0"}},"required":["id","publication_id","reason","trip_id","import_id","created_at","released_at","workspace_id"]},"GlobalSuppressionLift":{"type":"object","properties":{"id":{"type":"string"},"removed_at":{"type":"string","format":"date-time"}},"required":["id","removed_at"]},"PaymentsStatus":{"type":"object","properties":{"object":{"type":"string","enum":["payments_status"]},"publication_id":{"type":"string"},"account":{"$ref":"#/components/schemas/ConnectedAccount"},"selling_enabled":{"type":"boolean"},"tiers":{"type":"object","properties":{"active":{"type":"integer"},"archived":{"type":"integer"}},"required":["active","archived"]},"active_paid_subscriptions":{"type":"integer"},"webhooks":{"type":"object","properties":{"last_received_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"last_processed_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"pending":{"type":"integer"},"rejected_last_7_days":{"type":"integer"},"failed_last_7_days":{"type":"integer"},"recent":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"received_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"outcome":{"type":"string","enum":["received","processed","ignored","rejected","failed"]},"reason":{"type":["string","null"]}},"required":["type","received_at","outcome","reason"]}}},"required":["last_received_at","last_processed_at","pending","rejected_last_7_days","failed_last_7_days","recent"]},"last_reconciled_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"}},"required":["object","publication_id","account","selling_enabled","tiers","active_paid_subscriptions","webhooks","last_reconciled_at"]},"ConnectedAccount":{"type":["object","null"],"properties":{"object":{"type":"string","enum":["connected_account"]},"id":{"type":"string","example":"pacct_01jabcdefghjkmnpqrstvwxyz0"},"status":{"type":"string","enum":["onboarding","restricted","active","disconnected"]},"charges_enabled":{"type":"boolean"},"payouts_enabled":{"type":"boolean"},"details_submitted":{"type":"boolean"},"requirements_due":{"type":"array","items":{"type":"string"}},"default_currency":{"type":["string","null"]},"connected_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"disconnected_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"disconnect_reason":{"type":["string","null"],"enum":["creator","deauthorized","access_revoked",null]},"last_synced_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"}},"required":["object","id","status","charges_enabled","payouts_enabled","details_submitted","requirements_due","default_currency","connected_at","disconnected_at","disconnect_reason","last_synced_at"]},"OnboardingLink":{"type":"object","properties":{"object":{"type":"string","enum":["onboarding_link"]},"url":{"type":"string","description":"Send the creator here (Stripe)."},"mode":{"type":"string","enum":["oauth","create"]},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"}},"required":["object","url","mode","expires_at"]},"TierList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Tier"}}},"required":["object","data"]},"Tier":{"type":"object","properties":{"object":{"type":"string","enum":["tier"]},"id":{"type":"string","example":"tier_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"position":{"type":"integer"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/TierPrice"}},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"archived_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"}},"required":["object","id","publication_id","name","description","status","position","prices","created_at","archived_at"]},"TierPrice":{"type":"object","properties":{"id":{"type":"string","example":"tprice_01jabcdefghjkmnpqrstvwxyz0"},"interval":{"type":"string","enum":["month","year"]},"amount":{"type":"integer","description":"Minor units (cents).","example":500},"currency":{"type":"string","example":"eur"}},"required":["id","interval","amount","currency"]},"TierPriceInput":{"type":"object","properties":{"interval":{"type":"string","enum":["month","year"]},"amount":{"type":"integer","minimum":50,"maximum":99999999,"description":"Minor units (cents)."},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","example":"eur"}},"required":["interval","amount","currency"]},"PaidSubscriptionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/PaidSubscription"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"PaidSubscription":{"type":"object","properties":{"object":{"type":"string","enum":["paid_subscription"]},"id":{"type":"string","example":"psub_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"reader_id":{"type":["string","null"]},"tier_id":{"type":"string"},"tier_price_id":{"type":"string"},"status":{"type":"string","enum":["incomplete","incomplete_expired","trialing","active","past_due","paused","canceled","unpaid"]},"cancel_at_period_end":{"type":"boolean"},"current_period_end":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"provider":{"type":"string"},"provider_subscription_id":{"type":"string"},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"canceled_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"}},"required":["object","id","publication_id","reader_id","tier_id","tier_price_id","status","cancel_at_period_end","current_period_end","provider","provider_subscription_id","created_at","canceled_at"]},"EntitlementList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Entitlement"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"Entitlement":{"type":"object","properties":{"object":{"type":"string","enum":["entitlement"]},"id":{"type":"string","example":"ent_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"reader_id":{"type":["string","null"]},"tier_id":{"type":"string"},"source":{"type":"string","enum":["subscription","comp","gift"]},"paid_subscription_id":{"type":["string","null"]},"status":{"type":"string","enum":["active","suspended","ended"]},"valid_from":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"valid_to":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"reason":{"type":"string"},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"}},"required":["object","id","publication_id","reader_id","tier_id","source","paid_subscription_id","status","valid_from","valid_to","reason","created_at","updated_at"]},"SharedDomains":{"type":"object","properties":{"object":{"type":"string","enum":["shared_domains"]},"site_domain":{"type":"string","example":"tirada.pub"},"sending_domain":{"type":"string","example":"tirada.email"}},"required":["object","site_domain","sending_domain"]},"PublicationDomain":{"type":"object","properties":{"object":{"type":"string","enum":["publication_domain"]},"publication_id":{"type":"string","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"endpoints":{"$ref":"#/components/schemas/PublicationEndpoints"},"domain":{"type":["object","null"],"properties":{"id":{"type":"string","example":"dom_01jabcdefghjkmnpqrstvwxyz0"},"sending_domain":{"type":"string"},"web_host":{"type":"string"},"tracking_host":{"type":"string"},"status":{"type":"string","enum":["pending","dns_published","verified","tls_active","sending_ready","degraded"]},"status_since":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"added_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"last_checked_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"next_check_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"records":{"type":"array","items":{"$ref":"#/components/schemas/DomainRecord"}},"dmarc":{"type":"object","properties":{"found":{"type":"boolean"},"existing":{"type":"boolean"},"policy":{"type":["string","null"],"enum":["none","quarantine","reject",null]},"alignment_passes":{"type":"boolean"},"suggestion":{"type":["string","null"]}},"required":["found","existing","policy","alignment_passes","suggestion"]},"identity":{"type":"object","properties":{"dkim":{"type":"string","enum":["not_started","pending","success","failed","temporary_failure"]},"mail_from":{"type":"string","enum":["not_started","pending","success","failed","temporary_failure"]}},"required":["dkim","mail_from"]},"tls":{"type":"object","properties":{"web":{"type":["object","null"],"properties":{"host":{"type":"string"},"state":{"type":"string","enum":["none","issuing","active","failed","expiring"]},"not_after":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"checked_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"error":{"type":["string","null"]}},"required":["host","state","not_after","checked_at","error"]},"tracking":{"type":["object","null"],"properties":{"host":{"type":"string"},"state":{"type":"string","enum":["none","issuing","active","failed","expiring"]},"not_after":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"checked_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"error":{"type":["string","null"]}},"required":["host","state","not_after","checked_at","error"]}},"required":["web","tracking"]},"next_step":{"type":["string","null"],"example":"dkim_record_missing"}},"required":["id","sending_domain","web_host","tracking_host","status","status_since","added_at","expires_at","last_checked_at","next_check_at","records","dmarc","identity","tls","next_step"]}},"required":["object","publication_id","endpoints","domain"]},"PublicationEndpoints":{"type":"object","properties":{"mode":{"type":"string","enum":["custom","shared"]},"from_domain":{"type":"string"},"mail_from_domain":{"type":["string","null"]},"web_base_url":{"type":"string"},"tracking_base_url":{"type":"string"},"unsubscribe_base_url":{"type":"string"},"custom_domain_id":{"type":["string","null"],"example":"dom_01jabcdefghjkmnpqrstvwxyz0"},"degraded_parts":{"type":"array","items":{"type":"string","enum":["sending","tracking","web","mail_from"]}}},"required":["mode","from_domain","mail_from_domain","web_base_url","tracking_base_url","unsubscribe_base_url","custom_domain_id","degraded_parts"]},"DomainRecord":{"type":"object","properties":{"purpose":{"type":"string","enum":["ownership","web_ownership","tracking_ownership","dkim","mail_from_mx","mail_from_spf","dmarc","tracking","web"]},"type":{"type":"string","enum":["CNAME","MX","TXT"]},"name":{"type":"string","example":"abc123._domainkey.news.example.com"},"value":{"type":"string","example":"abc123.dkim.amazonses.com"},"priority":{"type":["integer","null"]},"critical":{"type":"boolean"},"status":{"type":"string","enum":["pending","ok","broken"]},"observed":{"type":"array","items":{"type":"string"}},"checked_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"fix":{"type":["string","null"]}},"required":["purpose","type","name","value","priority","critical","status","observed","checked_at","fix"]},"SubscriberList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Subscriber"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"Subscriber":{"type":"object","properties":{"object":{"type":"string","enum":["subscriber"]},"id":{"type":"string","example":"sub_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"email":{"type":"string","description":"Redacted (`a***@domain`) for MCP credentials."},"status":{"type":"string","enum":["pending_confirmation","active","unsubscribed"]},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T12:00:00.000Z"},"confirmed_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T12:00:00.000Z"},"unsubscribed_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T12:00:00.000Z"},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed"]}},"required":["id","status"]}},"tags":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"source":{"type":"object","properties":{"channel":{"type":"string","enum":["form","import","api","site","paid","dashboard"]},"source_ref_id":{"type":["string","null"],"description":"What brought the subscriber: a form id (`frm_…`) for channel `form`; for other channels an opaque reference (raw UUID) or null."},"utm_source":{"type":["string","null"]},"utm_medium":{"type":["string","null"]},"utm_campaign":{"type":["string","null"]},"utm_term":{"type":["string","null"]},"utm_content":{"type":["string","null"]},"landing_url":{"type":["string","null"]},"referrer_url":{"type":["string","null"]}},"required":["channel","source_ref_id","utm_source","utm_medium","utm_campaign","utm_term","utm_content","landing_url","referrer_url"]},"access":{"type":"object","properties":{"level":{"type":"string","enum":["free","premium"]},"tier_ids":{"type":"array","items":{"type":"string"}}},"required":["level","tier_ids"]},"suppression":{"type":["object","null"],"properties":{"layer":{"type":"string","enum":["publication","network"]}},"required":["layer"]},"validation_flags":{"type":"array","items":{"type":"string"}},"import_id":{"type":["string","null"]}},"required":["object","id","publication_id","email","status","first_name","last_name","created_at","confirmed_at","unsubscribed_at","lists","tags","custom_fields","source","access","suppression","validation_flags","import_id"]},"DeletedObject":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["object","id","deleted"]},"SubscriberTagChange":{"type":"object","properties":{"object":{"type":"string","enum":["subscriber_tag"]},"subscriber_id":{"type":"string"},"tag":{"type":"string"},"changed":{"type":"boolean"}},"required":["object","subscriber_id","tag","changed"]},"SubscriberListCollection":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SubscriberListObject"}}},"required":["object","data"]},"SubscriberListObject":{"type":"object","properties":{"object":{"type":"string","enum":["subscriber_list"]},"id":{"type":"string","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"name":{"type":"string"},"is_default":{"type":"boolean"},"archived":{"type":"boolean"},"archived_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T12:00:00.000Z"},"subscriber_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T12:00:00.000Z"}},"required":["object","id","publication_id","name","is_default","archived","archived_at","subscriber_count","created_at"]},"CustomFieldList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}}},"required":["object","data"]},"CustomField":{"type":"object","properties":{"object":{"type":"string","enum":["custom_field"]},"id":{"type":"string","example":"fld_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"key":{"type":"string","description":"Immutable. Merge tag `subscriber.custom.<key>`."},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","boolean","date","enum"]},"options":{"type":"array","items":{"type":"string"}}},"required":["object","id","publication_id","key","label","type","options"]},"TagList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}}},"required":["object","data"]},"Tag":{"type":"object","properties":{"object":{"type":"string","enum":["tag"]},"id":{"type":"string","example":"tag_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"name":{"type":"string"}},"required":["object","id","publication_id","name"]},"FormList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Form"}}},"required":["object","data"]},"Form":{"type":"object","properties":{"object":{"type":"string","enum":["form"]},"id":{"type":"string","example":"frm_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"],"enum":["creator","publication_archived",null]},"double_opt_in":{"type":"string","enum":["publication_default","always"]},"list_ids":{"type":"array","items":{"type":"string"}},"list_choice":{"type":"boolean"},"field_keys":{"type":"array","items":{"type":"string"}},"success":{"$ref":"#/components/schemas/FormSuccess"},"consent_text":{"type":["string","null"]},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"button_label":{"type":["string","null"]},"version":{"type":"integer"},"hosted_url":{"type":"string"},"embed_snippet":{"type":"string"},"site_default":{"type":"boolean","description":"The form the publication's own site shows on its home and post pages (one per publication, created automatically). Disable it to hide the form there."},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T12:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-10-15T12:00:00.000Z"}},"required":["object","id","publication_id","name","status","disabled_reason","double_opt_in","list_ids","list_choice","field_keys","success","consent_text","title","description","button_label","version","hosted_url","embed_snippet","site_default","created_at","updated_at"]},"FormSuccess":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["message"]},"text":{"type":"string","minLength":1,"maxLength":1000}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","enum":["redirect"]},"url":{"type":"string","maxLength":2048}},"required":["kind","url"]}]},"SegmentList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}}},"required":["object","data"]},"Segment":{"type":"object","properties":{"object":{"type":"string","enum":["segment"]},"id":{"type":"string","example":"seg_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/SegmentDefinition"},"version":{"type":"integer","description":"Grows with every change of the definition."},"counts":{"$ref":"#/components/schemas/SegmentCounts"},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T12:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-10-15T12:00:00.000Z"}},"required":["object","id","publication_id","name","definition","version","counts","created_at","updated_at"]},"SegmentDefinition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","enum":["status"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["pending_confirmation","active","unsubscribed"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["access"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["free","premium"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["tag"]},"op":{"type":"string","enum":["has","has_not"]},"tag_id":{"type":"string"}},"required":["field","op","tag_id"]},{"type":"object","properties":{"field":{"type":"string","enum":["list"]},"op":{"type":"string","enum":["in","not_in"]},"list_id":{"type":"string"}},"required":["field","op","list_id"]},{"type":"object","properties":{"field":{"type":"string","enum":["source"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["form","import","api","site","paid","dashboard"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["signup_date"]},"op":{"type":"string","enum":["before","after"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["field","op","date"]},{"type":"object","properties":{"field":{"type":"string","enum":["signup_date"]},"op":{"type":"string","enum":["within_days","not_within_days"]},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["field","op","days"]},{"type":"object","properties":{"field":{"type":"string","enum":["engagement"]},"op":{"type":"string","enum":["opened_within","not_opened_within","clicked_within","not_clicked_within"]},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["field","op","days"]},{"type":"object","properties":{"field":{"type":"string","enum":["custom_field"]},"key":{"type":"string","minLength":1,"maxLength":40},"op":{"type":"string","enum":["equals"]},"value":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}},"required":["field","key","op","value"]},{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","enum":["status"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["pending_confirmation","active","unsubscribed"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["access"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["free","premium"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["tag"]},"op":{"type":"string","enum":["has","has_not"]},"tag_id":{"type":"string"}},"required":["field","op","tag_id"]},{"type":"object","properties":{"field":{"type":"string","enum":["list"]},"op":{"type":"string","enum":["in","not_in"]},"list_id":{"type":"string"}},"required":["field","op","list_id"]},{"type":"object","properties":{"field":{"type":"string","enum":["source"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["form","import","api","site","paid","dashboard"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["signup_date"]},"op":{"type":"string","enum":["before","after"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["field","op","date"]},{"type":"object","properties":{"field":{"type":"string","enum":["signup_date"]},"op":{"type":"string","enum":["within_days","not_within_days"]},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["field","op","days"]},{"type":"object","properties":{"field":{"type":"string","enum":["engagement"]},"op":{"type":"string","enum":["opened_within","not_opened_within","clicked_within","not_clicked_within"]},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["field","op","days"]},{"type":"object","properties":{"field":{"type":"string","enum":["custom_field"]},"key":{"type":"string","minLength":1,"maxLength":40},"op":{"type":"string","enum":["equals"]},"value":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}},"required":["field","key","op","value"]}]},"maxItems":20}},"required":["match","conditions"]}]},"maxItems":20}},"required":["match","conditions"],"description":"Conditions joined by `match` (`all` = and, `any` = or); an item may be a group with its own `match` (one level). Fields: `status`, `access` (free/premium mirror), `tag` (`tag_id`), `list` (`list_id`), `source` (first-touch channel), `signup_date` (`before`/`after` a UTC day, or `within_days`/`not_within_days`), `engagement` (verified opens/clicks within N days, from deliverability) and `custom_field` (`key` equals `value`; text compares case-insensitively). At most 20 conditions."},"SegmentCounts":{"type":"object","properties":{"matching":{"type":"integer","description":"Subscribers matching the conditions, any status."},"sendable":{"type":"integer","description":"Of those, the ones a send to this segment would select now (active), before suppressions."}},"required":["matching","sendable"]},"SegmentDefinitionInput":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","enum":["status"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["pending_confirmation","active","unsubscribed"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["access"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["free","premium"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["tag"]},"op":{"type":"string","enum":["has","has_not"]},"tag_id":{"type":"string","description":"tag ID","example":"tag_01jabcdefghjkmnpqrstvwxyz0"}},"required":["field","op","tag_id"]},{"type":"object","properties":{"field":{"type":"string","enum":["list"]},"op":{"type":"string","enum":["in","not_in"]},"list_id":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"}},"required":["field","op","list_id"]},{"type":"object","properties":{"field":{"type":"string","enum":["source"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["form","import","api","site","paid","dashboard"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["signup_date"]},"op":{"type":"string","enum":["before","after"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["field","op","date"]},{"type":"object","properties":{"field":{"type":"string","enum":["signup_date"]},"op":{"type":"string","enum":["within_days","not_within_days"]},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["field","op","days"]},{"type":"object","properties":{"field":{"type":"string","enum":["engagement"]},"op":{"type":"string","enum":["opened_within","not_opened_within","clicked_within","not_clicked_within"]},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["field","op","days"]},{"type":"object","properties":{"field":{"type":"string","enum":["custom_field"]},"key":{"type":"string","minLength":1,"maxLength":40},"op":{"type":"string","enum":["equals"]},"value":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}},"required":["field","key","op","value"]},{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","enum":["status"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["pending_confirmation","active","unsubscribed"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["access"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["free","premium"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["tag"]},"op":{"type":"string","enum":["has","has_not"]},"tag_id":{"type":"string","description":"tag ID","example":"tag_01jabcdefghjkmnpqrstvwxyz0"}},"required":["field","op","tag_id"]},{"type":"object","properties":{"field":{"type":"string","enum":["list"]},"op":{"type":"string","enum":["in","not_in"]},"list_id":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"}},"required":["field","op","list_id"]},{"type":"object","properties":{"field":{"type":"string","enum":["source"]},"op":{"type":"string","enum":["is","is_not"]},"value":{"type":"string","enum":["form","import","api","site","paid","dashboard"]}},"required":["field","op","value"]},{"type":"object","properties":{"field":{"type":"string","enum":["signup_date"]},"op":{"type":"string","enum":["before","after"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["field","op","date"]},{"type":"object","properties":{"field":{"type":"string","enum":["signup_date"]},"op":{"type":"string","enum":["within_days","not_within_days"]},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["field","op","days"]},{"type":"object","properties":{"field":{"type":"string","enum":["engagement"]},"op":{"type":"string","enum":["opened_within","not_opened_within","clicked_within","not_clicked_within"]},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["field","op","days"]},{"type":"object","properties":{"field":{"type":"string","enum":["custom_field"]},"key":{"type":"string","minLength":1,"maxLength":40},"op":{"type":"string","enum":["equals"]},"value":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}},"required":["field","key","op","value"]}]},"maxItems":20}},"required":["match","conditions"]}]},"maxItems":20}},"required":["match","conditions"]},"ImportUpload":{"type":"object","properties":{"object":{"type":"string","enum":["import_upload"]},"import_id":{"type":"string","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"upload":{"type":"object","properties":{"method":{"type":"string","enum":["PUT"]},"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Send the raw file as the body of a `PUT` to `url` with exactly these headers (no multipart). The signature covers the key, the content type and the exact size declared in the request.","example":{"Content-Type":"text/csv"}},"expires_at":{"type":"string","example":"2026-10-15T12:00:00.000Z"}},"required":["method","url","headers","expires_at"]}},"required":["object","import_id","upload"]},"Import":{"type":"object","properties":{"object":{"type":"string","enum":["import"]},"id":{"type":"string","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"status":{"type":"string","enum":["awaiting_upload","queued","validating","awaiting_review","importing","completed","rejected","failed","canceled"],"description":"`awaiting_review` (ADR-0086): validated and waiting for Tirada to review it before anything is imported (large lists, or most rows without a last-interaction date)."},"file_name":{"type":"string"},"origin":{"type":["string","null"],"enum":["own_form","other_platform","event","purchase","other",null]},"consent_obtained_at":{"type":["string","null"],"example":"2026-10-15T12:00:00.000Z"},"totals":{"type":"object","properties":{"rows":{"type":"integer"},"processed":{"type":"integer"},"created":{"type":"integer"},"updated":{"type":"integer"},"skipped":{"type":"integer"},"rejected":{"type":"integer"}},"required":["rows","processed","created","updated","skipped","rejected"]},"by_reason":{"type":"object","additionalProperties":{"type":"integer"}},"risk":{"type":["object","null"],"properties":{"decision":{"type":"string","enum":["accepted","review","rejected"]},"metrics":{"type":"object","properties":{"invalid_rate":{"type":"number"},"globally_suppressed_rate":{"type":"number"},"known_bad_matches":{"type":"number"},"disposable_or_role_rate":{"type":"number"},"stale_rate":{"type":"number","description":"Of the rows with a last-interaction date, those older than 12 months (ADR-0086)."},"undated_rate":{"type":"number","description":"Rows without a last-interaction date (ADR-0086)."},"distinct_rows":{"type":"integer","description":"Distinct addresses of the file."},"window_rows":{"type":"integer","description":"Distinct addresses of the file plus what the workspace imported in the last 30 days (ADR-0086: more than 5,000 is reviewed)."}},"required":["invalid_rate","globally_suppressed_rate","known_bad_matches","disposable_or_role_rate","stale_rate","undated_rate","distinct_rows","window_rows"]},"triggered":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string"},"decision":{"type":"string","enum":["review","rejected"]}},"required":["metric","decision"]}}},"required":["decision","metrics","triggered"]},"row_report_available":{"type":"boolean"},"failure_reason":{"type":["string","null"]},"created_at":{"type":"string","example":"2026-10-15T12:00:00.000Z"},"started_at":{"type":["string","null"],"example":"2026-10-15T12:00:00.000Z"},"completed_at":{"type":["string","null"],"example":"2026-10-15T12:00:00.000Z"}},"required":["object","id","publication_id","status","file_name","origin","consent_obtained_at","totals","by_reason","risk","row_report_available","failure_reason","created_at","started_at","completed_at"]},"ImportList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Import"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"]},"ImportRowReport":{"type":"object","properties":{"object":{"type":"string","enum":["import_report"]},"url":{"type":"string"},"expires_at":{"type":"string","example":"2026-10-15T12:00:00.000Z"}},"required":["object","url","expires_at"]},"Export":{"type":"object","properties":{"object":{"type":"string","enum":["export"]},"id":{"type":"string","example":"exp_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"status":{"type":"string","enum":["queued","building","ready","failed","expired"]},"rows":{"type":["integer","null"]},"created_at":{"type":"string","example":"2026-10-15T12:00:00.000Z"},"ready_at":{"type":["string","null"],"example":"2026-10-15T12:00:00.000Z"},"expires_at":{"type":["string","null"],"example":"2026-10-15T12:00:00.000Z"},"download_url":{"type":["string","null"]},"download_url_expires_at":{"type":["string","null"],"example":"2026-10-15T12:00:00.000Z"}},"required":["object","id","publication_id","status","rows","created_at","ready_at","expires_at","download_url","download_url_expires_at"]},"OpsImportReviewList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/OpsImportReview"}}},"required":["object","data"]},"OpsImportReview":{"type":"object","properties":{"object":{"type":"string","enum":["import_review"]},"id":{"type":"string","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"workspace_id":{"type":"string"},"publication_id":{"type":"string"},"file_name":{"type":"string"},"rows_total":{"type":["integer","null"]},"distinct_rows":{"type":"integer"},"undated_rate":{"type":"number"},"stale_rate":{"type":"number"},"triggered":{"type":"array","items":{"type":"string"}},"origin":{"type":["string","null"],"enum":["own_form","other_platform","event","purchase","other",null]},"created_at":{"type":"string"}},"required":["object","id","workspace_id","publication_id","file_name","rows_total","distinct_rows","undated_rate","stale_rate","triggered","origin","created_at"]},"PostList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"Post":{"type":"object","properties":{"object":{"type":"string","enum":["post"]},"id":{"type":"string","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"slug":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"author_user_id":{"type":["string","null"]},"email_status":{"type":"string","enum":["none","awaiting_confirmation","scheduled","sending","sent","canceled","interrupted"]},"web_status":{"type":"string","enum":["draft","published","unpublished"]},"web_on_send":{"type":"boolean"},"seo_title":{"type":["string","null"]},"seo_description":{"type":["string","null"]},"draft_version":{"type":"integer"},"has_premium":{"type":"boolean"},"published_revision_id":{"type":["string","null"]},"web_url":{"type":"string"},"published_at":{"type":["string","null"],"description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"},"created_at":{"type":"string","description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"},"updated_at":{"type":"string","description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"}},"required":["object","id","publication_id","title","subtitle","slug","subject","preheader","author_user_id","email_status","web_status","web_on_send","seo_title","seo_description","draft_version","has_premium","published_revision_id","web_url","published_at","created_at","updated_at"]},"PostDetail":{"type":"object","properties":{"object":{"type":"string","enum":["post"]},"id":{"type":"string","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"slug":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"author_user_id":{"type":["string","null"]},"email_status":{"type":"string","enum":["none","awaiting_confirmation","scheduled","sending","sent","canceled","interrupted"]},"web_status":{"type":"string","enum":["draft","published","unpublished"]},"web_on_send":{"type":"boolean"},"seo_title":{"type":["string","null"]},"seo_description":{"type":["string","null"]},"draft_version":{"type":"integer"},"has_premium":{"type":"boolean"},"published_revision_id":{"type":["string","null"]},"web_url":{"type":"string"},"published_at":{"type":["string","null"],"description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"},"created_at":{"type":"string","description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"},"updated_at":{"type":"string","description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"},"content":{"$ref":"#/components/schemas/Document"}},"required":["object","id","publication_id","title","subtitle","slug","subject","preheader","author_user_id","email_status","web_status","web_on_send","seo_title","seo_description","draft_version","has_premium","published_revision_id","web_url","published_at","created_at","updated_at","content"]},"Document":{"type":"object","properties":{"type":{"type":"string","enum":["doc"]},"attrs":{"type":"object","properties":{"ast_version":{"type":"integer"}},"required":["ast_version"]},"content":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["type","attrs","content"]},"CreatePostRequest":{"type":"object","properties":{"title":{"type":"string","maxLength":2000},"subtitle":{"type":"string","maxLength":2000},"slug":{"type":"string","maxLength":2000},"subject":{"type":"string","maxLength":2000},"preheader":{"type":"string","maxLength":2000},"seo_title":{"type":["string","null"],"maxLength":2000},"seo_description":{"type":["string","null"],"maxLength":2000},"web_on_send":{"type":"boolean"},"content":{"type":"object","additionalProperties":{},"description":"Document AST (`{ type: \"doc\", attrs: { ast_version }, content: [...] }`)."}}},"UpdatePostRequest":{"type":"object","properties":{"base_version":{"type":"integer","minimum":1,"description":"`draft_version` the client edited (optimistic lock)."},"title":{"type":"string","maxLength":2000},"subtitle":{"type":"string","maxLength":2000},"slug":{"type":"string","maxLength":2000},"subject":{"type":"string","maxLength":2000},"preheader":{"type":"string","maxLength":2000},"seo_title":{"type":["string","null"],"maxLength":2000},"seo_description":{"type":["string","null"],"maxLength":2000},"web_on_send":{"type":"boolean"},"content":{"type":"object","additionalProperties":{},"description":"Document AST (`{ type: \"doc\", attrs: { ast_version }, content: [...] }`)."}},"required":["base_version"]},"BaseVersionRequest":{"type":"object","properties":{"base_version":{"type":"integer","minimum":1,"description":"`draft_version` the client edited (optimistic lock)."}},"required":["base_version"]},"RevisionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Revision"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"Revision":{"type":"object","properties":{"object":{"type":"string","enum":["revision"]},"id":{"type":"string","example":"rev_01jabcdefghjkmnpqrstvwxyz0"},"post_id":{"type":"string"},"reason":{"type":"string","enum":["autosave","manual","send_confirmed","welcome_enabled","published","restored"]},"name":{"type":["string","null"]},"content_hash":{"type":"string"},"author":{"$ref":"#/components/schemas/RevisionAuthor"},"send_id":{"type":["string","null"],"description":"Send that froze this revision.","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"created_at":{"type":"string","description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"}},"required":["object","id","post_id","reason","name","content_hash","author","send_id","created_at"]},"RevisionAuthor":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["user"]},"user_id":{"type":"string"}},"required":["kind","user_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["api_key","ops_agent","system"]}},"required":["kind"]}]},"NamedRevisionRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":2000}},"required":["name"]},"RevisionDetail":{"type":"object","properties":{"object":{"type":"string","enum":["revision"]},"id":{"type":"string","example":"rev_01jabcdefghjkmnpqrstvwxyz0"},"post_id":{"type":"string"},"reason":{"type":"string","enum":["autosave","manual","send_confirmed","welcome_enabled","published","restored"]},"name":{"type":["string","null"]},"content_hash":{"type":"string"},"author":{"$ref":"#/components/schemas/RevisionAuthor"},"send_id":{"type":["string","null"],"description":"Send that froze this revision.","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"created_at":{"type":"string","description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"},"title":{"type":"string"},"subtitle":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"seo_title":{"type":["string","null"]},"seo_description":{"type":["string","null"]},"draft_version":{"type":"integer"},"content":{"$ref":"#/components/schemas/Document"}},"required":["object","id","post_id","reason","name","content_hash","author","send_id","created_at","title","subtitle","subject","preheader","seo_title","seo_description","draft_version","content"]},"Preview":{"type":"object","properties":{"object":{"type":"string","enum":["preview"]},"target":{"type":"string","enum":["email","web","text","telegram"]},"body":{"type":"string","description":"Rendered output. Links are not tracked. `email`: the complete email document; `web`: the complete page of the reader site; `text`: the plain-text part; `telegram`: Bot API HTML."},"bytes":{"type":"integer"},"access":{"type":"string","enum":["free","premium"]},"hidden_blocks":{"type":"array","items":{"type":"object","properties":{"block_id":{"type":"string"},"reason":{"type":"string"}},"required":["block_id","reason"]}},"fallback_merge_tags":{"type":"array","items":{"type":"string"}}},"required":["object","target","body","bytes","access","hidden_blocks","fallback_merge_tags"]},"PreviewRequest":{"type":"object","properties":{"target":{"type":"string","enum":["email","web","text","telegram"]},"subscriber":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["synthetic"]},"access":{"type":"string","enum":["free","premium"]},"fields":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"`subscriber.*` merge tag values (`first_name`, `custom.city`…)."}},"required":["kind","access"]},{"type":"object","properties":{"kind":{"type":"string","enum":["subscriber"]},"subscription_id":{"type":"string","description":"Needs `subscribers:read`.","example":"sub_01jabcdefghjkmnpqrstvwxyz0"}},"required":["kind","subscription_id"]}]},"revision_id":{"type":"string","description":"Defaults to the latest saved draft.","example":"rev_01jabcdefghjkmnpqrstvwxyz0"}},"required":["target","subscriber"]},"PreflightReport":{"type":"object","properties":{"object":{"type":"string","enum":["preflight"]},"ok":{"type":"boolean","description":"No issue of severity `error`."},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"},"block_id":{"type":"string"},"detail":{"type":"string"}},"required":["code","severity","message"]}},"email_bytes":{"type":["object","null"],"properties":{"free":{"type":"integer"},"premium":{"type":"integer"}},"required":["free","premium"],"description":"UTF-8 size of each email variant; null when the document is invalid."}},"required":["object","ok","issues","email_bytes"]},"Theme":{"type":"object","properties":{"object":{"type":"string","enum":["theme"]},"publication_id":{"type":"string"},"theme":{"type":"object","additionalProperties":{},"description":"Partial design tokens (`colors`, `darkColors`, `fonts`, `fontSize`…)."},"email_footer":{"type":"string"},"preset":{"type":["string","null"]},"contrast":{"type":"array","items":{"$ref":"#/components/schemas/ThemeContrastIssue"},"description":"WCAG AA pairs of the resolved theme that fail (errors: text below 4.5:1, refused on `PUT` with `422 theme_contrast_insufficient`; warnings: the button below 3:1 against the surface)."},"version":{"type":"integer"},"updated_at":{"type":["string","null"],"description":"ISO 8601, UTC.","example":"2026-10-15T08:00:00.000Z"}},"required":["object","publication_id","theme","email_footer","preset","contrast","version","updated_at"]},"ThemeContrastIssue":{"type":"object","properties":{"palette":{"type":"string","enum":["light","dark"]},"foreground":{"type":"string"},"background":{"type":"string"},"ratio":{"type":"number"},"minimum":{"type":"number"},"severity":{"type":"string","enum":["error","warning"]}},"required":["palette","foreground","background","ratio","minimum","severity"]},"ThemeRequest":{"type":"object","properties":{"theme":{"type":"object","additionalProperties":{},"description":"Partial design tokens over the default theme (validated: `422 theme_invalid`)."},"email_footer":{"type":"string","maxLength":10000,"default":""},"preset":{"type":["string","null"],"maxLength":40,"description":"Gallery preset the tokens were made from (`GET …/theme/presets`), kept for the dashboard; absent or null = none. Informative only: the tokens are what renders (`422 theme_invalid` for an unknown id)."}},"required":["theme"]},"ThemePresetList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ThemePreset"}},"has_more":{"type":"boolean","enum":[false]}},"required":["object","data","has_more"]},"ThemePreset":{"type":"object","properties":{"object":{"type":"string","enum":["theme_preset"]},"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"theme":{"type":"object","additionalProperties":{},"description":"Complete design tokens of the preset."}},"required":["object","id","name","description","theme"]},"MediaUpload":{"type":"object","properties":{"media":{"$ref":"#/components/schemas/Media"},"upload":{"type":"object","properties":{"method":{"type":"string","enum":["PUT"]},"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Send the raw file as the body of a `PUT` to `url` with exactly these headers. The signature covers the type and the exact size declared in the request."},"expires_at":{"type":"string","format":"date-time"}},"required":["method","url","headers","expires_at"]}},"required":["media","upload"]},"Media":{"type":"object","properties":{"object":{"type":"string","enum":["media"]},"id":{"type":"string","example":"med_01jabcdefghjkmnpqrstvwxyz0"},"status":{"type":"string","enum":["pending","ready"]},"url":{"type":["string","null"],"description":"Public URL to use in documents. Only once `ready`."},"content_type":{"type":"string","enum":["image/jpeg","image/png","image/gif","image/webp"],"description":"Verified from the bytes once `ready`."},"bytes":{"type":"integer","description":"Real size once `ready`; the declared size while `pending`."},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"alt":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["object","id","status","url","content_type","bytes","width","height","alt","created_at"]},"CreateMediaUploadRequest":{"type":"object","properties":{"content_type":{"type":"string","minLength":1,"maxLength":100,"example":"image/jpeg"},"bytes":{"type":"integer","minimum":1,"description":"Exact size of the file, in bytes."},"filename":{"type":"string","maxLength":1000,"description":"Shown in the audit log only (at most 255 characters are kept)."},"alt":{"type":"string","maxLength":4000}},"required":["content_type","bytes"]},"MediaList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"next_cursor":{"type":["string","null"]}},"required":["object","data","next_cursor"]},"SendList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Send"}},"next_cursor":{"type":["string","null"]}},"required":["object","data","next_cursor"]},"Send":{"type":"object","properties":{"object":{"type":"string","enum":["send"]},"id":{"type":"string","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"post_id":{"type":"string"},"status":{"type":"string","enum":["awaiting_confirmation","confirmed","scheduled","sending","paused","sent","canceled","expired"]},"origin":{"type":"string","enum":["dashboard","api","mcp"]},"audience":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["all"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["lists"]},"list_ids":{"type":"array","items":{"type":"string"}}},"required":["kind","list_ids"]},{"type":"object","properties":{"kind":{"type":"string","enum":["segment"]},"segment_id":{"type":"string"}},"required":["kind","segment_id"]}]},"subject_variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"}},"required":["id","label","subject"]}},"ab_test":{"type":["object","null"],"properties":{"sample_percent":{"type":"number"},"wait_minutes":{"type":"number"},"winner_variant_id":{"type":["string","null"]},"significant":{"type":["boolean","null"]}},"required":["sample_percent","wait_minutes","winner_variant_id","significant"]},"revision_id":{"type":["string","null"]},"audience_count":{"type":["integer","null"]},"accepted":{"type":"integer"},"skipped":{"type":"integer"},"pause_reason":{"type":["string","null"],"enum":["kill_switch","quota","manual","review_hold",null]},"confirmation_url":{"type":["string","null"],"description":"Where a human confirms; null once confirmed."},"scheduled_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"confirmed_at":{"type":["string","null"]},"started_at":{"type":["string","null"]},"finished_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["object","id","publication_id","post_id","status","origin","audience","subject_variants","ab_test","revision_id","audience_count","accepted","skipped","pause_reason","confirmation_url","scheduled_at","expires_at","confirmed_at","started_at","finished_at","created_at"]},"CreateSendRequest":{"type":"object","properties":{"post_id":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"audience":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["all"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["lists"]},"list_ids":{"type":"array","items":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"minItems":1,"maxItems":50}},"required":["kind","list_ids"]},{"type":"object","properties":{"kind":{"type":"string","enum":["segment"]},"segment_id":{"type":"string","description":"segment ID","example":"seg_01jabcdefghjkmnpqrstvwxyz0"}},"required":["kind","segment_id"],"description":"A saved segment (ADR-0094): evaluated once, when the send is confirmed; the frozen audience then only shrinks."}]},"subject_variants":{"type":"array","items":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":998},"preheader":{"type":"string","maxLength":500,"default":""}},"required":["subject"]},"minItems":1,"maxItems":4},"ab_test":{"type":"object","properties":{"sample_percent":{"type":"integer"},"wait_minutes":{"type":"integer"}},"required":["sample_percent","wait_minutes"]},"scheduled_at":{"type":"string","format":"date-time"},"from_name":{"type":"string","maxLength":200},"from_address":{"type":"string","maxLength":320},"reply_to":{"type":"string","maxLength":320},"preflight":{"type":"string","enum":["block_on_errors","report_only"],"default":"block_on_errors"}},"required":["post_id","audience"]},"SendConfirmation":{"type":"object","properties":{"object":{"type":"string","enum":["send_confirmation"]},"send_id":{"type":"string"},"confirmation_digest":{"type":"string"},"audience_estimate":{"type":"integer"},"segment":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer"}},"required":["id","name","version"],"description":"For a `segment` audience (ADR-0094): the segment as reviewed. Changing its definition changes the digest."},"draft_version":{"type":"integer"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"}},"required":["id","label","subject","preheader"]}},"from_name":{"type":"string"},"from_address":{"type":"string"},"reply_to":{"type":["string","null"]},"scheduled_at":{"type":["string","null"]},"ab_test":{"type":["object","null"],"properties":{"sample_percent":{"type":"integer"},"wait_minutes":{"type":"integer"}},"required":["sample_percent","wait_minutes"]},"estimated_cost":{"type":"object","properties":{"amount_cents":{"type":"integer"},"currency":{"type":"string","enum":["eur"]}},"required":["amount_cents","currency"]},"spend_cap":{"type":["object","null"],"properties":{"cap_cents":{"type":"integer"},"projected_cents":{"type":"integer"},"exceeded":{"type":"boolean"}},"required":["cap_cents","projected_cents","exceeded"],"description":"Deprecated (ADR-0078): always null."},"email_credits":{"type":"object","properties":{"required":{"type":"integer"},"balance":{"type":"integer"},"missing_emails":{"type":"integer"},"missing_packs":{"type":"integer"},"pack_emails":{"type":"integer"},"pack_cents":{"type":"integer"},"covered":{"type":"boolean"}},"required":["required","balance","missing_emails","missing_packs","pack_emails","pack_cents","covered"],"description":"Prepaid emails against this send (ADR-0078). `covered` false: confirming fails with `email_balance_insufficient`; buy `missing_packs` with `POST /v1/workspace/billing/email-packs/checkout`."},"blockers":{"type":"array","items":{"$ref":"#/components/schemas/SendPauseCause"}},"first_send_review":{"type":"boolean","description":"ADR-0086: this is the first send the publication confirms, so after confirming it waits for Tirada to review it (a `review_hold` with reason `first_send`) and then goes out by itself."},"expires_at":{"type":"string"}},"required":["object","send_id","confirmation_digest","audience_estimate","segment","draft_version","variants","from_name","from_address","reply_to","scheduled_at","ab_test","estimated_cost","spend_cap","email_credits","blockers","first_send_review","expires_at"]},"SendPauseCause":{"type":"object","properties":{"kind":{"type":"string"}},"required":["kind"],"additionalProperties":{}},"ConfirmSendRequest":{"type":"object","properties":{"confirmation_digest":{"type":"string","minLength":1,"maxLength":200},"audience_estimate":{"type":"integer","minimum":0},"expected_draft_version":{"type":"integer","minimum":0},"schedule":{"anyOf":[{"type":"object","properties":{"now":{"type":"boolean","enum":[true]}},"required":["now"]},{"type":"object","properties":{"at":{"type":"string","format":"date-time"}},"required":["at"]}],"description":"Required when the scheduled time already passed."},"acknowledge_spend_cap":{"type":"boolean","default":false},"acknowledge_clipping":{"type":"boolean","default":false}},"required":["confirmation_digest","audience_estimate","expected_draft_version"]},"TestSendResult":{"type":"object","properties":{"object":{"type":"string","enum":["test_send"]},"id":{"type":"string"},"recipients":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"status":{"type":"string","enum":["accepted","rejected"]}},"required":["user_id","status"]}}},"required":["object","id","recipients"]},"TestSendRequest":{"type":"object","properties":{"user_ids":{"type":"array","items":{"type":"string","description":"user ID","example":"user_01jabcdefghjkmnpqrstvwxyz0"},"minItems":1,"maxItems":10},"access":{"type":"string","enum":["free","premium"],"default":"free"},"variant_label":{"type":"string","enum":["A","B","C","D"]}},"required":["user_ids"]},"RecipientSendTimeline":{"type":"object","properties":{"object":{"type":"string","enum":["recipient_send_timeline"]},"send_id":{"type":"string"},"ordinal":{"type":"integer"}},"required":["object","send_id","ordinal"],"additionalProperties":{}},"PauseDiagnosis":{"type":"object","properties":{"object":{"type":"string","enum":["pause_diagnosis"]},"publication_id":{"type":"string"},"send_id":{"type":["string","null"]},"status":{"type":["string","null"],"enum":["awaiting_confirmation","confirmed","scheduled","sending","paused","sent","canceled","expired",null]},"pause_reason":{"type":["string","null"],"enum":["kill_switch","quota","manual","review_hold",null]},"causes":{"type":"array","items":{"$ref":"#/components/schemas/SendPauseCause"}},"actionable":{"type":"boolean"}},"required":["object","publication_id","send_id","status","pause_reason","causes","actionable"]},"WelcomeEmail":{"type":"object","properties":{"object":{"type":"string","enum":["welcome_email"]},"id":{"type":"string"},"publication_id":{"type":"string"},"post_id":{"type":"string"},"revision_id":{"type":"string"},"from_name":{"type":"string"},"from_address":{"type":"string"},"sent_count":{"type":"integer"},"enabled_at":{"type":"string"}},"required":["object","id","publication_id","post_id","revision_id","from_name","from_address","sent_count","enabled_at"]},"EnableWelcomeEmailRequest":{"type":"object","properties":{"post_id":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"expected_draft_version":{"type":"integer","minimum":0},"from_name":{"type":"string","maxLength":200},"from_address":{"type":"string","maxLength":320},"reply_to":{"type":"string","maxLength":320}},"required":["post_id","expected_draft_version"]},"BillingStatus":{"type":"object","properties":{"plan":{"type":["string","null"],"enum":["no_support","ai_support","human_support",null]},"interval":{"type":["string","null"],"enum":["month","year",null]},"status":{"type":"string","enum":["none","trialing","active","past_due","paused","canceled"]},"can_confirm_sends":{"type":"boolean"},"current_period":{"$ref":"#/components/schemas/BillingPeriod"},"emails_this_period":{"type":"integer"},"spend_cap_cents":{"type":["integer","null"],"description":"Deprecated (ADR-0078: no metered usage, no spend cap): always null."},"email_credits":{"$ref":"#/components/schemas/EmailCredits"},"domain_addon":{"type":"object","properties":{"quantity":{"type":"integer"},"active":{"type":"boolean"}},"required":["quantity","active"]},"cancel_at":{"type":["string","null"]},"domain_grace_ends_at":{"type":["string","null"]},"entitlements":{"type":"object","properties":{"ai_support_assistant":{"type":"boolean"},"human_tickets":{"type":"string","enum":["included","paid","none"]},"custom_domains":{"type":"integer"},"telegram":{"type":"boolean"}},"required":["ai_support_assistant","human_tickets","custom_domains","telegram"]},"catalog_version":{"type":"string"}},"required":["plan","interval","status","can_confirm_sends","current_period","emails_this_period","spend_cap_cents","email_credits","domain_addon","cancel_at","domain_grace_ends_at","entitlements","catalog_version"]},"BillingPeriod":{"type":["object","null"],"properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"EmailCredits":{"type":"object","properties":{"balance":{"type":"integer","description":"Emails the workspace can send now."},"pack":{"type":"object","properties":{"emails":{"type":"integer"},"price_cents":{"type":"integer"},"currency":{"type":"string","enum":["eur"]}},"required":["emails","price_cents","currency"]},"trial":{"type":"object","properties":{"gift_emails":{"type":"integer"},"granted_at":{"type":["string","null"]},"settled_at":{"type":["string","null"]}},"required":["gift_emails","granted_at","settled_at"]}},"required":["balance","pack","trial"]},"BillingCheckoutResult":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["checkout"]},"url":{"type":"string"},"expires_at":{"type":"string"}},"required":["kind","url","expires_at"]},{"type":"object","properties":{"kind":{"type":"string","enum":["changed"]},"status":{"$ref":"#/components/schemas/BillingStatus"}},"required":["kind","status"]}]},"BillingCatalog":{"type":"object","properties":{"version":{"type":"string"},"currency":{"type":"string","enum":["eur"]},"plans":{"type":"array","items":{"type":"object","properties":{"plan":{"type":"string","enum":["no_support","ai_support","human_support"]},"name":{"type":"string","description":"Public name (Lite, Basic, Pro)."},"monthly_cents":{"type":"integer"},"yearly_cents":{"type":"integer","description":"Annual price: annual_months_charged × monthly."},"ai_assistant":{"type":"boolean"},"incident_management":{"type":"object","properties":{"included":{"type":"boolean"},"price_cents":{"type":["integer","null"],"description":"One-off price; null when included."}},"required":["included","price_cents"]}},"required":["plan","name","monthly_cents","yearly_cents","ai_assistant","incident_management"]}},"annual_months_charged":{"type":"integer"},"email_pack":{"type":"object","properties":{"emails":{"type":"integer"},"price_cents":{"type":"integer"},"max_per_purchase":{"type":"integer"}},"required":["emails","price_cents","max_per_purchase"]},"domain_addon":{"type":"object","properties":{"monthly_cents":{"type":"integer"},"yearly_cents":{"type":"integer"},"max_quantity":{"type":"integer","description":"Most custom domains one subscription can carry (0: the add-on is not sold here)."}},"required":["monthly_cents","yearly_cents","max_quantity"]},"trial":{"type":"object","properties":{"days":{"type":"integer"},"gift_emails":{"type":"integer"}},"required":["days","gift_emails"]}},"required":["version","currency","plans","annual_months_charged","email_pack","domain_addon","trial"]},"BillingPortal":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"EmailCreditLedger":{"type":"object","properties":{"credits":{"$ref":"#/components/schemas/EmailCredits"},"entries":{"type":"array","items":{"$ref":"#/components/schemas/EmailCreditEntry"}}},"required":["credits","entries"]},"EmailCreditEntry":{"type":"object","properties":{"kind":{"type":"string","enum":["pack_purchase","trial_grant","trial_deduction","send_debit","adjustment"]},"emails":{"type":"integer","description":"Signed: credits positive, debits negative."},"packs":{"type":["integer","null"]},"send_id":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["kind","emails","packs","send_id","created_at"]},"EmailPackCheckout":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string"}},"required":["url","expires_at"]},"BillingUsage":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/BillingPeriod"},"emails":{"type":"integer"},"variable_cost_cents":{"type":"integer","description":"What these emails are worth at the pack price (paid from the prepaid balance)."},"currency":{"type":"string","enum":["eur"]},"reported_units":{"type":"integer","description":"Deprecated (ADR-0078: nothing is reported to the provider): always 0."},"forecast_emails":{"type":"integer"},"sends":{"type":"array","items":{"$ref":"#/components/schemas/BillingUsageBySend"}}},"required":["period","emails","variable_cost_cents","currency","reported_units","forecast_emails","sends"]},"BillingUsageBySend":{"type":"object","properties":{"send_id":{"type":"string","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"kind":{"type":"string","enum":["send","welcome"]},"emails":{"type":"integer"},"cost_cents":{"type":"integer"}},"required":["send_id","publication_id","kind","emails","cost_cents"]},"BillingEstimate":{"type":"object","properties":{"emails":{"type":"integer"},"estimated_cost_cents":{"type":"integer"},"currency":{"type":"string","enum":["eur"]},"spend_cap":{"type":["object","null"],"properties":{"cap_cents":{"type":"integer"},"projected_cents":{"type":"integer"},"exceeded":{"type":"boolean"}},"required":["cap_cents","projected_cents","exceeded"],"description":"Deprecated (ADR-0078): always null."},"email_credits":{"type":"object","properties":{"balance":{"type":"integer"},"missing_emails":{"type":"integer"},"missing_packs":{"type":"integer"},"covered":{"type":"boolean"}},"required":["balance","missing_emails","missing_packs","covered"]},"can_confirm_sends":{"type":"boolean"},"block_reason":{"type":["string","null"]}},"required":["emails","estimated_cost_cents","currency","spend_cap","email_credits","can_confirm_sends","block_reason"]},"SupportTicketList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SupportTicket"}}},"required":["object","data"]},"SupportTicket":{"type":"object","properties":{"id":{"type":"string","example":"tkt_01jabcdefghjkmnpqrstvwxyz0"},"status":{"type":"string","enum":["awaiting_payment","open","closed","canceled"]},"subject":{"type":"string"},"plan_at_open":{"type":["string","null"],"enum":["no_support","ai_support","human_support",null]},"price_cents":{"type":"integer"},"currency":{"type":"string","enum":["eur"]},"included":{"type":"boolean"},"checkout_url":{"type":["string","null"]},"resolution":{"type":["string","null"],"enum":["resolved","unresolved","tirada_fault",null]},"refund":{"type":"object","properties":{"status":{"type":"string","enum":["none","pending","refunded","approval_required","failed"]},"amount_cents":{"type":"integer"}},"required":["status","amount_cents"]},"opened_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","status","subject","plan_at_open","price_cents","currency","included","checkout_url","resolution","refund","opened_at","closed_at"]},"OpsSupportTicketList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/OpsSupportTicket"}}},"required":["object","data"]},"OpsSupportTicket":{"type":"object","properties":{"id":{"type":"string","example":"tkt_01jabcdefghjkmnpqrstvwxyz0"},"workspace_id":{"type":"string","example":"ws_01jabcdefghjkmnpqrstvwxyz0"},"status":{"type":"string","enum":["awaiting_payment","open","closed","canceled"]},"subject":{"type":"string"},"body":{"type":"string","description":"Untrusted text written by the creator."},"plan_at_open":{"type":["string","null"],"enum":["no_support","ai_support","human_support",null]},"included":{"type":"boolean"},"price_cents":{"type":"integer"},"currency":{"type":"string","enum":["eur"]},"opened_at":{"type":"string"}},"required":["id","workspace_id","status","subject","body","plan_at_open","included","price_cents","currency","opened_at"]},"ResolveSupportTicket":{"type":"object","properties":{"resolution":{"type":"string","enum":["resolved","unresolved","tirada_fault"]},"fault_category":{"type":["string","null"],"enum":["bug","infrastructure_outage","send_failed_by_us","billing_error",null]},"evidence_refs":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_:./-]+$"},"maxItems":20}},"required":["resolution","evidence_refs"],"additionalProperties":false},"RefundRequestList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/RefundRequest"}}},"required":["object","data"]},"RefundRequest":{"type":"object","properties":{"id":{"type":"string","description":"Internal id of the approval request."},"workspace_id":{"type":"string"},"ticket_id":{"type":"string","example":"tkt_01jabcdefghjkmnpqrstvwxyz0"},"amount_cents":{"type":"integer"},"currency":{"type":"string","enum":["eur"]},"reason":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"}},"required":["id","workspace_id","ticket_id","amount_cents","currency","reason","status","created_at"]},"ChannelConnectionWithPosts":{"allOf":[{"$ref":"#/components/schemas/ChannelConnection"},{"type":"object","properties":{"recent_posts":{"type":"array","items":{"$ref":"#/components/schemas/ChannelPost"},"description":"Latest 10 publications, newest first."}},"required":["recent_posts"]}]},"ChannelPost":{"type":"object","properties":{"id":{"type":"string","example":"chp_01jabcdefghjkmnpqrstvwxyz0"},"connection_id":{"type":"string"},"post_id":{"type":"string"},"status":{"type":"string","enum":["queued","in_flight","published","failed","skipped"]},"trigger":{"type":"string","enum":["auto","manual"]},"message_id":{"type":["string","null"]},"failure_reason":{"type":["string","null"],"enum":["bot_not_admin","chat_not_found","message_rejected","unknown_outcome","rate_limited_exhausted","post_not_published","connection_inactive",null]},"created_at":{"type":"string"},"published_at":{"type":["string","null"]}},"required":["id","connection_id","post_id","status","trigger","message_id","failure_reason","created_at","published_at"]},"ChannelConnection":{"type":"object","properties":{"id":{"type":"string","example":"chn_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string"},"kind":{"type":"string","enum":["telegram"]},"status":{"type":"string","enum":["pending","connected","needs_attention","disconnected"]},"chat_id":{"type":["string","null"],"description":"Telegram chat id (decimal string). Null while pending."},"title":{"type":["string","null"]},"username":{"type":["string","null"]},"autopublish":{"type":"boolean"},"created_at":{"type":"string"},"connected_at":{"type":["string","null"]},"last_published_at":{"type":["string","null"]},"last_error":{"type":["string","null"],"enum":["bot_not_admin","chat_not_found","message_rejected","unknown_outcome","rate_limited_exhausted","post_not_published","connection_inactive",null]}},"required":["id","publication_id","kind","status","chat_id","title","username","autopublish","created_at","connected_at","last_published_at","last_error"]},"ChannelConnectionCreated":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/ChannelConnection"},"code":{"type":"string","description":"One-time connection code. Shown only in this response; post it in the channel within 1 hour.","example":"tirada-3q2v9VZsXkAa1bC4dE5fGg"},"code_expires_at":{"type":"string"},"bot_username":{"type":"string"},"instructions":{"type":"array","items":{"type":"string"}}},"required":["connection","code","code_expires_at","bot_username","instructions"]},"ApiKeyList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["object","data"]},"ApiKey":{"type":"object","properties":{"object":{"type":"string","enum":["api_key"]},"id":{"type":"string","example":"key_01jabcdefghjkmnpqrstvwxyz0"},"name":{"type":"string"},"prefix":{"type":"string","description":"Public part of the key (`trd_live_<prefix>`), for recognising it. Never the secret.","example":"trd_live_a1B2c3D4"},"scopes":{"type":"array","items":{"type":"string"}},"publication_ids":{"type":["array","null"],"items":{"type":"string"},"description":"`null`: every publication its creator can reach."},"default_version":{"type":"string","example":"2026-10-01"},"status":{"type":"string","enum":["active","suspended","revoked"]},"suspended_reason":{"type":["string","null"],"enum":["creator_removed","creator_role_changed","creator_access_lost","creator_sessions_revoked",null]},"created_by":{"type":"string","example":"user_01jabcdefghjkmnpqrstvwxyz0"},"created_at":{"type":"string","format":"date-time","example":"2026-10-15T10:00:00.000Z"},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"rolled_from_id":{"type":["string","null"]},"last_used_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"}},"required":["object","id","name","prefix","scopes","publication_ids","default_version","status","suspended_reason","created_by","created_at","expires_at","rolled_from_id","last_used_at"]},"IssuedApiKey":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","properties":{"token":{"type":"string","description":"The full key. Shown only in this response: store it now, Tirada keeps only its hash.","example":"trd_live_a1B2c3D4_0123456789abcdefghijABCDEFGHIJ0123456789abc"}},"required":["token"]}]},"ApiKeyUsage":{"type":"object","properties":{"object":{"type":"string","enum":["api_key_usage"]},"api_key_id":{"type":"string"},"last_used_at":{"type":["string","null"],"format":"date-time","example":"2026-10-15T10:00:00.000Z"},"requests_last_30_days":{"type":"integer"},"unused":{"type":"boolean","description":"No use (or never used) in the last 90 days."}},"required":["object","api_key_id","last_used_at","requests_last_30_days","unused"]},"WebhookEndpointList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["object","data"]},"WebhookEndpoint":{"type":"object","properties":{"object":{"type":"string","enum":["webhook_endpoint"]},"id":{"type":"string","example":"whe_01jabcdefghjkmnpqrstvwxyz0"},"url":{"type":"string","example":"https://hooks.example.com/tirada"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"},"example":["subscriber.created","subscription.*"]},"publications":{"type":["array","null"],"items":{"type":"string"},"description":"Null: every publication the creator can read."},"api_version":{"type":"string","example":"2026-10-01"},"status":{"type":"string","enum":["enabled","disabled"]},"disabled_reason":{"type":["string","null"],"enum":["automatic","manual","gone","creator_access_lost","creator_sessions_revoked",null]},"created_by":{"type":"string","example":"user_01jabcdefghjkmnpqrstvwxyz0"},"created_at":{"type":"string","example":"2026-10-15T09:12:44.000Z"},"failing_since":{"type":["string","null"],"example":"2026-10-15T09:12:44.000Z"},"last_success_at":{"type":["string","null"],"example":"2026-10-15T09:12:44.000Z"},"secret_rolling":{"type":"boolean","description":"Both secrets sign during the 24 h after a roll."}},"required":["object","id","url","description","events","publications","api_version","status","disabled_reason","created_by","created_at","failing_since","last_success_at","secret_rolling"]},"WebhookEndpointWithSecret":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","properties":{"secret":{"type":"string","description":"Signing secret (`whsec_…`). Shown only in this response.","example":"whsec_3q2-7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},"required":["secret"]}]},"DeletedWebhookEndpoint":{"type":"object","properties":{"object":{"type":"string","enum":["webhook_endpoint"]},"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["object","id","deleted"]},"WebhookDelivery":{"type":"object","properties":{"object":{"type":"string","enum":["webhook_delivery"]},"id":{"type":"string","example":"whd_01jabcdefghjkmnpqrstvwxyz0"},"endpoint_id":{"type":"string"},"event_id":{"type":"string","description":"Same as `Tirada-Webhook-Id`: stable across attempts and replays."},"type":{"type":"string"},"publication_id":{"type":["string","null"]},"status":{"type":"string","enum":["pending","retrying","succeeded","failed","skipped"]},"attempts":{"type":"integer"},"next_attempt_at":{"type":["string","null"],"example":"2026-10-15T09:12:44.000Z"},"last_status_code":{"type":["integer","null"]},"last_error":{"type":["string","null"]},"test":{"type":"boolean"},"erased":{"type":"boolean","description":"Erased by GDPR: reduced payload, no replay nor retry."},"payload":{"$ref":"#/components/schemas/WebhookEnvelope"},"payload_withheld":{"type":"boolean"},"created_at":{"type":"string","example":"2026-10-15T09:12:44.000Z"}},"required":["object","id","endpoint_id","event_id","type","publication_id","status","attempts","next_attempt_at","last_status_code","last_error","test","erased","payload","payload_withheld","created_at"]},"WebhookEnvelope":{"type":["object","null"],"properties":{"id":{"type":"string","example":"evt_01jabcdefghjkmnpqrstvwxyz0"},"type":{"type":"string","example":"subscriber.created"},"api_version":{"type":"string"},"created":{"type":"string","example":"2026-10-15T09:12:44.000Z"},"workspace_id":{"type":"string"},"publication_id":{"type":["string","null"]},"data":{"type":"object","properties":{"object":{},"previous_attributes":{}}}},"required":["id","type","api_version","created","workspace_id","publication_id","data"],"description":"Null when you cannot read this event family on its publication (`payload_withheld`)."},"WebhookDeliveryList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"WebhookReplay":{"type":"object","properties":{"object":{"type":"string","enum":["webhook_replay"]},"endpoint_id":{"type":"string"},"requested":{"type":"integer","description":"Deliveries that get one extra attempt."}},"required":["object","endpoint_id","requested"]},"AnalyticsSendStats":{"type":"object","properties":{"send_id":{"type":"string","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":"string","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"post_id":{"type":"string","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"status":{"type":"string","enum":["awaiting_confirmation","confirmed","scheduled","sending","paused","sent","canceled","expired"]},"started_at":{"type":["string","null"]},"finished_at":{"type":["string","null"]},"counts":{"$ref":"#/components/schemas/AnalyticsCounts"},"rates":{"$ref":"#/components/schemas/AnalyticsRates"},"freshness":{"type":"object","properties":{"computed_at":{"type":"string"},"verified_through":{"type":"string","description":"Verified opens and clicks are final up to this instant (tracking)."},"provisional":{"type":"boolean","description":"True until 72 h after the send finished."}},"required":["computed_at","verified_through","provisional"]}},"required":["send_id","publication_id","post_id","status","started_at","finished_at","counts","rates","freshness"]},"AnalyticsCounts":{"type":"object","properties":{"audience":{"type":"integer","minimum":0},"accepted":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"delivered":{"type":"integer","minimum":0},"hard_bounces":{"type":"integer","minimum":0},"soft_bounces":{"type":"integer","minimum":0},"complaints":{"type":"integer","minimum":0},"rejected":{"type":"integer","minimum":0},"raw_opens":{"type":"integer","minimum":0},"verified_opens":{"type":"integer","minimum":0},"unique_verified_opens":{"type":"integer","minimum":0},"bot_opens":{"type":"integer","minimum":0},"raw_clicks":{"type":"integer","minimum":0},"verified_clicks":{"type":"integer","minimum":0},"unique_verified_clicks":{"type":"integer","minimum":0},"bot_clicks":{"type":"integer","minimum":0},"unsubscribes":{"type":"integer","minimum":0}},"required":["audience","accepted","skipped","delivered","hard_bounces","soft_bounces","complaints","rejected","raw_opens","verified_opens","unique_verified_opens","bot_opens","raw_clicks","verified_clicks","unique_verified_clicks","bot_clicks","unsubscribes"]},"AnalyticsRates":{"type":"object","properties":{"delivery_rate":{"$ref":"#/components/schemas/AnalyticsRate"},"hard_bounce_rate":{"$ref":"#/components/schemas/AnalyticsRate"},"soft_bounce_rate":{"$ref":"#/components/schemas/AnalyticsRate"},"complaint_rate":{"$ref":"#/components/schemas/AnalyticsRate"},"verified_open_rate":{"$ref":"#/components/schemas/AnalyticsRate"},"verified_click_rate":{"$ref":"#/components/schemas/AnalyticsRate"},"unsubscribe_rate":{"$ref":"#/components/schemas/AnalyticsRate"},"open_bot_rate":{"$ref":"#/components/schemas/AnalyticsRate"},"click_bot_rate":{"$ref":"#/components/schemas/AnalyticsRate"}},"required":["delivery_rate","hard_bounce_rate","soft_bounce_rate","complaint_rate","verified_open_rate","verified_click_rate","unsubscribe_rate","open_bot_rate","click_bot_rate"]},"AnalyticsRate":{"type":"object","properties":{"value":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Fraction in [0, 1]; null when the denominator is 0."},"numerator":{"type":"integer","minimum":0},"denominator":{"type":"integer","minimum":0}},"required":["value","numerator","denominator"]},"AnalyticsPostStats":{"type":"object","properties":{"post_id":{"type":"string"},"publication_id":{"type":"string"},"title":{"type":"string"},"sends":{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsSendStats"}},"totals":{"$ref":"#/components/schemas/AnalyticsMetricSet"}},"required":["post_id","publication_id","title","sends","totals"]},"AnalyticsMetricSet":{"type":"object","properties":{"counts":{"$ref":"#/components/schemas/AnalyticsCounts"},"rates":{"$ref":"#/components/schemas/AnalyticsRates"}},"required":["counts","rates"]},"AnalyticsGrowth":{"type":"object","properties":{"publication_id":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"granularity":{"type":"string","enum":["day","week","month"]},"points":{"type":"array","items":{"type":"object","properties":{"period_start":{"type":"string"},"channel":{"type":"string","enum":["form","import","api","site","paid","dashboard"]},"gained":{"type":"integer"},"unsubscribed":{"type":"integer"},"removed":{"type":"integer"},"net":{"type":"integer"},"pending_created":{"type":"integer"}},"required":["period_start","channel","gained","unsubscribed","removed","net","pending_created"]}},"active_at_start":{"type":"integer"},"active_at_end":{"type":"integer"}},"required":["publication_id","from","to","granularity","points","active_at_start","active_at_end"]},"OAuthAuthorizationRequest":{"type":"object","properties":{"object":{"type":"string","enum":["oauth_authorization_request"]},"id":{"type":"string"},"client":{"type":"object","properties":{"id":{"type":"string","example":"mcpc_01jabcdefghjkmnpqrstvwxyz0"},"declared_name":{"type":"string","description":"Declared by the client. Not verified: anyone can say \"Claude\"."},"name_verified":{"type":"boolean","enum":[false]},"redirect_host":{"type":"string","description":"Where the authorization returns: show it prominently."},"registered_at":{"type":"string"}},"required":["id","declared_name","name_verified","redirect_host","registered_at"]},"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"available_workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","contributor"]}},"required":["id","name","role"]}},"requested_scopes":{"type":"array","items":{"type":"string"},"example":["posts:read","analytics:read"]},"grantable_scopes":{"type":"array","items":{"type":"string"},"example":["posts:read","analytics:read"],"description":"Preselection: what approve accepts for your role."},"publications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"]}},"new_client":{"type":"boolean","description":"You never connected this client: show a strong warning."},"new_redirect_host":{"type":"boolean","description":"You never used this redirect host: strong warning."},"expires_at":{"type":"string"}},"required":["object","id","client","workspace","available_workspaces","requested_scopes","grantable_scopes","publications","new_client","new_redirect_host","expires_at"]},"OAuthConsentRedirect":{"type":"object","properties":{"redirect_url":{"type":"string"}},"required":["redirect_url"]},"McpConnectionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/McpConnection"}}},"required":["object","data"]},"McpConnection":{"type":"object","properties":{"object":{"type":"string","enum":["mcp_connection"]},"id":{"type":"string","example":"mcpg_01jabcdefghjkmnpqrstvwxyz0"},"client_id":{"type":"string"},"client_name":{"type":"string","description":"Declared by the client; not verified."},"redirect_host":{"type":"string"},"user_id":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"},"example":["posts:read","analytics:read"]},"publication_ids":{"type":["array","null"],"items":{"type":"string"}},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}},"required":["object","id","client_id","client_name","redirect_host","user_id","scopes","publication_ids","created_at","last_used_at","revoked_at"]}},"parameters":{}},"paths":{"/feature-flags":{"get":{"tags":["Feature flags"],"summary":"List feature flags as seen by the caller’s workspace","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Evaluate publication-level overrides for this publication.","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"Evaluate publication-level overrides for this publication.","name":"publication_id","in":"query"}],"responses":{"200":{"description":"Evaluated flags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/feature-flags/{key}":{"put":{"tags":["Feature flags"],"summary":"Set or remove an override (operations only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"key","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","description":"workspace ID","example":"ws_01jabcdefghjkmnpqrstvwxyz0"},"publication_id":{"type":["string","null"],"default":null,"description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"enabled":{"type":["boolean","null"],"description":"`null` removes the override."}},"required":["workspace_id","enabled"]}}}},"responses":{"200":{"description":"The flag as now evaluated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlag"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/magic-links":{"post":{"tags":["Authentication"],"summary":"Ask for a login link by email (sign-in or sign-up)","description":"Always `202` with the same body, whether the email has an account and whether a limit was hit. Sets the `__Host-tirada_pairing` cookie so this browser can later claim an approval from the phone.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkRequest"}}}},"responses":{"202":{"description":"Accepted (an email is sent if the account can log in)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkRequested"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/magic-links/preview":{"post":{"tags":["Authentication"],"summary":"What a login link would do, without using it","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkToken"}}}},"responses":{"200":{"description":"The link is valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkPreview"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/magic-links/confirm":{"post":{"tags":["Authentication"],"summary":"Use a login link in this browser","description":"Requires an allowed `Origin`. Sets `__Host-tirada_session` and returns the session.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkToken"}}}},"responses":{"200":{"description":"Logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkConfirmed"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/magic-links/approve":{"post":{"tags":["Authentication"],"summary":"Approve, from the phone, the computer that asked for the link","description":"Requires an allowed `Origin`. Never creates a session here; the computer claims it.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkApproval"}}}},"responses":{"200":{"description":"Approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingApproved"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/magic-links/deny":{"post":{"tags":["Authentication"],"summary":"“No fui yo”: spend a login link you did not ask for","description":"Requires an allowed `Origin`. Consumes the link and rejects its pairing, so the computer that asked can never claim a session.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkToken"}}}},"responses":{"200":{"description":"Denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkDenied"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/pairings/{pairing_id}/claim":{"post":{"tags":["Authentication"],"summary":"Poll for the phone’s approval (the computer that asked for the link)","description":"Requires an allowed `Origin` and the pairing cookie. Poll every 2 seconds.","security":[],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"pairing_id","in":"path"}],"responses":{"200":{"description":"Pairing state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingClaim"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/reauthenticate":{"post":{"tags":["Authentication"],"summary":"Email a link that re-authenticates this session (sensitive actions)","description":"Authentication: dashboard session cookie `__Host-tirada_session` (set by the login routes); mutations also need `X-CSRF-Token` (from `GET /v1/session`) and an allowed `Origin`. API keys and MCP tokens get `403 human_session_required`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReauthenticateRequest"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Accepted"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/session":{"get":{"tags":["Sessions"],"summary":"The current dashboard session","description":"Authentication: dashboard session cookie `__Host-tirada_session` (set by the login routes); mutations also need `X-CSRF-Token` (from `GET /v1/session`) and an allowed `Origin`. API keys and MCP tokens get `403 human_session_required`.","responses":{"200":{"description":"Session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Sessions"],"summary":"Log out","description":"Authentication: dashboard session cookie `__Host-tirada_session` (set by the login routes); mutations also need `X-CSRF-Token` (from `GET /v1/session`) and an allowed `Origin`. API keys and MCP tokens get `403 human_session_required`.","responses":{"204":{"description":"Logged out"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/session/workspace":{"put":{"tags":["Sessions"],"summary":"Select the workspace of this session","description":"Authentication: dashboard session cookie `__Host-tirada_session` (set by the login routes); mutations also need `X-CSRF-Token` (from `GET /v1/session`) and an allowed `Origin`. API keys and MCP tokens get `403 human_session_required`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectWorkspace"}}}},"responses":{"200":{"description":"Selected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectedWorkspace"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions":{"get":{"tags":["Sessions"],"summary":"Active sessions of the current user","description":"Authentication: dashboard session cookie `__Host-tirada_session` (set by the login routes); mutations also need `X-CSRF-Token` (from `GET /v1/session`) and an allowed `Origin`. API keys and MCP tokens get `403 human_session_required`.","responses":{"200":{"description":"Sessions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions/{session_id}":{"delete":{"tags":["Sessions"],"summary":"Close one of your sessions","description":"Authentication: dashboard session cookie `__Host-tirada_session` (set by the login routes); mutations also need `X-CSRF-Token` (from `GET /v1/session`) and an allowed `Origin`. API keys and MCP tokens get `403 human_session_required`.","parameters":[{"schema":{"type":"string","description":"session ID","example":"ses_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"session ID","name":"session_id","in":"path"}],"responses":{"204":{"description":"Closed"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions/revoke-all":{"post":{"tags":["Sessions"],"summary":"Close all your sessions","description":"Authentication: dashboard session cookie `__Host-tirada_session` (set by the login routes); mutations also need `X-CSRF-Token` (from `GET /v1/session`) and an allowed `Origin`. API keys and MCP tokens get `403 human_session_required`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeAllSessions"}}}},"responses":{"200":{"description":"Closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokedSessions"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/users/{user_id}/sessions/revoke":{"post":{"tags":["Operations"],"summary":"Revoke every session of a user (ops:revoke_sessions)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"user ID","example":"user_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"user ID","name":"user_id","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokedSessions"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces":{"post":{"tags":["Workspaces"],"summary":"Create a workspace (you become its owner)","security":[],"description":"Sesión del dashboard (cookie); las claves de API y los tokens MCP reciben 403.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Workspaces"],"summary":"Workspaces you belong to","security":[],"description":"Sesión del dashboard (cookie); las claves de API y los tokens MCP reciben 403.","responses":{"200":{"description":"Your workspaces","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSummaryList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace":{"get":{"tags":["Workspaces"],"summary":"The current workspace","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Workspaces"],"summary":"Rename the current workspace","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"The workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications":{"get":{"tags":["Publications"],"summary":"Publications you have access to","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Publications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Publications"],"summary":"Create a publication","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","maxLength":100,"description":"DNS label, unique across Tirada, immutable."},"name":{"type":"string","maxLength":200},"description":{"type":["string","null"],"maxLength":1000},"language":{"type":"string","maxLength":35},"timezone":{"type":"string","maxLength":64},"sender_name":{"type":"string","maxLength":200},"reply_to":{"type":["string","null"],"maxLength":320},"double_opt_in_default":{"type":"boolean","description":"Changing it needs a person signed in to the dashboard (never an API key or MCP token)."}},"required":["slug","name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}":{"get":{"tags":["Publications"],"summary":"A publication","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"The publication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Publications"],"summary":"Change publication settings (the slug cannot change)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"description":{"type":["string","null"],"maxLength":1000},"language":{"type":"string","maxLength":35},"timezone":{"type":"string","maxLength":64},"sender_name":{"type":"string","maxLength":200},"reply_to":{"type":["string","null"],"maxLength":320},"double_opt_in_default":{"type":"boolean","description":"Changing it needs a person signed in to the dashboard (never an API key or MCP token)."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The publication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/archive":{"post":{"tags":["Publications"],"summary":"Archive a publication: it stops sending and its website stops being served","description":"Needs a recent re-authentication. Idempotent.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"The archived publication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/members":{"get":{"tags":["Members"],"summary":"Members of the workspace, with their publication overrides","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Members","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/members/{membership_id}":{"patch":{"tags":["Members"],"summary":"Change a member's workspace role","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"membership ID","example":"mem_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"membership ID","name":"membership_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","member","contributor"]}},"required":["role"],"additionalProperties":false}}}},"responses":{"200":{"description":"The member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Members"],"summary":"Remove a member, or leave the workspace (your own membership)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"membership ID","example":"mem_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"membership ID","name":"membership_id","in":"path"}],"responses":{"204":{"description":"Removed"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/members/{membership_id}":{"put":{"tags":["Members"],"summary":"Set a member's role on one publication (`none` = no access)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"membership ID","example":"mem_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"membership ID","name":"membership_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member","contributor","none"]}},"required":["role"],"additionalProperties":false}}}},"responses":{"200":{"description":"The member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Members"],"summary":"Remove a member's publication override (the workspace role applies again)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"membership ID","example":"mem_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"membership ID","name":"membership_id","in":"path"}],"responses":{"200":{"description":"The member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/invitations":{"get":{"tags":["Invitations"],"summary":"Pending invitations","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Invitations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Invitations"],"summary":"Invite someone by email (single use, 7 days)","description":"Needs a recent re-authentication.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320},"role":{"type":"string","enum":["owner","admin","member","contributor"]},"publications":{"type":"array","items":{"type":"object","properties":{"publication_id":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"role":{"type":"string","enum":["admin","member","contributor","none"]}},"required":["publication_id","role"],"additionalProperties":false},"maxItems":200}},"required":["email","role"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/invitations/{invitation_id}":{"delete":{"tags":["Invitations"],"summary":"Revoke a pending invitation","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"invitation ID","example":"inv_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"invitation ID","name":"invitation_id","in":"path"}],"responses":{"204":{"description":"Revoked"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/invitations/{invitation_id}/resend":{"post":{"tags":["Invitations"],"summary":"Resend an invitation with a new link and expiry (the previous link stops working)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"invitation ID","example":"inv_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"invitation ID","name":"invitation_id","in":"path"}],"responses":{"200":{"description":"The invitation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invitations/accept":{"post":{"tags":["Invitations"],"summary":"Accept an invitation (signed in with the invited email)","security":[],"description":"Sesión del dashboard (cookie); las claves de API y los tokens MCP reciben 403.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","maxLength":200}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Joined","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationAcceptance"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/links":{"get":{"tags":["Tracking"],"summary":"Tracked links of a send with verified and raw click counts","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"responses":{"200":{"description":"Links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackedLinkList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/sends/{send_id}/links/{link_index}/disable":{"post":{"tags":["Ops"],"summary":"Disable a tracked link after the send (operations only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":16383},"required":false,"name":"link_index","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","enum":["phishing","malware","abuse_report","other"]},"note":{"type":["string","null"],"maxLength":2000,"default":null}},"required":["reason"]}}}},"responses":{"200":{"description":"The link is disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisabledTrackedLink"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/deliverability":{"get":{"tags":["Deliverability"],"summary":"Deliverability report of a publication over a rolling window","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":90,"default":30,"description":"Window in UTC days, today included (1–90)."},"required":false,"description":"Window in UTC days, today included (1–90).","name":"window_days","in":"query"}],"responses":{"200":{"description":"The report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverabilityReport"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/suppressions":{"get":{"tags":["Deliverability"],"summary":"List the publication-layer suppressions, newest first","description":"Only this publication’s own layer. Network (global) suppressions are never listed: they come from mail of other tenants.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","enum":["hard_bounce","mailbox_full","dns","complaint","serial_complainer","spamtrap","sunset","legal","manual","abuse","unclassified_repeat"]},"required":false,"name":"reason","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true`: in force now; `false`: removed or expired."},"required":false,"description":"`true`: in force now; `false`: removed or expired.","name":"active","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":512,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"}],"responses":{"200":{"description":"One page of suppressions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Deliverability"],"summary":"Suppress an address manually for this publication","description":"The address is normalized and hashed at once and never stored nor returned. `list_id` limits the suppression to one list of the publication.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"example":"reader@example.com"},"list_id":{"type":["string","null"],"default":null,"description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"}},"required":["email"]}}}},"responses":{"201":{"description":"Suppressed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Suppression"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/suppressions/{suppression_id}":{"delete":{"tags":["Deliverability"],"summary":"Lift a suppression of this publication","description":"Only when the policy lets the creator lift it (`liftable_by` contains `creator`). A complaint is never liftable here (`suppression_not_liftable`): only a confirmed re-subscription of the reader ends it.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"suppression ID","example":"sup_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"suppression ID","name":"suppression_id","in":"path"}],"responses":{"200":{"description":"The suppression, now removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Suppression"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/review-holds":{"get":{"tags":["Ops"],"summary":"Open review holds (ops queue)","description":"Requires `ops:review_holds`. An agent bound to a workspace only sees that workspace’s holds. Paginated keyset over the global directory (`created_at`, `hold_id`), oldest first, ≤ 200 per page.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":512,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"}],"responses":{"200":{"description":"One page of open holds, oldest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsReviewHoldList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/review-holds/{hold_id}/release":{"post":{"tags":["Ops"],"summary":"Release a review hold","description":"Requires `ops:review_holds`. The note is mandatory and audited.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"review_hold ID","example":"hold_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"review_hold ID","name":"hold_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":2000}},"required":["note"]}}}},"responses":{"200":{"description":"The released hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewHold"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/global-suppressions/{suppression_id}/lift":{"post":{"tags":["Ops"],"summary":"Lift a network suppression (founder only)","description":"Requires `ops:global_suppressions`, which no ops agent holds in v0. Only when `ops` is in the lift policy.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"suppression ID","example":"sup_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"suppression ID","name":"suppression_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"justification":{"type":"string","maxLength":1000}},"required":["justification"]}}}},"responses":{"200":{"description":"Lifted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalSuppressionLift"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/payments/account":{"get":{"tags":["Payments"],"summary":"Connected Stripe account and payments health of a publication","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Payments status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentsStatus"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Payments"],"summary":"Disconnect the Stripe account: stop selling; readers keep access until their known end date","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Disconnected account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedAccount"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/payments/account/onboarding-link":{"post":{"tags":["Payments"],"summary":"Start connecting a Stripe account (OAuth for an existing one, hosted onboarding for a new one)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["oauth","create"]}},"required":["mode"]}}}},"responses":{"200":{"description":"Where to send the creator","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingLink"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/payments/account/connect":{"post":{"tags":["Payments"],"summary":"Finish the OAuth connection with the code and state Stripe returned","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":500},"state":{"type":"string","minLength":1,"maxLength":200}},"required":["code","state"]}}}},"responses":{"200":{"description":"Connected account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedAccount"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/payments/account/sync":{"post":{"tags":["Payments"],"summary":"Re-read the connected account now (back from Stripe onboarding)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Connected account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedAccount"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/tiers":{"get":{"tags":["Payments"],"summary":"List tiers","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","enum":["active","archived","all"],"default":"active"},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Tiers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TierList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Payments"],"summary":"Create a tier with its prices in the connected Stripe account","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7e]+$","description":"Required. Retries with the same key create the product and prices once."},"required":true,"description":"Required. Retries with the same key create the product and prices once.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"description":{"type":["string","null"],"maxLength":500,"default":null},"position":{"type":"integer","minimum":0,"maximum":1000,"default":0},"prices":{"type":"array","items":{"$ref":"#/components/schemas/TierPriceInput"},"minItems":1,"maxItems":8}},"required":["name","prices"]}}}},"responses":{"201":{"description":"Created tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tier"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/tiers/{tier_id}":{"get":{"tags":["Payments"],"summary":"Get a tier","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"tier ID","example":"tier_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"tier ID","name":"tier_id","in":"path"}],"responses":{"200":{"description":"Tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tier"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Payments"],"summary":"Rename, describe or reorder a tier","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"tier ID","example":"tier_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"tier ID","name":"tier_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"description":{"type":["string","null"],"maxLength":500},"position":{"type":"integer","minimum":0,"maximum":1000}}}}}},"responses":{"200":{"description":"Tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tier"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/tiers/{tier_id}/archive":{"post":{"tags":["Payments"],"summary":"Stop selling a tier (subscribers keep their access)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"tier ID","example":"tier_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"tier ID","name":"tier_id","in":"path"}],"responses":{"200":{"description":"Tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tier"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/tiers/{tier_id}/prices":{"post":{"tags":["Payments"],"summary":"Add a price (replaces the active price of the same interval and currency)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"tier ID","example":"tier_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"tier ID","name":"tier_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7e]+$","description":"Required. Retries with the same key create the product and prices once."},"required":true,"description":"Required. Retries with the same key create the product and prices once.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TierPriceInput"}}}},"responses":{"201":{"description":"Tier with its active prices","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tier"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/tiers/{tier_id}/prices/{price_id}/archive":{"post":{"tags":["Payments"],"summary":"Stop selling a price","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"tier ID","example":"tier_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"tier ID","name":"tier_id","in":"path"},{"schema":{"type":"string","description":"tier_price ID","example":"tprice_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"tier_price ID","name":"price_id","in":"path"}],"responses":{"200":{"description":"Tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tier"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/paid-subscriptions":{"get":{"tags":["Payments"],"summary":"List paid subscriptions","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["incomplete","incomplete_expired","trialing","active","past_due","paused","canceled","unpaid"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"paid_subscription ID","example":"psub_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"paid_subscription ID","name":"starting_after","in":"query"}],"responses":{"200":{"description":"Paid subscriptions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaidSubscriptionList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/paid-subscriptions/{paid_subscription_id}":{"get":{"tags":["Payments"],"summary":"Get a paid subscription","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"paid_subscription ID","example":"psub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"paid_subscription ID","name":"paid_subscription_id","in":"path"}],"responses":{"200":{"description":"Paid subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaidSubscription"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/entitlements":{"get":{"tags":["Payments"],"summary":"List entitlements (premium access of readers)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["active","suspended","ended"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["subscription","comp","gift"]},"required":false,"name":"source","in":"query"},{"schema":{"type":"string","description":"paid_subscription ID","example":"psub_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"paid_subscription ID","name":"paid_subscription_id","in":"query"},{"schema":{"type":"string","description":"entitlement ID","example":"ent_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"entitlement ID","name":"starting_after","in":"query"}],"responses":{"200":{"description":"Entitlements","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Payments"],"summary":"Give complimentary premium access to an existing subscriber of this publication","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["comp"],"default":"comp"},"subscription_id":{"type":"string","description":"subscription ID","example":"sub_01jabcdefghjkmnpqrstvwxyz0"},"tier_id":{"type":"string","description":"tier ID","example":"tier_01jabcdefghjkmnpqrstvwxyz0"},"valid_to":{"type":["string","null"],"format":"date-time","default":null}},"required":["subscription_id","tier_id"]}}}},"responses":{"201":{"description":"Granted entitlement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entitlement"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/entitlements/{entitlement_id}":{"delete":{"tags":["Payments"],"summary":"Revoke a complimentary entitlement (only comps)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"entitlement ID","example":"ent_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"entitlement ID","name":"entitlement_id","in":"path"}],"responses":{"200":{"description":"Ended entitlement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entitlement"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/publications/{publication_id}/payments/reconcile":{"post":{"tags":["Operations"],"summary":"Reconcile the publication’s connected account with Stripe now","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"202":{"description":"Enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["reconciliation"]},"enqueued":{"type":"boolean"}},"required":["object","enqueued"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/shared":{"get":{"tags":["Domains"],"security":[{"bearerAuth":[]}],"summary":"The shared domains: reader sites are `{slug}.{site_domain}` until a custom domain is ready","responses":{"200":{"description":"Shared domains","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedDomains"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/domain":{"get":{"tags":["Domains"],"security":[{"bearerAuth":[]}],"summary":"The publication’s domain: endpoints in use and, if any, the custom domain with every record","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Domain diagnosis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationDomain"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Domains"],"security":[{"bearerAuth":[]}],"summary":"Connect a domain you own (needs the custom domain add-on)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sending_domain":{"type":"string","minLength":1,"maxLength":253,"example":"news.example.com"},"web_host":{"type":"string","minLength":1,"maxLength":253,"example":"news.example.com"},"takeover":{"type":"boolean","default":false,"description":"Take over another workspace’s claim that never got its records published, after publishing the TXT record returned in the `domain_claim_pending` error."}},"required":["sending_domain","web_host"]}}}},"responses":{"201":{"description":"The claim with the exact records to publish","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationDomain"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Domains"],"security":[{"bearerAuth":[]}],"summary":"Disconnect the custom domain (the publication goes back to the shared domain)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"The publication on the shared domain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationDomain"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/domain/check":{"post":{"tags":["Domains"],"security":[{"bearerAuth":[]}],"summary":"Check DNS, identity and certificates now (once a minute per domain)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Domain diagnosis after the check","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationDomain"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/subscribers":{"get":{"tags":["Subscribers"],"summary":"List subscribers","description":"Keyset-paginated, oldest first. Counts toward the daily subscriber read limits (per credential and per workspace).","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","enum":["pending_confirmation","active","unsubscribed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"list ID","name":"list_id","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100},"required":false,"name":"tag","in":"query"},{"schema":{"type":"string","enum":["form","import","api","site","paid","dashboard"]},"required":false,"name":"channel","in":"query"},{"schema":{"type":"string","enum":["free","premium"]},"required":false,"name":"access","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"created_after","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":254},"required":false,"name":"email","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"One page of subscribers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberList"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Subscribers"],"summary":"Add a subscriber","description":"Respects the publication double opt-in (there is no way to skip it). Rate-limited per credential and per publication; risky signups are forced through double opt-in or refused.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320},"accept_as_typed":{"type":"boolean","default":false,"description":"Keep the address exactly as typed when the validator suggests a correction (otherwise 422 `invalid_email` with `details.suggestion`)."},"first_name":{"type":["string","null"],"maxLength":200},"last_name":{"type":["string","null"],"maxLength":200},"custom_fields":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Values by custom field key; `null` removes a value."},"list_ids":{"type":"array","items":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"maxItems":50,"default":[]},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"maxItems":50,"default":[]},"double_opt_in":{"type":"string","enum":["publication_default","always"],"default":"publication_default"}},"required":["email"]}}}},"responses":{"201":{"description":"Created (active, or pending confirmation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriber"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/subscribers/{subscriber_id}":{"get":{"tags":["Subscribers"],"summary":"Get a subscriber","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"subscription ID","example":"sub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"subscription ID","name":"subscriber_id","in":"path"}],"responses":{"200":{"description":"The subscriber","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriber"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Subscribers"],"summary":"Update a subscriber","description":"Name, custom fields, lists and unsubscribe. Never reactivates: only the reader can come back after unsubscribing.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"subscription ID","example":"sub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"subscription ID","name":"subscriber_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":["string","null"],"maxLength":200},"last_name":{"type":["string","null"],"maxLength":200},"custom_fields":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Values by custom field key; `null` removes a value."},"lists":{"type":"object","properties":{"add":{"type":"array","items":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"maxItems":50},"remove":{"type":"array","items":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"maxItems":50}}},"status":{"type":"string","enum":["pending_confirmation","active","unsubscribed"],"description":"Only `unsubscribed` changes anything."}}}}}},"responses":{"200":{"description":"The updated subscriber","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriber"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Subscribers"],"summary":"Delete a subscriber","description":"Leaves a tombstone without personal data. `erase=true` also asks every module to anonymize.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"subscription ID","example":"sub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"subscription ID","name":"subscriber_id","in":"path"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"erase","in":"query"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedObject"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/subscribers/{subscriber_id}/confirmation-email":{"post":{"tags":["Subscribers"],"summary":"Resend the confirmation email of a pending subscriber","description":"Once per confirmation, at least an hour after the first email; it replaces the automatic reminder, so nobody gets more than two. `409 subscriber_not_pending`, `409 confirmation_already_resent`, `409 confirmation_resend_too_soon` (`details.retry_at`), `429 confirmation_rate_limited`. Nothing changes state: only the reader confirms.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"subscription ID","example":"sub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"subscription ID","name":"subscriber_id","in":"path"}],"responses":{"200":{"description":"The subscriber (still pending)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriber"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/subscribers/{subscriber_id}/tags/{tag}":{"put":{"tags":["Subscribers"],"summary":"Tag a subscriber (creates the tag if needed; idempotent)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"subscription ID","example":"sub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"subscription ID","name":"subscriber_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"tag","in":"path"}],"responses":{"200":{"description":"Tagged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberTagChange"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Subscribers"],"summary":"Untag a subscriber (idempotent)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"subscription ID","example":"sub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"subscription ID","name":"subscriber_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"tag","in":"path"}],"responses":{"200":{"description":"Untagged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberTagChange"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/lists":{"get":{"tags":["Lists"],"summary":"List the lists of a publication","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Lists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberListCollection"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Lists"],"summary":"Create a list","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberListObject"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/lists/{list_id}":{"get":{"tags":["Lists"],"summary":"Get a list","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"list ID","name":"list_id","in":"path"}],"responses":{"200":{"description":"The list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberListObject"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Lists"],"summary":"Rename or archive a list","description":"The default list cannot be archived (`default_list_required`).","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"list ID","name":"list_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberListObject"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/custom-fields":{"get":{"tags":["Custom fields"],"summary":"List custom fields","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Custom fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Custom fields"],"summary":"Create a custom field","description":"At most 50 per publication. `key` and `type` cannot change later.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40},"label":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["text","number","boolean","date","enum"]},"options":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":100,"default":[]}},"required":["key","label","type"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/custom-fields/{field_id}":{"get":{"tags":["Custom fields"],"summary":"Get a custom field","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"custom_field ID","example":"fld_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"custom_field ID","name":"field_id","in":"path"}],"responses":{"200":{"description":"The field","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Custom fields"],"summary":"Update the label or options of a custom field","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"custom_field ID","example":"fld_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"custom_field ID","name":"field_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Immutable: only the current value is accepted."},"type":{"type":"string","enum":["text","number","boolean","date","enum"],"description":"Immutable."},"label":{"type":"string","minLength":1,"maxLength":100},"options":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":100}}}}}},"responses":{"200":{"description":"The field","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Custom fields"],"summary":"Delete a custom field and its values","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"custom_field ID","example":"fld_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"custom_field ID","name":"field_id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedObject"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/tags":{"get":{"tags":["Tags"],"summary":"List tags","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Tags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Tags"],"summary":"Create a tag","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/tags/{tag_id}":{"delete":{"tags":["Tags"],"summary":"Delete a tag (removes it from every subscriber)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"tag ID","example":"tag_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"tag ID","name":"tag_id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedObject"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/forms":{"get":{"tags":["Forms"],"summary":"List signup forms","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Forms","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Forms"],"summary":"Create a signup form","description":"`double_opt_in: publication_default` (the weaker mode) needs a human session: API keys and MCP get 403.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"double_opt_in":{"type":"string","enum":["publication_default","always"],"default":"always"},"list_ids":{"type":"array","items":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"maxItems":50,"default":[]},"list_choice":{"type":"boolean","default":false},"field_keys":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":50,"default":[]},"success":{"$ref":"#/components/schemas/FormSuccess"},"consent_text":{"type":["string","null"],"maxLength":2000,"default":null},"title":{"type":["string","null"],"maxLength":200,"default":null},"description":{"type":["string","null"],"maxLength":1000,"default":null},"button_label":{"type":["string","null"],"maxLength":60,"default":null},"status":{"type":"string","enum":["active","disabled"],"default":"active"}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/forms/{form_id}":{"get":{"tags":["Forms"],"summary":"Get a signup form","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"form ID","example":"frm_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"form ID","name":"form_id","in":"path"}],"responses":{"200":{"description":"The form","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Forms"],"summary":"Update a signup form","description":"Changing `double_opt_in` needs a human session (403 for API keys). A form disabled because its publication was archived cannot be re-enabled (`publication_archived`).","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"form ID","example":"frm_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"form ID","name":"form_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"double_opt_in":{"type":"string","enum":["publication_default","always"]},"list_ids":{"type":"array","items":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"maxItems":50},"list_choice":{"type":"boolean"},"field_keys":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":50},"success":{"$ref":"#/components/schemas/FormSuccess"},"consent_text":{"type":["string","null"],"maxLength":2000},"title":{"type":["string","null"],"maxLength":200},"description":{"type":["string","null"],"maxLength":1000},"button_label":{"type":["string","null"],"maxLength":60},"status":{"type":"string","enum":["active","disabled"]}}}}}},"responses":{"200":{"description":"The form","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/segments":{"get":{"tags":["Segments"],"summary":"List the segments of a publication (with counts)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Segments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Segments"],"summary":"Create a segment","description":"Conditions joined by `match` (`all` = and, `any` = or); an item may be a group with its own `match` (one level). Fields: `status`, `access` (free/premium mirror), `tag` (`tag_id`), `list` (`list_id`), `source` (first-touch channel), `signup_date` (`before`/`after` a UTC day, or `within_days`/`not_within_days`), `engagement` (verified opens/clicks within N days, from deliverability) and `custom_field` (`key` equals `value`; text compares case-insensitively). At most 20 conditions. At most 50 per publication.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"definition":{"$ref":"#/components/schemas/SegmentDefinitionInput"}},"required":["name","definition"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/segments/preview":{"post":{"tags":["Segments"],"summary":"Count the subscribers of an unsaved definition","description":"Live count for a segment builder; writes nothing. An empty definition counts everyone.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/SegmentDefinitionInput"}},"required":["definition"]}}}},"responses":{"200":{"description":"Counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentCounts"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/segments/{segment_id}":{"get":{"tags":["Segments"],"summary":"Get a segment (with counts)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"segment ID","example":"seg_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"segment ID","name":"segment_id","in":"path"}],"responses":{"200":{"description":"The segment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Segments"],"summary":"Rename a segment or change its definition","description":"A new definition bumps `version`: a send awaiting confirmation with this segment must be reviewed again.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"segment ID","example":"seg_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"segment ID","name":"segment_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"definition":{"$ref":"#/components/schemas/SegmentDefinitionInput"}}}}}},"responses":{"200":{"description":"The segment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Segments"],"summary":"Delete a segment","description":"Confirmed sends keep their frozen audience; a send still awaiting confirmation with this segment can no longer be confirmed (`segment_not_found`).","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"segment ID","example":"seg_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"segment ID","name":"segment_id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedObject"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/imports/uploads":{"post":{"tags":["Imports and exports"],"security":[{"bearerAuth":[]}],"summary":"Start an import: get a presigned PUT to upload the CSV directly to storage","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":255,"example":"suscriptores.csv"},"bytes":{"type":"integer","minimum":1,"description":"Exact size of the file, in bytes (at most 50 MiB): the upload URL is signed for exactly this size. Larger → `422 import_file_too_large`.","example":48213},"content_type":{"type":"string","enum":["text/csv"],"default":"text/csv","description":"Always `text/csv`, whatever type the browser guesses for the file."}},"required":["file_name","bytes"]}}}},"responses":{"201":{"description":"Import created (awaiting_upload) with its presigned upload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportUpload"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/imports":{"post":{"tags":["Imports and exports"],"security":[{"bearerAuth":[]}],"summary":"Declare the uploaded file (mapping, origin, consent) and process it asynchronously","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"import_id":{"type":"string","description":"import ID","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"mapping":{"type":"object","additionalProperties":{"type":"string"},"description":"Column header → `email`, `first_name`, `last_name`, `custom.<key>`, `last_interaction_at`, `tags` or `ignore`. Exactly one email column.","example":{"Email":"email","Nombre":"first_name","Última apertura":"last_interaction_at"}},"origin":{"type":"string","enum":["own_form","other_platform","event","purchase","other"]},"origin_detail":{"type":["string","null"],"maxLength":500,"default":null},"consent_obtained_at":{"type":"string","format":"date-time","description":"When the people in the file consented (required, not in the future)."},"attestation":{"type":"boolean","description":"Must be `true`: you declare that everybody in the file consented to receive this newsletter."},"list_ids":{"type":"array","items":{"type":"string","description":"list ID","example":"lst_01jabcdefghjkmnpqrstvwxyz0"},"maxItems":20,"default":[]},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"maxItems":20,"default":[]},"on_conflict":{"type":"string","enum":["skip","update"],"default":"skip"},"include_role_addresses":{"type":"boolean","default":false}},"required":["import_id","mapping","origin"]}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Import"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Imports and exports"],"security":[{"bearerAuth":[]}],"summary":"List imports, newest first","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"import ID","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"import ID","name":"starting_after","in":"query"}],"responses":{"200":{"description":"Imports","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/imports/{import_id}":{"get":{"tags":["Imports and exports"],"security":[{"bearerAuth":[]}],"summary":"Import report (progress, totals by outcome and reason, risk decision)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"import ID","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"import ID","name":"import_id","in":"path"}],"responses":{"200":{"description":"The import","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Import"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/imports/{import_id}/report":{"get":{"tags":["Imports and exports"],"security":[{"bearerAuth":[]}],"summary":"Signed URL (1 h) of the per-row CSV report (row number, outcome, reason; no emails)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"import ID","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"import ID","name":"import_id","in":"path"}],"responses":{"200":{"description":"Download URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRowReport"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/exports":{"post":{"tags":["Imports and exports"],"security":[{"bearerAuth":[]}],"summary":"Export every subscriber to a CSV (human session with recent sign-in only)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Export"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/exports/{export_id}":{"get":{"tags":["Imports and exports"],"security":[{"bearerAuth":[]}],"summary":"A ready export with a signed download URL (24 h; every issuance is audited)","description":"Human session with recent sign-in only. `409 export_not_ready` (with `details.status`) while it is queued or building, and once it failed or expired.","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"export ID","example":"exp_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"export ID","name":"export_id","in":"path"}],"responses":{"200":{"description":"The export","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Export"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/imports":{"get":{"tags":["Ops"],"security":[{"bearerAuth":[]}],"summary":"Imports awaiting Tirada’s review (ops queue)","description":"Requires `ops:review_holds`. Oldest first, at most 200. An agent bound to a workspace only sees its own.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Imports awaiting review","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsImportReviewList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/imports/{import_id}/approve":{"post":{"tags":["Ops"],"security":[{"bearerAuth":[]}],"summary":"Approve an import awaiting review","description":"Requires `ops:review_holds`. The import goes back to `queued`: it is validated again and imported as `accepted` (probation tiers still apply). The note is mandatory and audited. `409 import_upload_expired` once its file was deleted (7 days).","parameters":[{"schema":{"type":"string","description":"import ID","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"import ID","name":"import_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":2000}},"required":["note"]}}}},"responses":{"200":{"description":"The approved import (queued)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Import"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/imports/{import_id}/reject":{"post":{"tags":["Ops"],"security":[{"bearerAuth":[]}],"summary":"Reject an import awaiting review","description":"Requires `ops:review_holds`. The import ends `rejected`; nothing was imported and its file is deleted. The note is mandatory and audited.","parameters":[{"schema":{"type":"string","description":"import ID","example":"imp_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"import ID","name":"import_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":2000}},"required":["note"]}}}},"responses":{"200":{"description":"The rejected import","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Import"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts":{"get":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"List the posts of a publication (contributors see only their own)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":500,"description":"Opaque `next_cursor` of the previous page."},"required":false,"description":"Opaque `next_cursor` of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["none","awaiting_confirmation","scheduled","sending","sent","canceled","interrupted"]},"required":false,"name":"email_status","in":"query"},{"schema":{"type":"string","enum":["draft","published","unpublished"]},"required":false,"name":"web_status","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Search in titles."},"required":false,"description":"Search in titles.","name":"q","in":"query"}],"responses":{"200":{"description":"A page of posts, most recently updated first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Create a draft post","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostRequest"}}}},"responses":{"201":{"description":"The new draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDetail"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}":{"get":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Get a post with its draft content","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"responses":{"200":{"description":"The post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDetail"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Save the draft (optimistic lock on `base_version`)","description":"Saving the same values again does not change `draft_version`. A stale `base_version` answers `409 post_version_conflict`; a slug used by another post, `409 post_slug_taken`; changing the slug once the post was published or a send started, `409 post_slug_locked`.","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePostRequest"}}}},"responses":{"200":{"description":"The saved post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDetail"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Delete a post (it leaves the web too)","description":"Not while a send of the post is active (`409 post_has_active_send`).","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}/publish":{"post":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Publish the draft at `base_version` on the web (or republish an edit)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseVersionRequest"}}}},"responses":{"200":{"description":"The published post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDetail"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}/unpublish":{"post":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Take a post off the web","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"responses":{"200":{"description":"The post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDetail"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}/revisions":{"get":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"List the revisions of a post, newest first","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":500,"description":"Opaque `next_cursor` of the previous page."},"required":false,"description":"Opaque `next_cursor` of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of revisions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Save the current draft as a named revision","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamedRevisionRequest"}}}},"responses":{"201":{"description":"The new revision","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revision"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}/revisions/{revision_id}":{"get":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Get a revision with its content","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"},{"schema":{"type":"string","description":"revision ID","example":"rev_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"revision ID","name":"revision_id","in":"path"}],"responses":{"200":{"description":"The revision","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionDetail"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}/revisions/{revision_id}/restore":{"post":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Copy a revision into the draft (adds a `restored` revision; history is never rewritten)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"},{"schema":{"type":"string","description":"revision ID","example":"rev_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"revision ID","name":"revision_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseVersionRequest"}}}},"responses":{"200":{"description":"The post with the restored draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDetail"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}/preview":{"post":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Render the draft (or a revision) for a simulated subscriber","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewRequest"}}}},"responses":{"200":{"description":"The rendered preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}/preflight":{"post":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Check the last saved draft as it would be sent","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"responses":{"200":{"description":"The preflight report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightReport"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/theme":{"get":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Get the publication’s theme and email footer","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"The theme (`version` 0 = never customised)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Theme"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"Replace the publication’s theme and email footer","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeRequest"}}}},"responses":{"200":{"description":"The saved theme","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Theme"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/theme/presets":{"get":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"summary":"List the gallery of theme presets","description":"Complete design tokens of each preset (ADR-0089). Apply one with `PUT …/theme` (`theme` = its tokens, `preset` = its id).","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"The presets, `editorial` (the default look) first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemePresetList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/media/uploads":{"post":{"tags":["Media"],"security":[{"bearerAuth":[]}],"summary":"Start an image upload (presigned PUT)","description":"JPEG, PNG, GIF or WebP; never SVG. The upload URL is valid for 15 minutes; then call `complete`. At most 20 uploads in progress per person and 200 per workspace (`429 media_quota_exceeded` with `Retry-After`).","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMediaUploadRequest"}}}},"responses":{"201":{"description":"A pending asset and where to upload the file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUpload"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/media/{media_id}/complete":{"post":{"tags":["Media"],"security":[{"bearerAuth":[]}],"summary":"Verify an uploaded image and make it usable","description":"Checks the uploaded file (stored type, real type from its bytes, size, pixels, frames), removes its metadata (EXIF, GPS, comments) and publishes it. A file that does not match is discarded (`422 media_type_mismatch` or `media_too_large`). Completing a ready asset returns it unchanged.","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"media ID","example":"med_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"media ID","name":"media_id","in":"path"}],"responses":{"200":{"description":"The ready asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/media":{"get":{"tags":["Media"],"security":[{"bearerAuth":[]}],"summary":"List the ready images of a publication (contributors see only their own)","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":500,"description":"Opaque `next_cursor` of the previous page."},"required":false,"description":"Opaque `next_cursor` of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of images, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/media/{media_id}":{"delete":{"tags":["Media"],"security":[{"bearerAuth":[]}],"summary":"Remove an image from the library","description":"The file stays online: emails already sent keep showing it.","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"media ID","example":"med_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"media ID","name":"media_id","in":"path"}],"responses":{"204":{"description":"Removed"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends":{"get":{"tags":["Sending"],"summary":"List the sends of a publication, newest first","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","enum":["awaiting_confirmation","confirmed","scheduled","sending","paused","sent","canceled","expired"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"post ID","name":"post_id","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Cursor: `next_cursor` of the previous page.","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"Cursor: `next_cursor` of the previous page.","name":"before","in":"query"}],"responses":{"200":{"description":"Sends","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Sending"],"summary":"Create a send (always awaiting a human confirmation in the dashboard)","description":"Requires `Idempotency-Key`. Nothing is sent until a person confirms it at `confirmation_url` (ADR-0014).","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"Required on `POST /sends` (ADR-0014): unique per credential, forever."},"required":false,"description":"Required on `POST /sends` (ADR-0014): unique per credential, forever.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSendRequest"}}}},"responses":{"202":{"description":"Created, awaiting confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Send"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}":{"get":{"tags":["Sending"],"summary":"Get a send","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"responses":{"200":{"description":"The send","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Send"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/confirmation":{"get":{"tags":["Sending"],"summary":"What a human reviews before confirming (dashboard session only)","security":[{"bearerAuth":[]}],"x-tirada-permission":"sends:confirm","x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"responses":{"200":{"description":"Confirmation screen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendConfirmation"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/confirm":{"post":{"tags":["Sending"],"summary":"Confirm a send (dashboard session + CSRF only)","security":[{"bearerAuth":[]}],"x-tirada-permission":"sends:confirm","x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmSendRequest"}}}},"responses":{"200":{"description":"Confirmed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Send"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/cancel":{"post":{"tags":["Sending"],"summary":"Cancel a send that has not finished","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"responses":{"200":{"description":"The send","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Send"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/pause":{"post":{"tags":["Sending"],"summary":"Pause a send in progress","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"responses":{"200":{"description":"The send","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Send"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/resume":{"post":{"tags":["Sending"],"summary":"Resume a paused send (dashboard session only)","security":[{"bearerAuth":[]}],"x-tirada-permission":"sends:confirm","x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"responses":{"200":{"description":"The send","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Send"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/test":{"post":{"tags":["Sending"],"summary":"Send a test to workspace members (not billed)","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:write","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendRequest"}}}},"responses":{"200":{"description":"Test handed to the provider","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendResult"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/recipients":{"get":{"tags":["Sending"],"summary":"Timeline of one recipient in a send","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"},{"schema":{"type":"string","minLength":3,"maxLength":320},"required":true,"name":"email","in":"query"}],"responses":{"200":{"description":"Timeline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientSendTimeline"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sending/pause-diagnosis":{"get":{"tags":["Sending"],"summary":"Why a send (or the publication) cannot send or confirm right now","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":false,"description":"send ID","name":"send_id","in":"query"}],"responses":{"200":{"description":"Diagnosis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseDiagnosis"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/welcome-email":{"get":{"tags":["Sending"],"summary":"The active welcome email","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Welcome email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WelcomeEmail"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Sending"],"summary":"Enable or replace the welcome email (dashboard session + CSRF only)","security":[{"bearerAuth":[]}],"x-tirada-permission":"sends:confirm","x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableWelcomeEmailRequest"}}}},"responses":{"200":{"description":"Welcome email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WelcomeEmail"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Sending"],"summary":"Disable the welcome email","security":[{"bearerAuth":[]}],"x-tirada-permission":"posts:send","parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"The disabled welcome email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WelcomeEmail"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/sends/{send_id}/pause":{"post":{"tags":["Ops"],"summary":"Pause a send in progress (operations only; never resumes)","security":[{"bearerAuth":[]}],"x-tirada-permission":"ops:pause_sends","parameters":[{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"responses":{"200":{"description":"The send","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Send"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/billing":{"get":{"tags":["Billing"],"summary":"Plan, status and usage of the current period","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Billing status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingStatus"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/billing/checkout":{"post":{"tags":["Billing"],"summary":"Start a checkout, or change the plan of an existing subscription","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Required. Repeating the request with the same key returns the stored response."},"required":false,"description":"Required. Repeating the request with the same key returns the stored response.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["no_support","ai_support","human_support"]},"interval":{"type":"string","enum":["month","year"]},"domain_addon":{"type":"integer","minimum":0,"maximum":100,"default":0,"description":"Custom domains of the add-on (0: none)."}},"required":["plan","interval"]}}}},"responses":{"200":{"description":"Plan changed in the existing subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCheckoutResult"}}}},"201":{"description":"Hosted checkout to complete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCheckoutResult"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/billing/catalog":{"get":{"tags":["Billing"],"summary":"Plans, email packs and add-ons with the prices new checkouts use (EUR, without VAT)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Price catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCatalog"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/billing/portal":{"post":{"tags":["Billing"],"summary":"URL of the customer portal (invoices, payment method, cancellation)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Portal URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPortal"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/billing/email-credits":{"get":{"tags":["Billing"],"summary":"Prepaid email balance and its latest ledger entries","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Balance and ledger","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailCreditLedger"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/billing/email-packs/checkout":{"post":{"tags":["Billing"],"summary":"Start a checkout of prepaid email packs (10,000 emails each, non-refundable, never expire)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Required. Repeating the request with the same key returns the stored response."},"required":false,"description":"Required. Repeating the request with the same key returns the stored response.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"packs":{"type":"integer","description":"1 to maxPacksPerPurchase (100) packs. After `email_balance_insufficient`, its `missing_packs`."}},"required":["packs"]}}}},"responses":{"201":{"description":"Hosted checkout to complete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailPackCheckout"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/billing/usage":{"get":{"tags":["Billing"],"summary":"Metered usage of a period, per send","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Any instant of the period to show (default: now)."},"required":false,"description":"Any instant of the period to show (default: now).","name":"at","in":"query"}],"responses":{"200":{"description":"Usage of the period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUsage"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/billing/estimate":{"get":{"tags":["Billing"],"summary":"Estimated cost of sending to a number of emails, against the spend cap","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":["integer","null"],"minimum":0,"maximum":10000000},"required":false,"name":"emails","in":"query"}],"responses":{"200":{"description":"Estimate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingEstimate"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/support-tickets":{"get":{"tags":["Support"],"summary":"Support tickets of the workspace","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Tickets, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Support"],"summary":"Open a human support ticket (paid on plans 1–2, included on plan 3)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Required. Repeating the request with the same key returns the stored response."},"required":false,"description":"Required. Repeating the request with the same key returns the stored response.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","description":"1 to 200 characters."},"body":{"type":"string","description":"1 to 20,000 characters."}},"required":["subject","body"]}}}},"responses":{"201":{"description":"Ticket opened or awaiting payment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicket"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/support-tickets/{ticket_id}":{"get":{"tags":["Support"],"summary":"One support ticket","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"support_ticket ID","example":"tkt_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"support_ticket ID","name":"ticket_id","in":"path"}],"responses":{"200":{"description":"Ticket","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicket"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/support-tickets":{"get":{"tags":["Ops"],"summary":"Queue of open support tickets, oldest first (support reader agent)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Open tickets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsSupportTicketList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/support-tickets/{ticket_id}/resolve":{"post":{"tags":["Ops"],"summary":"Close an open ticket with typed input; `unresolved`/`tirada_fault` go through the refund rule","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"support_ticket ID","example":"tkt_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"support_ticket ID","name":"ticket_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveSupportTicket"}}}},"responses":{"200":{"description":"The closed ticket","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicket"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ops/refund-requests":{"get":{"tags":["Ops"],"summary":"Refunds waiting for the founder’s approval (read only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Pending approval","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRequestList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/channels":{"get":{"tags":["Channels"],"summary":"List the channel connections of a publication and their latest publications","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"responses":{"200":{"description":"Connections, oldest first","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChannelConnectionWithPosts"}}},"required":["object","data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Channels"],"summary":"Start connecting a Telegram channel (returns a one-time code)","description":"Creates a `pending` connection. Add the bot as an administrator of the channel with permission to post, then post the code in the channel. `autopublish: true` requires a dashboard session.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["telegram"]},"autopublish":{"type":"boolean","default":false}},"required":["kind"]}}}},"responses":{"201":{"description":"Pending connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelConnectionCreated"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/channels/{connection_id}":{"patch":{"tags":["Channels"],"summary":"Change autopublish or re-check the bot’s rights in the channel","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"channel_connection ID","example":"chn_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"channel_connection ID","name":"connection_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"autopublish":{"type":"boolean"},"recheck":{"type":"boolean","enum":[true]}}}}}},"responses":{"200":{"description":"The connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelConnection"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Channels"],"summary":"Disconnect a channel (the bot leaves it; what was published stays)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"channel_connection ID","example":"chn_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"channel_connection ID","name":"connection_id","in":"path"}],"responses":{"200":{"description":"The disconnected connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelConnection"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/channels/{connection_id}/posts":{"post":{"tags":["Channels"],"summary":"Publish a post (already published on the web) on this channel","description":"Only the free part is published. Requires `Idempotency-Key`. Asynchronous: answers 202.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"channel_connection ID","example":"chn_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"channel_connection ID","name":"connection_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"confirm_not_delivered":{"type":"boolean","default":false}},"required":["post_id"]}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelPost"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/api-keys":{"get":{"tags":["API keys"],"summary":"List the workspace’s API keys (never their secrets)","security":[{"bearerAuth":[]}],"x-tirada-permission":"developer:read","responses":{"200":{"description":"API keys, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key (dashboard session with recent re-authentication)","security":[{"bearerAuth":[]}],"x-tirada-permission":"api_keys:manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","items":{"type":"string","maxLength":100},"minItems":1,"maxItems":100},"publications":{"type":["array","null"],"items":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"minItems":1,"maxItems":500,"description":"`null`: every publication you can reach, now and in the future."},"expires_at":{"type":"string","format":"date-time"},"default_version":{"type":"string","maxLength":20}},"required":["name","scopes","publications"]}}}},"responses":{"201":{"description":"The key, with its token shown this once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedApiKey"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/api-keys/{api_key_id}":{"delete":{"tags":["API keys"],"summary":"Revoke an API key now (dashboard session with recent re-authentication)","security":[{"bearerAuth":[]}],"x-tirada-permission":"api_keys:manage","parameters":[{"schema":{"type":"string","description":"api_key ID","example":"key_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"api_key ID","name":"api_key_id","in":"path"}],"responses":{"200":{"description":"The revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/api-keys/{api_key_id}/roll":{"post":{"tags":["API keys"],"summary":"Replace an API key; the old one keeps working for `expires_in` seconds","security":[{"bearerAuth":[]}],"x-tirada-permission":"api_keys:manage","parameters":[{"schema":{"type":"string","description":"api_key ID","example":"key_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"api_key ID","name":"api_key_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expires_in":{"type":"integer","minimum":0,"maximum":604800,"description":"Seconds the old key keeps working (0 revokes it now; max 7 days)."}},"required":["expires_in"]}}}},"responses":{"201":{"description":"The new key, with its token shown this once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedApiKey"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/api-keys/{api_key_id}/usage":{"get":{"tags":["API keys"],"summary":"Last use and requests of an API key in the last 30 days","security":[{"bearerAuth":[]}],"x-tirada-permission":"developer:read","parameters":[{"schema":{"type":"string","description":"api_key ID","example":"key_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"api_key ID","name":"api_key_id","in":"path"}],"responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyUsage"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/webhook-endpoints":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","security":[{"bearerAuth":[]}],"x-tirada-permission":"developer:read","responses":{"200":{"description":"Endpoints","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint (human session with recent re-authentication)","description":"Returns the signing secret once. The URL must be public https on port 443 or 8443.","security":[{"bearerAuth":[]}],"x-tirada-permission":"webhooks:manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"events":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"minItems":1,"maxItems":100,"description":"Public types, family wildcards (`subscriber.*`) or `*`."},"publications":{"type":["array","null"],"items":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"minItems":1,"maxItems":100,"default":null,"description":"Null: every publication."},"api_version":{"type":"string"},"description":{"type":["string","null"],"maxLength":500}},"required":["url","events"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/webhook-endpoints/{endpoint_id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook endpoint","security":[{"bearerAuth":[]}],"x-tirada-permission":"developer:read","parameters":[{"schema":{"type":"string","description":"webhook_endpoint ID","example":"whe_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"webhook_endpoint ID","name":"endpoint_id","in":"path"}],"responses":{"200":{"description":"The endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Webhooks"],"summary":"Update a webhook endpoint (URL, events, publications, status)","security":[{"bearerAuth":[]}],"x-tirada-permission":"webhooks:manage","parameters":[{"schema":{"type":"string","description":"webhook_endpoint ID","example":"whe_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"webhook_endpoint ID","name":"endpoint_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"events":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"minItems":1,"maxItems":100,"description":"Public types, family wildcards (`subscriber.*`) or `*`."},"publications":{"type":["array","null"],"items":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"minItems":1,"maxItems":100,"description":"Null: every publication."},"description":{"type":["string","null"],"maxLength":500},"status":{"type":"string","enum":["enabled","disabled"]}}}}}},"responses":{"200":{"description":"The endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint and its delivery log","security":[{"bearerAuth":[]}],"x-tirada-permission":"webhooks:manage","parameters":[{"schema":{"type":"string","description":"webhook_endpoint ID","example":"whe_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"webhook_endpoint ID","name":"endpoint_id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedWebhookEndpoint"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/webhook-endpoints/{endpoint_id}/secret/roll":{"post":{"tags":["Webhooks"],"summary":"Roll the signing secret (both sign for 24 h)","security":[{"bearerAuth":[]}],"x-tirada-permission":"webhooks:manage","parameters":[{"schema":{"type":"string","description":"webhook_endpoint ID","example":"whe_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"webhook_endpoint ID","name":"endpoint_id","in":"path"}],"responses":{"200":{"description":"The new secret, shown once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/webhook-endpoints/{endpoint_id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a signed sample event now (10 per minute)","security":[{"bearerAuth":[]}],"x-tirada-permission":"webhooks:manage","parameters":[{"schema":{"type":"string","description":"webhook_endpoint ID","example":"whe_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"webhook_endpoint ID","name":"endpoint_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":100,"example":"subscriber.created"}},"required":["type"]}}}},"responses":{"200":{"description":"The test delivery and its outcome","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/webhook-endpoints/{endpoint_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List deliveries of the last 30 days, newest first","description":"Payloads are only included for the event families you can read on their publication.","security":[{"bearerAuth":[]}],"x-tirada-permission":"developer:read","parameters":[{"schema":{"type":"string","description":"webhook_endpoint ID","example":"whe_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"webhook_endpoint ID","name":"endpoint_id","in":"path"},{"schema":{"type":"string","enum":["pending","retrying","succeeded","failed","skipped"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":1024,"description":"`next_cursor` of the previous page."},"required":false,"description":"`next_cursor` of the previous page.","name":"starting_after","in":"query"}],"responses":{"200":{"description":"Deliveries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/webhook-endpoints/{endpoint_id}/replay":{"post":{"tags":["Webhooks"],"summary":"Send failed deliveries since a date again (one extra attempt each)","security":[{"bearerAuth":[]}],"x-tirada-permission":"webhooks:manage","parameters":[{"schema":{"type":"string","description":"webhook_endpoint ID","example":"whe_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"webhook_endpoint ID","name":"endpoint_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"since":{"type":"string","format":"date-time","example":"2026-10-14T00:00:00Z"},"status":{"type":"string","enum":["failed"]}},"required":["since","status"]}}}},"responses":{"202":{"description":"Replay requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookReplay"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/webhook-deliveries/{delivery_id}/retry":{"post":{"tags":["Webhooks"],"summary":"One extra attempt of a delivery","security":[{"bearerAuth":[]}],"x-tirada-permission":"webhooks:manage","parameters":[{"schema":{"type":"string","description":"webhook_delivery ID","example":"whd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"webhook_delivery ID","name":"delivery_id","in":"path"}],"responses":{"202":{"description":"Retry requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/sends/{send_id}/stats":{"get":{"tags":["Analytics"],"summary":"Metrics of one send","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"send ID","example":"snd_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"send ID","name":"send_id","in":"path"}],"responses":{"200":{"description":"Send metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSendStats"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/posts/{post_id}/stats":{"get":{"tags":["Analytics"],"summary":"Metrics of a post, summed over the sends that reached the audience","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","description":"post ID","example":"post_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"post ID","name":"post_id","in":"path"}],"responses":{"200":{"description":"Post metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsPostStats"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/publications/{publication_id}/growth":{"get":{"tags":["Analytics"],"summary":"Subscriber growth by acquisition channel","description":"Covers `[from, to)` at UTC day resolution: the days from the one containing `from` up to, and including, the one containing `to` unless `to` is a midnight. At most 731 days.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"publication ID","name":"publication_id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","enum":["day","week","month"],"default":"day"},"required":false,"name":"granularity","in":"query"}],"responses":{"200":{"description":"Growth report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsGrowth"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth/authorization-requests/{request_id}":{"get":{"tags":["MCP"],"summary":"A pending MCP authorization request, for the consent screen (human session)","security":[{"bearerAuth":[]}],"x-tirada-permission":"workspace:read","x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-Za-z]{43}$","description":"The `request` handle the authorization server put in the consent URL."},"required":true,"description":"The `request` handle the authorization server put in the consent URL.","name":"request_id","in":"path"}],"responses":{"200":{"description":"The request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAuthorizationRequest"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth/authorization-requests/{request_id}/approve":{"post":{"tags":["MCP"],"summary":"Approve an MCP authorization request (human session, recent re-authentication)","security":[{"bearerAuth":[]}],"x-tirada-permission":"workspace:read","x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-Za-z]{43}$","description":"The `request` handle the authorization server put in the consent URL."},"required":true,"description":"The `request` handle the authorization server put in the consent URL.","name":"request_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scopes":{"type":"array","items":{"type":"string","maxLength":100},"minItems":1,"maxItems":100},"publication_ids":{"type":["array","null"],"items":{"type":"string","description":"publication ID","example":"pub_01jabcdefghjkmnpqrstvwxyz0"},"maxItems":500,"description":"`null`: every publication you can reach."}},"required":["scopes","publication_ids"]}}}},"responses":{"200":{"description":"Where to send the browser","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthConsentRedirect"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth/authorization-requests/{request_id}/deny":{"post":{"tags":["MCP"],"summary":"Deny an MCP authorization request (human session)","security":[{"bearerAuth":[]}],"x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-Za-z]{43}$","description":"The `request` handle the authorization server put in the consent URL."},"required":true,"description":"The `request` handle the authorization server put in the consent URL.","name":"request_id","in":"path"}],"responses":{"200":{"description":"Where to send the browser","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthConsentRedirect"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/mcp-connections":{"get":{"tags":["MCP"],"summary":"Connected MCP apps: yours, or every member’s with developer:read (human session)","security":[{"bearerAuth":[]}],"x-tirada-permission":"workspace:read","x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","enum":["true","false"],"default":"false","description":"`true`: every member’s connections (needs developer:read)."},"required":false,"description":"`true`: every member’s connections (needs developer:read).","name":"all","in":"query"}],"responses":{"200":{"description":"Active connections, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpConnectionList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/mcp-connections/{grant_id}":{"delete":{"tags":["MCP"],"summary":"Revoke a connected MCP app: yours, or anyone’s with workspace:manage (human session)","security":[{"bearerAuth":[]}],"x-tirada-permission":"workspace:read","x-tirada-mcp":"deny","parameters":[{"schema":{"type":"string","description":"mcp_grant ID","example":"mcpg_01jabcdefghjkmnpqrstvwxyz0"},"required":true,"description":"mcp_grant ID","name":"grant_id","in":"path"}],"responses":{"200":{"description":"The revoked connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpConnection"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}