{"openapi":"3.1.0","info":{"title":"Formly API","version":"1.0.0","summary":"Create, edit, publish, and read Formly forms from agents and scripts.","description":"Programmatic API for Formly. Authenticate with a Formly API key (`formly_sk_...`) or an OAuth 2.0 access token. Credentials are scoped: forms:read, forms:write, submissions:read, spaces:write.","contact":{"name":"Formly","url":"https://formly.so/developers"}},"externalDocs":{"description":"Developer docs, MCP setup, and agent guide","url":"https://formly.so/developers"},"servers":[{"url":"https://api.formly.so","description":"Formly API"}],"tags":[{"name":"Spaces"},{"name":"Forms"},{"name":"Submissions"}],"security":[{"oauth2":["forms:read","forms:write","submissions:read","spaces:write"]},{"apiKey":["forms:read","forms:write","submissions:read","spaces:write"]}],"paths":{"/v1/spaces":{"get":{"tags":["Spaces"],"operationId":"listSpaces","summary":"List workspaces","security":[{"oauth2":["forms:read"]},{"apiKey":["forms:read"]}],"responses":{"200":{"description":"Workspaces"}}},"post":{"tags":["Spaces"],"operationId":"createSpace","summary":"Create a workspace","security":[{"oauth2":["spaces:write"]},{"apiKey":["spaces:write"]}],"responses":{"201":{"description":"Workspace created"}}}},"/v1/forms":{"get":{"tags":["Forms"],"operationId":"listForms","summary":"List forms","security":[{"oauth2":["forms:read"]},{"apiKey":["forms:read"]}],"responses":{"200":{"description":"Forms"}}},"post":{"tags":["Forms"],"operationId":"createForm","summary":"Create a blank or structured form","security":[{"oauth2":["forms:write"]},{"apiKey":["forms:write"]}],"responses":{"201":{"description":"Form created"}}}},"/v1/forms/ai":{"post":{"tags":["Forms"],"operationId":"createFormAI","summary":"Create a form from a natural-language description","security":[{"oauth2":["forms:write"]},{"apiKey":["forms:write"]}],"responses":{"201":{"description":"Form generated"}}}},"/v1/forms/{id}":{"get":{"tags":["Forms"],"operationId":"getForm","summary":"Get a form's structure","security":[{"oauth2":["forms:read"]},{"apiKey":["forms:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Form","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"published":{"type":"boolean"},"spaceId":{"type":"string"},"editUrl":{"type":"string","format":"uri"},"publicUrl":{"type":"string","format":"uri"}},"required":["id","name","published"]}}}}}},"put":{"tags":["Forms"],"operationId":"updateForm","summary":"Update a form's name or pages","security":[{"oauth2":["forms:write"]},{"apiKey":["forms:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated form"}}},"delete":{"tags":["Forms"],"operationId":"deleteForm","summary":"Delete a form","security":[{"oauth2":["forms:write"]},{"apiKey":["forms:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Form deleted"}}}},"/v1/forms/{id}/ai":{"post":{"tags":["Forms"],"operationId":"editFormAI","summary":"Edit a form with a natural-language instruction","security":[{"oauth2":["forms:write"]},{"apiKey":["forms:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Form edited"}}}},"/v1/forms/{id}/settings":{"patch":{"tags":["Forms"],"operationId":"updateFormSettings","summary":"Update a form's settings","security":[{"oauth2":["forms:write"]},{"apiKey":["forms:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated settings"}}}},"/v1/forms/{id}/publish":{"post":{"tags":["Forms"],"operationId":"publishForm","summary":"Publish a form","security":[{"oauth2":["forms:write"]},{"apiKey":["forms:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Published"}}}},"/v1/forms/{id}/unpublish":{"post":{"tags":["Forms"],"operationId":"unpublishForm","summary":"Unpublish a form","security":[{"oauth2":["forms:write"]},{"apiKey":["forms:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Unpublished"}}}},"/v1/forms/{id}/submissions":{"get":{"tags":["Submissions"],"operationId":"getSubmissions","summary":"List responses for a form","security":[{"oauth2":["submissions:read"]},{"apiKey":["submissions:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Submissions"}}}}},"components":{"securitySchemes":{"oauth2":{"type":"oauth2","description":"OAuth 2.0 authorization code with PKCE (S256). Discover the authorization server at /.well-known/oauth-authorization-server.","flows":{"authorizationCode":{"authorizationUrl":"https://api.formly.so/oauth/authorize","tokenUrl":"https://api.formly.so/oauth/token","refreshUrl":"https://api.formly.so/oauth/token","scopes":{"forms:read":"View your forms and workspaces","forms:write":"Create, edit, publish, and unpublish forms","submissions:read":"Read form submissions","spaces:write":"Create workspaces"}}}},"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Formly API key (`Authorization: Bearer formly_sk_...`). Keys use the same scopes as OAuth: forms:read, forms:write, submissions:read, spaces:write."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message"]}}}}