{"openapi":"3.1.0","info":{"title":"SmartForm Public API","description":"Tenant-scoped forms, submissions, exports and integrations. Create bearer tokens in workspace settings. Publish requires verified email for both token creator (still a workspace member) and trial owner. Signup creates preparation mode (3 drafts, 20 total AI operations, 1 member); the 14-day Pro trial starts only at the first successful publish, once per owner. Email verification failures return 403 email_unverified; exhausted trial eligibility returns 402 trial_not_eligible.","license":{"name":"UNLICENSED","identifier":"UNLICENSED"},"version":"1.0.0"},"paths":{"/v1/forms":{"get":{"operationId":"FormsList","summary":"FormsList","tags":["forms"],"description":"Required scope: forms:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"forms:read","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"example":{"items":[],"nextCursor":null}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}},"post":{"operationId":"FormsCreate","summary":"FormsCreate","tags":["forms"],"description":"Required scope: forms:write. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"forms:write","parameters":[],"responses":{"201":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"templateSlug":{"type":"string"},"schema":{"$ref":"#/components/schemas/FormSchema"}},"required":["name"]},"example":{"name":"Cleaning quote","templateSlug":"cleaning"}}}}}},"/v1/forms/{id}":{"get":{"operationId":"FormGet","summary":"FormGet","tags":["forms"],"description":"Required scope: forms:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"forms:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/forms/{id}/draft":{"patch":{"operationId":"DraftPatch","summary":"DraftPatch","tags":["forms"],"description":"Required scope: forms:write. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"forms:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftState"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"integer","minimum":1},"ops":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/PatchOp"}},"summary":{"type":"string","maxLength":1000}},"required":["expectedRevision","ops","summary"]},"example":{"expectedRevision":1,"ops":[{"op":"updateMeta","set":{"title":"My cleaning quote"}}],"summary":"Update title"}}}}}},"/v1/forms/{id}/validate":{"post":{"operationId":"Validate","summary":"Validate","tags":["forms"],"description":"Required scope: forms:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"forms:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationReport"},"example":{"errors":[],"warnings":[]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/forms/{id}/simulate":{"post":{"operationId":"Simulate","summary":"Simulate","tags":["forms"],"description":"Required scope: forms:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"forms:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation":{"$ref":"#/components/schemas/Evaluation"},"results":{"type":"array","items":{"type":"object"}},"coverage":{"type":"object"}},"required":["evaluation","results","coverage"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answers":{"$ref":"#/components/schemas/Answers"},"lookups":{"$ref":"#/components/schemas/LookupResults"},"scenarioIds":{"type":"array","items":{"type":"string"}}},"required":[]},"example":{"answers":{"f_area":"40","f_type":"opt_regular","f_extras":[],"f_discount":"opt_none"}}}}}}},"/v1/forms/{id}/publish":{"post":{"operationId":"Publish","summary":"Publish","tags":["forms"],"description":"Required scope: forms:publish. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"forms:publish","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormVersion"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"revision":{"type":"integer","minimum":1}},"required":["revision"]},"example":{"revision":2}}}}}},"/v1/forms/{id}/versions":{"get":{"operationId":"Versions","summary":"Versions","tags":["forms"],"description":"Required scope: forms:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"forms:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FormVersion"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"example":{"items":[],"nextCursor":null}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/forms/{id}/submissions":{"post":{"operationId":"Submit","summary":"Submit","tags":["forms"],"description":"Required scope: submissions:write. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"submissions:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Reuse the UUID for retries of exactly the same request. Replays return 200; changed payload returns 409."}],"responses":{"201":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"type":"object","properties":{"submissionId":{"type":"string","format":"uuid"},"number":{"type":"string"},"versionId":{"type":"string","format":"uuid"},"quote":{"$ref":"#/components/schemas/Quote"}},"required":["submissionId","number","quote"]}}}},"200":{"description":"Idempotent replay","content":{"application/json":{"schema":{"type":"object","properties":{"submissionId":{"type":"string","format":"uuid"},"number":{"type":"string"},"versionId":{"type":"string","format":"uuid"},"quote":{"$ref":"#/components/schemas/Quote"}},"required":["submissionId","number","quote"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answers":{"$ref":"#/components/schemas/Answers"},"quoteId":{"type":"string","format":"uuid"},"sessionId":{"type":"string","format":"uuid"},"startedAt":{"type":"string","format":"date-time"}},"required":["answers"]},"example":{"answers":{"f_area":"40","f_type":"opt_regular","f_extras":[],"f_discount":"opt_none"}}}}}}},"/v1/submissions":{"get":{"operationId":"SubmissionsList","summary":"SubmissionsList","tags":["submissions"],"description":"Required scope: submissions:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"submissions:read","parameters":[{"name":"formId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"schema":{"enum":["new","in_progress","closed","spam"],"type":"string"}},{"name":"since","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Submission"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"example":{"items":[],"nextCursor":null}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/submissions/{id}":{"get":{"operationId":"SubmissionGet","summary":"SubmissionGet","tags":["submissions"],"description":"Required scope: submissions:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"submissions:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Submission"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}},"patch":{"operationId":"SubmissionPatch","summary":"SubmissionPatch","tags":["submissions"],"description":"Required scope: submissions:write. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"submissions:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Submission"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"enum":["new","in_progress","closed","spam"],"type":"string"},"tags":{"type":"array","maxItems":30,"items":{"type":"string","minLength":1,"maxLength":80}},"assigneeEmail":{"type":["string","null"],"format":"email"}},"required":[]},"example":{"status":"in_progress","tags":["priority"],"assigneeEmail":"owner@example.com"}}}}}},"/v1/submissions/{id}/files/{fileId}":{"get":{"operationId":"FileDownload","summary":"FileDownload","tags":["submissions"],"description":"Required scope: submissions:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"submissions:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/exports":{"post":{"operationId":"ExportCreate","summary":"ExportCreate","tags":["exports"],"description":"Required scope: submissions:export. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"submissions:export","parameters":[],"responses":{"202":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Export"},"example":{"id":"0199f100-0000-7000-8000-000000000001","format":"csv","status":"pending"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"format":{"enum":["csv","xlsx","json"],"type":"string"},"filter":{"type":"object","properties":{"form":{"type":"string","format":"uuid"},"status":{"type":"string"},"dateFrom":{"type":"string","format":"date-time"},"dateTo":{"type":"string","format":"date-time"},"tag":{"type":"string"},"q":{"type":"string"},"isTest":{"type":"boolean"}},"required":[]}},"required":["format"]},"example":{"format":"csv","filter":{"status":"new"}}}}}}},"/v1/exports/{id}":{"get":{"operationId":"ExportGet","summary":"ExportGet","tags":["exports"],"description":"Required scope: submissions:export. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"submissions:export","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Export"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/exports/{id}/download":{"get":{"operationId":"ExportDownload","summary":"ExportDownload","tags":["exports"],"description":"Required scope: submissions:export. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"submissions:export","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/metrics/summary":{"get":{"operationId":"Metrics","summary":"Metrics","tags":["metrics"],"description":"Required scope: analytics:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"analytics:read","parameters":[{"name":"formId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","description":"YYYY-MM-DD or RFC3339; defaults to last 30 days"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","description":"YYYY-MM-DD (inclusive day) or RFC3339; maximum 366-day window"}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/integrations/status":{"get":{"operationId":"Integrations","summary":"Integrations","tags":["integrations"],"description":"Required scope: connections:read. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"connections:read","parameters":[],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"example":{"items":[],"nextCursor":null}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}},"/v1/webhooks":{"get":{"operationId":"WebhooksList","summary":"WebhooksList","tags":["webhooks"],"description":"Required scope: webhooks:manage. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"webhooks:manage","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"example":{"items":[],"nextCursor":null}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}},"post":{"operationId":"WebhookCreate","summary":"WebhookCreate","tags":["webhooks"],"description":"Required scope: webhooks:manage. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"webhooks:manage","parameters":[],"responses":{"201":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","minItems":1,"maxItems":3,"items":{"enum":["submission.created","submission.updated","delivery.failed"],"type":"string"}},"formIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["name","url","events"]},"example":{"name":"CRM events","url":"https://example.com/smartform","events":["submission.created","submission.updated"]}}}}}},"/v1/webhooks/{id}":{"delete":{"operationId":"WebhookDelete","summary":"WebhookDelete","tags":["webhooks"],"description":"Required scope: webhooks:manage. Tenant and form allowlists are enforced. Writes are audited as ApiToken.","x-required-scope":"webhooks:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Success","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"600 requests; bucket refills at 10 per second"},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until the next token"}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Invalid input","details":{}}}}}},"401":{"description":"Missing, expired or revoked bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Missing, expired or revoked bearer token","details":{}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Insufficient scope","details":{}}}}}},"404":{"description":"Resource not found or outside token permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Resource not found or outside token permissions","details":{}}}}}},"409":{"description":"Revision or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revision_conflict","message":"Revision or idempotency conflict","details":{}}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Validation failed","details":{}}}}}},"402":{"description":"Workspace locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Workspace locked","details":{}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Rate limited","details":{}}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}},"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"Unexpected error","details":{}}}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}},"required":["code","message","details"]}},"required":["error"]},"Answers":{"type":"object","additionalProperties":true,"description":"Field IDs map to typed answers. Numeric/money values are decimal strings, choices use option IDs; file answers are private upload UUID arrays.","example":{"f_area":"40","f_type":"opt_regular"}},"LookupResults":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"enum":["ok","error","timeout","pending"],"type":"string"},"outputs":{"type":"object","additionalProperties":true}}}},"Field":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["shortText","longText","email","phone","url","name","singleChoice","multiChoice","imageChoice","dropdown","yesNo","consent","integer","decimal","money","percent","quantity","date","datetime","file","heading","paragraph","image","divider","summary","quoteResult","termsLink","hidden"]},"label":{"type":"string"},"required":{"type":"boolean"},"source":{"enum":["visitor","constant","system"],"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":["string","null"],"description":"Decimal string"}},"required":["id","label"]}},"validation":{"type":"object","properties":{"min":{"type":"string"},"max":{"type":"string"},"step":{"type":"string"},"maxLength":{"type":"integer"},"maxFiles":{"type":"integer"},"maxSizeMb":{"type":"integer"},"accept":{"type":"string"}}},"piiKind":{"type":["string","null"]}},"required":["id","type","label"]},"Step":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["id","title","fieldIds"]},"Expr":{"type":"object","description":"Restricted expression AST: num (decimal string), str, bool, ref; or op add/sub/mul/div/min/max/round/if/sumOptions/optionValue/table/daysBetween/count/coalesce. No code execution or network.","additionalProperties":true,"examples":[{"ref":"f_area"},{"op":"mul","args":[{"ref":"f_area"},{"num":"2.00"}]}]},"Rule":{"type":"object","required":["id","kind","when"],"properties":{"id":{"type":"string"},"kind":{"enum":["show","require","enableOption","goto","block"],"type":"string"},"when":{"type":"object"},"target":{"type":"object"}},"additionalProperties":true},"FormSchema":{"type":"object","properties":{"schemaVersion":{"type":"integer","const":1},"title":{"type":"string"},"description":{"type":["string","null"]},"locale":{"type":"object","properties":{"language":{"type":"string"},"currency":{"type":"string"},"timezone":{"type":"string"}},"required":["language","currency","timezone"]},"settings":{"type":"object","properties":{"layout":{"enum":["steps","oneByOne"],"type":"string"},"submitLabel":{"type":"string"},"successMessage":{"type":"string"},"honeypot":{"type":"boolean"},"pricePolicy":{"type":"object"}}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"}},"rules":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}},"tables":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"valueType":{"type":"string"},"confirmed":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value":{"type":"string"}},"required":["key","value"]}}},"required":["id","rows"]}},"computed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"valueType":{"type":"string"},"expr":{"$ref":"#/components/schemas/Expr"}},"required":["id","expr"]}},"pricing":{"type":"object","properties":{"enabled":{"type":"boolean"},"currency":{"type":"string"},"lines":{"type":"array","items":{"type":"object"}},"totalComputedId":{"type":["string","null"]}}},"results":{"type":"array","items":{"$ref":"#/components/schemas/ResultLine"}},"lookups":{"type":"array","items":{"type":"object"}},"routes":{"type":"array","items":{"type":"object"}},"placeholders":{"type":"array","items":{"type":"string"}}},"required":["schemaVersion","title","fields","steps"]},"ResultLine":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"computedId":{"type":"string"}},"required":["id","label","computedId"]},"EvaluatedResult":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"object","properties":{"type":{"enum":["number","text","bool"],"type":"string"},"value":{"type":["string","boolean"]}}}},"required":["id","label","value"]},"PatchOp":{"type":"object","required":["op"],"properties":{"op":{"enum":["addField","updateField","removeField","moveField","addOption","updateOption","removeOption","addStep","updateStep","removeStep","moveStep","addRule","updateRule","removeRule","addComputed","updateComputed","removeComputed","addTable","updateTable","removeTable","setTableRow","removeTableRow","setPricing","setResults","updateSettings","updateMeta","addRoute","updateRoute","removeRoute","addLookup","removeLookup","markPlaceholder","confirmPlaceholder"],"type":"string"},"id":{"type":"string"},"set":{"type":"object"},"field":{"$ref":"#/components/schemas/Field"},"step":{"$ref":"#/components/schemas/Step"},"rule":{"$ref":"#/components/schemas/Rule"},"pricing":{"type":"object"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ResultLine"}},"index":{"type":["integer","null"]},"stepId":{"type":"string"},"fieldId":{"type":"string"}},"additionalProperties":true,"example":{"op":"updateMeta","set":{"title":"Updated quote"}}},"ValidationReport":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}}},"required":["errors","warnings"]},"Issue":{"type":"object","properties":{"code":{"type":"string"},"severity":{"enum":["error","warning"],"type":"string"},"message":{"type":"string"},"path":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["code","severity","message","path","ids"]},"Quote":{"type":"object","properties":{"status":{"enum":["ok","incomplete","error","requestQuote","declined"],"type":"string"},"currency":{"type":"string"},"total":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"amount":{"type":"string"}},"required":["id","label","amount"]}},"message":{"type":["string","null"]},"trace":{"type":"array","items":{"type":"object"}}},"required":["status","currency","total","lines"]},"Evaluation":{"type":"object","properties":{"visibleFields":{"type":"array","items":{"type":"string"}},"hiddenFields":{"type":"object"},"visibleSteps":{"type":"array","items":{"type":"string"}},"stepPath":{"type":"array","items":{"type":"string"}},"requiredFields":{"type":"array","items":{"type":"string"}},"enabledOptions":{"type":"object"},"activeAnswers":{"$ref":"#/components/schemas/Answers"},"droppedAnswers":{"type":"object"},"fieldErrors":{"type":"object"},"missingRequired":{"type":"array","items":{"type":"string"}},"computed":{"type":"object"},"quote":{"$ref":"#/components/schemas/Quote"},"results":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatedResult"}},"resultError":{"type":["string","null"]},"routes":{"type":"array","items":{"type":"string"}},"block":{"type":["object","null"]},"complete":{"type":"boolean"}},"required":["activeAnswers","quote","complete"]},"DraftState":{"type":"object","properties":{"revision":{"type":"integer","format":"int64"},"schema":{"$ref":"#/components/schemas/FormSchema"},"validation":{"$ref":"#/components/schemas/ValidationReport"},"changes":{"type":"array","items":{"type":"object"}},"updatedAt":{"type":"string","format":"date-time"}},"required":["revision","schema","validation"]},"FormVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"version":{"type":"integer"},"revision":{"type":"integer"},"publishedAt":{"type":"string","format":"date-time"},"publishedBy":{"type":["string","null"],"format":"uuid"},"closedAt":{"type":["string","null"],"format":"date-time"},"acceptsSubmissions":{"type":"boolean"}},"required":["id","version","revision","acceptsSubmissions"]},"Form":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"enum":["draft","published","closed","archived"],"type":"string"},"draft":{"$ref":"#/components/schemas/DraftState"},"publishedVersion":{"oneOf":[{"$ref":"#/components/schemas/FormVersion"},{"type":"null"}]},"publicUrl":{"type":["string","null"]}},"required":["id","name","draft"]},"Submission":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"formId":{"type":"string","format":"uuid"},"versionId":{"type":"string","format":"uuid"},"status":{"enum":["new","in_progress","closed","spam"],"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"assigneeId":{"type":["string","null"],"format":"uuid"},"activeAnswers":{"$ref":"#/components/schemas/Answers"},"rawAnswers":{"$ref":"#/components/schemas/Answers"},"computed":{"type":"object"},"quote":{"$ref":"#/components/schemas/Quote"},"results":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatedResult"}},"attribution":{"type":"object"},"files":{"type":"array","items":{"type":"object"}},"createdAt":{"type":"string","format":"date-time"},"source":{"type":"string","enum":["public","api"]}},"required":["id","number","formId","status","quote"]},"Export":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"format":{"enum":["csv","xlsx","json"],"type":"string"},"status":{"enum":["pending","processing","ready","failed","expired"],"type":"string"},"rowCount":{"type":["integer","null"]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"}},"required":["id","format","status"]},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"},"config":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"enum":["submission.created","submission.updated","delivery.failed"],"type":"string"}},"formIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["url","events"]},"signingSecret":{"type":"string","description":"Only present once, on creation."}},"required":["id","name","config"]}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sf_live_...","description":"Create in /app/settings/api-tokens. Tokens are workspace-scoped, optionally restricted to form IDs."}}},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","servers":[{"url":"/"}],"security":[{"bearerAuth":[]}],"x-scopes":["forms:read","forms:write","forms:publish","submissions:read","submissions:write","submissions:export","analytics:read","connections:read","webhooks:manage"]}