{"openapi":"3.1.0","info":{"title":"Formerize API","version":"1.0.0"},"servers":[{"url":"https://api.formerize.lansford.dev"}],"paths":{"/v1/workspace":{"get":{"operationId":"get_workspace","summary":"Get the current workspace and Trial usage","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/forms":{"get":{"operationId":"list_forms","summary":"List forms in the current workspace","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}},"post":{"operationId":"create_form","summary":"Create a draft form","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","definition","destination_email"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"definition":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"number","const":1},"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"branding":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":80},"accent":{"type":"string","enum":["indigo","blue","green","orange","rose"]},"background":{"type":"string","enum":["canvas","paper","slate"]},"font":{"type":"string","enum":["system","serif","mono"]},"radius":{"type":"string","enum":["none","small","medium","large"]},"density":{"type":"string","enum":["compact","comfortable","spacious"]}},"required":["displayName","accent","background","font","radius","density"],"additionalProperties":false},"submitLabel":{"type":"string","minLength":1,"maxLength":80},"successTitle":{"type":"string","minLength":1,"maxLength":160},"successBody":{"type":"string","minLength":1,"maxLength":1000},"pages":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"title":{"type":"string","minLength":1,"maxLength":120},"components":{"maxItems":40,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"short_text"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"long_text"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"email"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"phone"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"url"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"number"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"date"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"select"},"options":{"minItems":2,"maxItems":20,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}},"required":["label","value"],"additionalProperties":false}}},"required":["id","fieldKey","label","required","type","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"radio"},"options":{"minItems":2,"maxItems":20,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}},"required":["label","value"],"additionalProperties":false}}},"required":["id","fieldKey","label","required","type","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"checkbox_group"},"options":{"minItems":2,"maxItems":20,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}},"required":["label","value"],"additionalProperties":false}}},"required":["id","fieldKey","label","required","type","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"consent"},"policyUrl":{"type":"string","format":"uri"}},"required":["id","fieldKey","label","required","type","policyUrl"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"type":"string","const":"heading"},"text":{"type":"string","minLength":1,"maxLength":160}},"required":["id","type","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","minLength":1,"maxLength":1000}},"required":["id","type","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"type":"string","const":"divider"}},"required":["id","type"],"additionalProperties":false}]}}},"required":["id","components"],"additionalProperties":false}}},"required":["version","id","branding","submitLabel","successTitle","successBody","pages"],"additionalProperties":false},"destination_email":{"type":"string","format":"email"}}}}}},"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/forms/{id}":{"get":{"operationId":"get_form","summary":"Get one form","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}},"patch":{"operationId":"update_form","summary":"Update a form draft","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"definition":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"number","const":1},"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"branding":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":80},"accent":{"type":"string","enum":["indigo","blue","green","orange","rose"]},"background":{"type":"string","enum":["canvas","paper","slate"]},"font":{"type":"string","enum":["system","serif","mono"]},"radius":{"type":"string","enum":["none","small","medium","large"]},"density":{"type":"string","enum":["compact","comfortable","spacious"]}},"required":["displayName","accent","background","font","radius","density"],"additionalProperties":false},"submitLabel":{"type":"string","minLength":1,"maxLength":80},"successTitle":{"type":"string","minLength":1,"maxLength":160},"successBody":{"type":"string","minLength":1,"maxLength":1000},"pages":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"title":{"type":"string","minLength":1,"maxLength":120},"components":{"maxItems":40,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"short_text"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"long_text"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"email"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"phone"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"url"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"number"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"date"}},"required":["id","fieldKey","label","required","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"select"},"options":{"minItems":2,"maxItems":20,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}},"required":["label","value"],"additionalProperties":false}}},"required":["id","fieldKey","label","required","type","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"radio"},"options":{"minItems":2,"maxItems":20,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}},"required":["label","value"],"additionalProperties":false}}},"required":["id","fieldKey","label","required","type","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"checkbox_group"},"options":{"minItems":2,"maxItems":20,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}},"required":["label","value"],"additionalProperties":false}}},"required":["id","fieldKey","label","required","type","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":120},"helpText":{"type":"string","maxLength":280},"placeholder":{"type":"string","maxLength":160},"required":{"type":"boolean"},"width":{"type":"string","enum":["full","half"]},"type":{"type":"string","const":"consent"},"policyUrl":{"type":"string","format":"uri"}},"required":["id","fieldKey","label","required","type","policyUrl"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"type":"string","const":"heading"},"text":{"type":"string","minLength":1,"maxLength":160}},"required":["id","type","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","minLength":1,"maxLength":1000}},"required":["id","type","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"type":"string","const":"divider"}},"required":["id","type"],"additionalProperties":false}]}}},"required":["id","components"],"additionalProperties":false}}},"required":["version","id","branding","submitLabel","successTitle","successBody","pages"],"additionalProperties":false},"destination_email":{"type":"string","format":"email"}},"anyOf":[{"required":["name"]},{"required":["definition"]},{"required":["destination_email"]}]}}}},"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/forms/{id}/publish":{"post":{"operationId":"publish_form","summary":"Publish the current draft","security":[{"cookieAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/forms/{id}/submissions":{"get":{"operationId":"list_submissions","summary":"List retained submission content","security":[{"cookieAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/forms/{id}/deliveries":{"get":{"operationId":"list_deliveries","summary":"List delivery evidence","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/attention":{"get":{"operationId":"list_attention","summary":"List deliveries that need attention","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/keys":{"get":{"operationId":"list_keys","summary":"List management API keys","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}},"post":{"operationId":"create_key","summary":"Create a management API key","security":[{"cookieAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":80}}}}}},"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/keys/{id}":{"delete":{"operationId":"delete_key","summary":"Revoke a management API key","security":[{"cookieAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required"},"422":{"description":"Invalid request"}}}},"/v1/public/forms/{id}":{"get":{"operationId":"get_public_form","summary":"Get a published form","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Published form"}}}},"/f/{id}":{"post":{"operationId":"submit_form","summary":"Accept a published form submission","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","maxProperties":100,"additionalProperties":{"oneOf":[{"type":"string","maxLength":10000},{"type":"array","items":{"type":"string","maxLength":10000}}]}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","maxProperties":100}},"multipart/form-data":{"schema":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","maxLength":10000}}}}},"responses":{"202":{"description":"Accepted, not delivery proof"},"303":{"description":"Plain HTML receipt"},"429":{"description":"Rate or Trial quota reached"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"__Host-formerize_session"}}}}