{"openapi":"3.1.0","info":{"title":"formto API","version":"2.0.0","description":"Forms, responses, destinations and deliveries for agents and integrations."},"servers":[{"url":"https://api.formto.io"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An fta_ agent token or an fto_live_/fto_test_ project key. Never put a token in the URL."}},"schemas":{},"parameters":{}},"paths":{"/v2/submissions":{"get":{"summary":"List a form’s responses, newest first","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":500},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"formId","in":"query"}],"responses":{"200":{"description":"Responses and the cursor of the next page","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"formId":{"type":"string"},"createdAt":{"type":"string"},"email":{"type":["string","null"]},"status":{"type":"string"},"data":{"type":"object","additionalProperties":{}},"ai":{"type":["object","null"],"additionalProperties":{}},"workflowState":{"type":"string","enum":["new","in_progress","done"]},"starred":{"type":"boolean"}},"required":["id","formId","createdAt","email","status","data","ai"]}},"nextCursor":{"type":["string","null"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/submissions/{id}":{"get":{"summary":"Get one response with its data and file links","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"formId":{"type":"string"},"createdAt":{"type":"string"},"email":{"type":["string","null"]},"status":{"type":"string"},"data":{"type":"object","additionalProperties":{}},"ai":{"type":["object","null"],"additionalProperties":{}},"workflowState":{"type":"string","enum":["new","in_progress","done"]},"starred":{"type":"boolean"}},"required":["id","formId","createdAt","email","status","data","ai"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Mark a response as spam (quarantined) or not (ok), move its workflow state, or star it","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","quarantined"]},"state":{"type":"string","enum":["new","in_progress","done"]},"starred":{"type":"boolean"}}}}}},"responses":{"200":{"description":"What changed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"state":{"type":"string"},"starred":{"type":"boolean"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete a response and its files (needs submissions:delete)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/submissions/{id}/notes":{"get":{"summary":"A response’s private notes, oldest first","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Notes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"submissionId":{"type":"string"},"authorUserId":{"type":["string","null"]},"body":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","submissionId","authorUserId","body","createdAt"]}},"nextCursor":{"type":["string","null"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Add a private note to a response (never delivered, exported or shown publicly)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000}},"required":["body"]}}}},"responses":{"201":{"description":"The note","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"submissionId":{"type":"string"},"authorUserId":{"type":["string","null"]},"body":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","submissionId","authorUserId","body","createdAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/{id}/destinations":{"get":{"summary":"List a form’s destinations (never their secrets)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Destinations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"config":{}},"required":["id","kind","name"]}},"nextCursor":{"type":["string","null"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Add a destination; a signing secret is returned once","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string"},"name":{"type":"string","maxLength":100},"config":{"type":"object","additionalProperties":{}}},"required":["kind","config"]}}}},"responses":{"201":{"description":"The destination, and its secret (shown once)","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"config":{}},"required":["id","kind","name"]},"secret":{"type":"string"}},"required":["connection"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"402":{"description":"The plan does not include this kind","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/deliveries":{"get":{"summary":"The delivery log, optionally for one response, with attempts","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":500},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","maxLength":64},"required":false,"name":"submissionId","in":"query"}],"responses":{"200":{"description":"Deliveries and the cursor of the next page","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"submissionId":{"type":"string"},"attempts":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["id","status"]}},"nextCursor":{"type":["string","null"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/deliveries/{id}/replay":{"post":{"summary":"Send a finished delivery again (409 while it is in flight)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Still being sent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/{id}/results":{"get":{"summary":"Totals per field and per day for a form’s ok responses","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Results","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"fields":{"type":"object","additionalProperties":{}},"perDay":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"number"}},"required":["day","count"]}}},"required":["total","fields","perDay"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/{id}/ask":{"post":{"summary":"Answer a question about a form’s responses, citing the response ids used","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":500}},"required":["question"]}}}},"responses":{"200":{"description":"The answer (plain text) and its citations","content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string"},"citations":{"type":"array","items":{"type":"string"}}},"required":["answer","citations"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"402":{"description":"The plan’s question allowance is used up","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/views":{"get":{"summary":"List saved views, optionally of one form","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","maxLength":64},"required":false,"name":"formId","in":"query"}],"responses":{"200":{"description":"Views","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"formId":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"slug":{"type":"string"},"isPublic":{"type":"boolean"}},"required":["id","formId","name","kind","columns","slug","isPublic"]}},"nextCursor":{"type":["string","null"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Save a view of chosen columns, served at /v/<slug>","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"formId":{"type":"string","minLength":1,"maxLength":64},"kind":{"type":"string","enum":["list","cards","table","results"]},"columns":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":50},"name":{"type":"string","maxLength":100},"isPublic":{"type":"boolean"}},"required":["formId","kind","columns"]}}}},"responses":{"201":{"description":"The new view","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"formId":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"slug":{"type":"string"},"isPublic":{"type":"boolean"}},"required":["id","formId","name","kind","columns","slug","isPublic"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/{id}/export":{"get":{"summary":"Export a form’s responses as CSV or XLSX","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["csv","xlsx"],"default":"csv"},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"The export file","content":{"text/csv":{"schema":{"type":"string"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/zapier/forms":{"get":{"summary":"Zapier: the forms of the key’s project","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Forms","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"publicId":{"type":"string"}},"required":["id","name","publicId"]}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/zapier/submissions":{"get":{"summary":"Zapier: the newest responses of one of the key’s forms, optionally matching a query","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"formId","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Responses, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"formId":{"type":"string"},"createdAt":{"type":"string"},"email":{"type":["string","null"]},"status":{"type":"string"},"data":{}},"required":["id","formId","createdAt","email","status"]}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Zapier: store a response on one of the key’s forms","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"formId":{"type":"string","minLength":1,"maxLength":64},"data":{"type":"object","additionalProperties":{}}},"required":["formId","data"]}}}},"responses":{"201":{"description":"The stored response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"formId":{"type":"string"}},"required":["id","formId"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v2/zapier/hooks":{"post":{"summary":"Zapier: subscribe a REST hook to a form’s new responses; it stops when the key is replaced","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"formId":{"type":"string","minLength":1,"maxLength":64},"targetUrl":{"type":"string","maxLength":2048,"format":"uri"}},"required":["formId","targetUrl"]}}}},"responses":{"201":{"description":"The subscription","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"402":{"description":"The plan has no Zapier","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/zapier/hooks/{id}":{"delete":{"summary":"Zapier: unsubscribe a REST hook","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Unsubscribed"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/google/connections":{"get":{"summary":"The workspace’s Google connections: account, status and the products their access covers","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Google connections","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"accountEmail":{"type":["string","null"]},"status":{"type":"string"},"products":{"type":"array","items":{"type":"string"}}},"required":["id","accountEmail","status","products"]}},"nextCursor":{"type":["string","null"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/connections/{provider}/link":{"post":{"summary":"A one-time link where a person adds a credential; returns the link and a request id to poll","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":32},"required":true,"name":"provider","in":"path"}],"responses":{"200":{"description":"The link and request id","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"requestId":{"type":"string"}},"required":["url","requestId"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/connections/requests/{requestId}":{"get":{"summary":"The status and label of a connect request (never the secret)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"requestId","in":"path"}],"responses":{"200":{"description":"Status and label","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"provider":{"type":"string"},"label":{"type":["string","null"]}},"required":["status","provider","label"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/tools/{name}":{"post":{"summary":"Run one agent tool (the same tools formto’s MCP server serves) with the token’s scopes","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^formto_[a-z_]{1,60}$"},"required":true,"name":"name","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"The tool’s result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"402":{"description":"A plan limit","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The owner AI limit (Retry-After)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v2/me":{"get":{"summary":"The token’s org and scopes","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The caller","content":{"application/json":{"schema":{"type":"object","properties":{"orgId":{"type":"string"},"org":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"plan":{"type":"string"}},"required":["id","name","slug","plan"]},"kind":{"type":"string"},"userId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"scopes":{"type":["array","null"],"items":{"type":"string"}}},"required":["orgId","org","kind","userId","projectId","scopes"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/projects":{"get":{"summary":"List projects","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Projects","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"allowedOrigins":{"type":["array","null"],"items":{"type":"string"}},"createdAt":{"type":"string"}},"required":["id","name","slug"]}},"nextCursor":{"type":["string","null"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create a project","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"allowedOrigins":{"type":"array","items":{"type":"string"},"maxItems":50}},"required":["name"]}}}},"responses":{"201":{"description":"The new project","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"allowedOrigins":{"type":["array","null"],"items":{"type":"string"}},"createdAt":{"type":"string"}},"required":["id","name","slug"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms":{"get":{"summary":"List forms","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Forms","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"publicId":{"type":"string"},"name":{"type":"string"},"isActive":{"type":"boolean"},"validationMode":{"type":"string","enum":["sandbox","live"]},"submissionCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","projectId","publicId","name"]}},"nextCursor":{"type":["string","null"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create a form (notifications go to the owner unless notifyEmail is given; notify: false sends none)","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":100},"notifyEmail":{"type":"string","maxLength":254},"notify":{"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"The new form","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"publicId":{"type":"string"},"name":{"type":"string"},"isActive":{"type":"boolean"},"validationMode":{"type":"string","enum":["sandbox","live"]},"submissionCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","projectId","publicId","name"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/generate":{"post":{"summary":"Draft a form definition from a description with AI; nothing is saved until you PUT it as a form’s definition","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000}},"required":["prompt"]}}}},"responses":{"200":{"description":"The generated definition, unsaved, and the model’s notes","content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"type":"object","additionalProperties":{}},"notes":{"type":"string"}},"required":["definition"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"402":{"description":"AI form generation is part of the paid plans (plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"502":{"description":"The model did not answer with a valid definition (ai_invalid)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/{id}":{"get":{"summary":"Get a form","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The form","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"publicId":{"type":"string"},"name":{"type":"string"},"isActive":{"type":"boolean"},"validationMode":{"type":"string","enum":["sandbox","live"]},"submissionCount":{"type":"number"},"createdAt":{"type":"string"},"fieldSchema":{},"allowedOrigins":{"type":["array","null"],"items":{"type":"string"}}},"required":["id","projectId","publicId","name","allowedOrigins"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update a form: its name, whether it is active, the redirect and its spam rules","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"isActive":{"type":"boolean"},"successRedirect":{"type":["string","null"],"maxLength":2048},"spamRules":{"type":["object","null"],"properties":{"blockedEmailDomains":{"type":"array","items":{"type":"string","pattern":"^(\\*\\.|@)?(?=.{1,253}$)[a-z0-9-]+(\\.[a-z0-9-]+)+$"},"maxItems":200},"blockDisposable":{"type":"boolean"},"blockedKeywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"maxItems":200},"countries":{"type":"object","properties":{"mode":{"type":"string","enum":["allow","block"]},"list":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"maxItems":250}},"required":["mode","list"]},"duplicateWindowMinutes":{"type":["integer","null"],"minimum":1,"maximum":1440}}}}}}}},"responses":{"200":{"description":"The updated form","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"publicId":{"type":"string"},"name":{"type":"string"},"isActive":{"type":"boolean"},"validationMode":{"type":"string","enum":["sandbox","live"]},"submissionCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","projectId","publicId","name"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete a form and its responses","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/{id}/definition":{"get":{"summary":"Get a form’s v2 definition","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The definition (null when unset)","content":{"application/json":{"schema":{"type":"object","properties":{"formId":{"type":"string"},"definition":{}},"required":["formId"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}},"put":{"summary":"Replace a form’s v2 definition","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"The stored definition","content":{"application/json":{"schema":{"type":"object","properties":{"formId":{"type":"string"},"definition":{}},"required":["formId"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/{id}/go-live":{"post":{"summary":"Go live: replies to submitters send and the definition is enforced","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The form","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"publicId":{"type":"string"},"name":{"type":"string"},"isActive":{"type":"boolean"},"validationMode":{"type":"string","enum":["sandbox","live"]},"submissionCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","projectId","publicId","name"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}},"/v2/forms/{id}/sandbox":{"post":{"summary":"Back to sandbox: responses are stored and delivered, nothing is sent to submitters","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The form","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"publicId":{"type":"string"},"name":{"type":"string"},"isActive":{"type":"boolean"},"validationMode":{"type":"string","enum":["sandbox","live"]},"submissionCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","projectId","publicId","name"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, unknown, expired or revoked token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The token lacks the scope (or its user the role) for this action","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found, or in another org","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"upgradeUrl":{"type":"string"}},"required":["error"]}}}}}}}},"webhooks":{}}