{
  "openapi": "3.1.0",
  "info": {
    "title": "Polzy API",
    "version": "v1",
    "description": "Read surveys, responses, campaigns and results, create and move actions, and receive webhooks when something happens. Available on Team and up."
  },
  "servers": [
    {
      "url": "https://api.polzy.ai/api/v1"
    }
  ],
  "externalDocs": {
    "description": "API reference · v1",
    "url": "https://polzy.ai/help/api"
  },
  "tags": [
    {
      "name": "surveys"
    },
    {
      "name": "actions"
    },
    {
      "name": "webhooks"
    },
    {
      "name": "campaigns"
    },
    {
      "name": "responses"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/surveys": {
      "get": {
        "operationId": "list-surveys",
        "summary": "List surveys",
        "description": "The workspace’s surveys, newest first, with their state and how many completed responses each has.",
        "tags": [
          "surveys"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#list-surveys"
        },
        "security": [
          {
            "apiKey": [
              "surveys:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "draft, live, paused, closed or archived.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Up to 100. Defaults to 25.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page, unchanged. The last survey id of the page, which this list took before it had cursors, is read until the next release.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List surveys",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "6512f0…",
                      "name": "Q3 pulse — Operations",
                      "status": "live",
                      "responses": 284,
                      "created_at": "2026-07-01T09:00:00.000Z",
                      "updated_at": "2026-09-28T16:12:04.000Z"
                    }
                  ],
                  "has_more": true,
                  "next_cursor": "c1.ZW5jOnYxOkx3…"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nINVALID_CURSOR: starting_after is not a cursor this list gave — changed, or from another list or workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/surveys?status=live&limit=25\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/surveys?status=live&limit=25`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});\nconst { data, next_cursor } = await res.json();"
          },
          {
            "lang": "Python",
            "source": "import os, requests\n\nres = requests.get(\n    f\"https://api.polzy.ai/api/v1/surveys\",\n    params={\"status\": \"live\", \"limit\": 25},\n    headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"},\n)\nsurveys = res.json()[\"data\"]"
          }
        ]
      }
    },
    "/surveys/{id}/results": {
      "get": {
        "operationId": "survey-results",
        "summary": "Get results",
        "description": "Each theme’s score out of 10, overall and, with group_by, per group. Groups below the minimum group size are left out and counted in hidden_groups. When one is hidden, the smallest group shown can be left out and counted too.",
        "tags": [
          "surveys"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#survey-results"
        },
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The survey’s id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "description": "A field the workspace groups people by, such as department. Omit it for the overall score only. Grouping needs Heatmaps, from the Business plan.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Only answers from this date on (ISO 8601).",
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date"
                },
                {
                  "format": "date-time"
                }
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Only answers up to this date (ISO 8601).",
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date"
                },
                {
                  "format": "date-time"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get results",
            "content": {
              "application/json": {
                "example": {
                  "survey": {
                    "id": "6512f0…",
                    "name": "Q3 pulse — Operations"
                  },
                  "group_by": "department",
                  "min_group_size": 3,
                  "themes": [
                    {
                      "theme": "Workload",
                      "score": 6.1,
                      "responses": 212,
                      "groups": {
                        "Operations": 4.8,
                        "Product": 6.9
                      }
                    }
                  ],
                  "hidden_groups": 3
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.\n\nCAPABILITY_NOT_ENTITLED: The workspace’s plan does not include what this asks for — group_by needs Heatmaps.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/surveys/6512f0…/results?group_by=department\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/surveys/${surveyId}/results?group_by=department`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});\nconst results = await res.json();"
          },
          {
            "lang": "Python",
            "source": "res = requests.get(\n    f\"https://api.polzy.ai/api/v1/surveys/{survey_id}/results\",\n    params={\"group_by\": \"department\"},\n    headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"},\n)\nresults = res.json()"
          }
        ]
      }
    },
    "/actions": {
      "post": {
        "operationId": "create-action",
        "summary": "Create an action",
        "description": "Adds an action to the workspace’s board, owned by the member with that email.",
        "tags": [
          "actions"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#create-action"
        },
        "security": [
          {
            "apiKey": [
              "actions:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any string of 1 to 255 printable characters. The same key in the next 24 hours replays the first answer, marked Idempotent-Replayed: true, and the write is made once.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "owner"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "What needs to happen."
                  },
                  "owner": {
                    "type": "string",
                    "format": "email",
                    "description": "The email of a member of the workspace."
                  },
                  "due": {
                    "type": "string",
                    "anyOf": [
                      {
                        "format": "date"
                      },
                      {
                        "format": "date-time"
                      }
                    ],
                    "description": "Due date (ISO 8601)."
                  },
                  "description": {
                    "type": "string",
                    "description": "More detail, up to 4,000 characters."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Create an action",
            "content": {
              "application/json": {
                "example": {
                  "id": "6abd1d…",
                  "title": "Rewrite the handover checklist",
                  "stage": "pending",
                  "owner": "anouk@acme.com",
                  "due": "2026-10-15T00:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nOWNER_NOT_ASSIGNABLE: The owner could not be assigned: use the email of an active member of this workspace. The answer is the same whoever the address belongs to.\n\nINVALID_IDEMPOTENCY_KEY: The Idempotency-Key is not 1 to 255 printable characters, or was sent twice.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED: This Idempotency-Key was used in the last 24 hours for a different request. Use a new key for a new request.\n\nIDEMPOTENCY_IN_PROGRESS: A request with this Idempotency-Key is still running. Retry in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl -X POST \"https://api.polzy.ai/api/v1/actions\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\" \\\n  -H \"Idempotency-Key: 4f9c2d1e-handover\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"title\":\"Rewrite the handover checklist\",\"owner\":\"anouk@acme.com\",\"due\":\"2026-10-15\"}'"
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/actions`, {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.POLZY_KEY}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({ title: 'Rewrite the handover checklist', owner: 'anouk@acme.com', due: '2026-10-15' }),\n});"
          },
          {
            "lang": "Python",
            "source": "res = requests.post(\n    f\"https://api.polzy.ai/api/v1/actions\",\n    json={\"title\": \"Rewrite the handover checklist\", \"owner\": \"anouk@acme.com\", \"due\": \"2026-10-15\"},\n    headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"},\n)"
          }
        ]
      },
      "get": {
        "operationId": "list-actions",
        "summary": "List actions",
        "description": "The workspace’s actions, newest first, with their owner, stage and due date, the theme and group they are for, the baseline taken when they were written and their impact since: impact.value is the theme’s score in the group now minus the baseline (0–100), given only once both cleared the minimum group and are at least medium reliability — until then impact.state is too_early, with why. null where an action has no theme. An action raised from a safety signal is its assignee’s and reviewers' alone and is never listed.",
        "tags": [
          "actions"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#list-actions"
        },
        "security": [
          {
            "apiKey": [
              "actions:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100; 25 when left out. A larger limit is refused with 400, never cut down.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page, unchanged. It is good for this list in this workspace only.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "pending, in_progress, waiting, completed or dismissed.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List actions",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "object": "action",
                      "id": "6abd1d…",
                      "title": "Rewrite the handover checklist",
                      "description": null,
                      "stage": "in_progress",
                      "priority": "medium",
                      "owner": "anouk@acme.com",
                      "due": "2026-11-15T00:00:00.000Z",
                      "completed_at": null,
                      "created_at": "2026-10-02T09:00:00.000Z",
                      "updated_at": "2026-10-24T11:40:00.000Z",
                      "theme_id": "6512f7…",
                      "target_group": [
                        {
                          "field": "department",
                          "value": "operations"
                        }
                      ],
                      "baseline": {
                        "score": 58.4,
                        "people": 31,
                        "measured_at": "2026-10-02T09:00:00.000Z",
                        "window_days": 90
                      },
                      "impact": {
                        "state": "measured",
                        "value": 6.1,
                        "baseline": 58.4,
                        "current": 64.5,
                        "people": 27,
                        "reliability": "medium"
                      }
                    }
                  ],
                  "has_more": true,
                  "next_cursor": "c1.ZW5jOnYxOkx3…"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nINVALID_CURSOR: starting_after is not a cursor this list gave — changed, or from another list or workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/actions?stage=in_progress\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/actions?stage=in_progress`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});\nconst { data, next_cursor } = await res.json();"
          },
          {
            "lang": "Python",
            "source": "res = requests.get(f\"https://api.polzy.ai/api/v1/actions\", params={\"stage\": \"in_progress\"}, headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"})\nactions = res.json()[\"data\"]"
          }
        ]
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "list-webhooks",
        "summary": "List webhooks",
        "description": "The workspace’s webhooks, with each one’s events, whether it is sent responses, what it is narrowed to, whether it is switched on and why not (disabled_reason: failing, manual, or key_revoked once the key that registered it was revoked), whether it waits for the organization owner because the admin who added it left (needs_owner_review), its last delivery and how many have failed in a row. All of them, newest first: a workspace has at most 25, and the list holds up to 100, with has_more.",
        "tags": [
          "webhooks"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#list-webhooks"
        },
        "security": [
          {
            "apiKey": [
              "webhooks:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "List webhooks",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "6abd1d…",
                      "url": "https://hooks.acme.com/polzy",
                      "source": "api",
                      "integration_id": null,
                      "events": [
                        "response.created"
                      ],
                      "include_response": true,
                      "campaign_ids": [],
                      "enabled": true,
                      "disabled_at": null,
                      "disabled_reason": null,
                      "needs_owner_review": false,
                      "owner_review_since": null,
                      "created_at": "2026-09-01T09:00:00.000Z",
                      "last_delivery_at": "2026-10-24T08:20:41.000Z",
                      "last_status": 200,
                      "failures": 0,
                      "secret_hint": "a91f",
                      "secret_rotated_at": null
                    }
                  ],
                  "has_more": false
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/webhooks\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/webhooks`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});"
          },
          {
            "lang": "Python",
            "source": "res = requests.get(f\"https://api.polzy.ai/api/v1/webhooks\", headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"})"
          }
        ]
      },
      "post": {
        "operationId": "create-webhook",
        "summary": "Register a webhook",
        "description": "Subscribes an HTTPS endpoint to events, optionally narrowed to some campaigns (survey_ids is no longer accepted and is refused with 400). Response events carry the response itself unless include_response is false. The signing secret is in the answer once; store it, it is not shown again. A URL the workspace already sends to is refused with 409 WEBHOOK_URL_TAKEN. A workspace has at most 25; one more is refused with 409 WEBHOOK_LIMIT_REACHED.",
        "tags": [
          "webhooks"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#create-webhook"
        },
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "An HTTPS URL on the public internet."
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "One or more of response.created, response.scored, response.deleted, response.translated, campaign.launched, campaign.finished, campaign.round_closed, campaign.round_published, action.created and action.completed."
                  },
                  "include_response": {
                    "type": "boolean",
                    "description": "true to send each response event with the response itself — answers, scores and, when named, the respondent. False when left out. true needs a key that also holds responses:read; without it, 403 SCOPE_MISSING."
                  },
                  "campaign_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Only these campaigns' responses, launches and ends — up to 100, each this workspace’s. A response answered through the survey’s own link, without a campaign, is not sent; action events still are."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Register a webhook",
            "content": {
              "application/json": {
                "example": {
                  "id": "6abd1d…",
                  "url": "https://hooks.acme.com/polzy",
                  "source": "api",
                  "integration_id": null,
                  "events": [
                    "response.created",
                    "campaign.finished"
                  ],
                  "include_response": false,
                  "campaign_ids": [],
                  "enabled": true,
                  "disabled_at": null,
                  "disabled_reason": null,
                  "needs_owner_review": false,
                  "owner_review_since": null,
                  "created_at": "2026-09-01T09:00:00.000Z",
                  "last_delivery_at": "2026-10-24T08:20:41.000Z",
                  "last_status": 200,
                  "failures": 0,
                  "secret_hint": "a91f",
                  "secret_rotated_at": null,
                  "secret": "whsec_••••••••"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nWEBHOOK_FILTER_INVALID: campaign_ids holds something that is not an id, or more than 100.\n\nWEBHOOK_FILTER_UNKNOWN: campaign_ids names a campaign this workspace does not have.\n\nWEBHOOK_URL_INVALID: url cannot receive webhooks: it is not a URL, not https, its host is not found, or it points to a private or internal network. error says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "WEBHOOK_URL_TAKEN: That URL already receives this workspace’s webhooks.\n\nWEBHOOK_LIMIT_REACHED: The workspace already has 25 webhooks, the most it can have. Remove one to add another.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl -X POST \"https://api.polzy.ai/api/v1/webhooks\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\":\"https://hooks.acme.com/polzy\",\"events\":[\"response.created\",\"campaign.finished\"]}'"
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/webhooks`, {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.POLZY_KEY}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({ url: 'https://hooks.acme.com/polzy', events: ['response.created'] }),\n});\nconst { secret } = await res.json(); // shown once — store it"
          },
          {
            "lang": "Python",
            "source": "res = requests.post(\n    f\"https://api.polzy.ai/api/v1/webhooks\",\n    json={\"url\": \"https://hooks.acme.com/polzy\", \"events\": [\"response.created\"]},\n    headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"},\n)\nsecret = res.json()[\"secret\"]  # shown once — store it"
          }
        ]
      }
    },
    "/webhooks/{id}": {
      "patch": {
        "operationId": "update-webhook",
        "summary": "Change a webhook",
        "description": "Changes a webhook’s events, whether response events carry the response, and the campaigns it is narrowed to — what is left out stays as it was; an empty list receives everything again. survey_ids is no longer accepted and is refused with 400. Its address and secret stay. Only a webhook registered through a key or under Settings → API → Webhooks is found here: a Zapier or n8n connection’s destination is changed on its connection.",
        "tags": [
          "webhooks"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#update-webhook"
        },
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook’s id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any string of 1 to 255 printable characters. The same key in the next 24 hours replays the first answer, marked Idempotent-Replayed: true, and the write is made once.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "One or more of response.created, response.scored, response.deleted, response.translated, campaign.launched, campaign.finished, campaign.round_closed, campaign.round_published, action.created and action.completed."
                  },
                  "include_response": {
                    "type": "boolean",
                    "description": "true to send each response event with the response itself, false to stop. true needs a key that also holds responses:read; without it, 403 SCOPE_MISSING."
                  },
                  "campaign_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Only these campaigns' responses, launches and ends — up to 100, each this workspace’s. A response answered through the survey’s own link, without a campaign, is not sent; action events still are. An empty list receives every campaign’s again."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Change a webhook",
            "content": {
              "application/json": {
                "example": {
                  "id": "6abd1d…",
                  "url": "https://hooks.acme.com/polzy",
                  "source": "api",
                  "integration_id": null,
                  "events": [
                    "response.created"
                  ],
                  "include_response": true,
                  "campaign_ids": [
                    "6520aa…"
                  ],
                  "enabled": true,
                  "disabled_at": null,
                  "disabled_reason": null,
                  "needs_owner_review": false,
                  "owner_review_since": null,
                  "created_at": "2026-09-01T09:00:00.000Z",
                  "last_delivery_at": "2026-10-24T08:20:41.000Z",
                  "last_status": 200,
                  "failures": 0,
                  "secret_hint": "a91f",
                  "secret_rotated_at": null
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nWEBHOOK_FILTER_INVALID: campaign_ids holds something that is not an id, or more than 100.\n\nWEBHOOK_FILTER_UNKNOWN: campaign_ids names a campaign this workspace does not have.\n\nINVALID_IDEMPOTENCY_KEY: The Idempotency-Key is not 1 to 255 printable characters, or was sent twice.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED: This Idempotency-Key was used in the last 24 hours for a different request. Use a new key for a new request.\n\nIDEMPOTENCY_IN_PROGRESS: A request with this Idempotency-Key is still running. Retry in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl -X PATCH \"https://api.polzy.ai/api/v1/webhooks/6abd1d…\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"events\":[\"response.created\"],\"campaign_ids\":[\"6520aa…\"]}'"
          },
          {
            "lang": "JavaScript",
            "source": "await fetch(`https://api.polzy.ai/api/v1/webhooks/${id}`, {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.POLZY_KEY}`,\n    'Idempotency-Key': crypto.randomUUID(),\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({ events: ['response.created'], campaign_ids: [campaignId] }),\n});"
          },
          {
            "lang": "Python",
            "source": "requests.patch(\n    f\"https://api.polzy.ai/api/v1/webhooks/{hook_id}\",\n    json={\"events\": [\"response.created\"], \"campaign_ids\": [campaign_id]},\n    headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\", \"Idempotency-Key\": str(uuid.uuid4())},\n)"
          }
        ]
      },
      "delete": {
        "operationId": "delete-webhook",
        "summary": "Remove a webhook",
        "description": "Stops deliveries to that endpoint. Deliveries already queued are dropped.",
        "tags": [
          "webhooks"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#delete-webhook"
        },
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook’s id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl -X DELETE \"https://api.polzy.ai/api/v1/webhooks/6abd1d…\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "await fetch(`https://api.polzy.ai/api/v1/webhooks/${id}`, {\n  method: 'DELETE',\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});"
          },
          {
            "lang": "Python",
            "source": "requests.delete(f\"https://api.polzy.ai/api/v1/webhooks/{hook_id}\", headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"})"
          }
        ]
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "test-webhook",
        "summary": "Send a test",
        "description": "Sends webhook.test to the webhook once, signed like any delivery, even while it is switched off. It is queued (202) and lands in the webhook’s delivery log. At most 20 tests and resends per webhook per hour; the same Idempotency-Key sends it once.",
        "tags": [
          "webhooks"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#test-webhook"
        },
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook’s id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any string of 1 to 255 printable characters. The same key in the next 24 hours replays the first answer, marked Idempotent-Replayed: true, and the write is made once.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Send a test",
            "content": {
              "application/json": {
                "example": {
                  "event_id": "webhook.test:6abd1d…:1729760441000.9f2c41ab",
                  "event": "webhook.test",
                  "state": "pending"
                }
              }
            }
          },
          "400": {
            "description": "INVALID_IDEMPOTENCY_KEY: The Idempotency-Key is not 1 to 255 printable characters, or was sent twice.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED: This Idempotency-Key was used in the last 24 hours for a different request. Use a new key for a new request.\n\nIDEMPOTENCY_IN_PROGRESS: A request with this Idempotency-Key is still running. Retry in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.\n\nWEBHOOK_MANUAL_SEND_LIMIT: This webhook was sent 20 tests and resends in the last hour. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl -X POST \"https://api.polzy.ai/api/v1/webhooks/6abd1d…/test\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""
          },
          {
            "lang": "JavaScript",
            "source": "await fetch(`https://api.polzy.ai/api/v1/webhooks/${id}/test`, {\n  method: 'POST',\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}`, 'Idempotency-Key': crypto.randomUUID() },\n});"
          },
          {
            "lang": "Python",
            "source": "requests.post(\n    f\"https://api.polzy.ai/api/v1/webhooks/{hook_id}/test\",\n    headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\", \"Idempotency-Key\": str(uuid.uuid4())},\n)"
          }
        ]
      }
    },
    "/surveys/{id}": {
      "get": {
        "operationId": "get-survey",
        "summary": "Get a survey",
        "description": "One survey with its questions as a respondent meets them, and the keys their answers carry — never its scoring, its logic or the AI’s instructions. Content such as headings and images is left out; at most 500 questions, with truncated: true past that.",
        "tags": [
          "surveys"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#get-survey"
        },
        "security": [
          {
            "apiKey": [
              "surveys:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The survey’s id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a survey",
            "content": {
              "application/json": {
                "example": {
                  "object": "survey",
                  "id": "6512f0…",
                  "name": "Q3 pulse — Operations",
                  "description": null,
                  "status": "live",
                  "anonymous": false,
                  "responses": 284,
                  "questions": [
                    {
                      "id": "q1",
                      "type": "nps",
                      "variant": null,
                      "title": "Recommend us?",
                      "description": null,
                      "required": true,
                      "theme_id": null,
                      "scale": {
                        "min": 0,
                        "max": 10
                      }
                    },
                    {
                      "id": "q2",
                      "type": "single_select",
                      "variant": "list",
                      "title": "Pick one",
                      "description": null,
                      "required": false,
                      "theme_id": "65f0…f1",
                      "choices": [
                        {
                          "key": "a",
                          "label": "Alpha"
                        },
                        {
                          "key": "b",
                          "label": "Beta"
                        }
                      ],
                      "allows_other": false
                    }
                  ],
                  "created_at": "2026-07-01T09:00:00.000Z",
                  "updated_at": "2026-09-28T16:12:04.000Z"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/surveys/6512f0…\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/surveys/${surveyId}`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});\nconst survey = await res.json();"
          },
          {
            "lang": "Python",
            "source": "res = requests.get(f\"https://api.polzy.ai/api/v1/surveys/{survey_id}\", headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"})\nsurvey = res.json()"
          }
        ]
      }
    },
    "/surveys/{id}/responses": {
      "get": {
        "operationId": "survey-responses",
        "summary": "List a survey’s responses",
        "description": "The survey’s responses, newest first, each as one response object: typed answers, hidden fields, scores and the AI’s status. An anonymous response names nobody and gives only its day; an answer withheld for safety review has no value and withheld: true. When the anonymous answers asked for come from fewer people than the workspace’s minimum group, they are left out and withheld_anonymous is true — never how many, which would tell whose an answer was. An anonymous response from a campaign with too few anonymous answers of its own is listed without its campaign and language. Each read is recorded in the audit log, without the answers. A response in a round whose results are not out yet is left out until the round is published.",
        "tags": [
          "surveys"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#survey-responses"
        },
        "security": [
          {
            "apiKey": [
              "responses:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The survey’s id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100; 25 when left out. A larger limit is refused with 400, never cut down.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page, unchanged. It is good for this list in this workspace only.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "completed (the default), in_progress or all.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Completed on or after this instant (ISO 8601). An anonymous answer is matched by its day, on the workspace’s clock.",
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date"
                },
                {
                  "format": "date-time"
                }
              ]
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Completed on or before this instant (ISO 8601); an anonymous answer by its day. Before since is refused.",
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date"
                },
                {
                  "format": "date-time"
                }
              ]
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Changed on or after this instant (ISO 8601) — scored again, for instance; an anonymous answer by its day. What a sync reads to catch up.",
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date"
                },
                {
                  "format": "date-time"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a survey’s responses",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "object": "response",
                      "id": "resp_6721c9e0a4b1f2003d5e8a17",
                      "survey": {
                        "id": "6512f0…",
                        "title": "Q3 pulse — Operations"
                      },
                      "campaign": {
                        "id": "6520aa…",
                        "name": "Q3 pulse"
                      },
                      "round": 4,
                      "status": "completed",
                      "started_at": "2026-10-24T08:15:00.000Z",
                      "completed_at": "2026-10-24T08:20:30.000Z",
                      "duration_seconds": 330,
                      "language": "nl",
                      "respondent": {
                        "id": "65f0…a9",
                        "email": "ada@example.com",
                        "name": "Ada Lovelace",
                        "external_id": "E-7"
                      },
                      "answers": [
                        {
                          "question_id": "q1",
                          "question": "Recommend us?",
                          "type": "nps",
                          "variant": null,
                          "value": 9,
                          "label": null,
                          "withheld": false
                        },
                        {
                          "question_id": "q2",
                          "question": "Would you return?",
                          "type": "single_select",
                          "variant": "yes_no",
                          "value": "yes",
                          "label": "Yes",
                          "withheld": false
                        },
                        {
                          "question_id": "q3",
                          "question": "Pick any",
                          "type": "multi_select",
                          "variant": "list",
                          "value": [
                            "a",
                            "b"
                          ],
                          "label": [
                            "Alpha",
                            "Beta"
                          ],
                          "withheld": false
                        },
                        {
                          "question_id": "q4",
                          "question": "Tell us more",
                          "type": "text",
                          "variant": "long",
                          "value": null,
                          "label": null,
                          "withheld": true
                        }
                      ],
                      "hidden_fields": {
                        "order": "A-1001"
                      },
                      "score": {
                        "overall": 72,
                        "themes": [
                          {
                            "key": "65f0…f1",
                            "name": "Growth & learning",
                            "score": 81
                          }
                        ]
                      },
                      "ai": {
                        "status": "scored",
                        "sentiment": "positive"
                      }
                    }
                  ],
                  "has_more": true,
                  "next_cursor": "c1.ZW5jOnYxOkx3…",
                  "withheld_anonymous": false
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nINVALID_CURSOR: starting_after is not a cursor this list gave — changed, or from another list or workspace.\n\nINVALID_RANGE: until is before since.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/surveys/6512f0…/responses?since=2026-10-01&limit=100\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "let cursor;\ndo {\n  const query = new URLSearchParams({ limit: '100', ...(cursor && { starting_after: cursor }) });\n  const res = await fetch(`https://api.polzy.ai/api/v1/surveys/${surveyId}/responses?${query}`, {\n    headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n  });\n  const page = await res.json();\n  save(page.data);\n  cursor = page.next_cursor;\n} while (cursor);"
          },
          {
            "lang": "Python",
            "source": "cursor = None\nwhile True:\n    params = {\"limit\": 100, **({\"starting_after\": cursor} if cursor else {})}\n    page = requests.get(f\"https://api.polzy.ai/api/v1/surveys/{survey_id}/responses\", params=params, headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"}).json()\n    save(page[\"data\"])\n    cursor = page[\"next_cursor\"]\n    if not cursor:\n        break"
          }
        ]
      }
    },
    "/campaigns": {
      "get": {
        "operationId": "list-campaigns",
        "summary": "List campaigns",
        "description": "The workspace’s campaigns, newest first: their survey, state, dates, whether they take answers now and whether the plan holds them, and how many were invited and answered.",
        "tags": [
          "campaigns"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#list-campaigns"
        },
        "security": [
          {
            "apiKey": [
              "campaigns:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100; 25 when left out. A larger limit is refused with 400, never cut down.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page, unchanged. It is good for this list in this workspace only.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "draft, active, paused or completed.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List campaigns",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "object": "campaign",
                      "id": "6520aa…",
                      "name": "Q3 pulse",
                      "description": null,
                      "survey": {
                        "id": "6512f0…",
                        "title": "Q3 pulse — Operations"
                      },
                      "status": "active",
                      "purpose": "wellbeing",
                      "anonymous": true,
                      "accepting_responses": true,
                      "on_hold": false,
                      "starts_at": "2026-10-01T07:00:00.000Z",
                      "ends_at": "2026-10-31T17:00:00.000Z",
                      "max_responses": null,
                      "invited": 240,
                      "responses": 168,
                      "completed_at": null,
                      "created_at": "2026-09-20T10:00:00.000Z",
                      "updated_at": "2026-10-24T08:20:30.000Z"
                    }
                  ],
                  "has_more": true,
                  "next_cursor": "c1.ZW5jOnYxOkx3…"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nINVALID_CURSOR: starting_after is not a cursor this list gave — changed, or from another list or workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/campaigns?status=active\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/campaigns?status=active`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});\nconst { data, next_cursor } = await res.json();"
          },
          {
            "lang": "Python",
            "source": "res = requests.get(f\"https://api.polzy.ai/api/v1/campaigns\", params={\"status\": \"active\"}, headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"})\ncampaigns = res.json()[\"data\"]"
          }
        ]
      }
    },
    "/campaigns/{id}": {
      "get": {
        "operationId": "get-campaign",
        "summary": "Get a campaign",
        "description": "One campaign, as the list gives it.",
        "tags": [
          "campaigns"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#get-campaign"
        },
        "security": [
          {
            "apiKey": [
              "campaigns:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The campaign’s id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a campaign",
            "content": {
              "application/json": {
                "example": {
                  "object": "campaign",
                  "id": "6520aa…",
                  "name": "Q3 pulse",
                  "description": null,
                  "survey": {
                    "id": "6512f0…",
                    "title": "Q3 pulse — Operations"
                  },
                  "status": "active",
                  "purpose": "wellbeing",
                  "anonymous": true,
                  "accepting_responses": true,
                  "on_hold": false,
                  "starts_at": "2026-10-01T07:00:00.000Z",
                  "ends_at": "2026-10-31T17:00:00.000Z",
                  "max_responses": null,
                  "invited": 240,
                  "responses": 168,
                  "completed_at": null,
                  "created_at": "2026-09-20T10:00:00.000Z",
                  "updated_at": "2026-10-24T08:20:30.000Z"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/campaigns/6520aa…\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/campaigns/${campaignId}`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});\nconst campaign = await res.json();"
          },
          {
            "lang": "Python",
            "source": "campaign = requests.get(f\"https://api.polzy.ai/api/v1/campaigns/{campaign_id}\", headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"}).json()"
          }
        ]
      }
    },
    "/campaigns/{id}/responses": {
      "get": {
        "operationId": "campaign-responses",
        "summary": "List a campaign’s responses",
        "description": "The responses given through one campaign, as a survey’s list gives them. The minimum group is judged on the campaign’s own anonymous answers. A response in a round whose results are not out yet is left out until the round is published.",
        "tags": [
          "campaigns"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#campaign-responses"
        },
        "security": [
          {
            "apiKey": [
              "responses:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The campaign’s id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100; 25 when left out. A larger limit is refused with 400, never cut down.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page, unchanged. It is good for this list in this workspace only.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "completed (the default), in_progress or all.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Completed on or after this instant (ISO 8601). An anonymous answer is matched by its day, on the workspace’s clock.",
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date"
                },
                {
                  "format": "date-time"
                }
              ]
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Completed on or before this instant (ISO 8601); an anonymous answer by its day. Before since is refused.",
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date"
                },
                {
                  "format": "date-time"
                }
              ]
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Changed on or after this instant (ISO 8601) — scored again, for instance; an anonymous answer by its day. What a sync reads to catch up.",
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date"
                },
                {
                  "format": "date-time"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List a campaign’s responses",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "object": "response",
                      "id": "resp_q3Vt0Yk2mB8xWc1nL5hR9sPz4eJ7uA6dGfH0iKoT2wXyN3bQvEc_9w",
                      "survey": {
                        "id": "6512f0…",
                        "title": "Q3 pulse — Operations"
                      },
                      "campaign": {
                        "id": "6520aa…",
                        "name": "Q3 pulse"
                      },
                      "round": 4,
                      "status": "completed",
                      "started_at": "2026-10-24",
                      "completed_at": "2026-10-24",
                      "duration_seconds": null,
                      "language": "nl",
                      "respondent": null,
                      "answers": [
                        {
                          "question_id": "q1",
                          "question": "Recommend us?",
                          "type": "nps",
                          "variant": null,
                          "value": 9,
                          "label": null,
                          "withheld": false
                        },
                        {
                          "question_id": "q2",
                          "question": "Would you return?",
                          "type": "single_select",
                          "variant": "yes_no",
                          "value": "yes",
                          "label": "Yes",
                          "withheld": false
                        },
                        {
                          "question_id": "q3",
                          "question": "Pick any",
                          "type": "multi_select",
                          "variant": "list",
                          "value": [
                            "a",
                            "b"
                          ],
                          "label": [
                            "Alpha",
                            "Beta"
                          ],
                          "withheld": false
                        },
                        {
                          "question_id": "q4",
                          "question": "Tell us more",
                          "type": "text",
                          "variant": "long",
                          "value": null,
                          "label": null,
                          "withheld": true
                        }
                      ],
                      "hidden_fields": {},
                      "score": {
                        "overall": 72,
                        "themes": [
                          {
                            "key": "65f0…f1",
                            "name": "Growth & learning",
                            "score": 81
                          }
                        ]
                      },
                      "ai": {
                        "status": "scored",
                        "sentiment": "positive"
                      }
                    }
                  ],
                  "has_more": true,
                  "next_cursor": "c1.ZW5jOnYxOkx3…",
                  "withheld_anonymous": false
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nINVALID_CURSOR: starting_after is not a cursor this list gave — changed, or from another list or workspace.\n\nINVALID_RANGE: until is before since.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/campaigns/6520aa…/responses?updated_since=2026-10-24T00:00:00Z\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/campaigns/${campaignId}/responses?updated_since=${since}`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});\nconst { data, next_cursor, withheld_anonymous } = await res.json();"
          },
          {
            "lang": "Python",
            "source": "res = requests.get(\n    f\"https://api.polzy.ai/api/v1/campaigns/{campaign_id}/responses\",\n    params={\"updated_since\": since},\n    headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"},\n)\nresponses = res.json()[\"data\"]"
          }
        ]
      }
    },
    "/responses/{id}": {
      "get": {
        "operationId": "get-response",
        "summary": "Get a response",
        "description": "One response object by its id (resp_…). An anonymous response has an id of its own that carries no time, and is answered only where its survey’s — or campaign’s — anonymous answers come from enough people to hide among. Its answers are to the questions the survey asks now: an answer to a question removed since is left out, and comes back if the question is restored. A response in a round whose results are not out yet is answered with 404 until the round is published. A response to a survey that registers whoever answers as a contact names that contact as its respondent once the contact is made, moments after it is completed.",
        "tags": [
          "responses"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#get-response"
        },
        "security": [
          {
            "apiKey": [
              "responses:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The response’s id, resp_… as the list or a webhook gave it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get a response",
            "content": {
              "application/json": {
                "example": {
                  "object": "response",
                  "id": "resp_6721c9e0a4b1f2003d5e8a17",
                  "survey": {
                    "id": "6512f0…",
                    "title": "Q3 pulse — Operations"
                  },
                  "campaign": {
                    "id": "6520aa…",
                    "name": "Q3 pulse"
                  },
                  "round": 4,
                  "status": "completed",
                  "started_at": "2026-10-24T08:15:00.000Z",
                  "completed_at": "2026-10-24T08:20:30.000Z",
                  "duration_seconds": 330,
                  "language": "nl",
                  "respondent": {
                    "id": "65f0…a9",
                    "email": "ada@example.com",
                    "name": "Ada Lovelace",
                    "external_id": "E-7"
                  },
                  "answers": [
                    {
                      "question_id": "q1",
                      "question": "Recommend us?",
                      "type": "nps",
                      "variant": null,
                      "value": 9,
                      "label": null,
                      "withheld": false
                    },
                    {
                      "question_id": "q2",
                      "question": "Would you return?",
                      "type": "single_select",
                      "variant": "yes_no",
                      "value": "yes",
                      "label": "Yes",
                      "withheld": false
                    },
                    {
                      "question_id": "q3",
                      "question": "Pick any",
                      "type": "multi_select",
                      "variant": "list",
                      "value": [
                        "a",
                        "b"
                      ],
                      "label": [
                        "Alpha",
                        "Beta"
                      ],
                      "withheld": false
                    },
                    {
                      "question_id": "q4",
                      "question": "Tell us more",
                      "type": "text",
                      "variant": "long",
                      "value": null,
                      "label": null,
                      "withheld": true
                    }
                  ],
                  "hidden_fields": {
                    "order": "A-1001"
                  },
                  "score": {
                    "overall": 72,
                    "themes": [
                      {
                        "key": "65f0…f1",
                        "name": "Growth & learning",
                        "score": 81
                      }
                    ]
                  },
                  "ai": {
                    "status": "scored",
                    "sentiment": "positive"
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.\n\nGROUP_TOO_SMALL: An anonymous answer from a group too small to hide in: too few people answered anonymously here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl \"https://api.polzy.ai/api/v1/responses/resp_6721c9e0a4b1f2003d5e8a17\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\""
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/responses/${responseId}`, {\n  headers: { Authorization: `Bearer ${process.env.POLZY_KEY}` },\n});\nconst response = await res.json();"
          },
          {
            "lang": "Python",
            "source": "response = requests.get(f\"https://api.polzy.ai/api/v1/responses/{response_id}\", headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\"}).json()"
          }
        ]
      }
    },
    "/actions/{id}": {
      "patch": {
        "operationId": "update-action",
        "summary": "Move an action",
        "description": "Moves an action to another stage, as the board does: completing it dates it and announces action.completed. The move is made as the admin who created the key.",
        "tags": [
          "actions"
        ],
        "externalDocs": {
          "url": "https://polzy.ai/help/api#update-action"
        },
        "security": [
          {
            "apiKey": [
              "actions:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The action’s id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any string of 1 to 255 printable characters. The same key in the next 24 hours replays the first answer, marked Idempotent-Replayed: true, and the write is made once.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "stage"
                ],
                "properties": {
                  "stage": {
                    "type": "string",
                    "description": "pending, in_progress, waiting, completed or dismissed."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Move an action",
            "content": {
              "application/json": {
                "example": {
                  "id": "6abd1d…",
                  "title": "Rewrite the handover checklist",
                  "stage": "completed",
                  "owner": "anouk@acme.com",
                  "due": "2026-11-15T00:00:00.000Z",
                  "completed_at": "2026-10-24T11:40:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid — a limit outside 1–100, a date that is not ISO 8601, a value the field does not take. error names it.\n\nINVALID_IDEMPOTENCY_KEY: The Idempotency-Key is not 1 to 255 printable characters, or was sent twice.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or one that is unknown, revoked or expired, or whose creator no longer has access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_MISSING: The key was not given this endpoint’s scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with that id in this workspace. Another workspace’s id is not found either.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED: This Idempotency-Key was used in the last 24 hours for a different request. Use a new key for a new request.\n\nIDEMPOTENCY_IN_PROGRESS: A request with this Idempotency-Key is still running. Retry in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: The key, or the workspace’s keys together, have used this minute’s requests. Retry-After says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl -X PATCH \"https://api.polzy.ai/api/v1/actions/6abd1d…\" \\\n  -H \"Authorization: Bearer $POLZY_KEY\" \\\n  -H \"Idempotency-Key: 7b1e-close-handover\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"stage\":\"completed\"}'"
          },
          {
            "lang": "JavaScript",
            "source": "const res = await fetch(`https://api.polzy.ai/api/v1/actions/${actionId}`, {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.POLZY_KEY}`,\n    'Idempotency-Key': crypto.randomUUID(),\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({ stage: 'completed' }),\n});"
          },
          {
            "lang": "Python",
            "source": "res = requests.patch(\n    f\"https://api.polzy.ai/api/v1/actions/{action_id}\",\n    json={\"stage\": \"completed\"},\n    headers={\"Authorization\": f\"Bearer {os.environ['POLZY_KEY']}\", \"Idempotency-Key\": str(uuid.uuid4())},\n)"
          }
        ]
      }
    }
  },
  "webhooks": {
    "response.created": {
      "post": {
        "operationId": "response.created",
        "summary": "A response was completed and its written answers read for safety. Sent before scoring.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "response.created"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "The subject’s id — the response, campaign or action. Null for an anonymous response."
                      },
                      "response_id": {
                        "description": "The response as GET /responses/:id reads it: resp_ and its id, sealed when anonymous."
                      },
                      "survey_id": {
                        "description": "The survey it is about."
                      },
                      "campaign_id": {
                        "description": "The campaign it came through, or null — null as well for an anonymous answer from a campaign with too few anonymous answers to hide among. On a round event, the campaign whose round it is."
                      },
                      "completed_at": {
                        "description": "When it was completed — the day alone for an anonymous response."
                      },
                      "response": {
                        "description": "The response object, as GET /responses/:id gives it — only to an endpoint with include_response."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "response.created:6721c9e0a4b1f2003d5e8a17:6abd1e…",
                "type": "response.created",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "id": "6721c9e0a4b1f2003d5e8a17",
                  "response_id": "resp_6721c9e0a4b1f2003d5e8a17",
                  "survey_id": "6512f0…",
                  "campaign_id": "6520aa…",
                  "completed_at": "2026-10-24T08:20:30.000Z",
                  "response": {
                    "object": "response",
                    "id": "resp_6721c9e0a4b1f2003d5e8a17",
                    "survey": {
                      "id": "6512f0…",
                      "title": "Q3 pulse — Operations"
                    },
                    "campaign": {
                      "id": "6520aa…",
                      "name": "Q3 pulse"
                    },
                    "round": 4,
                    "status": "completed",
                    "started_at": "2026-10-24T08:15:00.000Z",
                    "completed_at": "2026-10-24T08:20:30.000Z",
                    "duration_seconds": 330,
                    "language": "nl",
                    "respondent": {
                      "id": "65f0…a9",
                      "email": "ada@example.com",
                      "name": "Ada Lovelace",
                      "external_id": "E-7"
                    },
                    "answers": [
                      {
                        "question_id": "q1",
                        "question": "Recommend us?",
                        "type": "nps",
                        "variant": null,
                        "value": 9,
                        "label": null,
                        "withheld": false
                      },
                      {
                        "question_id": "q2",
                        "question": "Would you return?",
                        "type": "single_select",
                        "variant": "yes_no",
                        "value": "yes",
                        "label": "Yes",
                        "withheld": false
                      },
                      {
                        "question_id": "q3",
                        "question": "Pick any",
                        "type": "multi_select",
                        "variant": "list",
                        "value": [
                          "a",
                          "b"
                        ],
                        "label": [
                          "Alpha",
                          "Beta"
                        ],
                        "withheld": false
                      },
                      {
                        "question_id": "q4",
                        "question": "Tell us more",
                        "type": "text",
                        "variant": "long",
                        "value": null,
                        "label": null,
                        "withheld": true
                      }
                    ],
                    "hidden_fields": {
                      "order": "A-1001"
                    },
                    "score": {
                      "overall": 72,
                      "themes": [
                        {
                          "key": "65f0…f1",
                          "name": "Growth & learning",
                          "score": 81
                        }
                      ]
                    },
                    "ai": {
                      "status": "pending",
                      "sentiment": null
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "response.scored": {
      "post": {
        "operationId": "response.scored",
        "summary": "A response’s AI reading was saved, with its scores. Only where AI scoring is on.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "response.scored"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "The subject’s id — the response, campaign or action. Null for an anonymous response."
                      },
                      "response_id": {
                        "description": "The response as GET /responses/:id reads it: resp_ and its id, sealed when anonymous."
                      },
                      "survey_id": {
                        "description": "The survey it is about."
                      },
                      "campaign_id": {
                        "description": "The campaign it came through, or null — null as well for an anonymous answer from a campaign with too few anonymous answers to hide among. On a round event, the campaign whose round it is."
                      },
                      "completed_at": {
                        "description": "When it was completed — the day alone for an anonymous response."
                      },
                      "response": {
                        "description": "The response object, as GET /responses/:id gives it — only to an endpoint with include_response."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "response.scored:6721c9e0a4b1f2003d5e8a17:6abd1e…",
                "type": "response.scored",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "id": "6721c9e0a4b1f2003d5e8a17",
                  "response_id": "resp_6721c9e0a4b1f2003d5e8a17",
                  "survey_id": "6512f0…",
                  "campaign_id": "6520aa…",
                  "completed_at": "2026-10-24T08:20:30.000Z",
                  "response": {
                    "object": "response",
                    "id": "resp_6721c9e0a4b1f2003d5e8a17",
                    "survey": {
                      "id": "6512f0…",
                      "title": "Q3 pulse — Operations"
                    },
                    "campaign": {
                      "id": "6520aa…",
                      "name": "Q3 pulse"
                    },
                    "round": 4,
                    "status": "completed",
                    "started_at": "2026-10-24T08:15:00.000Z",
                    "completed_at": "2026-10-24T08:20:30.000Z",
                    "duration_seconds": 330,
                    "language": "nl",
                    "respondent": {
                      "id": "65f0…a9",
                      "email": "ada@example.com",
                      "name": "Ada Lovelace",
                      "external_id": "E-7"
                    },
                    "answers": [
                      {
                        "question_id": "q1",
                        "question": "Recommend us?",
                        "type": "nps",
                        "variant": null,
                        "value": 9,
                        "label": null,
                        "withheld": false
                      },
                      {
                        "question_id": "q2",
                        "question": "Would you return?",
                        "type": "single_select",
                        "variant": "yes_no",
                        "value": "yes",
                        "label": "Yes",
                        "withheld": false
                      },
                      {
                        "question_id": "q3",
                        "question": "Pick any",
                        "type": "multi_select",
                        "variant": "list",
                        "value": [
                          "a",
                          "b"
                        ],
                        "label": [
                          "Alpha",
                          "Beta"
                        ],
                        "withheld": false
                      },
                      {
                        "question_id": "q4",
                        "question": "Tell us more",
                        "type": "text",
                        "variant": "long",
                        "value": null,
                        "label": null,
                        "withheld": true
                      }
                    ],
                    "hidden_fields": {
                      "order": "A-1001"
                    },
                    "score": {
                      "overall": 72,
                      "themes": [
                        {
                          "key": "65f0…f1",
                          "name": "Growth & learning",
                          "score": 81
                        }
                      ]
                    },
                    "ai": {
                      "status": "scored",
                      "sentiment": "positive"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "response.deleted": {
      "post": {
        "operationId": "response.deleted",
        "summary": "A response was deleted, by an admin or by the person who gave it. Ids only.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "response.deleted"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "The subject’s id — the response, campaign or action. Null for an anonymous response."
                      },
                      "response_id": {
                        "description": "The response as GET /responses/:id reads it: resp_ and its id, sealed when anonymous."
                      },
                      "survey_id": {
                        "description": "The survey it is about."
                      },
                      "campaign_id": {
                        "description": "The campaign it came through, or null — null as well for an anonymous answer from a campaign with too few anonymous answers to hide among. On a round event, the campaign whose round it is."
                      },
                      "deleted_at": {
                        "description": "When the response was deleted."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "response.deleted:6721c9e0a4b1f2003d5e8a17:6abd1e…",
                "type": "response.deleted",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "id": "6721c9e0a4b1f2003d5e8a17",
                  "response_id": "resp_6721c9e0a4b1f2003d5e8a17",
                  "survey_id": "6512f0…",
                  "campaign_id": "6520aa…",
                  "deleted_at": "2026-10-25T10:02:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "response.translated": {
      "post": {
        "operationId": "response.translated",
        "summary": "A response’s open answers were machine-translated into your organization’s language, with the translations on each answer. Sent once per response, and only to an endpoint that ticks it.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "response.translated"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "The subject’s id — the response, campaign or action. Null for an anonymous response."
                      },
                      "response_id": {
                        "description": "The response as GET /responses/:id reads it: resp_ and its id, sealed when anonymous."
                      },
                      "survey_id": {
                        "description": "The survey it is about."
                      },
                      "campaign_id": {
                        "description": "The campaign it came through, or null — null as well for an anonymous answer from a campaign with too few anonymous answers to hide among. On a round event, the campaign whose round it is."
                      },
                      "completed_at": {
                        "description": "When it was completed — the day alone for an anonymous response."
                      },
                      "response": {
                        "description": "The response object, as GET /responses/:id gives it — only to an endpoint with include_response."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "response.translated:6721c9e0a4b1f2003d5e8a17:6abd1e…",
                "type": "response.translated",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "id": "6721c9e0a4b1f2003d5e8a17",
                  "response_id": "resp_6721c9e0a4b1f2003d5e8a17",
                  "survey_id": "6512f0…",
                  "campaign_id": "6520aa…",
                  "completed_at": "2026-10-24T08:20:30.000Z",
                  "response": {
                    "object": "response",
                    "id": "resp_6721c9e0a4b1f2003d5e8a17",
                    "survey": {
                      "id": "6512f0…",
                      "title": "Q3 pulse — Operations"
                    },
                    "campaign": {
                      "id": "6520aa…",
                      "name": "Q3 pulse"
                    },
                    "round": 4,
                    "status": "completed",
                    "started_at": "2026-10-24T08:15:00.000Z",
                    "completed_at": "2026-10-24T08:20:30.000Z",
                    "duration_seconds": 330,
                    "language": "fr",
                    "respondent": {
                      "id": "65f0…a9",
                      "email": "ada@example.com",
                      "name": "Ada Lovelace",
                      "external_id": "E-7"
                    },
                    "answers": [
                      {
                        "question_id": "q1",
                        "question": "Recommend us?",
                        "type": "nps",
                        "variant": null,
                        "value": 9,
                        "label": null,
                        "withheld": false
                      },
                      {
                        "question_id": "q4",
                        "question": "Tell us more",
                        "type": "text",
                        "variant": "long",
                        "value": "Trop de réunions le lundi matin.",
                        "label": null,
                        "withheld": false,
                        "translated_text": "Too many meetings on Monday mornings.",
                        "source_language": "fr",
                        "translated_to": "en"
                      }
                    ],
                    "hidden_fields": {
                      "order": "A-1001"
                    },
                    "score": {
                      "overall": 72,
                      "themes": [
                        {
                          "key": "65f0…f1",
                          "name": "Growth & learning",
                          "score": 81
                        }
                      ]
                    },
                    "ai": {
                      "status": "scored",
                      "sentiment": "positive"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "campaign.launched": {
      "post": {
        "operationId": "campaign.launched",
        "summary": "A campaign went live — launched, or launched again after a pause.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "campaign.launched"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "The subject’s id — the response, campaign or action. Null for an anonymous response."
                      },
                      "survey_id": {
                        "description": "The survey it is about."
                      },
                      "name": {
                        "description": "The campaign’s name."
                      },
                      "resumed": {
                        "description": "True when the campaign was launched again after a pause."
                      },
                      "launched_at": {
                        "description": "When the campaign went live."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "campaign.launched:6520aa…:1727766000000:6abd1e…",
                "type": "campaign.launched",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "id": "6520aa…",
                  "name": "Q3 pulse",
                  "survey_id": "6512f0…",
                  "resumed": false,
                  "launched_at": "2026-10-01T07:00:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "campaign.finished": {
      "post": {
        "operationId": "campaign.finished",
        "summary": "A campaign closed, with its response rate.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "campaign.finished"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "The subject’s id — the response, campaign or action. Null for an anonymous response."
                      },
                      "name": {
                        "description": "The campaign’s name."
                      },
                      "response_rate": {
                        "description": "Responses per invitation sent, from 0 to 1."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "campaign.finished:6520aa…:6abd1e…",
                "type": "campaign.finished",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "id": "6520aa…",
                  "name": "Q3 pulse",
                  "response_rate": 0.7
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "campaign.round_closed": {
      "post": {
        "operationId": "campaign.round_closed",
        "summary": "A round of a campaign that keeps rounds closed, with who answered it.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "campaign.round_closed"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "campaign_id": {
                        "description": "The campaign it came through, or null — null as well for an anonymous answer from a campaign with too few anonymous answers to hide among. On a round event, the campaign whose round it is."
                      },
                      "name": {
                        "description": "The campaign’s name."
                      },
                      "round": {
                        "description": "The round’s number in its campaign, from 1."
                      },
                      "release": {
                        "description": "When its results come out: live, on_close or manual."
                      },
                      "opened_at": {
                        "description": "When the round opened — its send."
                      },
                      "closed_at": {
                        "description": "When the round closed."
                      },
                      "invited": {
                        "description": "Invitations the round sent, reminders not counted."
                      },
                      "answered": {
                        "description": "Completed answers to the round."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "campaign.round_closed:6520aa…:4:6abd1e…",
                "type": "campaign.round_closed",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "campaign_id": "6520aa…",
                  "name": "Weekly pulse",
                  "round": 4,
                  "release": "manual",
                  "opened_at": "2026-10-26T08:00:00.000Z",
                  "closed_at": "2026-11-02T08:00:00.000Z",
                  "invited": 120,
                  "answered": 83
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "campaign.round_published": {
      "post": {
        "operationId": "campaign.round_published",
        "summary": "A round’s results were published — by an admin, or by themselves as the round closed.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "campaign.round_published"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "campaign_id": {
                        "description": "The campaign it came through, or null — null as well for an anonymous answer from a campaign with too few anonymous answers to hide among. On a round event, the campaign whose round it is."
                      },
                      "name": {
                        "description": "The campaign’s name."
                      },
                      "round": {
                        "description": "The round’s number in its campaign, from 1."
                      },
                      "release": {
                        "description": "When its results come out: live, on_close or manual."
                      },
                      "opened_at": {
                        "description": "When the round opened — its send."
                      },
                      "closed_at": {
                        "description": "When the round closed."
                      },
                      "published_at": {
                        "description": "When its results were published."
                      },
                      "invited": {
                        "description": "Invitations the round sent, reminders not counted."
                      },
                      "answered": {
                        "description": "Completed answers to the round."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "campaign.round_published:6520aa…:4:6abd1e…",
                "type": "campaign.round_published",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "campaign_id": "6520aa…",
                  "name": "Weekly pulse",
                  "round": 4,
                  "release": "manual",
                  "opened_at": "2026-10-26T08:00:00.000Z",
                  "closed_at": "2026-11-02T08:00:00.000Z",
                  "published_at": "2026-11-03T09:15:00.000Z",
                  "invited": 120,
                  "answered": 83
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "action.created": {
      "post": {
        "operationId": "action.created",
        "summary": "An action was created.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "action.created"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "The subject’s id — the response, campaign or action. Null for an anonymous response."
                      },
                      "title": {
                        "description": "The action’s title."
                      },
                      "stage": {
                        "description": "The action’s stage."
                      },
                      "due": {
                        "description": "The action’s due date, or null."
                      },
                      "source": {
                        "description": "Where the action came from: bank (a recommended action), finding, deep-dive, manual, or null for one raised by Polzy."
                      },
                      "target_group": {
                        "description": "The group the action is for: each a field of the workspace and one of its values. Empty for everybody."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "action.created:6abd1d…:6abd1e…",
                "type": "action.created",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "id": "6abd1d…",
                  "title": "Rewrite the handover checklist",
                  "stage": "pending",
                  "due": "2026-11-15T00:00:00.000Z",
                  "source": "bank",
                  "target_group": [
                    {
                      "field": "department",
                      "value": "operations"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "action.completed": {
      "post": {
        "operationId": "action.completed",
        "summary": "An action was completed.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "action.completed"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "The subject’s id — the response, campaign or action. Null for an anonymous response."
                      },
                      "title": {
                        "description": "The action’s title."
                      },
                      "stage": {
                        "description": "The action’s stage."
                      },
                      "due": {
                        "description": "The action’s due date, or null."
                      },
                      "source": {
                        "description": "Where the action came from: bank (a recommended action), finding, deep-dive, manual, or null for one raised by Polzy."
                      },
                      "target_group": {
                        "description": "The group the action is for: each a field of the workspace and one of its values. Empty for everybody."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "action.completed:6abd1d…:6abd1e…",
                "type": "action.completed",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "id": "6abd1d…",
                  "title": "Rewrite the handover checklist",
                  "stage": "completed",
                  "due": "2026-11-15T00:00:00.000Z",
                  "source": "bank",
                  "target_group": [
                    {
                      "field": "department",
                      "value": "operations"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    },
    "webhook.test": {
      "post": {
        "operationId": "webhook.test",
        "summary": "Sent by Send test, or POST /webhooks/:id/test. Nothing else sends it.",
        "parameters": [
          {
            "name": "X-Polzy-Timestamp",
            "in": "header",
            "required": true,
            "description": "The Unix time, in seconds, the delivery was signed — new on every attempt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Signature",
            "in": "header",
            "required": true,
            "description": "The hex HMAC-SHA256 of \"<timestamp>.<raw body>\", with the webhook’s secret.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event-Id",
            "in": "header",
            "required": true,
            "description": "The delivery’s id, the same on every attempt and every resend: remember it to handle each event once.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Polzy-Event",
            "in": "header",
            "required": true,
            "description": "The event’s type, so you can route a delivery before parsing it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "webhook.test"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "webhook_id": {
                        "description": "webhook.test: the webhook it was sent to."
                      },
                      "message": {
                        "description": "webhook.test: a sentence saying it is a test."
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "webhook.test:6abd1d…:6abd1e…",
                "type": "webhook.test",
                "created_at": "2026-10-24T08:20:41.000Z",
                "data": {
                  "webhook_id": "6abd1d…",
                  "message": "A test delivery from Polzy. Answer with any 2xx within 10 seconds."
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Answer with any 2xx within 10 seconds; the body of your answer is not read, and an address gets 3 of those seconds to take the connection. No answer, a 408, a 429 or a 5xx is tried again — after 30 seconds, 2 minutes, 10 minutes, half an hour, 1, 3 and 6 hours, then every 12 hours — until three days after the first attempt, each attempt under Settings → API → Webhooks. Any other 4xx, or a redirect (never followed), is not tried again. X-Polzy-Event-Id is the same on every attempt, so a retry can be recognised. An endpoint is sent at most two deliveries at once; after five failures in a row its deliveries wait, untried, and one is let through every 5 minutes to try it — once one succeeds, the rest follow. A delivery that waits spends none of its attempts. A response event is sent once: a rescore does not send it again."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Send your key in the Authorization header as a bearer token. An admin creates keys in Settings → API; each key belongs to one workspace and is shown once. A key only reaches what its scopes allow: surveys:read, responses:read, campaigns:read, analytics:read, actions:read, actions:write, webhooks:read and webhooks:write, which includes webhooks:read. Reading responses, campaigns and actions are scopes of their own, given to no key made before they existed. A missing scope answers 403.",
        "x-scopes": [
          "actions:read",
          "actions:write",
          "analytics:read",
          "campaigns:read",
          "responses:read",
          "surveys:read",
          "webhooks:read",
          "webhooks:write"
        ]
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Errors use HTTP status codes and a JSON body with a sentence in error and, where it helps, a machine-readable code.",
        "required": [
          "error",
          "statusCode"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "statusCode": {
            "type": "integer"
          },
          "code": {
            "type": "string"
          }
        }
      }
    }
  }
}
