{"openapi":"3.1.0","info":{"title":"Management API","version":"1.0"},"servers":[{"url":"https://app.activecalculator.com/api/v1"}],"components":{"securitySchemes":{"sec0":{"type":"apiKey","in":"header","name":"x-ac-api-key"}}},"security":[{"sec0":[]}],"paths":{"/webhooks":{"get":{"summary":"Get All Webhooks","description":"Retrieve a list of all webhooks for the current workspace","operationId":"get-all-webhooks","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"data\": [\n    {\n      \"id\": \"webhook123\",\n      \"name\": \"Webhook One\",\n      \"createdAt\": \"2024-01-15T10:30:00.000Z\",\n      \"updatedAt\": \"2024-01-15T11:45:00.000Z\",\n      \"url\": \"https://example.com/webhook1\",\n      \"source\": \"user\",\n      \"workspaceId\": \"workspace456\",\n      \"calculators\": [\n        {\n          \"id\": \"calc789\",\n          \"name\": \"Calculator A\"\n        },\n        {\n          \"id\": \"calc101\",\n          \"name\": \"Calculator B\"\n        },\n        {\n          \"id\": \"calc202\",\n          \"name\": \"Calculator C\"\n        }\n      ],\n      \"triggers\": [\n        {\n          \"type\": \"newSubmission\",\n          \"webhookId\": \"webhook123\"\n        }\n      ]\n    },\n    {\n      \"id\": \"webhook456\",\n      \"name\": \"Webhook Two\",\n      \"createdAt\": \"2024-01-20T14:20:00.000Z\",\n      \"updatedAt\": \"2024-01-20T14:20:00.000Z\",\n      \"url\": \"https://example.com/webhook2\",\n      \"source\": \"user\",\n      \"workspaceId\": \"workspace456\",\n      \"calculators\": [\n        {\n          \"id\": \"calc789\",\n          \"name\": \"Calculator A\"\n        }\n      ],\n      \"triggers\": [\n        {\n          \"type\": \"newSubmission\",\n          \"webhookId\": \"webhook456\"\n        }\n      ]\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"webhook123"},"name":{"type":"string","example":"Webhook One"},"createdAt":{"type":"string","example":"2024-01-15T10:30:00.000Z"},"updatedAt":{"type":"string","example":"2024-01-15T11:45:00.000Z"},"url":{"type":"string","example":"https://example.com/webhook1"},"source":{"type":"string","example":"user"},"workspaceId":{"type":"string","example":"workspace456"},"calculators":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"calc789"},"name":{"type":"string","example":"Calculator A"}}}},"triggers":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","example":"newSubmission"},"webhookId":{"type":"string","example":"webhook123"}}}}}}}}}}}},"400":{"description":"400","content":{"text/plain":{"examples":{"Result":{"value":""}}}}}},"deprecated":false},"post":{"summary":"Register Webhook","description":"Create a new webhook right from the API and see it active right away!","operationId":"register-webhook","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url","triggers","calculators"],"properties":{"url":{"type":"string","description":"The URL where the webhook will send data"},"name":{"type":"string","description":"A name for the webhook"},"source":{"type":"string","description":"The source of the webhook","default":"user","enum":["user","zapier","make","n8n","pipedream"]},"triggers":{"type":"array","description":"An array of pipeline trigger event types. Currently supported trigger is \"newSubmission\"","default":["newSubmission"],"items":{"type":"string"}},"calculators":{"type":"array","description":"An array of calculator IDs (CUID2 format)","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"data\": {\n    \"id\": \"webhook123\",\n    \"name\": \"Example Webhook\",\n    \"createdAt\": \"2024-01-15T10:30:00.000Z\",\n    \"updatedAt\": \"2024-01-15T11:45:00.000Z\",\n    \"url\": \"https://example.com/webhook\",\n    \"source\": \"user\",\n    \"workspaceId\": \"workspace456\"\n  }\n}"}},"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","example":"webhook123"},"name":{"type":"string","example":"Example Webhook"},"createdAt":{"type":"string","example":"2024-01-15T10:30:00.000Z"},"updatedAt":{"type":"string","example":"2024-01-15T11:45:00.000Z"},"url":{"type":"string","example":"https://example.com/webhook"},"source":{"type":"string","example":"user"},"workspaceId":{"type":"string","example":"workspace456"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/webhooks/{webhookId}":{"get":{"summary":"Get Webhook","description":"Get a specific webhook object based on its ID","operationId":"get-webhook","parameters":[{"name":"webhookId","in":"path","description":"ID of the webhook","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"data\": {\n    \"id\": \"webhook123\",\n    \"name\": \"Example Webhook\",\n    \"createdAt\": \"2024-01-15T10:30:00.000Z\",\n    \"updatedAt\": \"2024-01-15T11:45:00.000Z\",\n    \"url\": \"https://example.com/webhook\",\n    \"source\": \"user\",\n    \"workspaceId\": \"workspace456\"\n  }\n}"}},"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","example":"webhook123"},"name":{"type":"string","example":"Example Webhook"},"createdAt":{"type":"string","example":"2024-01-15T10:30:00.000Z"},"updatedAt":{"type":"string","example":"2024-01-15T11:45:00.000Z"},"url":{"type":"string","example":"https://example.com/webhook"},"source":{"type":"string","example":"user"},"workspaceId":{"type":"string","example":"workspace456"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false},"delete":{"summary":"Remove Webhook","description":"Delete an existing webhook by provifding it's ID. It will immediately apply and not trigger again.","operationId":"remove-webhook","parameters":[{"name":"webhookId","in":"path","description":"ID of the webhook","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"data\": {\n    \"id\": \"webhook123\",\n    \"name\": \"Example Webhook\",\n    \"createdAt\": \"2024-06-23T17:03:38.899Z\",\n    \"updatedAt\": \"2024-06-23T17:11:04.774Z\",\n    \"url\": \"https://example.com/webhook\",\n    \"source\": \"user\",\n    \"workspaceId\": \"workspace456\"\n  }\n}"}},"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","example":"webhook123"},"name":{"type":"string","example":"Example Webhook"},"createdAt":{"type":"string","example":"2024-06-23T17:03:38.899Z"},"updatedAt":{"type":"string","example":"2024-06-23T17:11:04.774Z"},"url":{"type":"string","example":"https://example.com/webhook"},"source":{"type":"string","example":"user"},"workspaceId":{"type":"string","example":"workspace456"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/calculators":{"get":{"summary":"Get All Calculators","description":"Fetches all existing calculators","operationId":"get-all-calculators","parameters":[{"name":"limit","in":"query","description":"The maximum number of calculators to return","schema":{"type":"integer","format":"int32"}},{"name":"offset","in":"query","description":"The number of calculators to skip before starting to return results","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"data\": [\n    {\n      \"id\": \"calculator123\",\n      \"createdAt\": \"2024-08-11T20:45:07.966Z\",\n      \"updatedAt\": \"2024-08-11T20:45:07.966Z\",\n      \"name\": \"Example Calculator\",\n      \"slug\": null,\n      \"workspaceId\": \"workspace456\",\n      \"folderId\": \"folder789\",\n      \"status\": \"draft\",\n      \"elements\": [],\n      \"layouts\": {\n        \"lg\": [],\n        \"md\": [],\n        \"sm\": []\n      },\n      \"variables\": [],\n      \"submitActions\": {},\n      \"themeId\": \"default\",\n      \"templateVisibility\": null,\n      \"templateCalculatorId\": null,\n      \"clonesCount\": 0,\n      \"impressionsCount\": 0,\n      \"lastImpressionAt\": null,\n      \"submissionsCount\": 0,\n      \"lastSubmissionAt\": null,\n      \"newElementCount\": {}\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"calculator123"},"createdAt":{"type":"string","example":"2024-08-11T20:45:07.966Z"},"updatedAt":{"type":"string","example":"2024-08-11T20:45:07.966Z"},"name":{"type":"string","example":"Example Calculator"},"slug":{},"workspaceId":{"type":"string","example":"workspace456"},"folderId":{"type":"string","example":"folder789"},"status":{"type":"string","example":"draft"},"elements":{"type":"array"},"layouts":{"type":"object","properties":{"lg":{"type":"array"},"md":{"type":"array"},"sm":{"type":"array"}}},"variables":{"type":"array"},"submitActions":{"type":"object","properties":{}},"themeId":{"type":"string","example":"default"},"templateVisibility":{},"templateCalculatorId":{},"clonesCount":{"type":"integer","example":0,"default":0},"impressionsCount":{"type":"integer","example":0,"default":0},"lastImpressionAt":{},"submissionsCount":{"type":"integer","example":0,"default":0},"lastSubmissionAt":{},"newElementCount":{"type":"object","properties":{}}}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/me":{"get":{"summary":"Me","description":"Fetches the workspace associated with the passed API key","operationId":"me","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"id\": \"workspace123\",\n  \"name\": \"Example Workspace\",\n  \"createdAt\": \"2024-01-15T10:30:00.000Z\",\n  \"updatedAt\": \"2024-08-10T14:45:00.000Z\"\n}"}},"schema":{"type":"object","properties":{"id":{"type":"string","example":"workspace123"},"name":{"type":"string","example":"Example Workspace"},"createdAt":{"type":"string","example":"2024-01-15T10:30:00.000Z"},"updatedAt":{"type":"string","example":"2024-08-10T14:45:00.000Z"}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}}},"x-readme":{"headers":[],"explorer-enabled":true,"proxy-enabled":true},"x-readme-fauxas":true}