{"components":{"schemas":{"Error":{"properties":{"error":{"properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"}},"type":"object"}},"securitySchemes":{"bearer":{"scheme":"bearer","type":"http"}}},"info":{"description":"Account-scoped bearer keys (send, read, admin). send can only POST /send; read reads; admin does everything. Money is integer minor units. Irreversible acts need a preflight token.","title":"Kōlea API","version":"1"},"openapi":"3.1.0","paths":{"/forms/{token}":{"delete":{"operationId":"form_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The form's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a form with its counts, submissions, and file. The people it signed up stay.","tags":["forms"],"x-kolea-scope":"admin"},"get":{"operationId":"form_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The form's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One form with its hosted URL, embed snippet, reply mail, and numbers.","tags":["forms"],"x-kolea-scope":"read"},"patch":{"operationId":"form_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The form's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"active":{"type":"boolean"},"challenge":{"type":"boolean"},"description":{"type":"string"},"double_opt_in":{"description":"Refused off while the account is in probation (14.2).","type":"boolean"},"name":{"type":"string"},"redirect_url":{"type":"string"},"site_signup":{"description":"The form the public site's subscribe box posts to.","type":"boolean"},"slug":{"type":"string"},"success_message":{"type":"string"},"tags":{"description":"Tag names given to everyone who signs up.","items":{"type":"string"},"type":"array"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Changes a form's settings; anything left out stays as it is.","tags":["forms"],"x-kolea-scope":"admin"}},"/stats/list-health":{"get":{"operationId":"list_health","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"List health over the last 30 days: growth, churn, bounces, complaints.","tags":["audience"],"x-kolea-scope":"read"}},"/activity":{"get":{"operationId":"activity_list","parameters":[{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 50, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The account's newest events (opens, clicks, bounces, unsubscribes, signups).","tags":["audience"],"x-kolea-scope":"read"}},"/broadcasts/{token}/stats":{"get":{"operationId":"broadcast_stats","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Where a send stands (messages by status) and its opens, clicks, and Signal score.","tags":["broadcasts"],"x-kolea-scope":"read"}},"/broadcasts/{token}/resume":{"post":{"operationId":"broadcast_resume","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Resumes a cancelled broadcast for whoever has not had it yet; nobody is mailed twice (9.10).","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/sequences/{token}":{"delete":{"operationId":"sequence_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a paused sequence with its steps and enrollments. Refused while live.","tags":["sequences"],"x-kolea-scope":"admin"},"get":{"operationId":"sequence_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One sequence with its steps and its whole flow: exits, where finishers go, what feeds it.","tags":["sequences"],"x-kolea-scope":"read"},"patch":{"operationId":"sequence_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"description":"Shown to subscribers in the preference center.","type":"string"},"from_email":{"type":"string"},"from_name":{"type":"string"},"name":{"type":"string"},"next_sequence_token":{"description":"Where finishers go (\"\" for nowhere). Enrolls nobody now (1.11).","type":"string"},"reply_to":{"type":"string"},"trigger":{"enum":["subscribe","tag_added","manual"],"type":"string"},"trigger_tag":{"description":"For tag_added: the tag name.","type":"string"},"window_end":{"type":"string"},"window_start":{"description":"Send window start, HH:MM in the account's zone.","type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Changes a sequence's fields. A trigger change while live affects future enrollments only.","tags":["sequences"],"x-kolea-scope":"admin"}},"/consent/{email}":{"get":{"operationId":"consent_check","parameters":[{"in":"path","name":"email","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Whether a broadcast, a sequence, and a receipt would reach an address right now, and why not. Consent is scoped (8.1).","tags":["deliverability"],"x-kolea-scope":"read"}},"/campaigns":{"get":{"operationId":"campaign_list","parameters":[{"in":"query","name":"include_archived","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Campaigns with people, orders, refunds, and net revenue per currency.","tags":["campaigns"],"x-kolea-scope":"read"},"post":{"operationId":"campaign_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"name":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates a campaign; its slug follows the name.","tags":["campaigns"],"x-kolea-scope":"admin"}},"/tags":{"get":{"operationId":"tag_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Every tag with how many people carry it.","tags":["tags"],"x-kolea-scope":"read"},"post":{"operationId":"tag_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates a tag. Names are unique per account, ignoring case.","tags":["tags"],"x-kolea-scope":"admin"}},"/purchase-templates/{offer_slug}":{"put":{"operationId":"purchase_template_upsert","parameters":[{"in":"path","name":"offer_slug","required":true,"schema":{"description":"The offer's slug or SKU, or * for every other sale.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"discord_invite_url":{"type":"string"},"is_active":{"type":"boolean"},"markdown":{"description":"The body as Markdown.","type":"string"},"name":{"type":"string"},"subject":{"type":"string"}},"required":["name","subject","markdown"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates the thank-you template for an offer slug, or saves it if one exists.","tags":["sales"],"x-kolea-scope":"admin"}},"/sales":{"get":{"operationId":"sale_list","parameters":[{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 100, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Sales, newest first, with buyer, amount in minor units, status, and campaign.","tags":["sales"],"x-kolea-scope":"read"},"post":{"operationId":"sale_record","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"description":"Integer minor units, never a float.","type":"integer"},"campaign_slug":{"description":"Credit a campaign explicitly.","type":"string"},"currency":{"description":"ISO code, e.g. usd.","type":"string"},"description":{"type":"string"},"email":{"type":"string"},"end_sequence":{"description":"The slug of a sequence to stop selling them (16.3).","type":"string"},"external_id":{"description":"Your order id; a second record with it is the same sale.","type":"string"},"items":{"items":{"type":"object"},"type":"array"},"name":{"type":"string"},"occurred_at":{"description":"ISO 8601; default now.","type":"string"},"status":{"description":"refunded flips a known sale.","enum":["paid","refunded"],"type":"string"},"tag_names":{"items":{"type":"string"},"type":"array"}},"required":["email","amount","currency"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Records a sale from your shop: buyer email, amount in minor units (4100 is 41.00), currency. The campaign is credited once, now, and frozen (1.13).","tags":["sales"],"x-kolea-scope":"admin"}},"/messages/{token}":{"get":{"operationId":"message_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One message by its token: who, what kind, status, the suppression reason or error.","tags":["deliverability"],"x-kolea-scope":"read"}},"/sequences/{token}/deactivate":{"post":{"operationId":"sequence_deactivate","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Pauses a sequence: no new enrollments, pending steps halt, places are kept.","tags":["sequences"],"x-kolea-scope":"admin"}},"/keys":{"get":{"operationId":"apikey_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The account's API keys: name, prefix, scope, last use, revoked or live. Never the secrets.","tags":["ops"],"x-kolea-scope":"admin"}},"/broadcasts/{token}/schedule":{"post":{"operationId":"broadcast_schedule","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"preflight_token":{"type":"string"},"send_at":{"description":"Local date and time, e.g. 2026-10-01T09:00.","type":"string"}},"required":["preflight_token","send_at"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Schedules a draft for later, at a local date and time in the account's time zone. Needs the preflight_token.","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/sequences/{token}/steps/{step_token}":{"delete":{"operationId":"step_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}},{"in":"path","name":"step_token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a step; anyone waiting for it moves on to the next one.","tags":["sequences"],"x-kolea-scope":"admin"},"patch":{"operationId":"step_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}},{"in":"path","name":"step_token","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body":{"description":"Or the body as an editor document.","type":"object"},"delay_days":{"description":"Whole days after the previous step (0..365).","type":"integer"},"markdown":{"description":"The body as Markdown.","type":"string"},"subject":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Edits a step. It reaches everyone who has not had it yet and never re-sends (12.6).","tags":["sequences"],"x-kolea-scope":"admin"}},"/sequence-templates":{"get":{"operationId":"sequence_template_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The account's sequence templates: starters and its own.","tags":["sequence_templates"],"x-kolea-scope":"read"},"post":{"operationId":"sequence_template_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"best_for":{"items":{"type":"string"},"type":"array"},"default_description":{"type":"string"},"default_name":{"type":"string"},"description":{"type":"string"},"family":{"enum":["funnel","launch","welcome","sale","customer"],"type":"string"},"name":{"type":"string"},"needs":{"items":{"type":"string"},"type":"array"},"source":{"description":"Who the shape comes from.","type":"string"},"steps":{"description":"Up to 60 mails: [{delay_days, label, purpose, subject, body_md}]. [[placeholders]] block activation until filled.","items":{"type":"object"},"type":"array"},"suggested_trigger":{"enum":["subscribe","tag_added","manual"],"type":"string"},"tagline":{"type":"string"},"trigger_hint":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates a template. Its slug comes from the name and never changes.","tags":["sequence_templates"],"x-kolea-scope":"admin"}},"/tag-rules":{"get":{"operationId":"tagrule_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Tag rules: which open, click, or form signup tags whom.","tags":["tags"],"x-kolea-scope":"read"},"post":{"operationId":"tagrule_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"broadcast_token":{"type":"string"},"event":{"enum":["open","click","form_submit"],"type":"string"},"form_token":{"type":"string"},"name":{"type":"string"},"sequence_token":{"type":"string"},"tag":{"description":"The tag to apply (created if new).","type":"string"},"url_contains":{"description":"Click rules only.","type":"string"}},"required":["name","event","tag"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates a rule: when someone opens, clicks (optionally a link containing text), or signs up through a form, tag them.","tags":["tags"],"x-kolea-scope":"admin"}},"/broadcasts/{token}/cancel":{"post":{"operationId":"broadcast_cancel","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Cancels a scheduled or sending broadcast; queued mail is cancelled, none deleted (9.9).","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/stripe":{"get":{"operationId":"stripe_status","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Whether the account's Stripe is connected, live or test, and when it last synced or failed.","tags":["stripe"],"x-kolea-scope":"read"}},"/sequences/{token}/preflight":{"post":{"operationId":"sequence_preflight","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"What going live means (schedule, who enters, first send, refusals) and, when nothing refuses it, a single-use token for sequence_activate, valid 10 minutes and void after any edit.","tags":["sequences"],"x-kolea-scope":"admin"}},"/tags/{tag}/merge":{"post":{"operationId":"tag_merge","parameters":[{"in":"path","name":"tag","required":true,"schema":{"description":"The tag that goes away.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"into":{"type":"string"}},"required":["into"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Folds one tag into another: people move, segments, sequences and rules are repointed, the empty tag goes.","tags":["tags"],"x-kolea-scope":"admin"}},"/sequence-templates/{token}":{"delete":{"operationId":"sequence_template_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The template's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a template. Sequences made from it are untouched.","tags":["sequence_templates"],"x-kolea-scope":"admin"},"get":{"operationId":"sequence_template_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The template's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One template with every mail.","tags":["sequence_templates"],"x-kolea-scope":"read"},"put":{"operationId":"sequence_template_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The template's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"best_for":{"items":{"type":"string"},"type":"array"},"default_description":{"type":"string"},"default_name":{"type":"string"},"description":{"type":"string"},"family":{"enum":["funnel","launch","welcome","sale","customer"],"type":"string"},"name":{"type":"string"},"needs":{"items":{"type":"string"},"type":"array"},"source":{"description":"Who the shape comes from.","type":"string"},"steps":{"description":"Up to 60 mails: [{delay_days, label, purpose, subject, body_md}]. [[placeholders]] block activation until filled.","items":{"type":"object"},"type":"array"},"suggested_trigger":{"enum":["subscribe","tag_added","manual"],"type":"string"},"tagline":{"type":"string"},"trigger_hint":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Replaces a template whole (send every field you want kept). Nothing made from it changes.","tags":["sequence_templates"],"x-kolea-scope":"admin"}},"/segments/preview":{"post":{"operationId":"segment_preview","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"rule":{"description":"A rule: `statuses` (default [\"active\"]), `tag_match` (\"any\" or \"all\"),\n`include_tags` and `exclude_tags` (tag names), `sources`,\n`joined_after` / `joined_before` (dates), and `conditions` on custom\nfields ([{key, op, value}]).\n","type":"object"}},"required":["rule"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"How many a rule matches, and how many a broadcast to it would reach (active, unsuppressed), before saving anything.","tags":["segments"],"x-kolea-scope":"read"}},"/webhooks/{token}":{"delete":{"operationId":"webhook_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The endpoint's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes an endpoint and its delivery log.","tags":["webhooks"],"x-kolea-scope":"admin"},"patch":{"operationId":"webhook_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The endpoint's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"active":{"type":"boolean"},"description":{"type":"string"},"events":{"items":{"type":"string"},"type":"array"},"url":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Changes an endpoint's URL, events, description, or switches it on or off.","tags":["webhooks"],"x-kolea-scope":"admin"}},"/stripe/sync-runs":{"get":{"operationId":"sync_runs_list","parameters":[{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 20, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The latest Stripe sync runs: when, what triggered them, what they found, and errors.","tags":["stripe"],"x-kolea-scope":"read"}},"/posts":{"get":{"operationId":"post_list","parameters":[{"in":"query","name":"filter","required":false,"schema":{"enum":["all","published","unpublished"],"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Broadcasts as posts, in the one broadcast order, with whether each is on the site.","tags":["posts"],"x-kolea-scope":"read"}},"/webhooks/{token}/deliveries":{"get":{"operationId":"webhook_deliveries","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The endpoint's token.","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 50, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"An endpoint's recent deliveries with every attempt: status code, error, duration.","tags":["webhooks"],"x-kolea-scope":"read"}},"/outbox":{"get":{"operationId":"outbox_list","parameters":[{"in":"query","name":"to","required":false,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 50, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Mail the Local provider caught instead of sending (dev, or an account on the kill switch).","tags":["deliverability"],"x-kolea-scope":"read"}},"/sequences/{token}/enrollments":{"get":{"operationId":"sequence_enrollments","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 50, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The newest enrollments in a sequence with each person's address and status.","tags":["sequences"],"x-kolea-scope":"read"},"post":{"operationId":"sequence_enroll","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"description":"The subscriber's address.","type":"string"}},"required":["email"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Enrolls one person by hand. Refused, with the reason, for anyone who left this sequence or is not eligible (8.2).","tags":["sequences"],"x-kolea-scope":"admin"}},"/subscribers/{token}/timeline":{"get":{"operationId":"subscriber_timeline","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The subscriber's token.","type":"string"}},{"in":"query","name":"email","required":false,"schema":{"description":"Or the subscriber's address.","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 100, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"What happened to one person, newest first: arrivals, tags, consent, sequences, purchases.","tags":["audience"],"x-kolea-scope":"read"}},"/topics":{"get":{"operationId":"topic_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Post topics with how many published posts each has.","tags":["posts"],"x-kolea-scope":"read"}},"/purchase-templates":{"get":{"operationId":"purchase_template_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Purchase thank-you templates, by offer slug (* is the fallback).","tags":["sales"],"x-kolea-scope":"read"}},"/posts/{token}/unpublish":{"post":{"operationId":"post_unpublish","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The post's (broadcast's) token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Takes one post off the site; the slug and date are kept for its return.","tags":["posts"],"x-kolea-scope":"admin"}},"/stats/revenue-by-campaign":{"get":{"operationId":"revenue_by_campaign","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"People, orders, refunds, and net revenue for every campaign.","tags":["sales"],"x-kolea-scope":"read"}},"/stripe/catalog/sync":{"post":{"operationId":"stripe_catalog_sync","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Mirrors the account's Stripe products and prices now, and records the sync run.","tags":["stripe"],"x-kolea-scope":"admin"}},"/campaigns/{token}/archive":{"post":{"operationId":"campaign_archive","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The campaign's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"archived":{"description":"false restores it (default true).","type":"boolean"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Archives (hides) or restores a campaign. Changes no data.","tags":["campaigns"],"x-kolea-scope":"admin"}},"/sequences/{token}/exits":{"post":{"operationId":"sequence_exit_set","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"tag":{"type":"string"},"then_sequence_token":{"type":"string"}},"required":["tag"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Adds an exit: when this tag lands on someone in the sequence they leave it, and optionally join another. An exit is automation, never an opt-out (1.10).","tags":["sequences"],"x-kolea-scope":"admin"}},"/themes/{token}/activate":{"post":{"operationId":"theme_activate","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Makes one theme live and every other not.","tags":["site"],"x-kolea-scope":"admin"}},"/sequences/{token}/stats":{"get":{"operationId":"sequence_stats","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Per-step funnel, enrollments by status, cancellations by reason.","tags":["sequences"],"x-kolea-scope":"read"}},"/sequences/{token}/steps":{"post":{"operationId":"step_add","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body":{"description":"Or the body as an editor document.","type":"object"},"delay_days":{"description":"Whole days after the previous step (0..365).","type":"integer"},"markdown":{"description":"The body as Markdown.","type":"string"},"subject":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Adds a step at the end of a sequence.","tags":["sequences"],"x-kolea-scope":"admin"}},"/broadcasts":{"get":{"operationId":"broadcast_list","parameters":[{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 50, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Broadcasts, newest first by sent, scheduled, or created time (9.14).","tags":["broadcasts"],"x-kolea-scope":"read"},"post":{"operationId":"broadcast_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"audience":{"enum":["everyone","segment"],"type":"string"},"body":{"description":"Or the body as an editor document.","type":"object"},"excerpt":{"type":"string"},"from_email":{"description":"Must be on one of the account's verified domains to send.","type":"string"},"from_name":{"type":"string"},"markdown":{"description":"The body as Markdown (converted to the editor's blocks).","type":"string"},"publish_on_send":{"description":"Also put it on the site when it goes out (default true).","type":"boolean"},"reply_to":{"type":"string"},"segment_token":{"description":"When audience is segment.","type":"string"},"subject":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates a draft. Nothing is sent; sending needs broadcast_preflight and broadcast_send.","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/site":{"get":{"operationId":"site_get","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The public site: on or off, address, title, tagline, author, bio, social links, profile.","tags":["site"],"x-kolea-scope":"read"},"patch":{"operationId":"site_update","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"author_name":{"type":"string"},"author_photo_url":{"type":"string"},"enabled":{"type":"boolean"},"logo_url":{"type":"string"},"short_bio":{"type":"string"},"slug":{"description":"The site's address on the platform domain.","type":"string"},"social":{"description":"Links by network; merged key by key.","type":"object"},"tagline":{"type":"string"},"title":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Changes the site's settings; only the fields given change. \"\" clears a text field.","tags":["site"],"x-kolea-scope":"admin"}},"/subscribers/{token}/tags/{tag}":{"delete":{"operationId":"subscriber_remove_tag","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The subscriber's token.","type":"string"}},{"in":"path","name":"tag","required":true,"schema":{"type":"string"}},{"in":"query","name":"email","required":false,"schema":{"description":"Or the subscriber's address.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Removes one tag from one person. Deletes nobody.","tags":["audience"],"x-kolea-scope":"admin"}},"/webhooks":{"get":{"operationId":"webhook_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The account's webhook endpoints: URL, events, on or off, and recent failures.","tags":["webhooks"],"x-kolea-scope":"read"},"post":{"operationId":"webhook_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"events":{"description":"Any of: subscribed, unsubscribed, bounced, purchased, published.","items":{"type":"string"},"type":"array"},"url":{"type":"string"}},"required":["url","events"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Adds an https endpoint on a public host for some of: subscribed, unsubscribed, bounced, purchased, published. Returns the signing secret once.","tags":["webhooks"],"x-kolea-scope":"admin"}},"/stripe/sync":{"post":{"operationId":"stripe_sync_run","parameters":[],"responses":{"202":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Queues a catalog sync and a reconcile of missed charges now (the nightly job, on demand).","tags":["stripe"],"x-kolea-scope":"admin"}},"/stripe/catalog":{"get":{"operationId":"stripe_catalog_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The mirrored catalog: products with their prices, in minor units.","tags":["stripe"],"x-kolea-scope":"read"}},"/sequences/{token}/exits/{tag}":{"delete":{"operationId":"sequence_exit_remove","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}},{"in":"path","name":"tag","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Removes an exit.","tags":["sequences"],"x-kolea-scope":"admin"}},"/keys/{token}":{"delete":{"operationId":"apikey_revoke","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Revokes a key at once. Mail it already queued still goes.","tags":["ops"],"x-kolea-scope":"admin"}},"/forms/{token}/reply":{"put":{"operationId":"form_set_reply","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The form's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"markdown":{"description":"The body as Markdown.","type":"string"},"subject":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Sets the mail a signup gets (14.5). A blank subject turns it off.","tags":["forms"],"x-kolea-scope":"admin"}},"/templates":{"get":{"operationId":"template_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Stored transactional templates a POST /api/v1/send can name by slug.","tags":["templates"],"x-kolea-scope":"read"},"post":{"operationId":"template_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body_md":{"description":"Markdown with {{variables}}.","type":"string"},"name":{"type":"string"},"subject":{"description":"May carry {{variables}}.","type":"string"}},"required":["name","subject","body_md"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates a transactional template; its slug comes from the name and never changes.","tags":["templates"],"x-kolea-scope":"admin"}},"/messages":{"get":{"operationId":"message_list","parameters":[{"in":"query","name":"status","required":false,"schema":{"enum":["queued","enqueued","sending","sent","failed","suppressed","cancelled"],"type":"string"}},{"in":"query","name":"kind","required":false,"schema":{"enum":["broadcast","sequence","transactional","form"],"type":"string"}},{"in":"query","name":"to","required":false,"schema":{"description":"Only messages to this address.","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 50, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The newest messages of any kind, filtered by status or recipient: what went, what was suppressed and why.","tags":["deliverability"],"x-kolea-scope":"read"}},"/broadcasts/{token}/revise":{"post":{"operationId":"broadcast_revise","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body":{"description":"Or the body as an editor document.","type":"object"},"excerpt":{"type":"string"},"markdown":{"description":"The body as Markdown (converted to the editor's blocks).","type":"string"},"subject":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Revises a sent or cancelled broadcast's subject and body (9.11). Never sends; the as-mailed copy is kept once.","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/campaigns/{token}/sales":{"get":{"operationId":"campaign_sales","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The campaign's token.","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 100, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Sales credited to a campaign, newest first.","tags":["campaigns"],"x-kolea-scope":"read"}},"/tags/{tag}":{"delete":{"operationId":"tag_delete","parameters":[{"in":"path","name":"tag","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a tag from everyone (deleting no one). Refused while anything depends on it; see tag_check.","tags":["tags"],"x-kolea-scope":"admin"},"patch":{"operationId":"tag_rename","parameters":[{"in":"path","name":"tag","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Renames a tag; everyone keeps it, and rules and segments follow.","tags":["tags"],"x-kolea-scope":"admin"}},"/broadcasts/{token}":{"delete":{"operationId":"broadcast_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a broadcast. Refused while it is sending (9.13).","tags":["broadcasts"],"x-kolea-scope":"admin"},"get":{"operationId":"broadcast_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One broadcast with its body.","tags":["broadcasts"],"x-kolea-scope":"read"},"patch":{"operationId":"broadcast_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"audience":{"enum":["everyone","segment"],"type":"string"},"body":{"description":"Or the body as an editor document.","type":"object"},"excerpt":{"type":"string"},"from_email":{"description":"Must be on one of the account's verified domains to send.","type":"string"},"from_name":{"type":"string"},"markdown":{"description":"The body as Markdown (converted to the editor's blocks).","type":"string"},"publish_on_send":{"description":"Also put it on the site when it goes out (default true).","type":"boolean"},"reply_to":{"type":"string"},"segment_token":{"description":"When audience is segment.","type":"string"},"subject":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Saves a draft's fields. A sent or cancelled broadcast takes broadcast_revise instead.","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/send":{"post":{"operationId":"send","responses":{"202":{"description":"Accepted"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Sends one transactional mail (SPEC 13). Needs a send or admin key.","tags":["transactional"]}},"/subscribers/{token}/unsubscribe":{"post":{"operationId":"subscriber_unsubscribe","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The subscriber's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"description":"Or the subscriber's address.","type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Takes a person off broadcasts at their request (8.3.3). Their sequences and receipts continue. To stop all marketing, use suppression_add.","tags":["audience"],"x-kolea-scope":"admin"}},"/subscribers":{"get":{"operationId":"subscriber_search","parameters":[{"in":"query","name":"search","required":false,"schema":{"description":"Part of an email address or name.","type":"string"}},{"in":"query","name":"status","required":false,"schema":{"enum":["active","pending","unsubscribed","bounced","complained"],"type":"string"}},{"in":"query","name":"tag","required":false,"schema":{"description":"Only people carrying this tag.","type":"string"}},{"in":"query","name":"page","required":false,"schema":{"description":"Page number, from 1.","type":"integer"}},{"in":"query","name":"per_page","required":false,"schema":{"description":"Page size (default 50, at most 200).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Find subscribers by email or name, status, or tag; newest first, paged.","tags":["audience"],"x-kolea-scope":"read"},"post":{"operationId":"subscriber_upsert","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"attributes":{"description":"Custom field values by key.","type":"object"},"email":{"type":"string"},"name":{"type":"string"},"source":{"description":"Where they came from (default api).","type":"string"},"status":{"description":"For a new subscriber only (default active).","enum":["active","pending"],"type":"string"},"tags":{"description":"Tag names to add; new names are created.","items":{"type":"string"},"type":"array"}},"required":["email"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Adds a subscriber or updates one by address. Never returns anyone to active who left (1.6); tags are added, never removed.","tags":["audience"],"x-kolea-scope":"admin"}},"/stripe/events":{"get":{"operationId":"stripe_events_list","parameters":[{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 50, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The latest Stripe webhook events received and what each did.","tags":["stripe"],"x-kolea-scope":"read"}},"/sequences":{"get":{"operationId":"sequence_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Sequences with step and enrollment counts, and whether each is live.","tags":["sequences"],"x-kolea-scope":"read"},"post":{"operationId":"sequence_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"description":"Shown to subscribers in the preference center.","type":"string"},"from_email":{"type":"string"},"from_name":{"type":"string"},"name":{"type":"string"},"next_sequence_token":{"description":"Where finishers go (\"\" for nowhere). Enrolls nobody now (1.11).","type":"string"},"reply_to":{"type":"string"},"trigger":{"enum":["subscribe","tag_added","manual"],"type":"string"},"trigger_tag":{"description":"For tag_added: the tag name.","type":"string"},"window_end":{"type":"string"},"window_start":{"description":"Send window start, HH:MM in the account's zone.","type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates a sequence, paused. It sends nothing until sequence_preflight and sequence_activate.","tags":["sequences"],"x-kolea-scope":"admin"}},"/health":{"get":{"operationId":"health","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Whether sending works for this account: the kill switch, recent failures, and queued mail.","tags":["ops"],"x-kolea-scope":"read"}},"/tag-rules/{token}/toggle":{"post":{"operationId":"tagrule_toggle","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"active":{"type":"boolean"}},"required":["active"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Pauses or resumes a tag rule. Tags it already applied stay.","tags":["tags"],"x-kolea-scope":"admin"}},"/topics/{slug}":{"patch":{"operationId":"topic_update","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"show_on_home":{"type":"boolean"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Saves a topic's description and whether it shows on the home page.","tags":["posts"],"x-kolea-scope":"admin"}},"/calls":{"get":{"operationId":"mcp_audit_list","parameters":[{"in":"query","name":"operation","required":false,"schema":{"type":"string"}},{"in":"query","name":"outcome","required":false,"schema":{"enum":["ok","error","denied"],"type":"string"}},{"in":"query","name":"surface","required":false,"schema":{"enum":["rest","mcp"],"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 100, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The newest REST and MCP calls on this account: operation, outcome, arguments, duration.","tags":["ops"],"x-kolea-scope":"read"}},"/campaigns/{token}":{"delete":{"operationId":"campaign_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The campaign's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a campaign. Its sales stay, unattributed.","tags":["campaigns"],"x-kolea-scope":"admin"},"get":{"operationId":"campaign_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The campaign's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One campaign with its numbers and what belongs to it.","tags":["campaigns"],"x-kolea-scope":"read"},"patch":{"operationId":"campaign_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The campaign's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"name":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Renames or redescribes a campaign.","tags":["campaigns"],"x-kolea-scope":"admin"}},"/subscribers/{token}":{"delete":{"operationId":"subscriber_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The subscriber's token.","type":"string"}},{"in":"query","name":"email","required":false,"schema":{"description":"Or the subscriber's address.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a subscriber with their tags and history (7.8). For erasure requests only; to stop mailing someone use suppression_add.","tags":["audience"],"x-kolea-scope":"admin"},"get":{"operationId":"subscriber_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The subscriber's token.","type":"string"}},{"in":"query","name":"email","required":false,"schema":{"description":"Or the subscriber's address.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One subscriber by token or email, with tags.","tags":["audience"],"x-kolea-scope":"read"}},"/campaigns/{token}/members":{"get":{"operationId":"campaign_members","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The campaign's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The broadcasts, sequences, and forms that belong to a campaign.","tags":["campaigns"],"x-kolea-scope":"read"},"post":{"operationId":"campaign_add","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The campaign's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"kind":{"enum":["broadcast","sequence","form"],"type":"string"},"member_token":{"description":"The broadcast's, sequence's, or form's token.","type":"string"}},"required":["kind","member_token"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Puts a broadcast, sequence, or form in a campaign (each belongs to at most one).","tags":["campaigns"],"x-kolea-scope":"admin"}},"/templates/{token}":{"delete":{"operationId":"template_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The template's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a transactional template. Requests that used it keep its slug in their history.","tags":["templates"],"x-kolea-scope":"admin"},"get":{"operationId":"template_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The template's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One transactional template.","tags":["templates"],"x-kolea-scope":"read"},"patch":{"operationId":"template_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The template's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body_md":{"description":"Markdown with {{variables}}.","type":"string"},"name":{"type":"string"},"subject":{"description":"May carry {{variables}}.","type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Changes a transactional template's name, subject, or body.","tags":["templates"],"x-kolea-scope":"admin"}},"/broadcasts/{token}/preflight":{"post":{"operationId":"broadcast_preflight","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The send confirmation (audience count, opening, blockers, warnings) and, when nothing blocks it, a single-use token for broadcast_send, valid 10 minutes and void after any edit.","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/suppressions":{"get":{"operationId":"suppression_list","parameters":[{"in":"query","name":"search","required":false,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The account's suppressed addresses and why, newest first.","tags":["deliverability"],"x-kolea-scope":"read"},"post":{"operationId":"suppression_add","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"type":"string"},"note":{"type":"string"}},"required":["email"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Stops all marketing to an address (8.3.7). Receipts still go. This is the way to stop mailing someone.","tags":["deliverability"],"x-kolea-scope":"admin"}},"/sequences/{token}/remove":{"post":{"operationId":"sequence_remove_person","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"description":"The subscriber's address.","type":"string"}},"required":["email"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Takes a person out of a sequence AT THEIR OWN REQUEST: an opt-out they keep until they rejoin. For rules, set an exit instead (1.10).","tags":["sequences"],"x-kolea-scope":"admin"}},"/suppressions/{email}":{"delete":{"operationId":"suppression_remove","parameters":[{"in":"path","name":"email","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Removes an account suppression. The person's status does not change; a bounce or complaint on the platform list stays.","tags":["deliverability"],"x-kolea-scope":"admin"}},"/logs/types":{"get":{"operationId":"log_types","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The event types in the account's log over the last 90 days, with their category and how many of each, most common first.","tags":["logs"],"x-kolea-scope":"read"}},"/broadcasts/{token}/send":{"post":{"operationId":"broadcast_send","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"preflight_token":{"type":"string"}},"required":["preflight_token"],"type":"object"}}},"required":true},"responses":{"202":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Sends a draft now. Needs the preflight_token broadcast_preflight returned for it.","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/sales/{token}":{"get":{"operationId":"sale_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sale's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One sale with its items.","tags":["sales"],"x-kolea-scope":"read"}},"/tag-rules/{token}":{"delete":{"operationId":"tagrule_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a tag rule. Tags it applied stay where they are.","tags":["tags"],"x-kolea-scope":"admin"}},"/imports":{"post":{"operationId":"subscriber_import_csv","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"attestation":{"description":"Where this list came from and how they agreed (18.4).","type":"string"},"content":{"description":"The CSV text, with a header row.","type":"string"},"filename":{"type":"string"},"mapping":{"description":"Column mapping; the suggested one is used when absent.","items":{"type":"object"},"type":"array"},"tags":{"description":"Tag names applied to every row.","items":{"type":"string"},"type":"array"}},"required":["content","attestation"],"type":"object"}}},"required":true},"responses":{"202":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Starts a CSV import in the background. Imports never enroll or mail anyone (1.8). Requires where the list came from.","tags":["audience"],"x-kolea-scope":"admin"}},"/tags/{tag}/check":{"get":{"operationId":"tag_check","parameters":[{"in":"path","name":"tag","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"What deleting a tag would do: how many carry it, what depends on it, whether it may go.","tags":["tags"],"x-kolea-scope":"read"}},"/sequence-templates/{token}/use":{"post":{"operationId":"sequence_template_use","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The template's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"name":{"type":"string"},"trigger":{"enum":["subscribe","tag_added","manual"],"type":"string"},"trigger_tag":{"type":"string"}},"required":[],"type":"object"}}},"required":false},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Makes a paused sequence from a template, placeholders and all. Enrolls nobody; fill the placeholders, then preflight.","tags":["sequence_templates"],"x-kolea-scope":"admin"}},"/sales/{token}/purchase-mail":{"get":{"operationId":"purchase_mail_preview","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sale's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"What the thank-you for a sale would say, rendered, writing nothing.","tags":["sales"],"x-kolea-scope":"read"},"post":{"operationId":"purchase_mail_send","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sale's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"resend":{"type":"boolean"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Sends the thank-you for a sale (once; resend: true for a second).","tags":["sales"],"x-kolea-scope":"admin"}},"/sequences/{token}/activate":{"post":{"operationId":"sequence_activate","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"preflight_token":{"type":"string"}},"required":["preflight_token"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Takes a sequence live. Needs sequence_preflight's token. Enrolls nobody by itself (1.11).","tags":["sequences"],"x-kolea-scope":"admin"}},"/posts/{token}/publish":{"post":{"operationId":"post_publish","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The post's (broadcast's) token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Puts one post on the site. Its slug and date are kept if it was up before.","tags":["posts"],"x-kolea-scope":"admin"}},"/sales/unattributed":{"get":{"operationId":"sales_unattributed","parameters":[{"in":"query","name":"limit","required":false,"schema":{"description":"How many to return (default 100, at most 500).","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Recent sales credited to no campaign.","tags":["sales"],"x-kolea-scope":"read"}},"/posts/{token}":{"get":{"operationId":"post_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The post's (broadcast's) token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One post with its URL, topics, and publishing fields.","tags":["posts"],"x-kolea-scope":"read"},"patch":{"operationId":"post_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The post's (broadcast's) token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"access_level":{"description":"Who may read it: everyone, signed-in members, or premium members.","enum":["public","members","premium"],"type":"string"},"excerpt":{"type":"string"},"feature_image":{"type":"string"},"feature_image_credit":{"type":"string"},"feature_image_credit_url":{"type":"string"},"featured":{"type":"boolean"},"slug":{"type":"string"},"topics":{"description":"Topic names; the first is primary.","items":{"type":"string"},"type":"array"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Saves a post's publishing fields: slug, excerpt, feature image, featured, access level, topics (first is primary).","tags":["posts"],"x-kolea-scope":"admin"}},"/segments":{"get":{"operationId":"segment_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Saved segments, with each rule as a sentence.","tags":["segments"],"x-kolea-scope":"read"},"post":{"operationId":"segment_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"},"rule":{"description":"A rule: `statuses` (default [\"active\"]), `tag_match` (\"any\" or \"all\"),\n`include_tags` and `exclude_tags` (tag names), `sources`,\n`joined_after` / `joined_before` (dates), and `conditions` on custom\nfields ([{key, op, value}]).\n","type":"object"}},"required":["name","rule"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Saves a segment. A broadcast copies its rule when scheduled, so later edits never rewrite a send.","tags":["segments"],"x-kolea-scope":"admin"}},"/themes":{"get":{"operationId":"theme_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The site's themes, built-ins first, and which one is live.","tags":["site"],"x-kolea-scope":"read"}},"/sequences/{token}/steps/reorder":{"post":{"operationId":"step_reorder","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"step_tokens":{"items":{"type":"string"},"type":"array"}},"required":["step_tokens"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Puts every step of a sequence in the order given (all step tokens, once each).","tags":["sequences"],"x-kolea-scope":"admin"}},"/sequences/{token}/rejoin":{"post":{"operationId":"sequence_rejoin_person","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sequence's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"description":"The subscriber's address.","type":"string"}},"required":["email"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Clears a person's opt-out from a sequence at their explicit request. Enrolls nobody by itself.","tags":["sequences"],"x-kolea-scope":"admin"}},"/stats/revenue":{"get":{"operationId":"revenue_totals","parameters":[{"in":"query","name":"since","required":false,"schema":{"description":"ISO date or time; all time when absent.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Net revenue per currency (paid only), orders, and refunds, since a date or all time.","tags":["sales"],"x-kolea-scope":"read"}},"/subscribers/{token}/tags":{"post":{"operationId":"subscriber_add_tags","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The subscriber's token.","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"description":"Or the subscriber's address.","type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"required":["tags"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Adds tags to one person by name (new names are created). Tags new to them reach automation.","tags":["audience"],"x-kolea-scope":"admin"}},"/stats":{"get":{"operationId":"stats_overview","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"The account now: subscribers by status, list health, how the latest broadcasts scored, revenue.","tags":["ops"],"x-kolea-scope":"read"}},"/segments/{token}":{"delete":{"operationId":"segment_delete","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Deletes a segment. Broadcasts that copied its rule keep it.","tags":["segments"],"x-kolea-scope":"admin"},"get":{"operationId":"segment_get","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"One segment with its rule and how many a broadcast to it would reach now.","tags":["segments"],"x-kolea-scope":"read"},"patch":{"operationId":"segment_update","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"},"rule":{"description":"A rule: `statuses` (default [\"active\"]), `tag_match` (\"any\" or \"all\"),\n`include_tags` and `exclude_tags` (tag names), `sources`,\n`joined_after` / `joined_before` (dates), and `conditions` on custom\nfields ([{key, op, value}]).\n","type":"object"}},"required":[],"type":"object"}}},"required":false},"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Renames a segment or changes its rule. Broadcasts that already copied it are unaffected (1.13).","tags":["segments"],"x-kolea-scope":"admin"}},"/logs":{"get":{"operationId":"log_search","parameters":[{"in":"query","name":"category","required":false,"schema":{"description":"Only this kind of event.","enum":["mail","subscribers","broadcasts","sequences","forms","checkout","stripe","imports","webhooks","domains","site","api","account"],"type":"string"}},{"in":"query","name":"type","required":false,"schema":{"description":"One exact type, e.g. mail.bounced (see log_types).","type":"string"}},{"in":"query","name":"level","required":false,"schema":{"description":"Only this level.","enum":["info","warning","error"],"type":"string"}},{"in":"query","name":"q","required":false,"schema":{"description":"Text to find in the summary, the address or name, or the detail.","type":"string"}},{"in":"query","name":"subject_type","required":false,"schema":{"description":"What the event is about: subscriber, message, broadcast, webhook...","type":"string"}},{"in":"query","name":"subject_id","required":false,"schema":{"description":"That thing's token (a subscriber's or message's token).","type":"string"}},{"in":"query","name":"since","required":false,"schema":{"description":"ISO 8601; events at or after.","type":"string"}},{"in":"query","name":"until","required":false,"schema":{"description":"ISO 8601; events before.","type":"string"}},{"in":"query","name":"cursor","required":false,"schema":{"description":"next_cursor from the previous page.","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"1 to 200, default 50.","type":"integer"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Search the account's event log, newest first: mail delivered, bounced, or refused; subscribers joining and leaving; broadcasts and sequences; checkouts and every Stripe event; sign-ins, API and MCP calls, imports, webhooks, and domains. Kept 90 days. Pass next_cursor back as cursor for the next page.","tags":["logs"],"x-kolea-scope":"read"}},"/broadcasts/{token}/preview":{"get":{"operationId":"broadcast_preview","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"What the broadcast says as plain text, and who it would reach, without minting anything.","tags":["broadcasts"],"x-kolea-scope":"read"}},"/broadcasts/{token}/test":{"post":{"operationId":"broadcast_send_test","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The broadcast's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Mails the saved broadcast to the person who made this key, if they are on the list. It never counts (1.18).","tags":["broadcasts"],"x-kolea-scope":"admin"}},"/sequences/tick":{"post":{"operationId":"sequence_tick","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Sends every step due now in this account's live sequences (the minute clock does this by itself).","tags":["sequences"],"x-kolea-scope":"admin"}},"/forms":{"get":{"operationId":"form_list","parameters":[],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Signup forms with their last 30 days of views, signups, and confirmations.","tags":["forms"],"x-kolea-scope":"read"},"post":{"operationId":"form_create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"active":{"type":"boolean"},"challenge":{"type":"boolean"},"description":{"type":"string"},"double_opt_in":{"description":"Refused off while the account is in probation (14.2).","type":"boolean"},"name":{"type":"string"},"redirect_url":{"type":"string"},"site_signup":{"description":"The form the public site's subscribe box posts to.","type":"boolean"},"slug":{"type":"string"},"success_message":{"type":"string"},"tags":{"description":"Tag names given to everyone who signs up.","items":{"type":"string"},"type":"array"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Creates a signup form (double opt-in by default).","tags":["forms"],"x-kolea-scope":"admin"}},"/sales/{token}/refund":{"post":{"operationId":"sale_refund","parameters":[{"in":"path","name":"token","required":true,"schema":{"description":"The sale's token.","type":"string"}}],"responses":{"200":{"description":"Success; the result is under `data`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A refusal, naming the problem"}},"summary":"Flips a sale to refunded. It stops counting; nothing negative is added (1.14).","tags":["sales"],"x-kolea-scope":"admin"}}},"security":[{"bearer":[]}],"servers":[{"url":"https://kolea.pro/api/v1"}]}