{
    "openapi": "3.1.0",
    "info": {
        "title": "ColdReach API",
        "version": "1.0.0",
        "description": "Manage leads, lead lists, campaigns, sequences, pipelines, opportunities and analytics in your ColdReach workspace."
    },
    "servers": [
        {
            "url": "https://outreach.corammers.com/api/v1"
        }
    ],
    "tags": [
        {
            "name": "Account",
            "description": "Check which workspace a key belongs to and look up the IDs you need for other requests — email accounts for campaigns and custom field keys for leads."
        },
        {
            "name": "Leads",
            "description": "Leads are the people you reach out to. Emails are unique per workspace (case-insensitive), so the API rejects duplicates and the bulk endpoint can skip or update them."
        },
        {
            "name": "Lead lists",
            "description": "Lists group leads so you can enroll them into campaigns together. A lead can belong to many lists; deleting a list never deletes its leads."
        },
        {
            "name": "Campaigns",
            "description": "A campaign sends a multi-step email sequence to enrolled leads from your connected email accounts, within its schedule. New campaigns start as `draft`; activate them to start sending."
        },
        {
            "name": "Sequences",
            "description": "Each campaign has one sequence: an ordered list of `email` and `wait` steps. Email steps hold one or more A/B variants that are picked by weight. Subjects and bodies support variables such as `{{ first_name }}`, `{{ company }}`, `{{ custom.funding_stage }}` and `{{ sender_name }}`. Bodies accept a safe HTML subset (p, br, strong, em, a, lists, headings) or plain text, whose line breaks are preserved. Leave the subject of a follow-up empty and it is sent as a reply in the same thread (“Re: …” with In-Reply-To/References), which keeps the conversation together in the lead’s inbox."
        },
        {
            "name": "Email templates",
            "description": "Reusable subjects and bodies for sequence emails. Using a template copies its content into a variant; editing or deleting the template later never changes variants that already exist."
        },
        {
            "name": "Campaign leads",
            "description": "Enroll leads into a campaign's sequence and control each lead individually. Leads are referenced by their lead ID."
        },
        {
            "name": "Pipelines",
            "description": "Pipelines track deals (opportunities) through ordered stages. Stages can be flagged as won or lost, which drives win-rate analytics. Link campaigns to a pipeline with `campaign_ids` and every lead that replies to them is added as an opportunity in the first stage automatically."
        },
        {
            "name": "Opportunities",
            "description": "Opportunities are deals linked to a lead and placed in a pipeline stage. Every stage change is recorded in `activity_log`."
        },
        {
            "name": "Analytics",
            "description": "Email performance, lead and pipeline reporting — the same numbers as the dashboard. `sent` counts emails; every other metric counts people, so a lead who opens six times is one opener. A click or a reply also counts as an open, because mail clients often block the open pixel, while opens and clicks fired by mail security scanners (within seconds of delivery, or from known scanner agents) are ignored. Only activity of steps that still exist is counted. Rates are percentages of `sent`. All dates are UTC."
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "operationId": "accountMe",
                "summary": "Get the current account",
                "description": "Returns the account the API key belongs to, the key's scopes, a count of every resource and the account's plan with what is left of it. A `null` limit means unlimited. Check `plan.contacts.remaining` before importing: once a plan's contact limit is reached, creating leads returns `403` with `code: contact_limit_reached`, and bulk requests skip the rows that do not fit (`skipped_plan_limit`).",
                "tags": [
                    "Account"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Alex Morgan",
                                        "email": "alex@yourcompany.com",
                                        "api_key": {
                                            "name": "CRM sync",
                                            "scopes": [
                                                "read",
                                                "write"
                                            ],
                                            "last_used_at": "2026-10-10T09:14:22+00:00",
                                            "expires_at": null
                                        },
                                        "counts": {
                                            "leads": 1840,
                                            "lead_lists": 12,
                                            "campaigns": 9,
                                            "pipelines": 2,
                                            "opportunities": 41,
                                            "smtp_accounts": 4
                                        },
                                        "plan": {
                                            "key": "growth",
                                            "name": "Growth",
                                            "contacts": {
                                                "used": 1840,
                                                "limit": 25000,
                                                "remaining": 23160
                                            },
                                            "emails": {
                                                "used": 5120,
                                                "limit": 125000,
                                                "remaining": 119880,
                                                "period_started_at": "2026-11-01T00:00:00+00:00",
                                                "renews_at": "2026-12-01T00:00:00+00:00"
                                            },
                                            "email_accounts": {
                                                "used": 4,
                                                "limit": null
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/smtp-accounts": {
            "get": {
                "operationId": "accountSmtpAccounts",
                "summary": "List email accounts",
                "description": "Lists the sending (SMTP) accounts connected to the workspace. Pass their IDs as `smtp_account_ids` when creating or updating a campaign. Credentials are never returned.",
                "tags": [
                    "Account"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 3,
                                            "display_name": "Alex — Sales",
                                            "from_name": "Alex Morgan",
                                            "from_email": "alex@yourcompany.com",
                                            "status": "active",
                                            "daily_limit": 50,
                                            "emails_sent_today": 12
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/custom-fields": {
            "get": {
                "operationId": "accountCustomFields",
                "summary": "List custom lead fields",
                "description": "Lists the custom lead fields defined in the workspace. Use each field's `key` inside a lead's `custom_data` object and as `{{ custom.key }}` in email templates.",
                "tags": [
                    "Account"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 3,
                                            "key": "funding_stage",
                                            "name": "Funding Stage",
                                            "type": "text"
                                        },
                                        {
                                            "id": 4,
                                            "key": "employee_count",
                                            "name": "Employee Count",
                                            "type": "number"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/leads": {
            "get": {
                "operationId": "leadsList",
                "summary": "List leads",
                "description": "Returns a paginated list of leads, newest first. Combine filters to sync or segment your data.",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Matches first name, last name, email, company or title.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "required": false,
                        "description": "Exact email match (case-insensitive).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter by lead status.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "temperature",
                        "in": "query",
                        "required": false,
                        "description": "`hot`, `warm` or `cold`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "min_score / max_score",
                        "in": "query",
                        "required": false,
                        "description": "Only leads with a score in this range (0–100).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "validation_status",
                        "in": "query",
                        "required": false,
                        "description": "Filter by email validation status.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "required": false,
                        "description": "Filter by source, e.g. `api`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "list_id",
                        "in": "query",
                        "required": false,
                        "description": "Only leads in this lead list.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "required": false,
                        "description": "Only leads with this tag.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_after",
                        "in": "query",
                        "required": false,
                        "description": "ISO 8601 date or datetime.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "created_before",
                        "in": "query",
                        "required": false,
                        "description": "ISO 8601 date or datetime.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "updated_after",
                        "in": "query",
                        "required": false,
                        "description": "Useful for incremental syncs.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "One of `created_at`, `updated_at`, `email`, `first_name`, `last_name`, `company`, `status`, `score`, `last_activity_at`, `last_contacted_at`. Prefix with `-` for descending (e.g. `-score` for hottest first). Default `-created_at`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 1842,
                                            "first_name": "Ava",
                                            "last_name": "Chen",
                                            "full_name": "Ava Chen",
                                            "email": "ava@northwind.io",
                                            "title": "Head of Growth",
                                            "company": "Northwind",
                                            "website": "https://northwind.io",
                                            "phone": "+1 415 555 0134",
                                            "location": "San Francisco, CA",
                                            "linkedin_url": "https://linkedin.com/in/avachen",
                                            "facebook_url": null,
                                            "instagram_url": null,
                                            "twitter_url": null,
                                            "industry": "SaaS",
                                            "company_domain": "northwind.io",
                                            "email_provider": "google",
                                            "email_security_gateway": null,
                                            "status": "new",
                                            "validation_status": "valid",
                                            "validated_at": "2026-10-09T14:12:03+00:00",
                                            "score": 64,
                                            "temperature": "hot",
                                            "score_breakdown": [
                                                {
                                                    "label": "Job title on file",
                                                    "points": 4
                                                },
                                                {
                                                    "label": "Email verified as valid",
                                                    "points": 5
                                                },
                                                {
                                                    "label": "2 opens",
                                                    "points": 6
                                                },
                                                {
                                                    "label": "Replied",
                                                    "points": 25
                                                },
                                                {
                                                    "label": "Engaged in the last 7 days",
                                                    "points": 10
                                                },
                                                {
                                                    "label": "Status: Interested",
                                                    "points": 20
                                                }
                                            ],
                                            "last_activity_at": "2026-10-11T09:30:00+00:00",
                                            "last_contacted_at": "2026-10-10T15:02:00+00:00",
                                            "source": "api",
                                            "tags": [
                                                "saas",
                                                "series-a"
                                            ],
                                            "custom_data": {
                                                "funding_stage": "Series A"
                                            },
                                            "lists": [
                                                {
                                                    "id": 12,
                                                    "name": "Q4 SaaS founders"
                                                }
                                            ],
                                            "created_at": "2026-10-09T14:11:58+00:00",
                                            "updated_at": "2026-10-09T14:12:03+00:00"
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/leads?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/leads?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/leads?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/leads",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "leadsCreate",
                "summary": "Create a lead",
                "description": "Creates a single lead. Returns `422` if a lead with the same email already exists — use the bulk endpoint with `on_duplicate=update` for upserts. Returns `403` with `code: contact_limit_reached` (plus `limit` and `used`) when the account's plan has no room for another contact.",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 1842,
                                        "first_name": "Ava",
                                        "last_name": "Chen",
                                        "full_name": "Ava Chen",
                                        "email": "ava@northwind.io",
                                        "title": "Head of Growth",
                                        "company": "Northwind",
                                        "website": "https://northwind.io",
                                        "phone": "+1 415 555 0134",
                                        "location": "San Francisco, CA",
                                        "linkedin_url": "https://linkedin.com/in/avachen",
                                        "facebook_url": null,
                                        "instagram_url": null,
                                        "twitter_url": null,
                                        "industry": "SaaS",
                                        "company_domain": "northwind.io",
                                        "email_provider": "google",
                                        "email_security_gateway": null,
                                        "status": "new",
                                        "validation_status": "valid",
                                        "validated_at": "2026-10-09T14:12:03+00:00",
                                        "score": 64,
                                        "temperature": "hot",
                                        "score_breakdown": [
                                            {
                                                "label": "Job title on file",
                                                "points": 4
                                            },
                                            {
                                                "label": "Email verified as valid",
                                                "points": 5
                                            },
                                            {
                                                "label": "2 opens",
                                                "points": 6
                                            },
                                            {
                                                "label": "Replied",
                                                "points": 25
                                            },
                                            {
                                                "label": "Engaged in the last 7 days",
                                                "points": 10
                                            },
                                            {
                                                "label": "Status: Interested",
                                                "points": 20
                                            }
                                        ],
                                        "last_activity_at": "2026-10-11T09:30:00+00:00",
                                        "last_contacted_at": "2026-10-10T15:02:00+00:00",
                                        "source": "api",
                                        "tags": [
                                            "saas",
                                            "series-a"
                                        ],
                                        "custom_data": {
                                            "funding_stage": "Series A"
                                        },
                                        "lists": [
                                            {
                                                "id": 12,
                                                "name": "Q4 SaaS founders"
                                            }
                                        ],
                                        "created_at": "2026-10-09T14:11:58+00:00",
                                        "updated_at": "2026-10-09T14:12:03+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "Email address."
                                    },
                                    "first_name": {
                                        "type": "string",
                                        "description": "First name."
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Last name."
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Job title."
                                    },
                                    "company": {
                                        "type": "string",
                                        "description": "Company name."
                                    },
                                    "website": {
                                        "type": "string",
                                        "description": "Company website (up to 2,048 characters, like the social URLs)."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Phone number."
                                    },
                                    "location": {
                                        "type": "string",
                                        "description": "City, region or country."
                                    },
                                    "linkedin_url": {
                                        "type": "string",
                                        "description": "LinkedIn profile URL. Also `facebook_url`, `instagram_url`, `twitter_url`."
                                    },
                                    "industry": {
                                        "type": "string",
                                        "description": "Industry."
                                    },
                                    "company_domain": {
                                        "type": "string",
                                        "description": "Company domain, e.g. `northwind.io`."
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "`new` (default), `contacted`, `replied`, `interested`, `meeting_booked`, `qualified`, `customer`, `not_interested`, `unsubscribed`, `bounced`, `invalid`."
                                    },
                                    "validation_status": {
                                        "type": "string",
                                        "description": "`pending` (default), `valid`, `invalid`, `catch_all`, `risky`, `unknown`."
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Tags as an array or a comma-separated string. Stored lowercase."
                                    },
                                    "custom_data": {
                                        "type": "object",
                                        "description": "Custom field values keyed by field key (see GET /custom-fields). Unknown keys are rejected."
                                    },
                                    "list_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Add the lead to these lead lists."
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            },
                            "example": {
                                "email": "ava@northwind.io",
                                "first_name": "Ava",
                                "last_name": "Chen",
                                "company": "Northwind",
                                "title": "Head of Growth",
                                "website": "https://northwind.io",
                                "tags": [
                                    "saas",
                                    "series-a"
                                ],
                                "custom_data": {
                                    "funding_stage": "Series A"
                                },
                                "list_ids": [
                                    12
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{lead}": {
            "get": {
                "operationId": "leadsGet",
                "summary": "Retrieve a lead",
                "description": "Returns a lead with its lists and the campaigns it is enrolled in.",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 1842,
                                        "first_name": "Ava",
                                        "last_name": "Chen",
                                        "full_name": "Ava Chen",
                                        "email": "ava@northwind.io",
                                        "title": "Head of Growth",
                                        "company": "Northwind",
                                        "website": "https://northwind.io",
                                        "phone": "+1 415 555 0134",
                                        "location": "San Francisco, CA",
                                        "linkedin_url": "https://linkedin.com/in/avachen",
                                        "facebook_url": null,
                                        "instagram_url": null,
                                        "twitter_url": null,
                                        "industry": "SaaS",
                                        "company_domain": "northwind.io",
                                        "email_provider": "google",
                                        "email_security_gateway": null,
                                        "status": "new",
                                        "validation_status": "valid",
                                        "validated_at": "2026-10-09T14:12:03+00:00",
                                        "score": 64,
                                        "temperature": "hot",
                                        "score_breakdown": [
                                            {
                                                "label": "Job title on file",
                                                "points": 4
                                            },
                                            {
                                                "label": "Email verified as valid",
                                                "points": 5
                                            },
                                            {
                                                "label": "2 opens",
                                                "points": 6
                                            },
                                            {
                                                "label": "Replied",
                                                "points": 25
                                            },
                                            {
                                                "label": "Engaged in the last 7 days",
                                                "points": 10
                                            },
                                            {
                                                "label": "Status: Interested",
                                                "points": 20
                                            }
                                        ],
                                        "last_activity_at": "2026-10-11T09:30:00+00:00",
                                        "last_contacted_at": "2026-10-10T15:02:00+00:00",
                                        "source": "api",
                                        "tags": [
                                            "saas",
                                            "series-a"
                                        ],
                                        "custom_data": {
                                            "funding_stage": "Series A"
                                        },
                                        "lists": [
                                            {
                                                "id": 12,
                                                "name": "Q4 SaaS founders"
                                            }
                                        ],
                                        "created_at": "2026-10-09T14:11:58+00:00",
                                        "updated_at": "2026-10-09T14:12:03+00:00",
                                        "campaigns": [
                                            {
                                                "campaign_id": 31,
                                                "campaign_name": "Q4 SaaS founders",
                                                "status": "active",
                                                "current_step": 2,
                                                "next_send_at": "2026-10-12T14:05:00+00:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "leadsUpdate",
                "summary": "Update a lead",
                "description": "Updates only the fields you send. `tags` replaces the tag list, `custom_data` is merged (send `null` for a key to clear it), and `list_ids` replaces the lead's list memberships. `PUT` is accepted as an alias.",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 1842,
                                        "first_name": "Ava",
                                        "last_name": "Chen",
                                        "full_name": "Ava Chen",
                                        "email": "ava@northwind.io",
                                        "title": "VP Growth",
                                        "company": "Northwind",
                                        "website": "https://northwind.io",
                                        "phone": "+1 415 555 0134",
                                        "location": "San Francisco, CA",
                                        "linkedin_url": "https://linkedin.com/in/avachen",
                                        "facebook_url": null,
                                        "instagram_url": null,
                                        "twitter_url": null,
                                        "industry": "SaaS",
                                        "company_domain": "northwind.io",
                                        "email_provider": "google",
                                        "email_security_gateway": null,
                                        "status": "qualified",
                                        "validation_status": "valid",
                                        "validated_at": "2026-10-09T14:12:03+00:00",
                                        "score": 64,
                                        "temperature": "hot",
                                        "score_breakdown": [
                                            {
                                                "label": "Job title on file",
                                                "points": 4
                                            },
                                            {
                                                "label": "Email verified as valid",
                                                "points": 5
                                            },
                                            {
                                                "label": "2 opens",
                                                "points": 6
                                            },
                                            {
                                                "label": "Replied",
                                                "points": 25
                                            },
                                            {
                                                "label": "Engaged in the last 7 days",
                                                "points": 10
                                            },
                                            {
                                                "label": "Status: Interested",
                                                "points": 20
                                            }
                                        ],
                                        "last_activity_at": "2026-10-11T09:30:00+00:00",
                                        "last_contacted_at": "2026-10-10T15:02:00+00:00",
                                        "source": "api",
                                        "tags": [
                                            "saas",
                                            "series-a"
                                        ],
                                        "custom_data": {
                                            "funding_stage": "Series B"
                                        },
                                        "lists": [
                                            {
                                                "id": 12,
                                                "name": "Q4 SaaS founders"
                                            }
                                        ],
                                        "created_at": "2026-10-09T14:11:58+00:00",
                                        "updated_at": "2026-10-09T14:12:03+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "New email address."
                                    },
                                    "first_name": {
                                        "type": "string",
                                        "description": "First name."
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Last name."
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Job title."
                                    },
                                    "company": {
                                        "type": "string",
                                        "description": "Company name."
                                    },
                                    "website": {
                                        "type": "string",
                                        "description": "Company website (up to 2,048 characters, like the social URLs)."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Phone number."
                                    },
                                    "location": {
                                        "type": "string",
                                        "description": "City, region or country."
                                    },
                                    "linkedin_url": {
                                        "type": "string",
                                        "description": "LinkedIn profile URL. Also `facebook_url`, `instagram_url`, `twitter_url`."
                                    },
                                    "industry": {
                                        "type": "string",
                                        "description": "Industry."
                                    },
                                    "company_domain": {
                                        "type": "string",
                                        "description": "Company domain, e.g. `northwind.io`."
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "`new` (default), `contacted`, `replied`, `interested`, `meeting_booked`, `qualified`, `customer`, `not_interested`, `unsubscribed`, `bounced`, `invalid`."
                                    },
                                    "validation_status": {
                                        "type": "string",
                                        "description": "`pending` (default), `valid`, `invalid`, `catch_all`, `risky`, `unknown`."
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Tags as an array or a comma-separated string. Stored lowercase."
                                    },
                                    "custom_data": {
                                        "type": "object",
                                        "description": "Custom field values keyed by field key (see GET /custom-fields). Unknown keys are rejected."
                                    },
                                    "list_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Replaces the lead's list memberships. Send `[]` to remove it from every list."
                                    }
                                }
                            },
                            "example": {
                                "status": "qualified",
                                "title": "VP Growth",
                                "custom_data": {
                                    "funding_stage": "Series B"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "leadsDelete",
                "summary": "Delete a lead",
                "description": "Permanently deletes a lead, its list memberships, campaign enrollments and opportunities.",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Lead deleted.",
                                    "id": 1842
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/leads/{lead}/timeline": {
            "get": {
                "operationId": "leadsTimeline",
                "summary": "Get a lead’s timeline",
                "description": "Everything that happened to a lead, newest first: emails sent, opens, clicks, replies, bounces, unsubscribes and sequence changes, plus edits, status changes, list membership, deals and automatic replies. Each entry says who did it — a person, an API key, an import or the system.",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "`email` (sends and sequence changes), `engagement` (opens, clicks, replies, unsubscribes, auto-replies), `crm` (created, edits, lists) or `deals`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "required": false,
                        "description": "Only email activity from this campaign.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "include_scheduling",
                        "in": "query",
                        "required": false,
                        "description": "Also return the “email scheduled” entries written each time a send is planned or moved.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": "event-90211",
                                            "source": "email",
                                            "type": "replied",
                                            "category": "engagement",
                                            "title": "Replied",
                                            "detail": "Step 1 · “Re: Quick question, Ava”",
                                            "campaign": {
                                                "id": 31,
                                                "name": "Q4 SaaS founders"
                                            },
                                            "actor": null,
                                            "occurred_at": "2026-10-10T10:48:03+00:00"
                                        },
                                        {
                                            "id": "event-90188",
                                            "source": "email",
                                            "type": "clicked",
                                            "category": "engagement",
                                            "title": "Link clicked",
                                            "detail": "Step 1 · https://northwind.io/pricing",
                                            "campaign": {
                                                "id": 31,
                                                "name": "Q4 SaaS founders"
                                            },
                                            "actor": null,
                                            "occurred_at": "2026-10-10T09:51:40+00:00"
                                        },
                                        {
                                            "id": "activity-5120",
                                            "source": "activity",
                                            "type": "status_changed",
                                            "category": "crm",
                                            "title": "Status changed",
                                            "detail": "Status changed from new to qualified",
                                            "campaign": null,
                                            "actor": {
                                                "type": "api",
                                                "name": "API key “CRM sync”"
                                            },
                                            "occurred_at": "2026-10-09T16:20:00+00:00"
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/leads/1842/timeline?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/leads/1842/timeline?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/leads/1842/timeline?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/leads/1842/timeline",
                                        "per_page": 25,
                                        "to": 3,
                                        "total": 3
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/leads/bulk": {
            "post": {
                "operationId": "leadsBulkCreate",
                "summary": "Create or upsert leads in bulk",
                "description": "Imports up to 500 leads in one request. Each lead accepts the same fields as *Create a lead*. Existing emails are skipped by default or updated with `on_duplicate=update`. Returns `201` when at least one lead was created. New leads beyond the plan's contact limit are not created: they come back with `result: skipped_plan_limit` and count under `skipped`.",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "created": 1,
                                        "updated": 1,
                                        "skipped": 0,
                                        "leads": [
                                            {
                                                "email": "ava@northwind.io",
                                                "id": 1842,
                                                "result": "updated"
                                            },
                                            {
                                                "email": "li@acme.dev",
                                                "id": 1907,
                                                "result": "created"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "leads": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Up to 500 lead objects. Each needs an `email`."
                                    },
                                    "on_duplicate": {
                                        "type": "string",
                                        "description": "`skip` (default) or `update` existing leads with the same email."
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Tags added to every lead in the request."
                                    },
                                    "list_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Add every lead in the request to these lists."
                                    }
                                },
                                "required": [
                                    "leads"
                                ]
                            },
                            "example": {
                                "on_duplicate": "update",
                                "tags": [
                                    "webinar-oct"
                                ],
                                "list_ids": [
                                    12
                                ],
                                "leads": [
                                    {
                                        "email": "ava@northwind.io",
                                        "first_name": "Ava",
                                        "company": "Northwind"
                                    },
                                    {
                                        "email": "li@acme.dev",
                                        "first_name": "Li",
                                        "last_name": "Wei",
                                        "company": "Acme"
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/bulk-delete": {
            "post": {
                "operationId": "leadsBulkDelete",
                "summary": "Delete leads in bulk",
                "description": "Deletes up to 1,000 leads by ID. IDs that do not belong to your workspace are ignored.",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "3 lead(s) deleted.",
                                    "deleted": 3
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Lead IDs to delete."
                                    }
                                },
                                "required": [
                                    "ids"
                                ]
                            },
                            "example": {
                                "ids": [
                                    1842,
                                    1907,
                                    1911
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{lead}/validate-email": {
            "post": {
                "operationId": "leadsValidateEmail",
                "summary": "Validate a lead's email",
                "description": "Checks syntax, MX records, disposable domains and role addresses, then stores the result on the lead (`validation_status`, `email_provider`, `email_security_gateway`).",
                "tags": [
                    "Leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "lead_id": 1842,
                                        "email": "ava@northwind.io",
                                        "validation_status": "valid",
                                        "email_provider": "google",
                                        "email_security_gateway": null,
                                        "validated_at": "2026-10-10T09:20:41+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/lead-lists": {
            "get": {
                "operationId": "leadListsList",
                "summary": "List lead lists",
                "description": "Returns your lead lists with their lead counts.",
                "tags": [
                    "Lead lists"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Matches the list name.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`created_at`, `updated_at` or `name`, prefix `-` for descending.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 12,
                                            "name": "Q4 SaaS founders",
                                            "description": "Founders at Series A–B SaaS companies",
                                            "leads_count": 248,
                                            "created_at": "2026-09-02T10:00:00+00:00",
                                            "updated_at": "2026-10-08T16:41:09+00:00"
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/lead-lists?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/lead-lists?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/lead-lists?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/lead-lists",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "leadListsCreate",
                "summary": "Create a lead list",
                "description": "Creates a list and optionally fills it with existing leads.",
                "tags": [
                    "Lead lists"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 12,
                                        "name": "Q4 SaaS founders",
                                        "description": "Founders at Series A–B SaaS companies",
                                        "leads_count": 2,
                                        "created_at": "2026-09-02T10:00:00+00:00",
                                        "updated_at": "2026-10-08T16:41:09+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "List name."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Optional description."
                                    },
                                    "lead_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Leads to add straight away."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Q4 SaaS founders",
                                "description": "Founders at Series A–B SaaS companies",
                                "lead_ids": [
                                    1842,
                                    1907
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/lead-lists/{list}": {
            "get": {
                "operationId": "leadListsGet",
                "summary": "Retrieve a lead list",
                "description": "Returns a single list.",
                "tags": [
                    "Lead lists"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "list",
                        "in": "path",
                        "required": true,
                        "description": "Lead list ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 12,
                                        "name": "Q4 SaaS founders",
                                        "description": "Founders at Series A–B SaaS companies",
                                        "leads_count": 248,
                                        "created_at": "2026-09-02T10:00:00+00:00",
                                        "updated_at": "2026-10-08T16:41:09+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "leadListsUpdate",
                "summary": "Update a lead list",
                "description": "Renames a list or changes its description.",
                "tags": [
                    "Lead lists"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "list",
                        "in": "path",
                        "required": true,
                        "description": "Lead list ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 12,
                                        "name": "Q4 SaaS founders — US",
                                        "description": "Founders at Series A–B SaaS companies",
                                        "leads_count": 248,
                                        "created_at": "2026-09-02T10:00:00+00:00",
                                        "updated_at": "2026-10-08T16:41:09+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "New name."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "New description."
                                    }
                                }
                            },
                            "example": {
                                "name": "Q4 SaaS founders — US"
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "leadListsDelete",
                "summary": "Delete a lead list",
                "description": "Deletes the list. The leads in it are kept.",
                "tags": [
                    "Lead lists"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "list",
                        "in": "path",
                        "required": true,
                        "description": "Lead list ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Lead list deleted. Leads in the list were kept.",
                                    "id": 12
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/lead-lists/{list}/leads": {
            "get": {
                "operationId": "leadListsLeads",
                "summary": "List leads in a list",
                "description": "Returns the leads in a list, paginated.",
                "tags": [
                    "Lead lists"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "list",
                        "in": "path",
                        "required": true,
                        "description": "Lead list ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 1842,
                                            "first_name": "Ava",
                                            "last_name": "Chen",
                                            "full_name": "Ava Chen",
                                            "email": "ava@northwind.io",
                                            "title": "Head of Growth",
                                            "company": "Northwind",
                                            "website": "https://northwind.io",
                                            "phone": "+1 415 555 0134",
                                            "location": "San Francisco, CA",
                                            "linkedin_url": "https://linkedin.com/in/avachen",
                                            "facebook_url": null,
                                            "instagram_url": null,
                                            "twitter_url": null,
                                            "industry": "SaaS",
                                            "company_domain": "northwind.io",
                                            "email_provider": "google",
                                            "email_security_gateway": null,
                                            "status": "new",
                                            "validation_status": "valid",
                                            "validated_at": "2026-10-09T14:12:03+00:00",
                                            "score": 64,
                                            "temperature": "hot",
                                            "score_breakdown": [
                                                {
                                                    "label": "Job title on file",
                                                    "points": 4
                                                },
                                                {
                                                    "label": "Email verified as valid",
                                                    "points": 5
                                                },
                                                {
                                                    "label": "2 opens",
                                                    "points": 6
                                                },
                                                {
                                                    "label": "Replied",
                                                    "points": 25
                                                },
                                                {
                                                    "label": "Engaged in the last 7 days",
                                                    "points": 10
                                                },
                                                {
                                                    "label": "Status: Interested",
                                                    "points": 20
                                                }
                                            ],
                                            "last_activity_at": "2026-10-11T09:30:00+00:00",
                                            "last_contacted_at": "2026-10-10T15:02:00+00:00",
                                            "source": "api",
                                            "tags": [
                                                "saas",
                                                "series-a"
                                            ],
                                            "custom_data": {
                                                "funding_stage": "Series A"
                                            },
                                            "lists": [
                                                {
                                                    "id": 12,
                                                    "name": "Q4 SaaS founders"
                                                }
                                            ],
                                            "created_at": "2026-10-09T14:11:58+00:00",
                                            "updated_at": "2026-10-09T14:12:03+00:00"
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/lead-lists/12/leads?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/lead-lists/12/leads?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/lead-lists/12/leads?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/lead-lists/12/leads",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "leadListsAddLeads",
                "summary": "Add leads to a list",
                "description": "Adds existing leads to the list. Leads already in the list are left as they are.",
                "tags": [
                    "Lead lists"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "list",
                        "in": "path",
                        "required": true,
                        "description": "Lead list ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "2 lead(s) added to the list.",
                                    "added": 2,
                                    "already_in_list": 1,
                                    "leads_count": 250
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "lead_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Up to 10,000 lead IDs."
                                    }
                                },
                                "required": [
                                    "lead_ids"
                                ]
                            },
                            "example": {
                                "lead_ids": [
                                    1842,
                                    1907,
                                    1911
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "leadListsRemoveLeads",
                "summary": "Remove leads from a list",
                "description": "Removes leads from the list without deleting them.",
                "tags": [
                    "Lead lists"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "list",
                        "in": "path",
                        "required": true,
                        "description": "Lead list ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "1 lead(s) removed from the list.",
                                    "removed": 1,
                                    "leads_count": 249
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "lead_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Lead IDs to remove."
                                    }
                                },
                                "required": [
                                    "lead_ids"
                                ]
                            },
                            "example": {
                                "lead_ids": [
                                    1911
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/campaigns": {
            "get": {
                "operationId": "campaignsList",
                "summary": "List campaigns",
                "description": "Returns your campaigns, newest first.",
                "tags": [
                    "Campaigns"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter by status.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Matches the campaign name.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`created_at`, `updated_at`, `name` or `status`, prefix `-` for descending.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 31,
                                            "name": "Q4 SaaS founders",
                                            "description": null,
                                            "status": "active",
                                            "tags": [
                                                "q4"
                                            ],
                                            "lead_list_id": 12,
                                            "settings": {
                                                "stop_on_reply": true,
                                                "stop_company_on_reply": false,
                                                "stop_on_auto_reply": true,
                                                "open_tracking": true,
                                                "click_tracking": true,
                                                "unsubscribe_link": true
                                            },
                                            "schedule": {
                                                "timezone": "America/New_York",
                                                "send_window_start": "09:00",
                                                "send_window_end": "17:00",
                                                "active_days": [
                                                    1,
                                                    2,
                                                    3,
                                                    4,
                                                    5
                                                ],
                                                "daily_send_limit": 150,
                                                "time_gap_minutes": 5,
                                                "start_date": null,
                                                "end_date": null
                                            },
                                            "stats": {
                                                "total_leads": 248,
                                                "emails_sent": 1240,
                                                "emails_opened": 712,
                                                "clicks": 96,
                                                "replies_received": 58,
                                                "bounces": 11,
                                                "unsubscribes": 4,
                                                "open_rate": 57.4,
                                                "reply_rate": 4.7,
                                                "bounce_rate": 0.9
                                            },
                                            "smtp_accounts": [
                                                {
                                                    "id": 3,
                                                    "display_name": "Alex — Sales",
                                                    "from_name": "Alex Morgan",
                                                    "from_email": "alex@yourcompany.com",
                                                    "status": "active",
                                                    "daily_limit": 50,
                                                    "emails_sent_today": 12
                                                }
                                            ],
                                            "steps": [
                                                {
                                                    "id": 88,
                                                    "order": 1,
                                                    "type": "email",
                                                    "name": "Intro",
                                                    "wait_days": 0,
                                                    "subject": "Quick question, {{ first_name }}",
                                                    "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                    "stats": {
                                                        "sent": 1240,
                                                        "opened": 712,
                                                        "clicked": 96,
                                                        "replied": 58,
                                                        "bounced": 11,
                                                        "open_rate": 57.4,
                                                        "click_rate": 7.7,
                                                        "reply_rate": 4.7
                                                    },
                                                    "variants": [
                                                        {
                                                            "id": 201,
                                                            "name": "Short",
                                                            "subject": "Quick question, {{ first_name }}",
                                                            "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                            "weight": 50,
                                                            "is_active": true,
                                                            "sort_order": 1,
                                                            "stats": {
                                                                "sent": 620,
                                                                "opened": 371,
                                                                "clicked": 51,
                                                                "replied": 33,
                                                                "bounced": 5,
                                                                "open_rate": 59.8,
                                                                "click_rate": 8.2,
                                                                "reply_rate": 5.3
                                                            }
                                                        },
                                                        {
                                                            "id": 202,
                                                            "name": "Social proof",
                                                            "subject": "How Acme booked 40 demos",
                                                            "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                            "weight": 50,
                                                            "is_active": true,
                                                            "sort_order": 2,
                                                            "stats": {
                                                                "sent": 620,
                                                                "opened": 341,
                                                                "clicked": 45,
                                                                "replied": 25,
                                                                "bounced": 6,
                                                                "open_rate": 55,
                                                                "click_rate": 7.3,
                                                                "reply_rate": 4
                                                            }
                                                        }
                                                    ],
                                                    "created_at": "2026-10-01T12:00:00+00:00",
                                                    "updated_at": "2026-10-01T12:00:00+00:00"
                                                }
                                            ],
                                            "created_at": "2026-10-01T12:00:00+00:00",
                                            "updated_at": "2026-10-10T08:00:00+00:00"
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/campaigns?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/campaigns?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/campaigns?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/campaigns",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "campaignsCreate",
                "summary": "Create a campaign",
                "description": "Creates a `draft` campaign with an empty sequence. Only `name` is required — everything else falls back to sensible defaults. Add steps with the Sequences endpoints, then activate.",
                "tags": [
                    "Campaigns"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 31,
                                        "name": "Q4 SaaS founders",
                                        "description": null,
                                        "status": "draft",
                                        "tags": [
                                            "q4"
                                        ],
                                        "lead_list_id": 12,
                                        "settings": {
                                            "stop_on_reply": true,
                                            "stop_company_on_reply": false,
                                            "stop_on_auto_reply": true,
                                            "open_tracking": true,
                                            "click_tracking": true,
                                            "unsubscribe_link": true
                                        },
                                        "schedule": {
                                            "timezone": "America/New_York",
                                            "send_window_start": "09:00",
                                            "send_window_end": "17:00",
                                            "active_days": [
                                                1,
                                                2,
                                                3,
                                                4,
                                                5
                                            ],
                                            "daily_send_limit": 150,
                                            "time_gap_minutes": 5,
                                            "start_date": null,
                                            "end_date": null
                                        },
                                        "stats": {
                                            "total_leads": 0,
                                            "emails_sent": 0,
                                            "emails_opened": 0,
                                            "clicks": 0,
                                            "replies_received": 0,
                                            "bounces": 0,
                                            "unsubscribes": 0,
                                            "open_rate": 0,
                                            "reply_rate": 0,
                                            "bounce_rate": 0
                                        },
                                        "smtp_accounts": [
                                            {
                                                "id": 3,
                                                "display_name": "Alex — Sales",
                                                "from_name": "Alex Morgan",
                                                "from_email": "alex@yourcompany.com",
                                                "status": "active",
                                                "daily_limit": 50,
                                                "emails_sent_today": 12
                                            }
                                        ],
                                        "steps": [],
                                        "created_at": "2026-10-01T12:00:00+00:00",
                                        "updated_at": "2026-10-10T08:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Campaign name."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Internal description."
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Campaign tags."
                                    },
                                    "lead_list_id": {
                                        "type": "integer",
                                        "description": "Lead list whose leads are enrolled when the campaign is activated."
                                    },
                                    "smtp_account_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Email accounts to send from (rotated automatically). Replaces the current set."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Q4 SaaS founders",
                                "lead_list_id": 12,
                                "smtp_account_ids": [
                                    3,
                                    4
                                ],
                                "settings": {
                                    "click_tracking": true
                                },
                                "schedule": {
                                    "timezone": "America/New_York",
                                    "send_window_start": "09:00",
                                    "send_window_end": "17:00",
                                    "active_days": [
                                        1,
                                        2,
                                        3,
                                        4,
                                        5
                                    ],
                                    "daily_send_limit": 150
                                }
                            }
                        }
                    }
                }
            }
        },
        "/campaigns/{campaign}": {
            "get": {
                "operationId": "campaignsGet",
                "summary": "Retrieve a campaign",
                "description": "Returns a campaign with its settings, schedule, stats, email accounts and sequence steps.",
                "tags": [
                    "Campaigns"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 31,
                                        "name": "Q4 SaaS founders",
                                        "description": null,
                                        "status": "active",
                                        "tags": [
                                            "q4"
                                        ],
                                        "lead_list_id": 12,
                                        "settings": {
                                            "stop_on_reply": true,
                                            "stop_company_on_reply": false,
                                            "stop_on_auto_reply": true,
                                            "open_tracking": true,
                                            "click_tracking": true,
                                            "unsubscribe_link": true
                                        },
                                        "schedule": {
                                            "timezone": "America/New_York",
                                            "send_window_start": "09:00",
                                            "send_window_end": "17:00",
                                            "active_days": [
                                                1,
                                                2,
                                                3,
                                                4,
                                                5
                                            ],
                                            "daily_send_limit": 150,
                                            "time_gap_minutes": 5,
                                            "start_date": null,
                                            "end_date": null
                                        },
                                        "stats": {
                                            "total_leads": 248,
                                            "emails_sent": 1240,
                                            "emails_opened": 712,
                                            "clicks": 96,
                                            "replies_received": 58,
                                            "bounces": 11,
                                            "unsubscribes": 4,
                                            "open_rate": 57.4,
                                            "reply_rate": 4.7,
                                            "bounce_rate": 0.9
                                        },
                                        "smtp_accounts": [
                                            {
                                                "id": 3,
                                                "display_name": "Alex — Sales",
                                                "from_name": "Alex Morgan",
                                                "from_email": "alex@yourcompany.com",
                                                "status": "active",
                                                "daily_limit": 50,
                                                "emails_sent_today": 12
                                            }
                                        ],
                                        "steps": [
                                            {
                                                "id": 88,
                                                "order": 1,
                                                "type": "email",
                                                "name": "Intro",
                                                "wait_days": 0,
                                                "subject": "Quick question, {{ first_name }}",
                                                "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                "stats": {
                                                    "sent": 1240,
                                                    "opened": 712,
                                                    "clicked": 96,
                                                    "replied": 58,
                                                    "bounced": 11,
                                                    "open_rate": 57.4,
                                                    "click_rate": 7.7,
                                                    "reply_rate": 4.7
                                                },
                                                "variants": [
                                                    {
                                                        "id": 201,
                                                        "name": "Short",
                                                        "subject": "Quick question, {{ first_name }}",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 1,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 371,
                                                            "clicked": 51,
                                                            "replied": 33,
                                                            "bounced": 5,
                                                            "open_rate": 59.8,
                                                            "click_rate": 8.2,
                                                            "reply_rate": 5.3
                                                        }
                                                    },
                                                    {
                                                        "id": 202,
                                                        "name": "Social proof",
                                                        "subject": "How Acme booked 40 demos",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 2,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 341,
                                                            "clicked": 45,
                                                            "replied": 25,
                                                            "bounced": 6,
                                                            "open_rate": 55,
                                                            "click_rate": 7.3,
                                                            "reply_rate": 4
                                                        }
                                                    }
                                                ],
                                                "created_at": "2026-10-01T12:00:00+00:00",
                                                "updated_at": "2026-10-01T12:00:00+00:00"
                                            }
                                        ],
                                        "created_at": "2026-10-01T12:00:00+00:00",
                                        "updated_at": "2026-10-10T08:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "campaignsUpdate",
                "summary": "Update a campaign",
                "description": "Updates only the fields you send; nested `settings` and `schedule` objects are partial too. Schedule changes reschedule queued emails immediately.",
                "tags": [
                    "Campaigns"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 31,
                                        "name": "Q4 SaaS founders",
                                        "description": null,
                                        "status": "active",
                                        "tags": [
                                            "q4"
                                        ],
                                        "lead_list_id": 12,
                                        "settings": {
                                            "stop_on_reply": true,
                                            "stop_company_on_reply": false,
                                            "stop_on_auto_reply": true,
                                            "open_tracking": true,
                                            "click_tracking": true,
                                            "unsubscribe_link": true
                                        },
                                        "schedule": {
                                            "timezone": "America/New_York",
                                            "send_window_start": "09:00",
                                            "send_window_end": "17:00",
                                            "active_days": [
                                                1,
                                                2,
                                                3,
                                                4,
                                                5
                                            ],
                                            "daily_send_limit": 150,
                                            "time_gap_minutes": 5,
                                            "start_date": null,
                                            "end_date": null
                                        },
                                        "stats": {
                                            "total_leads": 248,
                                            "emails_sent": 1240,
                                            "emails_opened": 712,
                                            "clicks": 96,
                                            "replies_received": 58,
                                            "bounces": 11,
                                            "unsubscribes": 4,
                                            "open_rate": 57.4,
                                            "reply_rate": 4.7,
                                            "bounce_rate": 0.9
                                        },
                                        "smtp_accounts": [
                                            {
                                                "id": 3,
                                                "display_name": "Alex — Sales",
                                                "from_name": "Alex Morgan",
                                                "from_email": "alex@yourcompany.com",
                                                "status": "active",
                                                "daily_limit": 50,
                                                "emails_sent_today": 12
                                            }
                                        ],
                                        "steps": [
                                            {
                                                "id": 88,
                                                "order": 1,
                                                "type": "email",
                                                "name": "Intro",
                                                "wait_days": 0,
                                                "subject": "Quick question, {{ first_name }}",
                                                "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                "stats": {
                                                    "sent": 1240,
                                                    "opened": 712,
                                                    "clicked": 96,
                                                    "replied": 58,
                                                    "bounced": 11,
                                                    "open_rate": 57.4,
                                                    "click_rate": 7.7,
                                                    "reply_rate": 4.7
                                                },
                                                "variants": [
                                                    {
                                                        "id": 201,
                                                        "name": "Short",
                                                        "subject": "Quick question, {{ first_name }}",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 1,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 371,
                                                            "clicked": 51,
                                                            "replied": 33,
                                                            "bounced": 5,
                                                            "open_rate": 59.8,
                                                            "click_rate": 8.2,
                                                            "reply_rate": 5.3
                                                        }
                                                    },
                                                    {
                                                        "id": 202,
                                                        "name": "Social proof",
                                                        "subject": "How Acme booked 40 demos",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 2,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 341,
                                                            "clicked": 45,
                                                            "replied": 25,
                                                            "bounced": 6,
                                                            "open_rate": 55,
                                                            "click_rate": 7.3,
                                                            "reply_rate": 4
                                                        }
                                                    }
                                                ],
                                                "created_at": "2026-10-01T12:00:00+00:00",
                                                "updated_at": "2026-10-01T12:00:00+00:00"
                                            }
                                        ],
                                        "created_at": "2026-10-01T12:00:00+00:00",
                                        "updated_at": "2026-10-10T08:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Campaign name."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Internal description."
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Campaign tags."
                                    },
                                    "lead_list_id": {
                                        "type": "integer",
                                        "description": "Lead list whose leads are enrolled when the campaign is activated."
                                    },
                                    "smtp_account_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Email accounts to send from (rotated automatically). Replaces the current set."
                                    }
                                }
                            },
                            "example": {
                                "schedule": {
                                    "send_window_end": "16:30",
                                    "daily_send_limit": 250
                                },
                                "settings": {
                                    "stop_company_on_reply": true
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "campaignsDelete",
                "summary": "Delete a campaign",
                "description": "Permanently deletes the campaign, its sequence, enrollments and event history. Leads are kept.",
                "tags": [
                    "Campaigns"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Campaign deleted.",
                                    "id": 31
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/activate": {
            "post": {
                "operationId": "campaignsActivate",
                "summary": "Activate a campaign",
                "description": "Starts (or resumes) sending. Leads from the attached lead list are enrolled and every active lead is scheduled within the sending window. The response includes `warnings` when something will prevent sending, such as no email accounts.",
                "tags": [
                    "Campaigns"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 31,
                                        "name": "Q4 SaaS founders",
                                        "description": null,
                                        "status": "active",
                                        "tags": [
                                            "q4"
                                        ],
                                        "lead_list_id": 12,
                                        "settings": {
                                            "stop_on_reply": true,
                                            "stop_company_on_reply": false,
                                            "stop_on_auto_reply": true,
                                            "open_tracking": true,
                                            "click_tracking": true,
                                            "unsubscribe_link": true
                                        },
                                        "schedule": {
                                            "timezone": "America/New_York",
                                            "send_window_start": "09:00",
                                            "send_window_end": "17:00",
                                            "active_days": [
                                                1,
                                                2,
                                                3,
                                                4,
                                                5
                                            ],
                                            "daily_send_limit": 150,
                                            "time_gap_minutes": 5,
                                            "start_date": null,
                                            "end_date": null
                                        },
                                        "stats": {
                                            "total_leads": 248,
                                            "emails_sent": 1240,
                                            "emails_opened": 712,
                                            "clicks": 96,
                                            "replies_received": 58,
                                            "bounces": 11,
                                            "unsubscribes": 4,
                                            "open_rate": 57.4,
                                            "reply_rate": 4.7,
                                            "bounce_rate": 0.9
                                        },
                                        "smtp_accounts": [
                                            {
                                                "id": 3,
                                                "display_name": "Alex — Sales",
                                                "from_name": "Alex Morgan",
                                                "from_email": "alex@yourcompany.com",
                                                "status": "active",
                                                "daily_limit": 50,
                                                "emails_sent_today": 12
                                            }
                                        ],
                                        "steps": [
                                            {
                                                "id": 88,
                                                "order": 1,
                                                "type": "email",
                                                "name": "Intro",
                                                "wait_days": 0,
                                                "subject": "Quick question, {{ first_name }}",
                                                "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                "stats": {
                                                    "sent": 1240,
                                                    "opened": 712,
                                                    "clicked": 96,
                                                    "replied": 58,
                                                    "bounced": 11,
                                                    "open_rate": 57.4,
                                                    "click_rate": 7.7,
                                                    "reply_rate": 4.7
                                                },
                                                "variants": [
                                                    {
                                                        "id": 201,
                                                        "name": "Short",
                                                        "subject": "Quick question, {{ first_name }}",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 1,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 371,
                                                            "clicked": 51,
                                                            "replied": 33,
                                                            "bounced": 5,
                                                            "open_rate": 59.8,
                                                            "click_rate": 8.2,
                                                            "reply_rate": 5.3
                                                        }
                                                    },
                                                    {
                                                        "id": 202,
                                                        "name": "Social proof",
                                                        "subject": "How Acme booked 40 demos",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 2,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 341,
                                                            "clicked": 45,
                                                            "replied": 25,
                                                            "bounced": 6,
                                                            "open_rate": 55,
                                                            "click_rate": 7.3,
                                                            "reply_rate": 4
                                                        }
                                                    }
                                                ],
                                                "created_at": "2026-10-01T12:00:00+00:00",
                                                "updated_at": "2026-10-01T12:00:00+00:00"
                                            }
                                        ],
                                        "created_at": "2026-10-01T12:00:00+00:00",
                                        "updated_at": "2026-10-10T08:00:00+00:00"
                                    },
                                    "message": "Campaign activated.",
                                    "warnings": []
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/pause": {
            "post": {
                "operationId": "campaignsPause",
                "summary": "Pause a campaign",
                "description": "Stops all sending for the campaign until it is activated again. Returns `409` if the campaign is not active.",
                "tags": [
                    "Campaigns"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 31,
                                        "name": "Q4 SaaS founders",
                                        "description": null,
                                        "status": "paused",
                                        "tags": [
                                            "q4"
                                        ],
                                        "lead_list_id": 12,
                                        "settings": {
                                            "stop_on_reply": true,
                                            "stop_company_on_reply": false,
                                            "stop_on_auto_reply": true,
                                            "open_tracking": true,
                                            "click_tracking": true,
                                            "unsubscribe_link": true
                                        },
                                        "schedule": {
                                            "timezone": "America/New_York",
                                            "send_window_start": "09:00",
                                            "send_window_end": "17:00",
                                            "active_days": [
                                                1,
                                                2,
                                                3,
                                                4,
                                                5
                                            ],
                                            "daily_send_limit": 150,
                                            "time_gap_minutes": 5,
                                            "start_date": null,
                                            "end_date": null
                                        },
                                        "stats": {
                                            "total_leads": 248,
                                            "emails_sent": 1240,
                                            "emails_opened": 712,
                                            "clicks": 96,
                                            "replies_received": 58,
                                            "bounces": 11,
                                            "unsubscribes": 4,
                                            "open_rate": 57.4,
                                            "reply_rate": 4.7,
                                            "bounce_rate": 0.9
                                        },
                                        "smtp_accounts": [
                                            {
                                                "id": 3,
                                                "display_name": "Alex — Sales",
                                                "from_name": "Alex Morgan",
                                                "from_email": "alex@yourcompany.com",
                                                "status": "active",
                                                "daily_limit": 50,
                                                "emails_sent_today": 12
                                            }
                                        ],
                                        "steps": [
                                            {
                                                "id": 88,
                                                "order": 1,
                                                "type": "email",
                                                "name": "Intro",
                                                "wait_days": 0,
                                                "subject": "Quick question, {{ first_name }}",
                                                "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                "stats": {
                                                    "sent": 1240,
                                                    "opened": 712,
                                                    "clicked": 96,
                                                    "replied": 58,
                                                    "bounced": 11,
                                                    "open_rate": 57.4,
                                                    "click_rate": 7.7,
                                                    "reply_rate": 4.7
                                                },
                                                "variants": [
                                                    {
                                                        "id": 201,
                                                        "name": "Short",
                                                        "subject": "Quick question, {{ first_name }}",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 1,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 371,
                                                            "clicked": 51,
                                                            "replied": 33,
                                                            "bounced": 5,
                                                            "open_rate": 59.8,
                                                            "click_rate": 8.2,
                                                            "reply_rate": 5.3
                                                        }
                                                    },
                                                    {
                                                        "id": 202,
                                                        "name": "Social proof",
                                                        "subject": "How Acme booked 40 demos",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 2,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 341,
                                                            "clicked": 45,
                                                            "replied": 25,
                                                            "bounced": 6,
                                                            "open_rate": 55,
                                                            "click_rate": 7.3,
                                                            "reply_rate": 4
                                                        }
                                                    }
                                                ],
                                                "created_at": "2026-10-01T12:00:00+00:00",
                                                "updated_at": "2026-10-01T12:00:00+00:00"
                                            }
                                        ],
                                        "created_at": "2026-10-01T12:00:00+00:00",
                                        "updated_at": "2026-10-10T08:00:00+00:00"
                                    },
                                    "message": "Campaign paused. No emails will be sent until it is activated again."
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/sequence": {
            "get": {
                "operationId": "sequenceGet",
                "summary": "Retrieve a sequence",
                "description": "Returns every step with its variants and stats, plus how many leads are in each sequence state.",
                "tags": [
                    "Sequences"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "campaign_id": 31,
                                        "sequence_id": 31,
                                        "enrollments": {
                                            "total": 248,
                                            "by_status": {
                                                "active": 201,
                                                "replied": 19,
                                                "completed": 22,
                                                "bounced": 6
                                            }
                                        },
                                        "steps": [
                                            {
                                                "id": 88,
                                                "order": 1,
                                                "type": "email",
                                                "name": "Intro",
                                                "wait_days": 0,
                                                "subject": "Quick question, {{ first_name }}",
                                                "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                "stats": {
                                                    "sent": 1240,
                                                    "opened": 712,
                                                    "clicked": 96,
                                                    "replied": 58,
                                                    "bounced": 11,
                                                    "open_rate": 57.4,
                                                    "click_rate": 7.7,
                                                    "reply_rate": 4.7
                                                },
                                                "variants": [
                                                    {
                                                        "id": 201,
                                                        "name": "Short",
                                                        "subject": "Quick question, {{ first_name }}",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 1,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 371,
                                                            "clicked": 51,
                                                            "replied": 33,
                                                            "bounced": 5,
                                                            "open_rate": 59.8,
                                                            "click_rate": 8.2,
                                                            "reply_rate": 5.3
                                                        }
                                                    },
                                                    {
                                                        "id": 202,
                                                        "name": "Social proof",
                                                        "subject": "How Acme booked 40 demos",
                                                        "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                        "weight": 50,
                                                        "is_active": true,
                                                        "sort_order": 2,
                                                        "stats": {
                                                            "sent": 620,
                                                            "opened": 341,
                                                            "clicked": 45,
                                                            "replied": 25,
                                                            "bounced": 6,
                                                            "open_rate": 55,
                                                            "click_rate": 7.3,
                                                            "reply_rate": 4
                                                        }
                                                    }
                                                ],
                                                "created_at": "2026-10-01T12:00:00+00:00",
                                                "updated_at": "2026-10-01T12:00:00+00:00"
                                            },
                                            {
                                                "id": 89,
                                                "order": 2,
                                                "type": "wait",
                                                "name": "Wait 3 days",
                                                "wait_days": 3,
                                                "subject": null,
                                                "body": null,
                                                "stats": {
                                                    "sent": 0,
                                                    "opened": 0,
                                                    "clicked": 0,
                                                    "replied": 0,
                                                    "bounced": 0,
                                                    "open_rate": 0,
                                                    "click_rate": 0,
                                                    "reply_rate": 0
                                                },
                                                "variants": [],
                                                "created_at": "2026-10-01T12:00:00+00:00",
                                                "updated_at": "2026-10-01T12:00:00+00:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/sequence/steps": {
            "post": {
                "operationId": "sequenceStepsCreate",
                "summary": "Add a step",
                "description": "Appends a step to the end of the sequence. For an email step send `subject` and `body`, or a `variants` array for an A/B test. Adding the first step schedules leads that are already enrolled.",
                "tags": [
                    "Sequences"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 88,
                                        "order": 1,
                                        "type": "email",
                                        "name": "Intro",
                                        "wait_days": 0,
                                        "subject": "Quick question, {{ first_name }}",
                                        "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                        "stats": {
                                            "sent": 1240,
                                            "opened": 712,
                                            "clicked": 96,
                                            "replied": 58,
                                            "bounced": 11,
                                            "open_rate": 57.4,
                                            "click_rate": 7.7,
                                            "reply_rate": 4.7
                                        },
                                        "variants": [
                                            {
                                                "id": 201,
                                                "name": "Short",
                                                "subject": "Quick question, {{ first_name }}",
                                                "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                "weight": 50,
                                                "is_active": true,
                                                "sort_order": 1,
                                                "stats": {
                                                    "sent": 620,
                                                    "opened": 371,
                                                    "clicked": 51,
                                                    "replied": 33,
                                                    "bounced": 5,
                                                    "open_rate": 59.8,
                                                    "click_rate": 8.2,
                                                    "reply_rate": 5.3
                                                }
                                            },
                                            {
                                                "id": 202,
                                                "name": "Social proof",
                                                "subject": "How Acme booked 40 demos",
                                                "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                "weight": 50,
                                                "is_active": true,
                                                "sort_order": 2,
                                                "stats": {
                                                    "sent": 620,
                                                    "opened": 341,
                                                    "clicked": 45,
                                                    "replied": 25,
                                                    "bounced": 6,
                                                    "open_rate": 55,
                                                    "click_rate": 7.3,
                                                    "reply_rate": 4
                                                }
                                            }
                                        ],
                                        "created_at": "2026-10-01T12:00:00+00:00",
                                        "updated_at": "2026-10-01T12:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "description": "`email` or `wait`."
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Optional label."
                                    },
                                    "wait_days": {
                                        "type": "integer",
                                        "description": "Days after the previous step (0–365). Default `0`."
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "Required for the first email step. On follow-ups, leave it out to reply in the same thread."
                                    },
                                    "body": {
                                        "type": "string",
                                        "description": "HTML or plain text. Required for email steps without `variants`."
                                    },
                                    "variants": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Up to 26 variants, each with `subject`, `body`, optional `name`, `weight` (1–10000, default 100), `is_active` and `email_template_id`."
                                    },
                                    "email_template_id": {
                                        "type": "integer",
                                        "description": "Build the email from one of your templates: its subject, body and design are copied in unless you send your own. Also accepted on each item of `variants`."
                                    },
                                    "design": {
                                        "type": "object",
                                        "description": "Branded layout for the email (same shape as a template's `design`). Also accepted on each item of `variants`."
                                    }
                                },
                                "required": [
                                    "type"
                                ]
                            },
                            "example": {
                                "type": "email",
                                "name": "Intro",
                                "wait_days": 0,
                                "variants": [
                                    {
                                        "name": "Short",
                                        "subject": "Quick question, {{ first_name }}",
                                        "body": "Hi {{ first_name }},\n\nAre you the right person to talk to about outbound at {{ company }}?\n\n{{ sender_name }}",
                                        "weight": 50
                                    },
                                    {
                                        "name": "Social proof",
                                        "subject": "How Acme booked 40 demos",
                                        "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                        "weight": 50
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/campaigns/{campaign}/sequence/steps/{step}": {
            "get": {
                "operationId": "sequenceStepsGet",
                "summary": "Retrieve a step",
                "description": "Returns one step with its variants.",
                "tags": [
                    "Sequences"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "step",
                        "in": "path",
                        "required": true,
                        "description": "Step ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 88,
                                        "order": 1,
                                        "type": "email",
                                        "name": "Intro",
                                        "wait_days": 0,
                                        "subject": "Quick question, {{ first_name }}",
                                        "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                        "stats": {
                                            "sent": 1240,
                                            "opened": 712,
                                            "clicked": 96,
                                            "replied": 58,
                                            "bounced": 11,
                                            "open_rate": 57.4,
                                            "click_rate": 7.7,
                                            "reply_rate": 4.7
                                        },
                                        "variants": [
                                            {
                                                "id": 201,
                                                "name": "Short",
                                                "subject": "Quick question, {{ first_name }}",
                                                "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                "weight": 50,
                                                "is_active": true,
                                                "sort_order": 1,
                                                "stats": {
                                                    "sent": 620,
                                                    "opened": 371,
                                                    "clicked": 51,
                                                    "replied": 33,
                                                    "bounced": 5,
                                                    "open_rate": 59.8,
                                                    "click_rate": 8.2,
                                                    "reply_rate": 5.3
                                                }
                                            },
                                            {
                                                "id": 202,
                                                "name": "Social proof",
                                                "subject": "How Acme booked 40 demos",
                                                "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                "weight": 50,
                                                "is_active": true,
                                                "sort_order": 2,
                                                "stats": {
                                                    "sent": 620,
                                                    "opened": 341,
                                                    "clicked": 45,
                                                    "replied": 25,
                                                    "bounced": 6,
                                                    "open_rate": 55,
                                                    "click_rate": 7.3,
                                                    "reply_rate": 4
                                                }
                                            }
                                        ],
                                        "created_at": "2026-10-01T12:00:00+00:00",
                                        "updated_at": "2026-10-01T12:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "sequenceStepsUpdate",
                "summary": "Update a step",
                "description": "Updates the name, delay or — for email steps with a single variant — the subject and body. Steps with several variants are edited through the variant endpoints.",
                "tags": [
                    "Sequences"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "step",
                        "in": "path",
                        "required": true,
                        "description": "Step ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 88,
                                        "order": 1,
                                        "type": "email",
                                        "name": "Intro",
                                        "wait_days": 0,
                                        "subject": "Quick question, {{ first_name }}",
                                        "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                        "stats": {
                                            "sent": 1240,
                                            "opened": 712,
                                            "clicked": 96,
                                            "replied": 58,
                                            "bounced": 11,
                                            "open_rate": 57.4,
                                            "click_rate": 7.7,
                                            "reply_rate": 4.7
                                        },
                                        "variants": [
                                            {
                                                "id": 201,
                                                "name": "Short",
                                                "subject": "Quick question, {{ first_name }}",
                                                "body": "<p>Hi {{ first_name }},</p><p>Are you the right person to talk to about outbound at {{ company }}?</p><p>{{ sender_name }}</p>",
                                                "weight": 50,
                                                "is_active": true,
                                                "sort_order": 1,
                                                "stats": {
                                                    "sent": 620,
                                                    "opened": 371,
                                                    "clicked": 51,
                                                    "replied": 33,
                                                    "bounced": 5,
                                                    "open_rate": 59.8,
                                                    "click_rate": 8.2,
                                                    "reply_rate": 5.3
                                                }
                                            },
                                            {
                                                "id": 202,
                                                "name": "Social proof",
                                                "subject": "How Acme booked 40 demos",
                                                "body": "<p>Hi {{ first_name }},</p><p>Acme booked 40 demos last month with ColdReach…</p>",
                                                "weight": 50,
                                                "is_active": true,
                                                "sort_order": 2,
                                                "stats": {
                                                    "sent": 620,
                                                    "opened": 341,
                                                    "clicked": 45,
                                                    "replied": 25,
                                                    "bounced": 6,
                                                    "open_rate": 55,
                                                    "click_rate": 7.3,
                                                    "reply_rate": 4
                                                }
                                            }
                                        ],
                                        "created_at": "2026-10-01T12:00:00+00:00",
                                        "updated_at": "2026-10-01T12:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Label."
                                    },
                                    "wait_days": {
                                        "type": "integer",
                                        "description": "Days after the previous step."
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "New subject (single-variant email steps)."
                                    },
                                    "body": {
                                        "type": "string",
                                        "description": "New body (single-variant email steps)."
                                    }
                                }
                            },
                            "example": {
                                "wait_days": 2,
                                "body": "Hi {{ first_name }}, bumping this to the top of your inbox."
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "sequenceStepsDelete",
                "summary": "Delete a step",
                "description": "Removes a step and its variants from the sequence.",
                "tags": [
                    "Sequences"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "step",
                        "in": "path",
                        "required": true,
                        "description": "Step ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Step deleted.",
                                    "id": 88
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/sequence/steps/{step}/variants": {
            "post": {
                "operationId": "sequenceVariantsCreate",
                "summary": "Add an A/B variant",
                "description": "Adds a variant to an email step. Variants are chosen per lead in proportion to their `weight`.",
                "tags": [
                    "Sequences"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "step",
                        "in": "path",
                        "required": true,
                        "description": "Step ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 203,
                                        "name": "Question hook",
                                        "subject": "{{ first_name }}, worth a look?",
                                        "body": "<p>Hi {{ first_name }}, one idea for {{ company }}…</p>",
                                        "weight": 34,
                                        "is_active": true,
                                        "sort_order": 3,
                                        "stats": {
                                            "sent": 0,
                                            "opened": 0,
                                            "clicked": 0,
                                            "replied": 0,
                                            "bounced": 0,
                                            "open_rate": 0,
                                            "click_rate": 0,
                                            "reply_rate": 0
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subject": {
                                        "type": "string",
                                        "description": "Subject line. Required on the first email step; empty on a follow-up means “reply in thread”."
                                    },
                                    "body": {
                                        "type": "string",
                                        "description": "HTML or plain text. Required unless `email_template_id` is given."
                                    },
                                    "email_template_id": {
                                        "type": "integer",
                                        "description": "Copy the subject and body from one of your templates (fields you send win)."
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Label. Defaults to the next letter, e.g. \"Variant C\"."
                                    },
                                    "weight": {
                                        "type": "integer",
                                        "description": "1–10000. Default `100`."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Default `true`."
                                    }
                                }
                            },
                            "example": {
                                "name": "Question hook",
                                "subject": "{{ first_name }}, worth a look?",
                                "body": "Hi {{ first_name }}, one idea for {{ company }}…",
                                "weight": 34
                            }
                        }
                    }
                }
            }
        },
        "/campaigns/{campaign}/sequence/steps/{step}/variants/{variant}": {
            "patch": {
                "operationId": "sequenceVariantsUpdate",
                "summary": "Update a variant",
                "description": "Edits a variant or turns it on/off. An email step always keeps at least one active variant.",
                "tags": [
                    "Sequences"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "step",
                        "in": "path",
                        "required": true,
                        "description": "Step ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "path",
                        "required": true,
                        "description": "Variant ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 203,
                                        "name": "Question hook",
                                        "subject": "{{ first_name }}, worth a look?",
                                        "body": "<p>Hi {{ first_name }}, one idea for {{ company }}…</p>",
                                        "weight": 34,
                                        "is_active": false,
                                        "sort_order": 3,
                                        "stats": {
                                            "sent": 0,
                                            "opened": 0,
                                            "clicked": 0,
                                            "replied": 0,
                                            "bounced": 0,
                                            "open_rate": 0,
                                            "click_rate": 0,
                                            "reply_rate": 0
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Label."
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "Subject line."
                                    },
                                    "body": {
                                        "type": "string",
                                        "description": "HTML or plain text."
                                    },
                                    "weight": {
                                        "type": "integer",
                                        "description": "1–10000."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable the variant."
                                    }
                                }
                            },
                            "example": {
                                "is_active": false
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "sequenceVariantsDelete",
                "summary": "Delete a variant",
                "description": "Deletes a variant. Returns `409` if it is the step's only variant or its last active one.",
                "tags": [
                    "Sequences"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "step",
                        "in": "path",
                        "required": true,
                        "description": "Step ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "path",
                        "required": true,
                        "description": "Variant ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Variant deleted.",
                                    "id": 203
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/email-templates": {
            "get": {
                "operationId": "emailTemplatesList",
                "summary": "List templates",
                "description": "Returns your email templates.",
                "tags": [
                    "Email templates"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "Only templates of this category.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Matches the template name.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`created_at`, `updated_at`, `name` or `category`, prefix `-` for descending.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 14,
                                            "name": "Quick question",
                                            "category": "intro",
                                            "description": "Short first email that opens with a question.",
                                            "subject": "Quick question, {{ first_name | 'there' }}",
                                            "body": "<p>Hi {{ first_name | 'there' }},</p><p>Who looks after bringing in new customers at {{ company | 'your company' }}?</p><p>{{ sender_name }}</p>",
                                            "is_starter": true,
                                            "used_in_variants": 3,
                                            "created_at": "2026-10-16T09:00:00+00:00",
                                            "updated_at": "2026-10-16T09:00:00+00:00"
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/email-templates?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/email-templates?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/email-templates?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/email-templates",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "emailTemplatesCreate",
                "summary": "Create a template",
                "description": "Saves a reusable email.",
                "tags": [
                    "Email templates"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 14,
                                        "name": "Quick question",
                                        "category": "intro",
                                        "description": "Short first email that opens with a question.",
                                        "subject": "Quick question, {{ first_name | 'there' }}",
                                        "body": "<p>Hi {{ first_name | 'there' }},</p><p>Who looks after bringing in new customers at {{ company | 'your company' }}?</p><p>{{ sender_name }}</p>",
                                        "is_starter": false,
                                        "used_in_variants": 0,
                                        "created_at": "2026-10-16T09:00:00+00:00",
                                        "updated_at": "2026-10-16T09:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Template name."
                                    },
                                    "body": {
                                        "type": "string",
                                        "description": "HTML or plain text with {{ variables }}."
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "Subject line. Leave empty for a follow-up that replies in the thread."
                                    },
                                    "category": {
                                        "type": "string",
                                        "description": "Default `other`."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "When to use it."
                                    },
                                    "design": {
                                        "type": "object",
                                        "description": "Optional branded layout wrapped around the body when sent: `layout` (letter, spotlight, showcase, invite), `accent` (#hex), `brand_name`, `logo_url`, `tagline`, `headline`, `subheadline`, `button_text`, `button_url`, `highlights` (up to 3 of `value`/`label`), `footer_address`, `website_url`, `linkedin_url`. `null` for a plain email."
                                    }
                                },
                                "required": [
                                    "name",
                                    "body"
                                ]
                            },
                            "example": {
                                "name": "Quick question",
                                "category": "intro",
                                "subject": "Quick question, {{ first_name | 'there' }}",
                                "body": "<p>Hi {{ first_name | 'there' }},</p><p>Who looks after bringing in new customers at {{ company | 'your company' }}?</p>"
                            }
                        }
                    }
                }
            }
        },
        "/email-templates/{template}": {
            "get": {
                "operationId": "emailTemplatesGet",
                "summary": "Retrieve a template",
                "description": "Returns one template.",
                "tags": [
                    "Email templates"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "template",
                        "in": "path",
                        "required": true,
                        "description": "Template ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 14,
                                        "name": "Quick question",
                                        "category": "intro",
                                        "description": "Short first email that opens with a question.",
                                        "subject": "Quick question, {{ first_name | 'there' }}",
                                        "body": "<p>Hi {{ first_name | 'there' }},</p><p>Who looks after bringing in new customers at {{ company | 'your company' }}?</p><p>{{ sender_name }}</p>",
                                        "is_starter": true,
                                        "used_in_variants": 3,
                                        "created_at": "2026-10-16T09:00:00+00:00",
                                        "updated_at": "2026-10-16T09:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "emailTemplatesUpdate",
                "summary": "Update a template",
                "description": "Changes a template. Variants already built from it are not changed.",
                "tags": [
                    "Email templates"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "template",
                        "in": "path",
                        "required": true,
                        "description": "Template ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 14,
                                        "name": "Quick question",
                                        "category": "intro",
                                        "description": "Short first email that opens with a question.",
                                        "subject": "Quick question, {{ first_name | 'there' }}",
                                        "body": "<p>Hi {{ first_name | 'there' }},</p><p>Who looks after bringing in new customers at {{ company | 'your company' }}?</p><p>{{ sender_name }}</p>",
                                        "is_starter": true,
                                        "used_in_variants": 3,
                                        "created_at": "2026-10-16T09:00:00+00:00",
                                        "updated_at": "2026-10-16T09:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "New name."
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "New subject."
                                    },
                                    "body": {
                                        "type": "string",
                                        "description": "New body."
                                    },
                                    "category": {
                                        "type": "string",
                                        "description": "New category."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "New description."
                                    }
                                }
                            },
                            "example": {
                                "subject": "{{ first_name | 'Hi' }}, a quick question"
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "emailTemplatesDelete",
                "summary": "Delete a template",
                "description": "Deletes the template. Variants built from it keep their content.",
                "tags": [
                    "Email templates"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "template",
                        "in": "path",
                        "required": true,
                        "description": "Template ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Template deleted. Variants built from it keep their content.",
                                    "id": 14
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/leads": {
            "get": {
                "operationId": "campaignLeadsList",
                "summary": "List campaign leads",
                "description": "Returns the leads enrolled in a campaign with their sequence progress.",
                "tags": [
                    "Campaign leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter by enrollment status.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "step",
                        "in": "query",
                        "required": false,
                        "description": "Only leads currently on this step.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Matches the lead's email, name or company.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`enrolled_at`, `next_send_at` or `created_at`, prefix `-` for descending.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "enrollment_id": 5521,
                                            "campaign_id": 31,
                                            "status": "active",
                                            "current_step": 1,
                                            "enrolled_at": "2026-10-10T09:30:12+00:00",
                                            "next_send_at": "2026-10-10T13:05:00+00:00",
                                            "last_step_sent_at": null,
                                            "last_error": null,
                                            "lead": {
                                                "id": 1842,
                                                "email": "ava@northwind.io",
                                                "first_name": "Ava",
                                                "last_name": "Chen",
                                                "company": "Northwind"
                                            },
                                            "assigned_smtp": {
                                                "id": 3,
                                                "from_email": "alex@yourcompany.com"
                                            }
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/campaigns/31/leads?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/campaigns/31/leads?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/campaigns/31/leads?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/campaigns/31/leads",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "campaignLeadsAdd",
                "summary": "Enroll leads",
                "description": "Enrolls leads by ID and/or every lead of a list. Leads already in the campaign, unsubscribed, bounced or on the suppression list are skipped. If the campaign is active they are scheduled right away.",
                "tags": [
                    "Campaign leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "2 lead(s) enrolled.",
                                    "enrolled": 2,
                                    "skipped": 0,
                                    "skipped_reason": "Leads already in this campaign, unsubscribed, bounced or suppressed are skipped.",
                                    "data": [
                                        {
                                            "enrollment_id": 5521,
                                            "campaign_id": 31,
                                            "status": "active",
                                            "current_step": 1,
                                            "enrolled_at": "2026-10-10T09:30:12+00:00",
                                            "next_send_at": "2026-10-10T13:05:00+00:00",
                                            "last_step_sent_at": null,
                                            "last_error": null,
                                            "lead": {
                                                "id": 1842,
                                                "email": "ava@northwind.io",
                                                "first_name": "Ava",
                                                "last_name": "Chen",
                                                "company": "Northwind"
                                            },
                                            "assigned_smtp": {
                                                "id": 3,
                                                "from_email": "alex@yourcompany.com"
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "lead_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Lead IDs. Required without `lead_list_id`."
                                    },
                                    "lead_list_id": {
                                        "type": "integer",
                                        "description": "Enroll every lead in this list. Required without `lead_ids`."
                                    }
                                }
                            },
                            "example": {
                                "lead_ids": [
                                    1842,
                                    1907
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/campaigns/{campaign}/leads/{lead}": {
            "delete": {
                "operationId": "campaignLeadsRemove",
                "summary": "Remove a lead",
                "description": "Stops the sequence for a lead permanently. The enrollment is kept with status `removed` for reporting.",
                "tags": [
                    "Campaign leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Lead removed from the campaign. No further emails will be sent to it.",
                                    "data": {
                                        "enrollment_id": 5521,
                                        "campaign_id": 31,
                                        "status": "removed",
                                        "current_step": 1,
                                        "enrolled_at": "2026-10-10T09:30:12+00:00",
                                        "next_send_at": null,
                                        "last_step_sent_at": null,
                                        "last_error": null,
                                        "lead": {
                                            "id": 1842,
                                            "email": "ava@northwind.io",
                                            "first_name": "Ava",
                                            "last_name": "Chen",
                                            "company": "Northwind"
                                        },
                                        "assigned_smtp": {
                                            "id": 3,
                                            "from_email": "alex@yourcompany.com"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/leads/{lead}/pause": {
            "post": {
                "operationId": "campaignLeadsPause",
                "summary": "Pause a lead",
                "description": "Pauses an active lead. Returns `409` if the lead is not active.",
                "tags": [
                    "Campaign leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Lead paused in the sequence.",
                                    "data": {
                                        "enrollment_id": 5521,
                                        "campaign_id": 31,
                                        "status": "paused",
                                        "current_step": 1,
                                        "enrolled_at": "2026-10-10T09:30:12+00:00",
                                        "next_send_at": "2026-10-10T13:05:00+00:00",
                                        "last_step_sent_at": null,
                                        "last_error": null,
                                        "lead": {
                                            "id": 1842,
                                            "email": "ava@northwind.io",
                                            "first_name": "Ava",
                                            "last_name": "Chen",
                                            "company": "Northwind"
                                        },
                                        "assigned_smtp": {
                                            "id": 3,
                                            "from_email": "alex@yourcompany.com"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/leads/{lead}/resume": {
            "post": {
                "operationId": "campaignLeadsResume",
                "summary": "Resume a lead",
                "description": "Resumes a paused lead and reschedules its current step inside the sending window.",
                "tags": [
                    "Campaign leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Lead resumed in the sequence.",
                                    "data": {
                                        "enrollment_id": 5521,
                                        "campaign_id": 31,
                                        "status": "active",
                                        "current_step": 1,
                                        "enrolled_at": "2026-10-10T09:30:12+00:00",
                                        "next_send_at": "2026-10-10T13:05:00+00:00",
                                        "last_step_sent_at": null,
                                        "last_error": null,
                                        "lead": {
                                            "id": 1842,
                                            "email": "ava@northwind.io",
                                            "first_name": "Ava",
                                            "last_name": "Chen",
                                            "company": "Northwind"
                                        },
                                        "assigned_smtp": {
                                            "id": 3,
                                            "from_email": "alex@yourcompany.com"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/leads/{lead}/skip": {
            "post": {
                "operationId": "campaignLeadsSkip",
                "summary": "Skip to the next step",
                "description": "Moves the lead to the next step. On the last step the lead is marked `completed`.",
                "tags": [
                    "Campaign leads"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "Lead ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Lead advanced to the next step.",
                                    "data": {
                                        "enrollment_id": 5521,
                                        "campaign_id": 31,
                                        "status": "active",
                                        "current_step": 3,
                                        "enrolled_at": "2026-10-10T09:30:12+00:00",
                                        "next_send_at": "2026-10-13T13:05:00+00:00",
                                        "last_step_sent_at": null,
                                        "last_error": null,
                                        "lead": {
                                            "id": 1842,
                                            "email": "ava@northwind.io",
                                            "first_name": "Ava",
                                            "last_name": "Chen",
                                            "company": "Northwind"
                                        },
                                        "assigned_smtp": {
                                            "id": 3,
                                            "from_email": "alex@yourcompany.com"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/pipelines": {
            "get": {
                "operationId": "pipelinesList",
                "summary": "List pipelines",
                "description": "Returns every pipeline with its stages and deal counts. Not paginated.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 5,
                                            "name": "Sales pipeline",
                                            "is_default": true,
                                            "campaign_ids": [
                                                31
                                            ],
                                            "opportunities_count": 41,
                                            "stages": [
                                                {
                                                    "id": 36,
                                                    "pipeline_id": 5,
                                                    "name": "New Lead",
                                                    "color": "#6366f1",
                                                    "order": 0,
                                                    "is_won": false,
                                                    "is_lost": false,
                                                    "opportunities_count": 12,
                                                    "opportunities_value": 140000
                                                },
                                                {
                                                    "id": 37,
                                                    "pipeline_id": 5,
                                                    "name": "Contacted",
                                                    "color": "#3b82f6",
                                                    "order": 1,
                                                    "is_won": false,
                                                    "is_lost": false,
                                                    "opportunities_count": 6,
                                                    "opportunities_value": 72000
                                                },
                                                {
                                                    "id": 38,
                                                    "pipeline_id": 5,
                                                    "name": "Opened",
                                                    "color": "#8b5cf6",
                                                    "order": 2,
                                                    "is_won": false,
                                                    "is_lost": false,
                                                    "opportunities_count": 3,
                                                    "opportunities_value": 30000
                                                },
                                                {
                                                    "id": 39,
                                                    "pipeline_id": 5,
                                                    "name": "Responded",
                                                    "color": "#f59e0b",
                                                    "order": 3,
                                                    "is_won": false,
                                                    "is_lost": false,
                                                    "opportunities_count": 3,
                                                    "opportunities_value": 54000
                                                },
                                                {
                                                    "id": 40,
                                                    "pipeline_id": 5,
                                                    "name": "Qualified",
                                                    "color": "#10b981",
                                                    "order": 4,
                                                    "is_won": false,
                                                    "is_lost": false,
                                                    "opportunities_count": 3,
                                                    "opportunities_value": 66000
                                                },
                                                {
                                                    "id": 41,
                                                    "pipeline_id": 5,
                                                    "name": "Meeting Booked",
                                                    "color": "#06b6d4",
                                                    "order": 5,
                                                    "is_won": false,
                                                    "is_lost": false,
                                                    "opportunities_count": 2,
                                                    "opportunities_value": 50000
                                                },
                                                {
                                                    "id": 42,
                                                    "pipeline_id": 5,
                                                    "name": "Won",
                                                    "color": "#22c55e",
                                                    "order": 6,
                                                    "is_won": true,
                                                    "is_lost": false,
                                                    "opportunities_count": 8,
                                                    "opportunities_value": 96000
                                                },
                                                {
                                                    "id": 43,
                                                    "pipeline_id": 5,
                                                    "name": "Lost",
                                                    "color": "#ef4444",
                                                    "order": 7,
                                                    "is_won": false,
                                                    "is_lost": true,
                                                    "opportunities_count": 4,
                                                    "opportunities_value": 40000
                                                }
                                            ],
                                            "created_at": "2026-08-20T09:00:00+00:00",
                                            "updated_at": "2026-10-02T15:30:00+00:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "pipelinesCreate",
                "summary": "Create a pipeline",
                "description": "Creates a pipeline. Without `stages`, the default eight stages are created (New Lead → Won/Lost). Your first pipeline becomes the default.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 5,
                                        "name": "Sales pipeline",
                                        "is_default": true,
                                        "campaign_ids": [
                                            31
                                        ],
                                        "opportunities_count": 41,
                                        "stages": [
                                            {
                                                "id": 36,
                                                "pipeline_id": 5,
                                                "name": "New Lead",
                                                "color": "#6366f1",
                                                "order": 0,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 12,
                                                "opportunities_value": 140000
                                            },
                                            {
                                                "id": 37,
                                                "pipeline_id": 5,
                                                "name": "Contacted",
                                                "color": "#3b82f6",
                                                "order": 1,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 6,
                                                "opportunities_value": 72000
                                            },
                                            {
                                                "id": 38,
                                                "pipeline_id": 5,
                                                "name": "Opened",
                                                "color": "#8b5cf6",
                                                "order": 2,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 30000
                                            },
                                            {
                                                "id": 39,
                                                "pipeline_id": 5,
                                                "name": "Responded",
                                                "color": "#f59e0b",
                                                "order": 3,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 54000
                                            },
                                            {
                                                "id": 40,
                                                "pipeline_id": 5,
                                                "name": "Qualified",
                                                "color": "#10b981",
                                                "order": 4,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 66000
                                            },
                                            {
                                                "id": 41,
                                                "pipeline_id": 5,
                                                "name": "Meeting Booked",
                                                "color": "#06b6d4",
                                                "order": 5,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 2,
                                                "opportunities_value": 50000
                                            },
                                            {
                                                "id": 42,
                                                "pipeline_id": 5,
                                                "name": "Won",
                                                "color": "#22c55e",
                                                "order": 6,
                                                "is_won": true,
                                                "is_lost": false,
                                                "opportunities_count": 8,
                                                "opportunities_value": 96000
                                            },
                                            {
                                                "id": 43,
                                                "pipeline_id": 5,
                                                "name": "Lost",
                                                "color": "#ef4444",
                                                "order": 7,
                                                "is_won": false,
                                                "is_lost": true,
                                                "opportunities_count": 4,
                                                "opportunities_value": 40000
                                            }
                                        ],
                                        "created_at": "2026-08-20T09:00:00+00:00",
                                        "updated_at": "2026-10-02T15:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Pipeline name."
                                    },
                                    "is_default": {
                                        "type": "boolean",
                                        "description": "Make this the default pipeline."
                                    },
                                    "campaign_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Campaigns whose replies are added to this pipeline as opportunities."
                                    },
                                    "stages": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Custom stages in order, each with `name`, optional `color` (`#RRGGBB`), `is_won`, `is_lost`."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Agency deals",
                                "campaign_ids": [
                                    31
                                ],
                                "stages": [
                                    {
                                        "name": "Discovery",
                                        "color": "#9fbbe0"
                                    },
                                    {
                                        "name": "Proposal sent",
                                        "color": "#c0a8dd"
                                    },
                                    {
                                        "name": "Won",
                                        "color": "#9fc9a2",
                                        "is_won": true
                                    },
                                    {
                                        "name": "Lost",
                                        "color": "#dfa88f",
                                        "is_lost": true
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/pipelines/{pipeline}": {
            "get": {
                "operationId": "pipelinesGet",
                "summary": "Retrieve a pipeline",
                "description": "Returns a pipeline with its stages and deal counts.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline",
                        "in": "path",
                        "required": true,
                        "description": "Pipeline ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 5,
                                        "name": "Sales pipeline",
                                        "is_default": true,
                                        "campaign_ids": [
                                            31
                                        ],
                                        "opportunities_count": 41,
                                        "stages": [
                                            {
                                                "id": 36,
                                                "pipeline_id": 5,
                                                "name": "New Lead",
                                                "color": "#6366f1",
                                                "order": 0,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 12,
                                                "opportunities_value": 140000
                                            },
                                            {
                                                "id": 37,
                                                "pipeline_id": 5,
                                                "name": "Contacted",
                                                "color": "#3b82f6",
                                                "order": 1,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 6,
                                                "opportunities_value": 72000
                                            },
                                            {
                                                "id": 38,
                                                "pipeline_id": 5,
                                                "name": "Opened",
                                                "color": "#8b5cf6",
                                                "order": 2,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 30000
                                            },
                                            {
                                                "id": 39,
                                                "pipeline_id": 5,
                                                "name": "Responded",
                                                "color": "#f59e0b",
                                                "order": 3,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 54000
                                            },
                                            {
                                                "id": 40,
                                                "pipeline_id": 5,
                                                "name": "Qualified",
                                                "color": "#10b981",
                                                "order": 4,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 66000
                                            },
                                            {
                                                "id": 41,
                                                "pipeline_id": 5,
                                                "name": "Meeting Booked",
                                                "color": "#06b6d4",
                                                "order": 5,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 2,
                                                "opportunities_value": 50000
                                            },
                                            {
                                                "id": 42,
                                                "pipeline_id": 5,
                                                "name": "Won",
                                                "color": "#22c55e",
                                                "order": 6,
                                                "is_won": true,
                                                "is_lost": false,
                                                "opportunities_count": 8,
                                                "opportunities_value": 96000
                                            },
                                            {
                                                "id": 43,
                                                "pipeline_id": 5,
                                                "name": "Lost",
                                                "color": "#ef4444",
                                                "order": 7,
                                                "is_won": false,
                                                "is_lost": true,
                                                "opportunities_count": 4,
                                                "opportunities_value": 40000
                                            }
                                        ],
                                        "created_at": "2026-08-20T09:00:00+00:00",
                                        "updated_at": "2026-10-02T15:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "pipelinesUpdate",
                "summary": "Update a pipeline",
                "description": "Renames a pipeline or makes it the default.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline",
                        "in": "path",
                        "required": true,
                        "description": "Pipeline ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 5,
                                        "name": "Agency deals 2026",
                                        "is_default": true,
                                        "campaign_ids": [
                                            31
                                        ],
                                        "opportunities_count": 41,
                                        "stages": [
                                            {
                                                "id": 36,
                                                "pipeline_id": 5,
                                                "name": "New Lead",
                                                "color": "#6366f1",
                                                "order": 0,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 12,
                                                "opportunities_value": 140000
                                            },
                                            {
                                                "id": 37,
                                                "pipeline_id": 5,
                                                "name": "Contacted",
                                                "color": "#3b82f6",
                                                "order": 1,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 6,
                                                "opportunities_value": 72000
                                            },
                                            {
                                                "id": 38,
                                                "pipeline_id": 5,
                                                "name": "Opened",
                                                "color": "#8b5cf6",
                                                "order": 2,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 30000
                                            },
                                            {
                                                "id": 39,
                                                "pipeline_id": 5,
                                                "name": "Responded",
                                                "color": "#f59e0b",
                                                "order": 3,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 54000
                                            },
                                            {
                                                "id": 40,
                                                "pipeline_id": 5,
                                                "name": "Qualified",
                                                "color": "#10b981",
                                                "order": 4,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 66000
                                            },
                                            {
                                                "id": 41,
                                                "pipeline_id": 5,
                                                "name": "Meeting Booked",
                                                "color": "#06b6d4",
                                                "order": 5,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 2,
                                                "opportunities_value": 50000
                                            },
                                            {
                                                "id": 42,
                                                "pipeline_id": 5,
                                                "name": "Won",
                                                "color": "#22c55e",
                                                "order": 6,
                                                "is_won": true,
                                                "is_lost": false,
                                                "opportunities_count": 8,
                                                "opportunities_value": 96000
                                            },
                                            {
                                                "id": 43,
                                                "pipeline_id": 5,
                                                "name": "Lost",
                                                "color": "#ef4444",
                                                "order": 7,
                                                "is_won": false,
                                                "is_lost": true,
                                                "opportunities_count": 4,
                                                "opportunities_value": 40000
                                            }
                                        ],
                                        "created_at": "2026-08-20T09:00:00+00:00",
                                        "updated_at": "2026-10-02T15:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "New name."
                                    },
                                    "is_default": {
                                        "type": "boolean",
                                        "description": "Make this the default pipeline."
                                    },
                                    "campaign_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Replaces the linked campaigns. Send `[]` to unlink all."
                                    }
                                }
                            },
                            "example": {
                                "name": "Agency deals 2026",
                                "is_default": true,
                                "campaign_ids": [
                                    31
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "pipelinesDelete",
                "summary": "Delete a pipeline",
                "description": "Deletes a pipeline and its stages. If it still has opportunities the request returns `409` unless you pass `?force=true`, which deletes them too.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline",
                        "in": "path",
                        "required": true,
                        "description": "Pipeline ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "force",
                        "in": "query",
                        "required": false,
                        "description": "Also delete the pipeline's opportunities.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Pipeline deleted.",
                                    "id": 5,
                                    "opportunities_deleted": 0
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/pipelines/{pipeline}/stages": {
            "post": {
                "operationId": "pipelinesStagesCreate",
                "summary": "Add a stage",
                "description": "Adds a stage at the end of the pipeline.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline",
                        "in": "path",
                        "required": true,
                        "description": "Pipeline ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 44,
                                        "pipeline_id": 5,
                                        "name": "Negotiation",
                                        "color": "#c08532",
                                        "order": 8,
                                        "is_won": false,
                                        "is_lost": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Stage name."
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Hex color `#RRGGBB`. Default `#6366f1`."
                                    },
                                    "is_won": {
                                        "type": "boolean",
                                        "description": "Deals here count as won."
                                    },
                                    "is_lost": {
                                        "type": "boolean",
                                        "description": "Deals here count as lost."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Negotiation",
                                "color": "#c08532"
                            }
                        }
                    }
                }
            }
        },
        "/pipelines/{pipeline}/stages/{stage}": {
            "patch": {
                "operationId": "pipelinesStagesUpdate",
                "summary": "Update a stage",
                "description": "Renames, recolors or re-flags a stage.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline",
                        "in": "path",
                        "required": true,
                        "description": "Pipeline ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "stage",
                        "in": "path",
                        "required": true,
                        "description": "Stage ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 40,
                                        "pipeline_id": 5,
                                        "name": "Qualified (SQL)",
                                        "color": "#10b981",
                                        "order": 4,
                                        "is_won": false,
                                        "is_lost": false,
                                        "opportunities_count": 3,
                                        "opportunities_value": 66000
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Stage name."
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Hex color `#RRGGBB`."
                                    },
                                    "is_won": {
                                        "type": "boolean",
                                        "description": "Deals here count as won."
                                    },
                                    "is_lost": {
                                        "type": "boolean",
                                        "description": "Deals here count as lost."
                                    }
                                }
                            },
                            "example": {
                                "name": "Qualified (SQL)"
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "pipelinesStagesDelete",
                "summary": "Delete a stage",
                "description": "Deletes a stage. If it holds opportunities, pass `move_to_stage_id` (a stage of the same pipeline) to move them first; otherwise the request returns `409`.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline",
                        "in": "path",
                        "required": true,
                        "description": "Pipeline ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "stage",
                        "in": "path",
                        "required": true,
                        "description": "Stage ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "move_to_stage_id",
                        "in": "query",
                        "required": false,
                        "description": "Stage to move existing opportunities into.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Stage deleted.",
                                    "id": 40,
                                    "opportunities_moved": 3
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/pipelines/{pipeline}/stages/reorder": {
            "post": {
                "operationId": "pipelinesStagesReorder",
                "summary": "Reorder stages",
                "description": "Sets the stage order. `stage_ids` must contain every stage of the pipeline exactly once.",
                "tags": [
                    "Pipelines"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline",
                        "in": "path",
                        "required": true,
                        "description": "Pipeline ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 5,
                                        "name": "Sales pipeline",
                                        "is_default": true,
                                        "campaign_ids": [
                                            31
                                        ],
                                        "opportunities_count": 41,
                                        "stages": [
                                            {
                                                "id": 36,
                                                "pipeline_id": 5,
                                                "name": "New Lead",
                                                "color": "#6366f1",
                                                "order": 0,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 12,
                                                "opportunities_value": 140000
                                            },
                                            {
                                                "id": 37,
                                                "pipeline_id": 5,
                                                "name": "Contacted",
                                                "color": "#3b82f6",
                                                "order": 1,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 6,
                                                "opportunities_value": 72000
                                            },
                                            {
                                                "id": 38,
                                                "pipeline_id": 5,
                                                "name": "Opened",
                                                "color": "#8b5cf6",
                                                "order": 2,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 30000
                                            },
                                            {
                                                "id": 39,
                                                "pipeline_id": 5,
                                                "name": "Responded",
                                                "color": "#f59e0b",
                                                "order": 3,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 54000
                                            },
                                            {
                                                "id": 40,
                                                "pipeline_id": 5,
                                                "name": "Qualified",
                                                "color": "#10b981",
                                                "order": 4,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 3,
                                                "opportunities_value": 66000
                                            },
                                            {
                                                "id": 41,
                                                "pipeline_id": 5,
                                                "name": "Meeting Booked",
                                                "color": "#06b6d4",
                                                "order": 5,
                                                "is_won": false,
                                                "is_lost": false,
                                                "opportunities_count": 2,
                                                "opportunities_value": 50000
                                            },
                                            {
                                                "id": 42,
                                                "pipeline_id": 5,
                                                "name": "Won",
                                                "color": "#22c55e",
                                                "order": 6,
                                                "is_won": true,
                                                "is_lost": false,
                                                "opportunities_count": 8,
                                                "opportunities_value": 96000
                                            },
                                            {
                                                "id": 43,
                                                "pipeline_id": 5,
                                                "name": "Lost",
                                                "color": "#ef4444",
                                                "order": 7,
                                                "is_won": false,
                                                "is_lost": true,
                                                "opportunities_count": 4,
                                                "opportunities_value": 40000
                                            }
                                        ],
                                        "created_at": "2026-08-20T09:00:00+00:00",
                                        "updated_at": "2026-10-02T15:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "stage_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "All stage IDs in the new order."
                                    }
                                },
                                "required": [
                                    "stage_ids"
                                ]
                            },
                            "example": {
                                "stage_ids": [
                                    36,
                                    37,
                                    39,
                                    38,
                                    40,
                                    41,
                                    42,
                                    43
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/opportunities": {
            "get": {
                "operationId": "opportunitiesList",
                "summary": "List opportunities",
                "description": "Returns opportunities, newest first.",
                "tags": [
                    "Opportunities"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by pipeline.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "pipeline_stage_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by stage.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by lead.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by source campaign.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "`open`, `won` or `lost` (based on the stage flags).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Matches the opportunity name.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`created_at`, `updated_at`, `name`, `value` or `close_date`, prefix `-` for descending.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 77,
                                            "name": "Northwind — annual plan",
                                            "value": 18000,
                                            "currency": "USD",
                                            "close_date": "2026-11-30",
                                            "notes": null,
                                            "pipeline_id": 5,
                                            "pipeline_stage_id": 40,
                                            "campaign_id": 31,
                                            "lead_id": 1842,
                                            "stage": {
                                                "id": 40,
                                                "name": "Qualified",
                                                "is_won": false,
                                                "is_lost": false
                                            },
                                            "lead": {
                                                "id": 1842,
                                                "email": "ava@northwind.io",
                                                "full_name": "Ava Chen",
                                                "company": "Northwind"
                                            },
                                            "activity_log": [
                                                {
                                                    "action": "created",
                                                    "stage_id": 40,
                                                    "via": "api",
                                                    "at": "2026-10-10T10:58:12+00:00"
                                                }
                                            ],
                                            "created_at": "2026-10-10T10:58:12+00:00",
                                            "updated_at": "2026-10-10T10:58:12+00:00"
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/opportunities?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/opportunities?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/opportunities?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/opportunities",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "opportunitiesCreate",
                "summary": "Create an opportunity",
                "description": "Creates a deal for a lead. Without `pipeline_stage_id` the deal starts in the pipeline's first stage.",
                "tags": [
                    "Opportunities"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 77,
                                        "name": "Northwind — annual plan",
                                        "value": 18000,
                                        "currency": "USD",
                                        "close_date": "2026-11-30",
                                        "notes": null,
                                        "pipeline_id": 5,
                                        "pipeline_stage_id": 40,
                                        "campaign_id": 31,
                                        "lead_id": 1842,
                                        "stage": {
                                            "id": 40,
                                            "name": "Qualified",
                                            "is_won": false,
                                            "is_lost": false
                                        },
                                        "lead": {
                                            "id": 1842,
                                            "email": "ava@northwind.io",
                                            "full_name": "Ava Chen",
                                            "company": "Northwind"
                                        },
                                        "activity_log": [
                                            {
                                                "action": "created",
                                                "stage_id": 40,
                                                "via": "api",
                                                "at": "2026-10-10T10:58:12+00:00"
                                            }
                                        ],
                                        "created_at": "2026-10-10T10:58:12+00:00",
                                        "updated_at": "2026-10-10T10:58:12+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Deal name."
                                    },
                                    "lead_id": {
                                        "type": "integer",
                                        "description": "Lead the deal belongs to."
                                    },
                                    "pipeline_id": {
                                        "type": "integer",
                                        "description": "Pipeline."
                                    },
                                    "pipeline_stage_id": {
                                        "type": "integer",
                                        "description": "Stage within the pipeline."
                                    },
                                    "campaign_id": {
                                        "type": "integer",
                                        "description": "Campaign that sourced the deal."
                                    },
                                    "value": {
                                        "type": "number",
                                        "description": "Deal value."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code. Default `USD`."
                                    },
                                    "close_date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Expected close date `YYYY-MM-DD`."
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Free-form notes."
                                    }
                                },
                                "required": [
                                    "name",
                                    "lead_id",
                                    "pipeline_id"
                                ]
                            },
                            "example": {
                                "name": "Northwind — annual plan",
                                "lead_id": 1842,
                                "pipeline_id": 5,
                                "campaign_id": 31,
                                "value": 18000,
                                "currency": "USD",
                                "close_date": "2026-11-30"
                            }
                        }
                    }
                }
            }
        },
        "/opportunities/{opportunity}": {
            "get": {
                "operationId": "opportunitiesGet",
                "summary": "Retrieve an opportunity",
                "description": "Returns one opportunity with its stage and lead.",
                "tags": [
                    "Opportunities"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "opportunity",
                        "in": "path",
                        "required": true,
                        "description": "Opportunity ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 77,
                                        "name": "Northwind — annual plan",
                                        "value": 18000,
                                        "currency": "USD",
                                        "close_date": "2026-11-30",
                                        "notes": null,
                                        "pipeline_id": 5,
                                        "pipeline_stage_id": 40,
                                        "campaign_id": 31,
                                        "lead_id": 1842,
                                        "stage": {
                                            "id": 40,
                                            "name": "Qualified",
                                            "is_won": false,
                                            "is_lost": false
                                        },
                                        "lead": {
                                            "id": 1842,
                                            "email": "ava@northwind.io",
                                            "full_name": "Ava Chen",
                                            "company": "Northwind"
                                        },
                                        "activity_log": [
                                            {
                                                "action": "created",
                                                "stage_id": 40,
                                                "via": "api",
                                                "at": "2026-10-10T10:58:12+00:00"
                                            }
                                        ],
                                        "created_at": "2026-10-10T10:58:12+00:00",
                                        "updated_at": "2026-10-10T10:58:12+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "opportunitiesUpdate",
                "summary": "Update an opportunity",
                "description": "Updates the fields you send. Changing `pipeline_id` without a stage moves the deal to the new pipeline's first stage.",
                "tags": [
                    "Opportunities"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "opportunity",
                        "in": "path",
                        "required": true,
                        "description": "Opportunity ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 77,
                                        "name": "Northwind — annual plan",
                                        "value": 24000,
                                        "currency": "USD",
                                        "close_date": "2026-11-30",
                                        "notes": "Added the onboarding package.",
                                        "pipeline_id": 5,
                                        "pipeline_stage_id": 40,
                                        "campaign_id": 31,
                                        "lead_id": 1842,
                                        "stage": {
                                            "id": 40,
                                            "name": "Qualified",
                                            "is_won": false,
                                            "is_lost": false
                                        },
                                        "lead": {
                                            "id": 1842,
                                            "email": "ava@northwind.io",
                                            "full_name": "Ava Chen",
                                            "company": "Northwind"
                                        },
                                        "activity_log": [
                                            {
                                                "action": "created",
                                                "stage_id": 40,
                                                "via": "api",
                                                "at": "2026-10-10T10:58:12+00:00"
                                            }
                                        ],
                                        "created_at": "2026-10-10T10:58:12+00:00",
                                        "updated_at": "2026-10-10T10:58:12+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Deal name."
                                    },
                                    "lead_id": {
                                        "type": "integer",
                                        "description": "Lead."
                                    },
                                    "pipeline_id": {
                                        "type": "integer",
                                        "description": "Pipeline."
                                    },
                                    "pipeline_stage_id": {
                                        "type": "integer",
                                        "description": "Stage within the pipeline."
                                    },
                                    "campaign_id": {
                                        "type": "integer",
                                        "description": "Source campaign."
                                    },
                                    "value": {
                                        "type": "number",
                                        "description": "Deal value."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "close_date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Expected close date."
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Notes."
                                    }
                                }
                            },
                            "example": {
                                "value": 24000,
                                "notes": "Added the onboarding package."
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "opportunitiesDelete",
                "summary": "Delete an opportunity",
                "description": "Permanently deletes a deal.",
                "tags": [
                    "Opportunities"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "opportunity",
                        "in": "path",
                        "required": true,
                        "description": "Opportunity ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Opportunity deleted.",
                                    "id": 77
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/opportunities/{opportunity}/move": {
            "post": {
                "operationId": "opportunitiesMove",
                "summary": "Move to another stage",
                "description": "Moves a deal to another stage of its pipeline and records the change in `activity_log`.",
                "tags": [
                    "Opportunities"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "opportunity",
                        "in": "path",
                        "required": true,
                        "description": "Opportunity ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 77,
                                        "name": "Northwind — annual plan",
                                        "value": 18000,
                                        "currency": "USD",
                                        "close_date": "2026-11-30",
                                        "notes": null,
                                        "pipeline_id": 5,
                                        "pipeline_stage_id": 42,
                                        "campaign_id": 31,
                                        "lead_id": 1842,
                                        "stage": {
                                            "id": 42,
                                            "name": "Won",
                                            "is_won": true,
                                            "is_lost": false
                                        },
                                        "lead": {
                                            "id": 1842,
                                            "email": "ava@northwind.io",
                                            "full_name": "Ava Chen",
                                            "company": "Northwind"
                                        },
                                        "activity_log": [
                                            {
                                                "action": "created",
                                                "stage_id": 40,
                                                "via": "api",
                                                "at": "2026-10-10T10:58:12+00:00"
                                            },
                                            {
                                                "action": "stage_changed",
                                                "from": 40,
                                                "to": 42,
                                                "via": "api",
                                                "at": "2026-10-10T11:02:44+00:00"
                                            }
                                        ],
                                        "created_at": "2026-10-10T10:58:12+00:00",
                                        "updated_at": "2026-10-10T10:58:12+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "pipeline_stage_id": {
                                        "type": "integer",
                                        "description": "Target stage in the same pipeline."
                                    }
                                },
                                "required": [
                                    "pipeline_stage_id"
                                ]
                            },
                            "example": {
                                "pipeline_stage_id": 42
                            }
                        }
                    }
                }
            }
        },
        "/analytics/overview": {
            "get": {
                "operationId": "analyticsOverview",
                "summary": "Workspace overview",
                "description": "Email performance across all campaigns plus campaign, lead and pipeline totals.",
                "tags": [
                    "Analytics"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start date `YYYY-MM-DD` (UTC). Omit for all time.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End date `YYYY-MM-DD`, inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "range": {
                                            "from": "2026-09-11",
                                            "to": "2026-10-10",
                                            "timezone": "UTC"
                                        },
                                        "email": {
                                            "sent": 1240,
                                            "opened": 712,
                                            "clicked": 96,
                                            "replied": 58,
                                            "bounced": 11,
                                            "open_rate": 57.4,
                                            "click_rate": 7.7,
                                            "reply_rate": 4.7,
                                            "bounce_rate": 0.9,
                                            "unsubscribed": 4
                                        },
                                        "campaigns": {
                                            "total": 9,
                                            "by_status": {
                                                "active": 3,
                                                "paused": 1,
                                                "draft": 5
                                            }
                                        },
                                        "leads": {
                                            "total": 1840,
                                            "created_in_range": 420,
                                            "by_status": {
                                                "new": 1402,
                                                "contacted": 360,
                                                "replied": 58,
                                                "unsubscribed": 9,
                                                "bounced": 11
                                            },
                                            "by_validation_status": {
                                                "valid": 1510,
                                                "risky": 88,
                                                "pending": 242
                                            }
                                        },
                                        "pipeline": {
                                            "opportunities": 41,
                                            "open_count": 29,
                                            "open_value": 412000,
                                            "won_count": 8,
                                            "won_value": 96000,
                                            "lost_count": 4,
                                            "win_rate": 66.7
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/campaigns": {
            "get": {
                "operationId": "analyticsCampaigns",
                "summary": "Campaign comparison",
                "description": "Performance for every campaign side by side, paginated.",
                "tags": [
                    "Analytics"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start date `YYYY-MM-DD` (UTC). Omit for all time.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End date `YYYY-MM-DD`, inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Only campaigns with this status.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "campaign_id": 31,
                                            "name": "Q4 SaaS founders",
                                            "status": "active",
                                            "leads_enrolled": 248,
                                            "metrics": {
                                                "sent": 1240,
                                                "opened": 712,
                                                "clicked": 96,
                                                "replied": 58,
                                                "bounced": 11,
                                                "open_rate": 57.4,
                                                "click_rate": 7.7,
                                                "reply_rate": 4.7,
                                                "bounce_rate": 0.9
                                            }
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/analytics/campaigns?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/analytics/campaigns?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/analytics/campaigns?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/analytics/campaigns",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    },
                                    "range": {
                                        "from": null,
                                        "to": null,
                                        "timezone": "UTC"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/campaigns/{campaign}": {
            "get": {
                "operationId": "analyticsCampaign",
                "summary": "Campaign report",
                "description": "Deep dive into one campaign: totals, enrollment states, metrics per step and per A/B variant, and a daily series (last 30 days unless a range is given).",
                "tags": [
                    "Analytics"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "Campaign ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start date `YYYY-MM-DD` (UTC). Omit for all time.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End date `YYYY-MM-DD`, inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "campaign_id": 31,
                                        "name": "Q4 SaaS founders",
                                        "status": "active",
                                        "range": {
                                            "from": null,
                                            "to": null,
                                            "timezone": "UTC"
                                        },
                                        "metrics": {
                                            "sent": 1240,
                                            "opened": 712,
                                            "clicked": 96,
                                            "replied": 58,
                                            "bounced": 11,
                                            "open_rate": 57.4,
                                            "click_rate": 7.7,
                                            "reply_rate": 4.7,
                                            "bounce_rate": 0.9,
                                            "unsubscribed": 2
                                        },
                                        "enrollments": {
                                            "total": 248,
                                            "by_status": {
                                                "active": 201,
                                                "replied": 19,
                                                "completed": 22,
                                                "bounced": 6
                                            }
                                        },
                                        "steps": [
                                            {
                                                "step_id": 88,
                                                "order": 1,
                                                "type": "email",
                                                "name": "Intro",
                                                "metrics": {
                                                    "sent": 1240,
                                                    "opened": 712,
                                                    "clicked": 96,
                                                    "replied": 58,
                                                    "bounced": 11,
                                                    "open_rate": 57.4,
                                                    "click_rate": 7.7,
                                                    "reply_rate": 4.7,
                                                    "bounce_rate": 0.9
                                                },
                                                "variants": [
                                                    {
                                                        "variant_id": 201,
                                                        "name": "Short",
                                                        "is_active": true,
                                                        "weight": 50,
                                                        "metrics": {
                                                            "sent": 620,
                                                            "opened": 371,
                                                            "clicked": 51,
                                                            "replied": 33,
                                                            "bounced": 5,
                                                            "open_rate": 59.8,
                                                            "click_rate": 8.2,
                                                            "reply_rate": 5.3,
                                                            "bounce_rate": 0.8
                                                        }
                                                    },
                                                    {
                                                        "variant_id": 202,
                                                        "name": "Social proof",
                                                        "is_active": true,
                                                        "weight": 50,
                                                        "metrics": {
                                                            "sent": 620,
                                                            "opened": 341,
                                                            "clicked": 45,
                                                            "replied": 25,
                                                            "bounced": 6,
                                                            "open_rate": 55,
                                                            "click_rate": 7.3,
                                                            "reply_rate": 4,
                                                            "bounce_rate": 1
                                                        }
                                                    }
                                                ]
                                            }
                                        ],
                                        "timeseries": [
                                            {
                                                "date": "2026-10-09",
                                                "sent": 142,
                                                "opened": 80,
                                                "clicked": 11,
                                                "replied": 6,
                                                "bounced": 1
                                            },
                                            {
                                                "date": "2026-10-10",
                                                "sent": 150,
                                                "opened": 64,
                                                "clicked": 9,
                                                "replied": 4,
                                                "bounced": 0
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/timeseries": {
            "get": {
                "operationId": "analyticsTimeseries",
                "summary": "Daily timeseries",
                "description": "Day-by-day email activity for charts. Defaults to the last 30 days; ranges can span up to 366 days. Days without activity are returned as zeros.",
                "tags": [
                    "Analytics"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start date `YYYY-MM-DD` (UTC). Omit for all time.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End date `YYYY-MM-DD`, inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one campaign.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "range": {
                                            "from": "2026-10-08",
                                            "to": "2026-10-10",
                                            "timezone": "UTC"
                                        },
                                        "interval": "day",
                                        "campaign_id": 31,
                                        "series": [
                                            {
                                                "date": "2026-10-08",
                                                "sent": 0,
                                                "opened": 0,
                                                "clicked": 0,
                                                "replied": 0,
                                                "bounced": 0
                                            },
                                            {
                                                "date": "2026-10-09",
                                                "sent": 142,
                                                "opened": 80,
                                                "clicked": 11,
                                                "replied": 6,
                                                "bounced": 1
                                            },
                                            {
                                                "date": "2026-10-10",
                                                "sent": 150,
                                                "opened": 64,
                                                "clicked": 9,
                                                "replied": 4,
                                                "bounced": 0
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/events": {
            "get": {
                "operationId": "analyticsEvents",
                "summary": "Activity feed",
                "description": "Raw sequence events, newest first: enrolled, scheduled, sent, opened, clicked, replied, bounced, paused, resumed, skipped, completed and removed. Poll it to react to replies or opens in your own tools.",
                "tags": [
                    "Analytics"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start date `YYYY-MM-DD` (UTC). Omit for all time.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End date `YYYY-MM-DD`, inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "event_type",
                        "in": "query",
                        "required": false,
                        "description": "Only this event type.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this campaign.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this lead.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page, 1–100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 90211,
                                            "event_type": "replied",
                                            "occurred_at": "2026-10-10T10:48:03+00:00",
                                            "campaign_id": 31,
                                            "step": 1,
                                            "step_id": 88,
                                            "variant": {
                                                "id": 201,
                                                "name": "Short"
                                            },
                                            "lead": {
                                                "id": 1842,
                                                "email": "ava@northwind.io",
                                                "full_name": "Ava Chen"
                                            },
                                            "smtp_account": {
                                                "id": 3,
                                                "from_email": "alex@yourcompany.com"
                                            },
                                            "metadata": {
                                                "reason": "reply_detected"
                                            }
                                        }
                                    ],
                                    "links": {
                                        "first": "https://outreach.corammers.com/api/v1/analytics/events?page=1",
                                        "last": "https://outreach.corammers.com/api/v1/analytics/events?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "meta": {
                                        "current_page": 1,
                                        "from": 1,
                                        "last_page": 1,
                                        "links": [
                                            {
                                                "url": null,
                                                "label": "&laquo; Previous",
                                                "active": false
                                            },
                                            {
                                                "url": "https://outreach.corammers.com/api/v1/analytics/events?page=1",
                                                "label": "1",
                                                "active": true
                                            },
                                            {
                                                "url": null,
                                                "label": "Next &raquo;",
                                                "active": false
                                            }
                                        ],
                                        "path": "https://outreach.corammers.com/api/v1/analytics/events",
                                        "per_page": 25,
                                        "to": 1,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/pipelines": {
            "get": {
                "operationId": "analyticsPipelines",
                "summary": "Pipeline report",
                "description": "Deal counts and values per stage, open/won/lost totals and win rate for each pipeline.",
                "tags": [
                    "Analytics"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "pipeline_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this pipeline.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "pipeline_id": 5,
                                            "name": "Sales pipeline",
                                            "is_default": true,
                                            "totals": {
                                                "opportunities": 41,
                                                "value": 548000,
                                                "open_count": 29,
                                                "open_value": 412000,
                                                "won_count": 8,
                                                "won_value": 96000,
                                                "lost_count": 4,
                                                "win_rate": 66.7
                                            },
                                            "stages": [
                                                {
                                                    "stage_id": 36,
                                                    "name": "New Lead",
                                                    "order": 0,
                                                    "is_won": false,
                                                    "is_lost": false,
                                                    "opportunities": 12,
                                                    "value": 140000
                                                },
                                                {
                                                    "stage_id": 42,
                                                    "name": "Won",
                                                    "order": 6,
                                                    "is_won": true,
                                                    "is_lost": false,
                                                    "opportunities": 8,
                                                    "value": 96000
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "API key created in Settings → API."
            }
        },
        "responses": {
            "Unauthenticated": {
                "description": "Missing, invalid, expired or revoked API key.",
                "content": {
                    "application/json": {
                        "example": {
                            "message": "Unauthenticated."
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "The API key lacks the required scope.",
                "content": {
                    "application/json": {
                        "example": {
                            "message": "This API key is read-only. Create a key with read & write access to perform this action."
                        }
                    }
                }
            },
            "ValidationError": {
                "description": "The request payload is invalid.",
                "content": {
                    "application/json": {
                        "example": {
                            "message": "The email field is required.",
                            "errors": {
                                "email": [
                                    "The email field is required."
                                ]
                            }
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "More than 120 requests in a minute.",
                "content": {
                    "application/json": {
                        "example": {
                            "message": "Too many requests. The API allows 120 requests per minute per account."
                        }
                    }
                }
            }
        }
    }
}