{
  "openapi" : "3.1.0",
  "info" : {
    "title" : "Niotio REST API",
    "version" : "9d78b932ed",
    "summary" : "NPS surveys over HTTP: campaigns, respondents, responses, metrics, comments and tags, follow-up cases, webhooks and email usage.",
    "description" : "Niotio REST API. Base URL: https://niotio.dk/api\n\nAuthentication: Use Authorization: Bearer <API_TOKEN> for API requests.\n\nErrors are JSON with `error`, `kind: \"api\"` and `status`. Full guide: /api/docs.md. Everything in one file: /llms-full.txt.\n\nPlans: Free 0 DKK/mo (100 survey emails, 1 seat, Niotio branding); Start 299 DKK/mo (1,000 emails, 2 seats); Pro 499 DKK/mo (3,000, 5 seats, webhooks, detractor case workflow, opt-in overage 15 DKK per 100); Business 999 DKK/mo (10,000, 15 seats, white label, overage). Yearly = 2 months free. Prices excl. VAT. API, CLI and MCP server on all plans. Paid plans are arranged by contacting us; no online payment yet.",
    "license" : {
      "name" : "Proprietary",
      "url" : "https://niotio.dk/terms"
    }
  },
  "servers" : [ {
    "url" : "https://niotio.dk",
    "description" : "This Niotio instance"
  } ],
  "tags" : [ {
    "name" : "campaigns"
  }, {
    "name" : "metrics"
  }, {
    "name" : "search"
  }, {
    "name" : "usage"
  }, {
    "name" : "responses"
  }, {
    "name" : "cases"
  }, {
    "name" : "comment-tags"
  }, {
    "name" : "comments"
  } ],
  "paths" : {
    "/api/campaigns" : {
      "get" : {
        "tags" : [ "campaigns" ],
        "summary" : "List campaigns (`?test=true|false`; `?trash=true` lists the caller's trash)",
        "description" : "List campaigns (`?test=true|false`; `?trash=true` lists the caller's trash)",
        "operationId" : "getApiCampaigns",
        "parameters" : [ {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "test",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "trash",
          "in" : "query",
          "required" : false
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Create a campaign",
        "description" : "Create a campaign",
        "operationId" : "postApiCampaigns",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}" : {
      "get" : {
        "tags" : [ "campaigns" ],
        "summary" : "Get a campaign by id",
        "description" : "Get a campaign by id",
        "operationId" : "getApiCampaignsId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "put" : {
        "tags" : [ "campaigns" ],
        "summary" : "Update a campaign",
        "description" : "Update a campaign",
        "operationId" : "putApiCampaignsId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Updated resource."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "delete" : {
        "tags" : [ "campaigns" ],
        "summary" : "Move a campaign to the trash (204).",
        "description" : "Move a campaign to the trash (204). It can be restored for 30 days; trashed campaigns are listed with ?trash=true.",
        "operationId" : "deleteApiCampaignsId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "trash",
          "in" : "query",
          "required" : false
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Deleted; usually 204 with no body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/restore" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Restore a trashed campaign (204)",
        "description" : "Restore a trashed campaign (204)",
        "operationId" : "postApiCampaignsIdRestore",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/activate" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Activate a campaign so it can send and collect responses; returns the campaign",
        "description" : "Activate a campaign so it can send and collect responses; returns the campaign",
        "operationId" : "postApiCampaignsIdActivate",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/deactivate" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Close a campaign; returns the campaign",
        "description" : "Close a campaign; returns the campaign",
        "operationId" : "postApiCampaignsIdDeactivate",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/respondents" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Add a respondent ({\"email\":\"…\",\"name\":\"…\",\"language\":\"en|da\"}; name and language are optional).",
        "description" : "Add a respondent ({\"email\":\"…\",\"name\":\"…\",\"language\":\"en|da\"}; name and language are optional). 201 with the respondent. Owner or editor only.",
        "operationId" : "postApiCampaignsIdRespondents",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "get" : {
        "tags" : [ "campaigns" ],
        "summary" : "List respondents, paged (?page=0&size=50, max 200; ?search=; ?status=UNSENT|SENT|RESPONDED|OPTED_OUT|ALL)",
        "description" : "List respondents, paged (?page=0&size=50, max 200; ?search=; ?status=UNSENT|SENT|RESPONDED|OPTED_OUT|ALL)",
        "operationId" : "getApiCampaignsIdRespondents",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "page",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "size",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "search",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "status",
          "in" : "query",
          "required" : false
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/send" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Send the survey to every respondent who has not had it yet: {\"sent\",\"failed\",\"blocked\",\"total\"}.",
        "description" : "Send the survey to every respondent who has not had it yet: {\"sent\",\"failed\",\"blocked\",\"total\"}. 409 {\"error\":\"monthly_email_limit_reached\",\"requested\",\"used\",\"limit\",\"resetsOn\",\"sent\":0} when the monthly allowance would be exceeded (nothing is sent).",
        "operationId" : "postApiCampaignsIdSend",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/metrics" : {
      "get" : {
        "tags" : [ "campaigns" ],
        "summary" : "NPS, promoters, passives, detractors and response counts for one campaign",
        "description" : "NPS, promoters, passives, detractors and response counts for one campaign",
        "operationId" : "getApiCampaignsIdMetrics",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/activity" : {
      "get" : {
        "tags" : [ "campaigns" ],
        "summary" : "The campaign's activity log (audit entries), newest first",
        "description" : "The campaign's activity log (audit entries), newest first",
        "operationId" : "getApiCampaignsIdActivity",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/segments" : {
      "get" : {
        "tags" : [ "campaigns" ],
        "summary" : "NPS per segment of one attribute (?attribute=company|customer_type|location|product): value, response count, NPS and whether the sample is big enough (min 5 …",
        "description" : "NPS per segment of one attribute (?attribute=company|customer_type|location|product): value, response count, NPS and whether the sample is big enough (min 5 responses)",
        "operationId" : "getApiCampaignsIdSegments",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "attribute",
          "in" : "query",
          "required" : false
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/simulate" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Test campaigns only: generate simulated responses ({\"counts\":{\"0\":3,\"10\":7},\"spreadDays\":14,\"danishPercent\":50}); never sends mail.",
        "description" : "Test campaigns only: generate simulated responses ({\"counts\":{\"0\":3,\"10\":7},\"spreadDays\":14,\"danishPercent\":50}); never sends mail. 400 on a real campaign.",
        "operationId" : "postApiCampaignsIdSimulate",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/simulate/clear" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Test campaigns only: remove all simulated respondents ({\"removedRespondents\":n})",
        "description" : "Test campaigns only: remove all simulated respondents ({\"removedRespondents\":n})",
        "operationId" : "postApiCampaignsIdSimulateClear",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/stagger/start" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Test campaigns only: trickle simulated responses into the live feed ({\"intervalSeconds\":10,\"counts\":{…}}); returns {\"queued\":n}",
        "description" : "Test campaigns only: trickle simulated responses into the live feed ({\"intervalSeconds\":10,\"counts\":{…}}); returns {\"queued\":n}",
        "operationId" : "postApiCampaignsIdStaggerStart",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{id}/stagger/stop" : {
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Stop a staggered demo and discard what is still queued ({\"discarded\":n})",
        "description" : "Stop a staggered demo and discard what is still queued ({\"discarded\":n})",
        "operationId" : "postApiCampaignsIdStaggerStop",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{campaignId}/shares" : {
      "get" : {
        "tags" : [ "campaigns" ],
        "summary" : "People the campaign is shared with (owner and anyone it is shared with)",
        "description" : "People the campaign is shared with (owner and anyone it is shared with)",
        "operationId" : "getApiCampaignsCampaignIdShares",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The campaignId.",
          "name" : "campaignId",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "post" : {
        "tags" : [ "campaigns" ],
        "summary" : "Share the campaign with an existing Niotio user ({\"email\":\"…\",\"role\":\"VIEWER|EDITOR\"}, default VIEWER; owner only)",
        "description" : "Share the campaign with an existing Niotio user ({\"email\":\"…\",\"role\":\"VIEWER|EDITOR\"}, default VIEWER; owner only)",
        "operationId" : "postApiCampaignsCampaignIdShares",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The campaignId.",
          "name" : "campaignId",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/campaigns/{campaignId}/shares/{shareId}" : {
      "delete" : {
        "tags" : [ "campaigns" ],
        "summary" : "Remove a share (the owner, or the person it was shared with to leave)",
        "description" : "Remove a share (the owner, or the person it was shared with to leave)",
        "operationId" : "deleteApiCampaignsCampaignIdSharesShareId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The campaignId.",
          "name" : "campaignId",
          "in" : "path",
          "required" : true
        }, {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The shareId.",
          "name" : "shareId",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Deleted; usually 204 with no body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/metrics" : {
      "get" : {
        "tags" : [ "metrics" ],
        "summary" : "Get overall metrics (real campaigns included in the score; TEST campaigns are excluded, like the dashboard)",
        "description" : "Get overall metrics (real campaigns included in the score; TEST campaigns are excluded, like the dashboard)",
        "operationId" : "getApiMetrics",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/search" : {
      "get" : {
        "tags" : [ "search" ],
        "summary" : "Search campaigns, respondents, comments and cases you can reach (?q=…, at most 20 hits per group); the same results as the command palette",
        "description" : "Search campaigns, respondents, comments and cases you can reach (?q=…, at most 20 hits per group); the same results as the command palette",
        "operationId" : "getApiSearch",
        "parameters" : [ {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "q",
          "in" : "query",
          "required" : false
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/v1/usage/email" : {
      "get" : {
        "tags" : [ "usage" ],
        "summary" : "Get survey email usage this month",
        "description" : "Get survey email usage this month",
        "operationId" : "getApiV1UsageEmail",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/responses" : {
      "post" : {
        "tags" : [ "responses" ],
        "summary" : "Submit response (410 campaign_not_open if the campaign is in the trash)",
        "description" : "Submit response (410 campaign_not_open if the campaign is in the trash)",
        "operationId" : "postApiResponses",
        "security" : [ {
          "respondentToken" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          }
        }
      }
    },
    "/api/cases" : {
      "get" : {
        "tags" : [ "cases" ],
        "summary" : "The follow-up case inbox across every campaign you can reach (?status=OPEN|NEW|IN_PROGRESS|RESOLVED|NOT_POSSIBLE|ALL, ?assignee=MINE|ALL|UNASSIGNED, ?overdue…",
        "description" : "The follow-up case inbox across every campaign you can reach (?status=OPEN|NEW|IN_PROGRESS|RESOLVED|NOT_POSSIBLE|ALL, ?assignee=MINE|ALL|UNASSIGNED, ?overdue=true, ?campaignId=). When follow-up cases are off (plan or campaign switch), this returns 200 with an empty list, not 403.",
        "operationId" : "getApiCases",
        "parameters" : [ {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "status",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "assignee",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "overdue",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "campaignId",
          "in" : "query",
          "required" : false
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/cases/counts" : {
      "get" : {
        "tags" : [ "cases" ],
        "summary" : "Open, overdue, mine and unassigned case counts.",
        "description" : "Open, overdue, mine and unassigned case counts. When follow-up cases are off, this returns 200 with zeros, not 403.",
        "operationId" : "getApiCasesCounts",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/cases/{id}" : {
      "get" : {
        "tags" : [ "cases" ],
        "summary" : "One case: respondent, rating, comment, assignee, status, outcome, due date",
        "description" : "One case: respondent, rating, comment, assignee, status, outcome, due date",
        "operationId" : "getApiCasesId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/cases/{id}/notes" : {
      "get" : {
        "tags" : [ "cases" ],
        "summary" : "A case's internal notes, oldest first",
        "description" : "A case's internal notes, oldest first",
        "operationId" : "getApiCasesIdNotes",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "post" : {
        "tags" : [ "cases" ],
        "summary" : "Append an internal note ({\"body\":\"...\"}, max 2000 characters).",
        "description" : "Append an internal note ({\"body\":\"...\"}, max 2000 characters). 403 {\"error\":\"followup_cases_disabled\"} when the campaign has cases switched off.",
        "operationId" : "postApiCasesIdNotes",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/cases/{id}/assign" : {
      "post" : {
        "tags" : [ "cases" ],
        "summary" : "Assign ({\"assigneeId\":7}) or unassign ({\"assigneeId\":null}) — the assignee is notified.",
        "description" : "Assign ({\"assigneeId\":7}) or unassign ({\"assigneeId\":null}) — the assignee is notified. An empty body ({}) is 400; only an explicit null unassigns. 403 {\"error\":\"followup_cases_disabled\"} when the campaign has cases switched off.",
        "operationId" : "postApiCasesIdAssign",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/cases/{id}/status" : {
      "post" : {
        "tags" : [ "cases" ],
        "summary" : "Change status ({\"status\":\"RESOLVED\",\"outcome\":\"RETAINED\"}); closing stores the outcome.",
        "description" : "Change status ({\"status\":\"RESOLVED\",\"outcome\":\"RETAINED\"}); closing stores the outcome. 403 {\"error\":\"followup_cases_disabled\"} when the campaign has cases switched off.",
        "operationId" : "postApiCasesIdStatus",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comment-tags" : {
      "get" : {
        "tags" : [ "comment-tags" ],
        "summary" : "Your account's comment tag vocabulary with counts, a 30-day trend, a reliable flag (false = too little data) and up to three quoted source comments.",
        "description" : "Your account's comment tag vocabulary with counts, a 30-day trend, a reliable flag (false = too little data) and up to three quoted source comments. Tags are added by hand, or proposed by the browser's built-in AI and then accepted by a person; each tag carries a `source` of HUMAN or AI and an `aiCount`, so the two can be told apart. Filter with ?q= (name contains) and ?source=HUMAN|AI.",
        "operationId" : "getApiCommentTags",
        "parameters" : [ {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "q",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "source",
          "in" : "query",
          "required" : false
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "post" : {
        "tags" : [ "comment-tags" ],
        "summary" : "Create a comment tag.",
        "description" : "Create a comment tag. {\"name\":\"Pris\",\"color\":\"#6c757d\"} — name is 1-40 characters and unique per account, case-insensitively. 400 when invalid or already used.",
        "operationId" : "postApiCommentTags",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comment-tags/{id}" : {
      "put" : {
        "tags" : [ "comment-tags" ],
        "summary" : "Rename and/or recolour a tag.",
        "description" : "Rename and/or recolour a tag. {\"name\":\"Pricing\",\"color\":\"#0d6efd\"}; existing tag assignments follow the rename.",
        "operationId" : "putApiCommentTagsId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Updated resource."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "delete" : {
        "tags" : [ "comment-tags" ],
        "summary" : "Delete a tag and remove it from every comment that carried it.",
        "description" : "Delete a tag and remove it from every comment that carried it.",
        "operationId" : "deleteApiCommentTagsId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The id.",
          "name" : "id",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Deleted; usually 204 with no body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comments/{responseId}/tags" : {
      "get" : {
        "tags" : [ "comments" ],
        "summary" : "Tags on one comment (your account's tags only).",
        "description" : "Tags on one comment (your account's tags only). Each tag carries a `source` of HUMAN or AI: who applied it to this comment, so an AI-applied tag is visible without a second lookup.",
        "operationId" : "getApiCommentsResponseIdTags",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The responseId.",
          "name" : "responseId",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "put" : {
        "tags" : [ "comments" ],
        "summary" : "Replace the whole tag set on one comment: {\"tagIds\":[1,4]}.",
        "description" : "Replace the whole tag set on one comment: {\"tagIds\":[1,4]}. Empty list clears the tags. Needs editor access to the campaign; a viewer or stranger gets 404.",
        "operationId" : "putApiCommentsResponseIdTags",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The responseId.",
          "name" : "responseId",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Updated resource."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comments" : {
      "get" : {
        "tags" : [ "comments" ],
        "summary" : "Search comments across every campaign you can reach: ?q= free text, ?tag=Name or ?tagId= (not both), ?source=HUMAN|AI (comments carrying a human- or model-ap…",
        "description" : "Search comments across every campaign you can reach: ?q= free text, ?tag=Name or ?tagId= (not both), ?source=HUMAN|AI (comments carrying a human- or model-applied tag), ?minRating= and ?maxRating= (0-10), ?categories=promoter,passive,detractor, ?campaignId=, ?dateFrom= and ?dateTo= (YYYY-MM-DD, inclusive), paged with ?page= (0-based) and ?size= (default 50, max 200). Every comment carries its tags[] with each tag's own source. An unknown tag name or a foreign tag id is an empty page, like a campaign you cannot see.",
        "operationId" : "getApiComments",
        "parameters" : [ {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "q",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "tag",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "tagId",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "source",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "minRating",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "maxRating",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "categories",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "campaignId",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "dateFrom",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "dateTo",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "page",
          "in" : "query",
          "required" : false
        }, {
          "schema" : {
            "type" : "string"
          },
          "description" : "See the endpoint description.",
          "name" : "size",
          "in" : "query",
          "required" : false
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "OK, JSON body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comments/{responseId}/tags/{tagId}" : {
      "post" : {
        "tags" : [ "comments" ],
        "summary" : "Add one tag to a comment and keep the rest: POST /api/comments/{responseId}/tags/{tagId}.",
        "description" : "Add one tag to a comment and keep the rest: POST /api/comments/{responseId}/tags/{tagId}. Returns the comment's resulting tag set. Needs editor access to the campaign; a viewer or stranger gets 404, and tagging twice is a no-op.",
        "operationId" : "postApiCommentsResponseIdTagsTagId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The responseId.",
          "name" : "responseId",
          "in" : "path",
          "required" : true
        }, {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The tagId.",
          "name" : "tagId",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      },
      "delete" : {
        "tags" : [ "comments" ],
        "summary" : "Remove one tag from a comment and leave the others: DELETE /api/comments/{responseId}/tags/{tagId}.",
        "description" : "Remove one tag from a comment and leave the others: DELETE /api/comments/{responseId}/tags/{tagId}. 204, also when the comment did not carry that tag. Same editor access rule as adding.",
        "operationId" : "deleteApiCommentsResponseIdTagsTagId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The responseId.",
          "name" : "responseId",
          "in" : "path",
          "required" : true
        }, {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The tagId.",
          "name" : "tagId",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Deleted; usually 204 with no body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comment-tags/ai-apply" : {
      "post" : {
        "tags" : [ "comment-tags" ],
        "summary" : "Save a tagging run produced in the user's browser: {\"model\":\"Gemini Nano\",\"browser\":\"Chrome/148\",\"assignments\":[{\"responseId\":12,\"tagIds\":[5]}],\"newTags\":[{\"…",
        "description" : "Save a tagging run produced in the user's browser: {\"model\":\"Gemini Nano\",\"browser\":\"Chrome/148\",\"assignments\":[{\"responseId\":12,\"tagIds\":[5]}],\"newTags\":[{\"name\":\"Onboarding\",\"color\":\"#0d6efd\",\"commentIds\":[12,14]}]}. Comments you may no longer edit are skipped and counted in the response; a tag id outside your account is a 404. Saved assignments are marked as AI and never overwrite human ones.",
        "operationId" : "postApiCommentTagsAiApply",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comment-tags/ai" : {
      "delete" : {
        "tags" : [ "comment-tags" ],
        "summary" : "Remove every AI-applied tag assignment for this account, then any AI-created tag left without comments.",
        "description" : "Remove every AI-applied tag assignment for this account, then any AI-created tag left without comments. Human tags and human assignments are untouched.",
        "operationId" : "deleteApiCommentTagsAi",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Deleted; usually 204 with no body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comment-tags/ai/runs/{runId}" : {
      "delete" : {
        "tags" : [ "comment-tags" ],
        "summary" : "Undo one AI save: remove the tag assignments that run applied, then any AI-created tag left without comments.",
        "description" : "Undo one AI save: remove the tag assignments that run applied, then any AI-created tag left without comments. Human tags, human assignments and other runs are untouched. 404 if the run is not yours.",
        "operationId" : "deleteApiCommentTagsAiRunsRunId",
        "parameters" : [ {
          "schema" : {
            "type" : "integer"
          },
          "description" : "The runId.",
          "name" : "runId",
          "in" : "path",
          "required" : true
        } ],
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Deleted; usually 204 with no body."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comment-tags/translations" : {
      "put" : {
        "tags" : [ "comment-tags" ],
        "summary" : "Set a tag's name in other languages: {\"tags\":[{\"tagId\":7,\"names\":{\"da\":\"Priser\"},\"source\":\"AI\"}]}.",
        "description" : "Set a tag's name in other languages: {\"tags\":[{\"tagId\":7,\"names\":{\"da\":\"Priser\"},\"source\":\"AI\"}]}. `name` stays the base name and is the fallback for any language without an entry; an empty name removes that language. Names must be unique per account within one language, case-insensitively — a clash is 400 and nothing is written; a tag id outside your account is 404. Same as editing the names on a tag in the app.",
        "operationId" : "putApiCommentTagsTranslations",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Updated resource."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    },
    "/api/comments/languages" : {
      "post" : {
        "tags" : [ "comments" ],
        "summary" : "Store the language a comment was written in: {\"detections\":[{\"responseId\":12,\"language\":\"da\",\"confidence\":0.93}]}.",
        "description" : "Store the language a comment was written in: {\"detections\":[{\"responseId\":12,\"language\":\"da\",\"confidence\":0.93}]}. Detection normally runs in the browser (on-device); this endpoint only stores the result. An empty language clears a previous detection. Codes are BCP-47 primary subtags (\"da\", \"en\"), normalised to lower case; a code that is not 2-3 letters is 400 and writes nothing. Needs editor access to the campaign per comment — comments that are gone or no longer editable are skipped and counted, not an error. `GET /api/comments` returns each comment's detectedLanguage.",
        "operationId" : "postApiCommentsLanguages",
        "security" : [ {
          "bearerAuth" : [ ]
        } ],
        "responses" : {
          "2XX" : {
            "description" : "Created (or the resulting resource)."
          },
          "400" : {
            "description" : "Invalid id, query parameter or JSON body."
          },
          "401" : {
            "description" : "Missing or invalid token: `{\"error\":\"HTTP 401\",\"kind\":\"api\",\"status\":401}`."
          },
          "404" : {
            "description" : "Unknown resource, or one belonging to another account (indistinguishable)."
          }
        }
      }
    }
  },
  "components" : {
    "securitySchemes" : {
      "respondentToken" : {
        "in" : "query",
        "description" : "The survey token from the respondent's link; no account needed.",
        "name" : "token",
        "type" : "apiKey"
      },
      "bearerAuth" : {
        "description" : "API token from Settings → API Tokens: `Authorization: Bearer <API_TOKEN>`.",
        "scheme" : "bearer",
        "type" : "http"
      }
    }
  }
}
