{
  "openapi": "3.1.0",
  "info": {
    "title": "Formzed API",
    "version": "1.0.0",
    "summary": "Forms, responses, prefilled links, payments, AI, AI Research and webhooks.",
    "description": "Formzed API v1. Base URL: https://api.formzed.com/v1.\n\nAuth: send your key as `X-API-Key: fz_...` or `Authorization: Bearer fz_...`. Keys are server-side secrets: never put one in a web page or app. Each operation lists its required scope (also in `x-scope`): responses:read, responses:write, responses:delete, forms:read, forms:write, payments:read, ai, interviews:read, interviews:write, webhooks.\n\nConventions: JSON in and out; ISO 8601 times (UTC). One item: { data }. Created: 201 { data }. Deleted: { data: { id, deleted: true } }. Lists: { data, next_cursor }, newest first, ?limit (1-200, default 50) and ?cursor. Errors: { error, code, ...extra }. Every keyed reply has X-Request-Id. Idempotency: send an Idempotency-Key header (1-255 characters) with a POST; a repeat with the same key and body within 24 hours returns the first answer with Idempotent-Replayed: true instead of running again (IDEMPOTENCY_KEY_REUSED 422 for a different body, IDEMPOTENCY_IN_PROGRESS 409 while the first runs).\n\nLimits: plan per-minute burst per key (RATE_LIMITED) and twice that for the whole account, all keys and connected apps together (ACCOUNT_RATE_LIMITED), the plan's monthly API requests plus API packs for all keys (MONTHLY_LIMIT), the key's daily cap 100-10,000 (KEY_DAILY_LIMIT); at most 25 active keys and connected apps per person; Retry-After says when to retry. Plans: Starter 5,000/month (60/min), Pro 25,000 (120/min), Growth 100,000 (300/min), Team Pro 10,000 per seat (120/min), Team Growth 40,000 per seat (300/min), Team Scale 100,000 per seat (600/min); Free and Team Free have no API. API packs: 10,000 for $10, 50,000 for $40, 250,000 for $150 (one-time, never expire).\n\nHuman docs: https://www.formzed.com/api-docs. Markdown for AI assistants: https://www.formzed.com/api-docs.md",
    "contact": {
      "url": "https://www.formzed.com/contact"
    }
  },
  "servers": [
    {
      "url": "https://api.formzed.com/v1",
      "description": "Formzed API v1"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Forms"
    },
    {
      "name": "Responses"
    },
    {
      "name": "Prefilled links"
    },
    {
      "name": "Payments"
    },
    {
      "name": "AI",
      "description": "Uses the key owner's AI credits."
    },
    {
      "name": "AI Research",
      "description": "Separate product from forms. Keys limited to one form can't use it."
    },
    {
      "name": "Evaluations",
      "description": "AI Training: human evaluation of AI outputs, part of AI Research. Keys limited to one form can't use it."
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Legacy",
      "description": "Older endpoint kept for existing integrations."
    },
    {
      "name": "Website forms",
      "description": "Public endpoint, no API key."
    }
  ],
  "paths": {
    "/forms": {
      "get": {
        "operationId": "listForms",
        "tags": [
          "Forms"
        ],
        "summary": "List forms",
        "description": "Forms the key can use (the owner's own and the team forms they can see), newest first. A key limited to one form lists only that form.\n\nRequired scope: `forms:read`.",
        "x-scope": "forms:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string",
              "enum": [
                "published",
                "draft"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of forms.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormList"
                },
                "example": {
                  "data": [
                    {
                      "id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                      "title": "Event sign-up",
                      "description": "Register for the October meetup.",
                      "status": "published",
                      "slug": "event-sign-up",
                      "url": "https://www.formzed.com/form/event-sign-up",
                      "created_at": "2026-10-01T09:12:44.512345+00:00",
                      "updated_at": "2026-10-02T16:03:10.118204+00:00",
                      "published_at": "2026-10-02T16:03:10.118204+00:00"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "post": {
        "operationId": "createForm",
        "tags": [
          "Forms"
        ],
        "summary": "Create a draft form",
        "description": "Creates a draft owned by the key's owner. Errors: KEY_FORM_RESTRICTED (one-form key), PLAN_LIMIT (plan's forms or questions).\n\nRequired scope: `forms:write`.",
        "x-scope": "forms:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "oneOf": [
                      {
                        "type": "string",
                        "maxLength": 5000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fields": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FieldInput"
                    },
                    "description": "Up to 300."
                  }
                }
              },
              "example": {
                "title": "Event sign-up",
                "fields": [
                  {
                    "type": "text",
                    "label": "Name",
                    "required": true
                  },
                  {
                    "type": "email",
                    "label": "Email",
                    "required": true
                  },
                  {
                    "type": "select",
                    "label": "Ticket",
                    "options": [
                      "Standard",
                      "VIP"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST (errors: FieldIssue[]).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/forms/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Form id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getForm",
        "tags": [
          "Forms"
        ],
        "summary": "Get a form with its fields",
        "description": "fields is the published version (the draft if never published); draft_fields appears when the draft differs.\n\nRequired scope: `forms:read`.",
        "x-scope": "forms:read",
        "responses": {
          "200": {
            "description": "The form.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                    "title": "Event sign-up",
                    "description": "Register for the October meetup.",
                    "status": "published",
                    "slug": "event-sign-up",
                    "url": "https://www.formzed.com/form/event-sign-up",
                    "created_at": "2026-10-01T09:12:44.512345+00:00",
                    "updated_at": "2026-10-02T16:03:10.118204+00:00",
                    "published_at": "2026-10-02T16:03:10.118204+00:00",
                    "fields": [
                      {
                        "id": "field-1712345678901",
                        "type": "text",
                        "label": "Name",
                        "required": true,
                        "placeholder": "Jane Cooper"
                      },
                      {
                        "id": "field-1712345678902",
                        "type": "email",
                        "label": "Email",
                        "required": true
                      },
                      {
                        "id": "field-1712345678903",
                        "type": "select",
                        "label": "Ticket",
                        "required": false,
                        "options": [
                          "Standard",
                          "VIP"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateForm",
        "tags": [
          "Forms"
        ],
        "summary": "Update a form's draft",
        "description": "Changes the draft only; publish to put it live. fields replaces the whole list; a list that keeps more than one Payment question (forms made before the one-per-form rule) is refused (422 VALIDATION_FAILED). Allowed for the owner and teammates with edit rights (else FORBIDDEN).\n\nRequired scope: `forms:write`.",
        "x-scope": "forms:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "oneOf": [
                      {
                        "type": "string",
                        "maxLength": 5000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fields": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FieldInput"
                    }
                  }
                }
              },
              "example": {
                "title": "Event sign-up (October)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The form.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED (errors: FieldIssue[]): more than one Payment question.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/forms/{id}/publish": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Form id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "publishForm",
        "tags": [
          "Forms"
        ],
        "summary": "Publish a form",
        "description": "Puts the draft live as a new version. Owner only, and only while they can edit the form (FORBIDDEN: a creator who became a viewer, or an archived or read-only workspace). Needs at least one field and valid calculated fields (422 VALIDATION_FAILED); payment forms need a priced item and connected Stripe (422 STRIPE_NOT_CONNECTED). No body.\n\nRequired scope: `forms:write`.",
        "x-scope": "forms:write",
        "responses": {
          "200": {
            "description": "The published form.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED (errors: FieldIssue[]) or STRIPE_NOT_CONNECTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/forms/{id}/duplicate": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Form id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "duplicateForm",
        "tags": [
          "Forms"
        ],
        "summary": "Copy a form",
        "description": "New draft \"Copy of <title>\" from the source draft and theme, owned by the key's owner. An older form's Payment questions are merged into one in the copy (422 VALIDATION_FAILED when they can't be merged safely). Errors: KEY_FORM_RESTRICTED, VALIDATION_FAILED, PLAN_LIMIT. No body.\n\nRequired scope: `forms:write`.",
        "x-scope": "forms:write",
        "responses": {
          "201": {
            "description": "The copy.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED: more than one Payment question, and they can't be merged safely.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/forms/{id}/responses": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Form id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listResponses",
        "tags": [
          "Responses"
        ],
        "summary": "List a form's responses",
        "description": "Newest first. File links are signed and open for 24 hours.\n\nRequired scope: `responses:read`.",
        "x-scope": "responses:read",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only items with a submission time at or after this time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Only items with a submission time at or before this time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "include_drafts",
            "in": "query",
            "required": false,
            "description": "Also return unfinished drafts.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "include_excluded",
            "in": "query",
            "required": false,
            "description": "Also return responses the form's team excluded from results (default false, like the app's exports).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of responses.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseList"
                },
                "example": {
                  "data": [
                    {
                      "id": "0b9c2f4e-7a1d-4c3b-9e8f-5d6a7b8c9d0e",
                      "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                      "submitted_at": "2026-10-13T18:02:45.123456+00:00",
                      "is_draft": false,
                      "answers": {
                        "field-1712345678901": "Jane Cooper",
                        "field-1712345678902": "jane@example.com",
                        "field-1712345678903": "VIP"
                      },
                      "answers_by_label": {
                        "Name": "Jane Cooper",
                        "Email": "jane@example.com",
                        "Ticket": "VIP"
                      },
                      "computed": {},
                      "source": "form",
                      "payment_status": null
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "post": {
        "operationId": "createResponse",
        "tags": [
          "Responses"
        ],
        "summary": "Submit a response",
        "description": "Saves a response to a published form, validated like the hosted form. Runs automations, sends response.created webhooks, counts toward the owner's monthly responses. Errors: FORM_NOT_PUBLISHED, RESPONSE_LIMIT (403), VALIDATION_FAILED (422).\n\nRequired scope: `responses:write`.",
        "x-scope": "responses:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Answers keyed by field id."
                  }
                }
              },
              "example": {
                "data": {
                  "field-1712345678901": "Jane Cooper",
                  "field-1712345678902": "jane@example.com",
                  "field-1712345678903": "VIP"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Saved.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResponseCreated"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0b9c2f4e-7a1d-4c3b-9e8f-5d6a7b8c9d0e",
                    "computed": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED (errors: ValidationIssue[]).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Validation failed",
                  "code": "VALIDATION_FAILED",
                  "errors": [
                    {
                      "field_id": "field-1712345678902",
                      "message": "\"Email\" is required"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/forms/{id}/responses/import": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Form id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "importResponses",
        "tags": [
          "Responses"
        ],
        "summary": "Import up to 500 responses",
        "description": "Each row is validated; failed rows are reported and the rest saved. One API request; each saved row counts toward monthly responses in the month imported. run_automations false (default) runs no automations and sends no webhooks. If the monthly response limit is reached the call stops with 403 RESPONSE_LIMIT plus imported, ids, failed and stopped_at.\n\nRequired scope: `responses:write`.",
        "x-scope": "responses:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "responses"
                ],
                "properties": {
                  "responses": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "data"
                      ],
                      "properties": {
                        "data": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "submitted_at": {
                          "type": "string",
                          "description": "Original time; not in the future.",
                          "format": "date-time"
                        }
                      }
                    },
                    "description": "1 to 500 rows."
                  },
                  "run_automations": {
                    "type": "boolean",
                    "description": "Default false."
                  }
                }
              },
              "example": {
                "responses": [
                  {
                    "data": {
                      "field-1712345678901": "Ann Lee",
                      "field-1712345678902": "ann@example.com"
                    },
                    "submitted_at": "2026-09-01T10:00:00Z"
                  },
                  {
                    "data": {
                      "field-1712345678901": "Bob Stone",
                      "field-1712345678902": "bob@example.com"
                    }
                  }
                ],
                "run_automations": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import summary.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImportResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/responses/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Response id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getResponse",
        "tags": [
          "Responses"
        ],
        "summary": "Get a response",
        "description": "One response.\n\nRequired scope: `responses:read`.",
        "x-scope": "responses:read",
        "responses": {
          "200": {
            "description": "The response.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Response"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0b9c2f4e-7a1d-4c3b-9e8f-5d6a7b8c9d0e",
                    "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                    "submitted_at": "2026-10-13T18:02:45.123456+00:00",
                    "is_draft": false,
                    "answers": {
                      "field-1712345678901": "Jane Cooper",
                      "field-1712345678902": "jane@example.com",
                      "field-1712345678903": "VIP"
                    },
                    "answers_by_label": {
                      "Name": "Jane Cooper",
                      "Email": "jane@example.com",
                      "Ticket": "VIP"
                    },
                    "computed": {},
                    "source": "form",
                    "payment_status": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateResponse",
        "tags": [
          "Responses"
        ],
        "summary": "Edit a response",
        "description": "Merges data into the saved answers (null clears one) and validates the whole response again. Drafts can't be edited (400). Needs edit rights (FORBIDDEN). Sends response.updated webhooks when answers change.\n\nRequired scope: `responses:write`.",
        "x-scope": "responses:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Answers to change, keyed by field id."
                  }
                }
              },
              "example": {
                "data": {
                  "field-1712345678903": "Standard"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated response.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Response"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteResponse",
        "tags": [
          "Responses"
        ],
        "summary": "Delete a response",
        "description": "Deletes the response and its uploaded files. Needs edit rights (FORBIDDEN). Sends response.deleted webhooks.\n\nRequired scope: `responses:delete`.",
        "x-scope": "responses:delete",
        "responses": {
          "200": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deleted"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0b9c2f4e-7a1d-4c3b-9e8f-5d6a7b8c9d0e",
                    "deleted": true
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/erasure": {
      "post": {
        "operationId": "eraseByEmail",
        "tags": [
          "Responses"
        ],
        "summary": "Erase a person's data by email",
        "description": "On every form the key can change: deletes responses (submitted or draft) and prefilled links with an answer equal to the email (case-insensitive, trimmed), removes their files, and clears the email from payments.\n\nRequired scope: `responses:delete`.",
        "x-scope": "responses:delete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              },
              "example": {
                "email": "jane@example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was erased.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ErasureResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/forms/{id}/prefill-links": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Form id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listPrefillLinks",
        "tags": [
          "Prefilled links"
        ],
        "summary": "List prefilled links",
        "description": "A form's prefilled links, newest first.\n\nRequired scope: `forms:read`.",
        "x-scope": "forms:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of links.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefillLinkList"
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "post": {
        "operationId": "createPrefillLink",
        "tags": [
          "Prefilled links"
        ],
        "summary": "Create a prefilled link",
        "description": "A link (https://www.formzed.com/form/<slug or id>?prefill=<token>) that opens the form with answers filled in. Only fields of the published form; never files, signatures, payments, terms or calculated fields. Bad answers: 400 BAD_REQUEST with errors: FieldIssue[].\n\nRequired scope: `forms:write`.",
        "x-scope": "forms:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "answers"
                ],
                "properties": {
                  "answers": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Field id -> value."
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "expires_in_days": {
                    "type": "integer",
                    "description": "Default 30.",
                    "minimum": 1,
                    "maximum": 365
                  },
                  "max_uses": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "description": "Default null (no limit).",
                        "minimum": 1,
                        "maximum": 1000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              "example": {
                "answers": {
                  "field-1712345678901": "Jane Cooper",
                  "field-1712345678902": "jane@example.com"
                },
                "expires_in_days": 14,
                "max_uses": 1
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PrefillLink"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/prefill-links/{token}": {
      "parameters": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "description": "The link's token.",
          "schema": {
            "type": "string",
            "pattern": "^[0-9a-f]{16,128}$"
          }
        }
      ],
      "delete": {
        "operationId": "deletePrefillLink",
        "tags": [
          "Prefilled links"
        ],
        "summary": "Delete a prefilled link",
        "description": "The link stops filling in answers.\n\nRequired scope: `forms:write`.",
        "x-scope": "forms:write",
        "responses": {
          "200": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "token",
                        "deleted"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/payments": {
      "get": {
        "operationId": "listPayments",
        "tags": [
          "Payments"
        ],
        "summary": "List payments",
        "description": "Payments on forms the key can use, newest first. Amounts in the currency's main unit.\n\nRequired scope: `payments:read`.",
        "x-scope": "payments:read",
        "parameters": [
          {
            "name": "form_id",
            "in": "query",
            "required": false,
            "description": "Only this form's payments.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string",
              "enum": [
                "paid",
                "pending",
                "refunded"
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Stripe live or test mode.",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "test"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only items with a creation time at or after this time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Only items with a creation time at or before this time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of payments.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentList"
                },
                "example": {
                  "data": [
                    {
                      "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                      "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                      "response_id": "0b9c2f4e-7a1d-4c3b-9e8f-5d6a7b8c9d0e",
                      "status": "paid",
                      "amount": 49,
                      "currency": "usd",
                      "mode": "live",
                      "items": [
                        {
                          "product_id": "vip",
                          "name": "VIP ticket",
                          "unit_amount": 49,
                          "quantity": 1,
                          "subtotal": 49,
                          "file": null
                        }
                      ],
                      "coupon_code": null,
                      "discount": 0,
                      "payer_email": "jane@example.com",
                      "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoV",
                      "created_at": "2026-10-13T18:02:51.004812+00:00",
                      "paid_at": "2026-10-13T18:03:40.551093+00:00"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/payments/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Payment id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getPayment",
        "tags": [
          "Payments"
        ],
        "summary": "Get a payment",
        "description": "One payment.\n\nRequired scope: `payments:read`.",
        "x-scope": "payments:read",
        "responses": {
          "200": {
            "description": "The payment.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Payment"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                    "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                    "response_id": "0b9c2f4e-7a1d-4c3b-9e8f-5d6a7b8c9d0e",
                    "status": "paid",
                    "amount": 49,
                    "currency": "usd",
                    "mode": "live",
                    "items": [
                      {
                        "product_id": "vip",
                        "name": "VIP ticket",
                        "unit_amount": 49,
                        "quantity": 1,
                        "subtotal": 49,
                        "file": null
                      }
                    ],
                    "coupon_code": null,
                    "discount": 0,
                    "payer_email": "jane@example.com",
                    "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoV",
                    "created_at": "2026-10-13T18:02:51.004812+00:00",
                    "paid_at": "2026-10-13T18:03:40.551093+00:00"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "PAYMENT_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/ai/ask": {
      "post": {
        "operationId": "aiAsk",
        "tags": [
          "AI"
        ],
        "summary": "Ask a question about a form's responses",
        "description": "Answers from submitted responses (newest first, up to about 120,000 characters). Uses the key owner's AI credits: 402 CREDITS_EXHAUSTED when none are left; 502 AI_ERROR when the model fails.\n\nRequired scope: `ai`.",
        "x-scope": "ai",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "form_id",
                  "question"
                ],
                "properties": {
                  "form_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "question": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "since": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "until": {
                    "type": "string",
                    "description": "Inclusive.",
                    "format": "date-time"
                  }
                }
              },
              "example": {
                "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                "question": "What do people say about the venue?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AiAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "CREDITS_EXHAUSTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "description": "AI_ERROR.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/ai/summary": {
      "post": {
        "operationId": "aiSummary",
        "tags": [
          "AI"
        ],
        "summary": "Summarize a form's responses",
        "description": "A summary and the main themes with counts and example quotes. Uses AI credits.\n\nRequired scope: `ai`.",
        "x-scope": "ai",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "form_id"
                ],
                "properties": {
                  "form_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "since": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "until": {
                    "type": "string",
                    "description": "Inclusive.",
                    "format": "date-time"
                  }
                }
              },
              "example": {
                "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                "since": "2026-10-01T00:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The summary.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AiSummary"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "CREDITS_EXHAUSTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "description": "AI_ERROR.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/studies": {
      "get": {
        "operationId": "listStudies",
        "tags": [
          "AI Research"
        ],
        "summary": "List AI Research studies",
        "description": "Studies of the key owner and everyone sharing a workspace with them, newest first. Interview studies only: evaluation studies are /evaluations. One-form keys get 403 KEY_RESTRICTED.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of studies.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudyList"
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "post": {
        "operationId": "createStudy",
        "tags": [
          "AI Research"
        ],
        "summary": "Create a draft study",
        "description": "Draft study (15-minute interviews, ages 18-65); publish it in the dashboard. Without questions, the AI drafts the guide and screener and research AI credits are used (402 CREDITS_EXHAUSTED, 502 AI_ERROR).\n\nRequired scope: `interviews:write`.",
        "x-scope": "interviews:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "idea"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "idea": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 4000
                  },
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "description": "1 to 12 questions."
                  },
                  "modes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "chat",
                        "voice",
                        "voice_to_voice",
                        "video"
                      ]
                    },
                    "description": "Default [\"chat\"]."
                  },
                  "language": {
                    "type": "string",
                    "description": "Default \"en\".",
                    "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,4})?$"
                  }
                }
              },
              "example": {
                "title": "Onboarding interviews",
                "idea": "Learn what slows new customers down in their first week.",
                "questions": [
                  "Walk me through your first day with the product."
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Study"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "CREDITS_EXHAUSTED (research AI credits).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "description": "AI_ERROR.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/studies/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Study id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getStudy",
        "tags": [
          "AI Research"
        ],
        "summary": "Get a study",
        "description": "With its guide and screener questions.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "responses": {
          "200": {
            "description": "The study.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Study"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "STUDY_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/studies/{id}/report": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Study id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getStudyReport",
        "tags": [
          "AI Research"
        ],
        "summary": "Get a study's report",
        "description": "The latest report: summary, themes with respondent_count (checked against each person's own words) and quotes, notable_quotes, sentiment, and exercises (MaxDiff and concept-test results counted in code). interviews_since_report: interviews newer than the report. interviews_removed_since_report: interviews the report counted that were removed since; while it is above 0, interview_count and the theme counts leave them out, summary is a note without figures, sentiment is all 0 and exercises is empty until the report is updated in Formzed. Respondents by number only.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "responses": {
          "200": {
            "description": "The report.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "study_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "report_updated_at": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "interviews_since_report": {
                          "type": "integer"
                        },
                        "interviews_removed_since_report": {
                          "type": "integer"
                        },
                        "interview_count": {
                          "type": "integer"
                        },
                        "summary": {
                          "type": "string"
                        },
                        "themes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "respondent_count": {
                                "type": "integer"
                              },
                              "quotes": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "respondent_no": {
                                      "type": "integer"
                                    },
                                    "quote": {
                                      "type": "string"
                                    },
                                    "translation": {
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "notable_quotes": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "sentiment": {
                          "type": "object",
                          "properties": {
                            "positive": {
                              "type": "integer"
                            },
                            "neutral": {
                              "type": "integer"
                            },
                            "negative": {
                              "type": "integer"
                            },
                            "mixed": {
                              "type": "integer"
                            }
                          }
                        },
                        "exercises": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "description": "kind maxdiff (items with shown, best, worst, score -100..100), concept (concepts with ratings, average, top_two, first_average, preferred; choosers; preference with p, significant, verdict) or likert (a rating scale: points, labels lowest first, dont_know_label, respondents, other_scale; statements with answers, rated, distribution and percent per point, dont_know, top_two, top_two_pct, bottom_two, bottom_two_pct, median, median_label)."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "STUDY_NOT_FOUND or REPORT_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/studies/{id}/interviews": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Study id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listInterviews",
        "tags": [
          "AI Research"
        ],
        "summary": "List a study's interviews",
        "description": "Newest first by start time. No participant contact details; names shortened to first name + last initial.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "completed",
                "active",
                "abandoned",
                "ended_by_owner"
              ],
              "default": "all"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only items with a start time at or after this time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Only items with a start time at or before this time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of interviews.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InterviewList"
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "STUDY_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/interviews/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Interview id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getInterview",
        "tags": [
          "AI Research"
        ],
        "summary": "Get an interview with its transcript",
        "description": "Up to 1,000 transcript turns. Typed emails and phone numbers are removed.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "responses": {
          "200": {
            "description": "The interview.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewDetail"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "INTERVIEW_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "description": "The key owner's webhooks (a one-form key: that form's only), newest first.\n\nRequired scope: `webhooks`.",
        "x-scope": "webhooks",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of webhooks.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "post": {
        "operationId": "createWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook",
        "description": "Up to 20 per account (403 WEBHOOK_LIMIT). The URL must be public https (400 INVALID_URL). interview.completed needs a webhook without form_id. The reply includes the signing secret.\n\nRequired scope: `webhooks`.",
        "x-scope": "webhooks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2000
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/WebhookEventType"
                    },
                    "description": "At least one."
                  },
                  "form_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "description": "Only this form's events; null for every form.",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": {
                    "oneOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              "example": {
                "url": "https://hooks.example.com/formzed",
                "events": [
                  "response.created"
                ],
                "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                "description": "CRM sync"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookWithSecret"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
                    "url": "https://hooks.example.com/formzed",
                    "events": [
                      "response.created",
                      "payment.succeeded"
                    ],
                    "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                    "description": "CRM sync",
                    "is_active": true,
                    "disabled_reason": null,
                    "consecutive_failures": 0,
                    "last_delivery_at": null,
                    "last_status": null,
                    "created_at": "2026-10-03T08:00:00.120934+00:00",
                    "updated_at": "2026-10-03T08:00:00.120934+00:00",
                    "secret": "whsec_0123456789abcdef0123456789abcdef0123456789abcdef"
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST or INVALID_URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/webhooks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Webhook id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a webhook",
        "description": "One webhook (without its secret).\n\nRequired scope: `webhooks`.",
        "x-scope": "webhooks",
        "responses": {
          "200": {
            "description": "The webhook.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
                    "url": "https://hooks.example.com/formzed",
                    "events": [
                      "response.created",
                      "payment.succeeded"
                    ],
                    "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                    "description": "CRM sync",
                    "is_active": true,
                    "disabled_reason": null,
                    "consecutive_failures": 0,
                    "last_delivery_at": null,
                    "last_status": null,
                    "created_at": "2026-10-03T08:00:00.120934+00:00",
                    "updated_at": "2026-10-03T08:00:00.120934+00:00"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "WEBHOOK_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook",
        "description": "Send only what changes. A new URL resets the failure count; is_active true clears disabled_reason.\n\nRequired scope: `webhooks`.",
        "x-scope": "webhooks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/WebhookEventType"
                    }
                  },
                  "form_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": {
                    "oneOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "is_active": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST or INVALID_URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "WEBHOOK_NOT_FOUND or FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook",
        "description": "Removes the webhook and its delivery log.\n\nRequired scope: `webhooks`.",
        "x-scope": "webhooks",
        "responses": {
          "200": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deleted"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "WEBHOOK_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Webhook id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "testWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test event",
        "description": "Queues a webhook.test delivery, sent within about a minute. 409 WEBHOOK_DISABLED when the webhook is off. No body.\n\nRequired scope: `webhooks`.",
        "x-scope": "webhooks",
        "responses": {
          "201": {
            "description": "The queued delivery.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Delivery"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "WEBHOOK_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "WEBHOOK_DISABLED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/webhooks/{id}/deliveries": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Webhook id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listDeliveries",
        "tags": [
          "Webhooks"
        ],
        "summary": "List deliveries",
        "description": "Delivery log, newest first, with payloads. Finished deliveries are kept 30 days.\n\nRequired scope: `webhooks`.",
        "x-scope": "webhooks",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivered",
                "failed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deliveries.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryList"
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "WEBHOOK_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/submit-response": {
      "servers": [
        {
          "url": "https://api.formzed.com"
        }
      ],
      "post": {
        "operationId": "submitResponseLegacy",
        "tags": [
          "Legacy"
        ],
        "summary": "Submit a response (legacy)",
        "description": "Legacy endpoint, still supported: same as POST /forms/{id}/responses with the form id in the body. Success is 200 { success, response_id, message }. A key limited to another form gets 403 FORM_NOT_ALLOWED. Other errors, limits and headers as API v1.\n\nRequired scope: `responses:write`.",
        "x-scope": "responses:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitResponseRequest"
              },
              "example": {
                "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                "data": {
                  "field-1712345678901": "Jane Cooper",
                  "field-1712345678902": "jane@example.com"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponseSuccess"
                },
                "example": {
                  "success": true,
                  "response_id": "0b9c2f4e-7a1d-4c3b-9e8f-5d6a7b8c9d0e",
                  "message": "Response submitted successfully"
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "FORM_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED: use POST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/forms/submit": {
      "servers": [
        {
          "url": "https://api.formzed.com"
        }
      ],
      "post": {
        "operationId": "submitFormResponse",
        "tags": [
          "Website forms"
        ],
        "summary": "Submit a response from your own website form (no API key)",
        "description": "Public endpoint for website forms: call it from the browser, CORS is open, no key. Validated like the hosted form. 100 submissions per hour from one connection to one form. Doesn't use API requests; counts toward the owner's monthly responses and runs automations.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitFormResponseRequest",
                "properties": {
                  "data": {
                    "type": "object",
                    "description": "Same as answers (the v1 API's name). Send one of the two."
                  },
                  "_hp": {
                    "type": "string",
                    "description": "Spam trap: a hidden input people never fill in. When not empty the reply looks normal, but nothing is saved."
                  }
                }
              },
              "example": {
                "form_id": "6f1c2b9e-3d4a-4e5f-8a7b-1c2d3e4f5a6b",
                "answers": {
                  "field-1712345678901": "Jane Cooper",
                  "field-1712345678902": "jane@example.com"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "computed"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "computed": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/components/schemas/CalcResult"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or form_id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                }
              }
            }
          },
          "403": {
            "description": "RESPONSE_LIMIT.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                }
              }
            }
          },
          "404": {
            "description": "Form not found or not published.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                }
              }
            }
          },
          "413": {
            "description": "Body over 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed (errors: ValidationIssue[]).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                }
              }
            }
          }
        }
      }
    },
    "/evaluations": {
      "get": {
        "operationId": "listEvaluations",
        "tags": [
          "Evaluations"
        ],
        "summary": "List evaluations",
        "description": "Evaluation studies of the key owner and everyone sharing a workspace with them, newest first.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of evaluations.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluationList"
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "post": {
        "operationId": "createEvaluation",
        "tags": [
          "Evaluations"
        ],
        "summary": "Create an evaluation",
        "description": "A draft evaluation study. Add files and items, then publish. Each rater session counts as one interview of the AI Research plan when the rater finishes it.\n\nRequired scope: `interviews:write`.",
        "x-scope": "interviews:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "task"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "task": {
                    "type": "string",
                    "enum": [
                      "pairwise",
                      "rubric",
                      "write_edit",
                      "task_success",
                      "media_label",
                      "translation_check",
                      "model_chat",
                      "agent_review",
                      "battle",
                      "prompt_write"
                    ]
                  },
                  "instructions": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "raters_per_item": {
                    "type": "integer",
                    "enum": [
                      3,
                      4,
                      5
                    ]
                  },
                  "items_per_session": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50
                  },
                  "gold_per_session": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  },
                  "criteria": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "label"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-z0-9_]{1,40}$"
                        },
                        "label": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    },
                    "maxItems": 8
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "label"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-z0-9_]{1,40}$"
                        },
                        "label": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    },
                    "maxItems": 50
                  },
                  "multi_label": {
                    "type": "boolean"
                  },
                  "moments": {
                    "type": "boolean"
                  },
                  "boxes": {
                    "type": "boolean",
                    "description": "media_label: raters draw a labelled box around each thing on images and video frames."
                  },
                  "reply_scores": {
                    "type": "boolean",
                    "description": "model_chat: raters score every reply of the model 1-5 as they chat."
                  },
                  "with_answer": {
                    "type": "boolean",
                    "description": "prompt_write: raters also write the ideal answer to their prompt."
                  },
                  "coverage": {
                    "type": "string",
                    "enum": ["per_item", "every_rater"],
                    "description": "per_item (default): each item is rated by raters_per_item raters. every_rater: every rater rates every item in a shuffled order (up to 50 items, sessions up to 60 minutes; not for agent_review), until target_raters raters are counted. The item set can't change once the study is live or a rater has started."
                  },
                  "target_raters": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "every_rater: how many raters to collect (Paid Research up to 1,000)."
                  },
                  "qualification": {
                    "type": "object",
                    "description": "A check before a rater's first real item, on the study's gold items: on, items (3-10), pass_share (0.5-1). Failing ends the session, not counted or paid.",
                    "properties": { "on": { "type": "boolean" }, "items": { "type": "integer", "minimum": 3, "maximum": 10 }, "pass_share": { "type": "number", "minimum": 0.5, "maximum": 1 } }
                  },
                  "battle_mode": {
                    "type": "string",
                    "enum": ["one_shot", "chat", "every_turn"],
                    "description": "battle: one message and one vote, a whole chat with one vote at the end (default), or a vote on every pair of replies (the picked reply carries on)."
                  },
                  "allow_tie": {
                    "type": "boolean"
                  },
                  "reason_required": {
                    "type": "boolean"
                  },
                  "write_mode": {
                    "type": "string",
                    "enum": [
                      "write",
                      "edit"
                    ]
                  },
                  "review_required": {
                    "type": "boolean"
                  },
                  "categories": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "label"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-z0-9_]{1,40}$"
                        },
                        "label": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    },
                    "maxItems": 20
                  },
                  "max_turns": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$"
                    },
                    "maxItems": 30
                  },
                  "content_warning": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              },
              "example": {
                "title": "Support bot: v2 vs v1",
                "task": "pairwise",
                "raters_per_item": 3
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Evaluation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "KEY_RESTRICTED or PLAN_LIMIT (limit: studies).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/evaluations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Evaluation id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getEvaluation",
        "tags": [
          "Evaluations"
        ],
        "summary": "Get an evaluation",
        "description": "The evaluation with its task, settings and progress.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "responses": {
          "200": {
            "description": "The evaluation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Evaluation"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "EVALUATION_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/evaluations/{id}/media": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Evaluation id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "createEvaluationMedia",
        "tags": [
          "Evaluations"
        ],
        "summary": "Upload a file",
        "description": "An upload slot for one image, audio or video file: PUT the file to upload.url with upload.headers within 2 hours, then complete it.\n\nRequired scope: `interviews:write`.",
        "x-scope": "interviews:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "mime",
                  "bytes"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "mime": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "duration_ms": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The slot.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "media_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "upload": {
                          "type": "object",
                          "properties": {
                            "method": {
                              "type": "string",
                              "enum": [
                                "PUT"
                              ]
                            },
                            "url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "headers": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "expires_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "FORBIDDEN, KEY_RESTRICTED or MEDIA_LIMIT.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "EVALUATION_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/evaluations/{id}/media/{media_id}/complete": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Evaluation id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "media_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "completeEvaluationMedia",
        "tags": [
          "Evaluations"
        ],
        "summary": "Finish an upload",
        "description": "Checks the uploaded file and makes it usable in items.\n\nRequired scope: `interviews:write`.",
        "x-scope": "interviews:write",
        "responses": {
          "200": {
            "description": "Ready.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "media_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "ready"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "FORBIDDEN or KEY_RESTRICTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "EVALUATION_NOT_FOUND or MEDIA_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "MEDIA_NOT_UPLOADED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/evaluations/{id}/items": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Evaluation id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "addEvaluationItems",
        "tags": [
          "Evaluations"
        ],
        "summary": "Add items",
        "description": "Up to 1,000 items (2 MB) a request, all or nothing: JSONL (application/x-ndjson, the dashboard import's format) or JSON {items: [...]}. A study holds 20,000 items, deleted ones included.\n\nRequired scope: `interviews:write`.",
        "x-scope": "interviews:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-ndjson": {
              "schema": {
                "type": "string",
                "description": "One item (a JSON object) a line."
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "maxItems": 1000,
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "added": {
                          "type": "integer"
                        },
                        "first_seq": {
                          "type": "integer"
                        },
                        "last_seq": {
                          "type": "integer"
                        },
                        "total_items": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "FORBIDDEN, KEY_RESTRICTED or ITEM_LIMIT (limit: items).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "EVALUATION_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED: nothing was added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "line": {
                            "type": "integer"
                          },
                          "field": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/evaluations/{id}/publish": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Evaluation id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "publishEvaluation",
        "tags": [
          "Evaluations"
        ],
        "summary": "Publish an evaluation",
        "description": "Opens the evaluation's link to raters.\n\nRequired scope: `interviews:write`.",
        "x-scope": "interviews:write",
        "responses": {
          "200": {
            "description": "Published.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Evaluation"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "FORBIDDEN or KEY_RESTRICTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "EVALUATION_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "NOT_READY.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "problems": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/evaluations/{id}/summary": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Evaluation id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getEvaluationSummary",
        "tags": [
          "Evaluations"
        ],
        "summary": "Get the figures",
        "description": "The figures of the dashboard's Results tab, computed in code from counted sessions only: totals, coverage_by_language, agreement (percent and Krippendorff's alpha) and the block of the study's task (pairwise win rates with a 95% interval and head-to-head, rubric scores, labels, …); the other tasks' blocks are null.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "responses": {
          "200": {
            "description": "The figures.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "title",
                        "status",
                        "results"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "title": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "live",
                            "paused",
                            "finished"
                          ]
                        },
                        "results": {
                          "type": "object",
                          "description": "totals, coverage_by_language, agreement, and one block per task (null unless it is the study's task).",
                          "additionalProperties": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "EVALUATION_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/evaluations/{id}/results": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Evaluation id.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getEvaluationResults",
        "tags": [
          "Evaluations"
        ],
        "summary": "Get results",
        "description": "A dataset page as text, 5,000 rows a page (or limit); X-Next-Cursor when there's more. Only counted sessions' ratings (include_held adds held ones). Raters as numbers only. 409 RESULTS_CHANGED when ratings changed between pages: start again without a cursor.\n\nRequired scope: `interviews:read`.",
        "x-scope": "interviews:read",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "jsonl",
                "csv"
              ]
            }
          },
          {
            "name": "dataset",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "preference",
                "ideal",
                "labels",
                "steps",
                "replies",
                "prompts",
                "matrix",
                "full"
              ]
            },
            "description": "Default: the task's first (preference, ideal, labels, steps, replies, prompts, matrix or full). matrix: every-rater studies, one row per rater and one column per item."
          },
          {
            "name": "min_agreement",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "include_held",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "per",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "rating",
                "item"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000,
              "default": 5000
            },
            "description": "Rows a page."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the dataset.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-Monthly-Limit": {
                "$ref": "#/components/headers/X-Monthly-Limit"
              },
              "X-Monthly-Remaining": {
                "$ref": "#/components/headers/X-Monthly-Remaining"
              },
              "X-Next-Cursor": {
                "description": "The next page's cursor (absent on the last page).",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "BAD_REQUEST.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "EVALUATION_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "RESULTS_CHANGED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    }
  },
  "webhooks": {
    "response.created": {
      "post": {
        "summary": "response.created",
        "description": "A response is submitted (hosted form, website form or API) or a draft is submitted. Not sent for imports with run_automations false.\n\nAnswer 2xx within 10 seconds. Otherwise retried after 1m, 5m, 30m, 2h, 6h, 12h and 24h (8 attempts), then failed; 50 failures in a row turn the webhook off. Redirects aren't followed.",
        "parameters": [
          {
            "name": "Formzed-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "Formzed-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Delivery id, the same on every retry."
          },
          {
            "name": "Formzed-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret>. Reject old timestamps (for example over 5 minutes)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "response.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/ResponseEventData"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    },
    "response.updated": {
      "post": {
        "summary": "response.updated",
        "description": "A submitted response's answers change.\n\nAnswer 2xx within 10 seconds. Otherwise retried after 1m, 5m, 30m, 2h, 6h, 12h and 24h (8 attempts), then failed; 50 failures in a row turn the webhook off. Redirects aren't followed.",
        "parameters": [
          {
            "name": "Formzed-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "Formzed-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Delivery id, the same on every retry."
          },
          {
            "name": "Formzed-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret>. Reject old timestamps (for example over 5 minutes)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "response.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/ResponseEventData"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    },
    "response.deleted": {
      "post": {
        "summary": "response.deleted",
        "description": "A submitted response is deleted (dashboard, API or erasure). Carries ids only; earlier deliveries with its answers are removed.\n\nAnswer 2xx within 10 seconds. Otherwise retried after 1m, 5m, 30m, 2h, 6h, 12h and 24h (8 attempts), then failed; 50 failures in a row turn the webhook off. Redirects aren't followed.",
        "parameters": [
          {
            "name": "Formzed-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "Formzed-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Delivery id, the same on every retry."
          },
          {
            "name": "Formzed-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret>. Reject old timestamps (for example over 5 minutes)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "response.deleted"
                      },
                      "data": {
                        "$ref": "#/components/schemas/ResponseDeletedEventData"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    },
    "payment.succeeded": {
      "post": {
        "summary": "payment.succeeded",
        "description": "A payment's status becomes paid.\n\nAnswer 2xx within 10 seconds. Otherwise retried after 1m, 5m, 30m, 2h, 6h, 12h and 24h (8 attempts), then failed; 50 failures in a row turn the webhook off. Redirects aren't followed.",
        "parameters": [
          {
            "name": "Formzed-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "Formzed-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Delivery id, the same on every retry."
          },
          {
            "name": "Formzed-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret>. Reject old timestamps (for example over 5 minutes)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "payment.succeeded"
                      },
                      "data": {
                        "$ref": "#/components/schemas/PaymentEventData"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    },
    "payment.refunded": {
      "post": {
        "summary": "payment.refunded",
        "description": "A payment's status becomes refunded.\n\nAnswer 2xx within 10 seconds. Otherwise retried after 1m, 5m, 30m, 2h, 6h, 12h and 24h (8 attempts), then failed; 50 failures in a row turn the webhook off. Redirects aren't followed.",
        "parameters": [
          {
            "name": "Formzed-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "Formzed-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Delivery id, the same on every retry."
          },
          {
            "name": "Formzed-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret>. Reject old timestamps (for example over 5 minutes)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "payment.refunded"
                      },
                      "data": {
                        "$ref": "#/components/schemas/PaymentEventData"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    },
    "interview.completed": {
      "post": {
        "summary": "interview.completed",
        "description": "An AI interview finishes: it reached the end of the guide, or has at least 3 answers. Sent once per interview: when its AI summary is saved (summary included), or within about 10 minutes of the interview ending or going idle if no summary is written. Only for webhooks without form_id.\n\nAnswer 2xx within 10 seconds. Otherwise retried after 1m, 5m, 30m, 2h, 6h, 12h and 24h (8 attempts), then failed; 50 failures in a row turn the webhook off. Redirects aren't followed. Emails and phone numbers typed into the summary are removed; interviews hidden from the study team are never sent.",
        "parameters": [
          {
            "name": "Formzed-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "Formzed-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Delivery id, the same on every retry."
          },
          {
            "name": "Formzed-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret>. Reject old timestamps (for example over 5 minutes)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "interview.completed"
                      },
                      "data": {
                        "$ref": "#/components/schemas/InterviewEventData"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    },
    "webhook.test": {
      "post": {
        "summary": "webhook.test",
        "description": "Sent by Send test in the dashboard or POST /webhooks/{id}/test.\n\nAnswer 2xx within 10 seconds. Otherwise retried after 1m, 5m, 30m, 2h, 6h, 12h and 24h (8 attempts), then failed; 50 failures in a row turn the webhook off. Redirects aren't followed.",
        "parameters": [
          {
            "name": "Formzed-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "Formzed-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Delivery id, the same on every retry."
          },
          {
            "name": "Formzed-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret>. Reject old timestamps (for example over 5 minutes)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "webhook.test"
                      },
                      "data": {
                        "$ref": "#/components/schemas/TestEventData"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Create keys at https://www.formzed.com/dashboard/api-keys. Keys start with fz_ and are shown once. Keep them on your server."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same fz_ key as a Bearer token."
      }
    },
    "parameters": {
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Items per page.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "next_cursor of the previous page.",
        "schema": {
          "type": "string"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Any unique string (1-255 characters). A repeat with the same key and body within 24 hours returns the first answer (header Idempotent-Replayed: true) instead of running again.",
        "schema": {
          "type": "string",
          "maxLength": 255
        }
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "Unique id of this request. Quote it to support.",
        "schema": {
          "type": "string"
        }
      },
      "X-RateLimit-Limit": {
        "description": "Requests per minute per key on the plan. Omitted when unlimited.",
        "schema": {
          "type": "integer"
        }
      },
      "X-Monthly-Limit": {
        "description": "This month's API requests (plan plus unused packs). Omitted when unlimited.",
        "schema": {
          "type": "integer"
        }
      },
      "X-Monthly-Remaining": {
        "description": "API requests left this month. Omitted when unlimited.",
        "schema": {
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds until the limit resets (429s).",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "MISSING_API_KEY, INVALID_API_KEY, API_KEY_EXPIRED, API_KEY_ROTATED or SSO_REQUIRED.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Invalid or inactive API key",
              "code": "INVALID_API_KEY"
            }
          }
        }
      },
      "Forbidden": {
        "description": "IP_NOT_ALLOWED, PLAN_FEATURE, INSUFFICIENT_SCOPE (required_scope), or the endpoint's own: FORBIDDEN, KEY_FORM_RESTRICTED, KEY_RESTRICTED, FORM_NOT_PUBLISHED, RESPONSE_LIMIT, PLAN_LIMIT (limit: forms|questions), WEBHOOK_LIMIT.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "This key doesn't have the \"forms:write\" permission. Edit the key in Dashboard → API.",
              "code": "INSUFFICIENT_SCOPE",
              "required_scope": "forms:write"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "KEY_DAILY_LIMIT, RATE_LIMITED, ACCOUNT_RATE_LIMITED or MONTHLY_LIMIT. Only RATE_LIMITED and ACCOUNT_RATE_LIMITED clear within a minute.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Too many requests: your plan allows 60 per minute per key.",
              "code": "RATE_LIMITED",
              "limit": 60
            }
          }
        }
      },
      "ServerError": {
        "description": "SERVER_ERROR. Retry with backoff; for POST check first whether the item was created.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Every error: { error, code, ...extra }.",
        "required": [
          "error",
          "code"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable message. Don't branch on it."
          },
          "code": {
            "type": "string",
            "description": "Machine-readable reason. Branch on this.",
            "enum": [
              "BAD_REQUEST",
              "INVALID_URL",
              "MISSING_API_KEY",
              "INVALID_API_KEY",
              "API_KEY_EXPIRED",
              "API_KEY_ROTATED",
              "SSO_REQUIRED",
              "CREDITS_EXHAUSTED",
              "IP_NOT_ALLOWED",
              "PLAN_FEATURE",
              "INSUFFICIENT_SCOPE",
              "KEY_FORM_RESTRICTED",
              "KEY_RESTRICTED",
              "FORBIDDEN",
              "FORM_NOT_ALLOWED",
              "FORM_NOT_PUBLISHED",
              "RESPONSE_LIMIT",
              "PLAN_LIMIT",
              "WEBHOOK_LIMIT",
              "NOT_FOUND",
              "FORM_NOT_FOUND",
              "PAYMENT_NOT_FOUND",
              "STUDY_NOT_FOUND",
              "INTERVIEW_NOT_FOUND",
              "WEBHOOK_NOT_FOUND",
              "METHOD_NOT_ALLOWED",
              "WEBHOOK_DISABLED",
              "VALIDATION_FAILED",
              "STRIPE_NOT_CONNECTED",
              "KEY_DAILY_LIMIT",
              "RATE_LIMITED",
              "ACCOUNT_RATE_LIMITED",
              "MONTHLY_LIMIT",
              "SERVER_ERROR",
              "AI_ERROR",
              "LIMITS_UNAVAILABLE"
            ]
          },
          "limit": {
            "description": "KEY_DAILY_LIMIT, RATE_LIMITED, ACCOUNT_RATE_LIMITED, MONTHLY_LIMIT: the number that was hit. PLAN_LIMIT: forms or questions.",
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "required_scope": {
            "type": "string",
            "description": "INSUFFICIENT_SCOPE: the scope the endpoint needs."
          },
          "errors": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ValidationIssue"
                },
                {
                  "$ref": "#/components/schemas/FieldIssue"
                }
              ]
            },
            "description": "Per-field problems (VALIDATION_FAILED, BAD_REQUEST)."
          },
          "docs": {
            "type": "string",
            "description": "NOT_FOUND for an unknown path: link to these docs."
          },
          "imported": {
            "type": "integer",
            "description": "RESPONSE_LIMIT during an import: rows saved."
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "RESPONSE_LIMIT during an import: ids of the saved rows."
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportFailure"
            },
            "description": "RESPONSE_LIMIT during an import: rows that failed."
          },
          "stopped_at": {
            "type": "integer",
            "description": "RESPONSE_LIMIT during an import: index of the first row that wasn't imported."
          }
        }
      },
      "ValidationIssue": {
        "type": "object",
        "description": "An answer that broke the form's rules.",
        "required": [
          "field_id",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          },
          "field_id": {
            "type": "string",
            "description": "Field id ('' for the whole answer set)."
          }
        }
      },
      "FieldIssue": {
        "type": "object",
        "description": "A problem with a form field (create/update/publish) or a prefilled answer.",
        "required": [
          "message"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "description": "Position in the sent fields list (-1 for the whole list)."
          },
          "field_id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Deleted": {
        "type": "object",
        "required": [
          "id",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "Field": {
        "type": "object",
        "description": "A form field as the API shows it.",
        "required": [
          "id",
          "type",
          "label",
          "required"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Field id: the key for this field's answer."
          },
          "type": {
            "type": "string",
            "description": "Field type.",
            "enum": [
              "text",
              "email",
              "number",
              "tel",
              "date",
              "textarea",
              "select",
              "radio",
              "checkbox",
              "image_choice",
              "file",
              "video_answer",
              "image",
              "image_upload",
              "appointment",
              "address",
              "divider",
              "statement",
              "embed",
              "video",
              "rating",
              "signature",
              "scheduling",
              "terms",
              "single_checkbox",
              "table",
              "nps",
              "scale",
              "matrix",
              "likert",
              "ranking",
              "time",
              "date_range",
              "hidden",
              "calculated",
              "payment"
            ]
          },
          "label": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Choice fields."
          },
          "description": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          }
        }
      },
      "FieldInput": {
        "type": "object",
        "description": "A field sent to POST/PATCH /forms. With PATCH, a field with the id and type of a saved field starts from the saved one: omitted properties stay, null removes one, builder-only settings are kept.",
        "required": [
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional. 1-64 letters, digits, - or _. Generated when missing (field-<timestamp><n>).",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "type": {
            "type": "string",
            "description": "Payment fields can only be added in the builder.",
            "enum": [
              "text",
              "email",
              "number",
              "tel",
              "date",
              "textarea",
              "select",
              "radio",
              "checkbox",
              "image_choice",
              "file",
              "video_answer",
              "image",
              "image_upload",
              "appointment",
              "address",
              "divider",
              "statement",
              "embed",
              "video",
              "rating",
              "signature",
              "scheduling",
              "terms",
              "single_checkbox",
              "table",
              "nps",
              "scale",
              "matrix",
              "likert",
              "ranking",
              "time",
              "date_range",
              "hidden",
              "calculated"
            ]
          },
          "label": {
            "type": "string",
            "description": "Required except for divider, statement, embed and video.",
            "maxLength": 1000
          },
          "required": {
            "type": "boolean",
            "description": "Default false."
          },
          "placeholder": {
            "type": "string",
            "maxLength": 300
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 500
            },
            "description": "select, radio, checkbox, image_choice: 1-200 unique options (required for them)."
          },
          "optionWeights": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "description": "Choice fields: option -> points."
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "image_choice: one image URL per option."
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "maxFileSize": {
            "type": "integer",
            "description": "Upload fields: MB, 1-50.",
            "minimum": 1,
            "maximum": 50
          },
          "allowedFileTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "pdf",
                "docs",
                "images",
                "all"
              ]
            },
            "description": "Upload fields."
          },
          "videoMaxDurationSec": {
            "type": "integer",
            "description": "video_answer: 15-300.",
            "minimum": 15,
            "maximum": 300
          },
          "embedUrl": {
            "type": "string",
            "description": "embed block.",
            "format": "uri"
          },
          "videoUrl": {
            "type": "string",
            "description": "video block.",
            "format": "uri"
          },
          "videoCaption": {
            "type": "string",
            "description": "video block.",
            "maxLength": 300
          },
          "termsContent": {
            "type": "string",
            "description": "terms.",
            "maxLength": 20000
          },
          "termsFormat": {
            "type": "string",
            "description": "terms.",
            "enum": [
              "paragraph",
              "list"
            ]
          },
          "tableColumns": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "type"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "number",
                    "select",
                    "currency",
                    "line_total"
                  ]
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "currencySymbol": {
                  "type": "string"
                },
                "quantityColumnId": {
                  "type": "string"
                },
                "priceColumnId": {
                  "type": "string"
                }
              }
            },
            "description": "table: up to 20 columns."
          },
          "calc": {
            "type": "object",
            "description": "calculated fields.",
            "required": [
              "expression"
            ],
            "properties": {
              "expression": {
                "type": "string"
              },
              "precision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10
              },
              "blank": {
                "type": "string",
                "enum": [
                  "zero",
                  "null"
                ]
              },
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              },
              "bands": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "label",
                    "min"
                  ],
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "min": {
                      "type": "number"
                    },
                    "max": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "fieldId",
                "operator"
              ],
              "properties": {
                "fieldId": {
                  "type": "string",
                  "description": "Another field of the form."
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "equals",
                    "not_equals",
                    "contains",
                    "not_contains",
                    "greater_than",
                    "less_than",
                    "is_empty",
                    "is_not_empty"
                  ]
                },
                "value": {
                  "type": "string"
                },
                "logic": {
                  "type": "string",
                  "enum": [
                    "AND",
                    "OR"
                  ]
                }
              }
            },
            "description": "Show the field only when these match (up to 20)."
          }
        }
      },
      "FormSummary": {
        "type": "object",
        "required": [
          "id",
          "title",
          "description",
          "status",
          "slug",
          "url",
          "created_at",
          "updated_at",
          "published_at",
          "edit_url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "published",
              "draft"
            ]
          },
          "slug": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "type": "string",
            "description": "Public form address.",
            "format": "uri"
          },
          "edit_url": {
            "type": "string",
            "format": "uri",
            "description": "The form in the Formzed builder (opens for someone signed in who can edit it)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "published_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Form": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FormSummary"
          },
          {
            "type": "object",
            "required": [
              "fields"
            ],
            "properties": {
              "fields": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Field"
                },
                "description": "The published version (the draft if never published)."
              },
              "draft_fields": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Field"
                },
                "description": "Only when the draft differs from the published version."
              }
            }
          }
        ]
      },
      "Response": {
        "type": "object",
        "required": [
          "id",
          "form_id",
          "submitted_at",
          "is_draft",
          "answers",
          "answers_by_label",
          "computed",
          "source",
          "payment_status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "form_id": {
            "type": "string",
            "format": "uuid"
          },
          "submitted_at": {
            "type": "string",
            "description": "Submission time (the original time for imports).",
            "format": "date-time"
          },
          "is_draft": {
            "type": "boolean"
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Answers keyed by field id. File links open for 24 hours."
          },
          "answers_by_label": {
            "type": "object",
            "additionalProperties": true,
            "description": "Answers keyed by question label."
          },
          "computed": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CalcResult"
            },
            "description": "Calculated fields by field id."
          },
          "source": {
            "type": "string",
            "description": "form (hosted or website form), api or api_import."
          },
          "payment_status": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "pending",
                  "paid",
                  "refunded"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "quality": {
            "type": "object",
            "description": "The response quality check (no AI): why it looks low quality, if it does.",
            "properties": {
              "checked": {
                "type": "boolean"
              },
              "low_quality": {
                "type": "boolean"
              },
              "flags": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "kind",
                    "label",
                    "reason"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "speeder",
                        "bot",
                        "straight_line",
                        "gibberish",
                        "duplicate"
                      ]
                    },
                    "label": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "field_id": {
                      "type": "string"
                    }
                  }
                }
              },
              "seconds": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Seconds from opening the form to sending it."
              }
            }
          },
          "excluded": {
            "type": "boolean",
            "description": "Excluded from results by the form's team (kept, never deleted)."
          },
          "excluded_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CalcResult": {
        "type": "object",
        "required": [
          "value",
          "band"
        ],
        "properties": {
          "value": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "band": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ResponseCreated": {
        "type": "object",
        "required": [
          "id",
          "computed"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "computed": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CalcResult"
            }
          }
        }
      },
      "ImportFailure": {
        "type": "object",
        "required": [
          "index",
          "code",
          "error"
        ],
        "properties": {
          "index": {
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            }
          }
        }
      },
      "ImportResult": {
        "type": "object",
        "required": [
          "imported",
          "ids",
          "failed"
        ],
        "properties": {
          "imported": {
            "type": "integer"
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportFailure"
            }
          }
        }
      },
      "ErasureResult": {
        "type": "object",
        "required": [
          "deleted",
          "response_ids",
          "payments_redacted",
          "prefill_links_deleted"
        ],
        "properties": {
          "deleted": {
            "type": "integer"
          },
          "response_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "payments_redacted": {
            "type": "integer"
          },
          "prefill_links_deleted": {
            "type": "integer"
          }
        }
      },
      "PrefillLink": {
        "type": "object",
        "required": [
          "token",
          "url",
          "label",
          "answers",
          "expires_at",
          "max_uses",
          "uses",
          "created_at"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "label": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Field id -> value."
          },
          "expires_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_uses": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "uses": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaymentItem": {
        "type": "object",
        "required": [
          "product_id",
          "name",
          "unit_amount",
          "quantity",
          "subtotal",
          "file"
        ],
        "properties": {
          "product_id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "unit_amount": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "number"
          },
          "subtotal": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "file": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "name",
                  "size"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "size": {
                    "oneOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Payment": {
        "type": "object",
        "required": [
          "id",
          "form_id",
          "response_id",
          "status",
          "amount",
          "currency",
          "mode",
          "items",
          "coupon_code",
          "discount",
          "payer_email",
          "receipt_url",
          "created_at",
          "paid_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "form_id": {
            "type": "string",
            "format": "uuid"
          },
          "response_id": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "paid",
              "refunded"
            ]
          },
          "amount": {
            "type": "number",
            "description": "In the currency's main unit (49.5 = 49.50)."
          },
          "currency": {
            "type": "string",
            "description": "Lower-case code, like usd."
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentItem"
            }
          },
          "coupon_code": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount": {
            "type": "number"
          },
          "payer_email": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "receipt_url": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "paid_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AiAnswer": {
        "type": "object",
        "required": [
          "answer",
          "responses_considered",
          "responses_total",
          "credits_used"
        ],
        "properties": {
          "answer": {
            "type": "string"
          },
          "responses_considered": {
            "type": "integer",
            "description": "Responses the AI read."
          },
          "responses_total": {
            "type": "integer",
            "description": "Submitted responses in the period."
          },
          "credits_used": {
            "type": "number",
            "description": "AI credits charged (1 credit = 4,000 tokens)."
          }
        }
      },
      "AiSummary": {
        "type": "object",
        "required": [
          "summary",
          "themes",
          "responses_considered",
          "responses_total",
          "credits_used"
        ],
        "properties": {
          "summary": {
            "type": "string"
          },
          "themes": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "count",
                "example"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                },
                "example": {
                  "type": "string",
                  "description": "A quote from a response, or '' when it couldn't be confirmed."
                }
              }
            }
          },
          "responses_considered": {
            "type": "integer"
          },
          "responses_total": {
            "type": "integer"
          },
          "credits_used": {
            "type": "number"
          }
        }
      },
      "StudySummary": {
        "type": "object",
        "required": [
          "id",
          "title",
          "status",
          "modes",
          "recruitment",
          "public_url",
          "created_at",
          "interviews",
          "completed"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "live",
              "paused",
              "finished"
            ]
          },
          "modes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "chat",
                "voice",
                "voice_to_voice",
                "video"
              ]
            }
          },
          "recruitment": {
            "type": "string",
            "enum": [
              "own",
              "paid"
            ]
          },
          "public_url": {
            "oneOf": [
              {
                "type": "string",
                "description": "Null for Paid Research (invite only).",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "interviews": {
            "type": "integer",
            "description": "Interviews started."
          },
          "completed": {
            "type": "integer",
            "description": "Interviews completed."
          }
        }
      },
      "Study": {
        "allOf": [
          {
            "$ref": "#/components/schemas/StudySummary"
          },
          {
            "type": "object",
            "required": [
              "idea",
              "language",
              "max_minutes",
              "updated_at",
              "published_at",
              "guide",
              "screener"
            ],
            "properties": {
              "idea": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "max_minutes": {
                "type": "integer"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "published_at": {
                "oneOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "guide": {
                "type": "object",
                "required": [
                  "opening",
                  "closing",
                  "questions"
                ],
                "properties": {
                  "opening": {
                    "type": "string"
                  },
                  "closing": {
                    "type": "string"
                  },
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "text",
                        "goal",
                        "probes"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string"
                        },
                        "goal": {
                          "type": "string"
                        },
                        "probes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "screener": {
                "type": "object",
                "required": [
                  "title",
                  "description",
                  "questions"
                ],
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "type",
                        "label",
                        "required",
                        "options"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "radio",
                            "checkbox",
                            "select",
                            "text",
                            "textarea",
                            "number"
                          ]
                        },
                        "label": {
                          "type": "string"
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "options": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "InterviewSummary": {
        "type": "object",
        "required": [
          "headline",
          "key_points",
          "sentiment",
          "notable_quotes"
        ],
        "properties": {
          "headline": {
            "type": "string"
          },
          "key_points": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sentiment": {
            "type": "string",
            "enum": [
              "positive",
              "neutral",
              "negative",
              "mixed"
            ]
          },
          "notable_quotes": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "quote",
                "context"
              ],
              "properties": {
                "quote": {
                  "type": "string"
                },
                "context": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Interview": {
        "type": "object",
        "required": [
          "id",
          "study_id",
          "respondent_no",
          "status",
          "mode",
          "started_at",
          "ended_at",
          "answer_count",
          "summary",
          "screener_answers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "study_id": {
            "type": "string",
            "format": "uuid"
          },
          "respondent_no": {
            "type": "integer"
          },
          "participant_name": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name the participant chose to share on the consent step (studies with Collect name and email on). Null when they didn't, and always for Paid Research."
          },
          "participant_email": {
            "oneOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "description": "The email the participant chose to share on the consent step. Null when they didn't, and always for Paid Research."
          },
          "participant_consented_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the participant agreed to share their name and email. Null when they didn't."
          },
          "status": {
            "type": "string",
            "description": "Active interviews idle for 10 minutes count as completed (3+ answers) or abandoned.",
            "enum": [
              "active",
              "completed",
              "abandoned",
              "ended_by_owner"
            ]
          },
          "mode": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "answer_count": {
            "type": "integer"
          },
          "summary": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/InterviewSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "screener_answers": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "value"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            },
            "description": "Contact questions left out; names shortened; typed emails and phone numbers removed."
          }
        }
      },
      "InterviewDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Interview"
          },
          {
            "type": "object",
            "required": [
              "transcript"
            ],
            "properties": {
              "transcript": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "role",
                    "text",
                    "created_at",
                    "question_index",
                    "is_followup"
                  ],
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "ai",
                        "respondent"
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "question_index": {
                      "oneOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "is_followup": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "WebhookEventType": {
        "type": "string",
        "enum": [
          "response.created",
          "response.updated",
          "response.deleted",
          "payment.succeeded",
          "payment.refunded",
          "interview.completed"
        ]
      },
      "Webhook": {
        "type": "object",
        "required": [
          "id",
          "url",
          "events",
          "form_id",
          "description",
          "is_active",
          "disabled_reason",
          "consecutive_failures",
          "last_delivery_at",
          "last_status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            }
          },
          "form_id": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "disabled_reason": {
            "oneOf": [
              {
                "type": "string",
                "description": "Why Formzed turned it off."
              },
              {
                "type": "null"
              }
            ]
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "last_delivery_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_status": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookWithSecret": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Webhook"
          },
          {
            "type": "object",
            "required": [
              "secret"
            ],
            "properties": {
              "secret": {
                "type": "string",
                "description": "Signing secret (whsec_...). Only returned on create."
              }
            }
          }
        ]
      },
      "Delivery": {
        "type": "object",
        "required": [
          "id",
          "webhook_id",
          "event",
          "event_id",
          "status",
          "attempts",
          "next_attempt_at",
          "response_status",
          "last_error",
          "created_at",
          "delivered_at",
          "payload"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "webhook_id": {
            "type": "string",
            "format": "uuid"
          },
          "event": {
            "type": "string"
          },
          "event_id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "next_attempt_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "response_status": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_error": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "delivered_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "payload": {
            "$ref": "#/components/schemas/WebhookEvent"
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "description": "Envelope of every webhook event.",
        "required": [
          "id",
          "type",
          "created_at",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Event id. The same on every retry: use it to skip duplicates."
          },
          "type": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ResponseEventData": {
        "type": "object",
        "required": [
          "id",
          "form_id",
          "form_title",
          "submitted_at",
          "answers",
          "computed",
          "source",
          "payment_status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "form_id": {
            "type": "string",
            "format": "uuid"
          },
          "form_title": {
            "type": "string"
          },
          "submitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Keyed by field id. File links open for 7 days."
          },
          "computed": {
            "type": "object",
            "additionalProperties": true
          },
          "source": {
            "type": "string"
          },
          "payment_status": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ResponseDeletedEventData": {
        "type": "object",
        "required": [
          "id",
          "form_id",
          "form_title",
          "deleted_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "form_id": {
            "type": "string",
            "format": "uuid"
          },
          "form_title": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaymentEventData": {
        "type": "object",
        "required": [
          "id",
          "form_id",
          "response_id",
          "status",
          "amount",
          "currency",
          "mode",
          "items",
          "payer_email",
          "paid_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "form_id": {
            "type": "string",
            "format": "uuid"
          },
          "response_id": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "paid",
              "refunded"
            ]
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentItem"
            }
          },
          "payer_email": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "coupon_code": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount": {
            "type": "number"
          },
          "receipt_url": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InterviewEventData": {
        "type": "object",
        "required": [
          "id",
          "study_id",
          "study_title",
          "status",
          "mode",
          "started_at",
          "ended_at",
          "answer_count",
          "summary"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "study_id": {
            "type": "string",
            "format": "uuid"
          },
          "study_title": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "answer_count": {
            "type": "integer"
          },
          "summary": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/InterviewSummary",
                "description": "Often still null when the event is sent; fetch GET /interviews/{id} later."
              },
              {
                "type": "null"
              }
            ]
          },
          "participant_name": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name the participant chose to share on the consent step. Null when they didn't."
          },
          "participant_email": {
            "oneOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "description": "The email the participant chose to share on the consent step. Null when they didn't."
          },
          "participant_consented_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the participant agreed to share their name and email. Null when they didn't."
          }
        }
      },
      "TestEventData": {
        "type": "object",
        "required": [
          "message",
          "webhook_id"
        ],
        "properties": {
          "message": {
            "type": "string"
          },
          "webhook_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "SubmitResponseRequest": {
        "type": "object",
        "required": [
          "form_id",
          "data"
        ],
        "properties": {
          "form_id": {
            "type": "string",
            "description": "ID of a published form.",
            "format": "uuid"
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Answers keyed by field id."
          }
        }
      },
      "SubmitResponseSuccess": {
        "type": "object",
        "required": [
          "success",
          "response_id",
          "message"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "response_id": {
            "type": "string",
            "format": "uuid"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "SubmitFormResponseRequest": {
        "type": "object",
        "required": [
          "form_id",
          "answers"
        ],
        "properties": {
          "form_id": {
            "type": "string",
            "format": "uuid"
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Answers keyed by field id, same rules as data."
          }
        }
      },
      "PublicError": {
        "type": "object",
        "description": "Errors of the public submit-form-response endpoint (code only on 403 and 429).",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "RESPONSE_LIMIT",
              "RATE_LIMITED"
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            }
          }
        }
      },
      "FormList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FormSummary"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ResponseList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Response"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PrefillLinkList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrefillLink"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PaymentList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "StudyList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StudySummary"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "InterviewList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interview"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "WebhookList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DeliveryList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Delivery"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PublicValidationIssue": {
        "type": "object",
        "description": "Legacy /submit-response and the public /submit-form-response use fieldId.",
        "required": [
          "fieldId",
          "message"
        ],
        "properties": {
          "fieldId": {
            "type": "string",
            "description": "Field id ('' for the whole answer set)."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Evaluation": {
        "type": "object",
        "required": [
          "id",
          "title",
          "task",
          "status",
          "link",
          "raters_per_item",
          "items_per_session",
          "items",
          "items_complete",
          "sessions_completed",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "task": {
            "type": "string",
            "enum": [
              "pairwise",
              "rubric",
              "write_edit",
              "task_success",
              "media_label",
              "translation_check",
              "model_chat",
              "agent_review",
              "battle",
              "prompt_write"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "live",
              "paused",
              "finished"
            ]
          },
          "link": {
            "type": "string",
            "format": "uri",
            "description": "The raters' link (/e/{slug})."
          },
          "raters_per_item": {
            "type": "integer",
            "enum": [
              3,
              4,
              5
            ]
          },
          "items_per_session": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "items": {
            "type": "integer",
            "description": "Items to rate (not gold, not deleted)."
          },
          "items_complete": {
            "type": "integer",
            "description": "Items with all their counted ratings."
          },
          "sessions_completed": {
            "type": "integer",
            "description": "Rater sessions finished (each counts as one interview)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EvaluationList": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Evaluation"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Pass as ?cursor= for the next page. null on the last page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    }
  }
}
