{ "components": { "schemas": { "conditionGroup": { "properties": { "conditions": { "items": { "anyOf": [ { "allOf": [ { "properties": { "id": { "type": "string" }, "leftOperand": { "anyOf": [ { "properties": { "meta": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "element", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "properties": { "type": { "const": "variable", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "properties": { "type": { "const": "hiddenField", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" } ] }, "operator": { "enum": [ "equals", "doesNotEqual", "contains", "doesNotContain", "startsWith", "doesNotStartWith", "endsWith", "doesNotEndWith", "isSubmitted", "isSkipped", "isGreaterThan", "isLessThan", "isGreaterThanOrEqual", "isLessThanOrEqual", "equalsOneOf", "includesAllOf", "includesOneOf", "doesNotIncludeOneOf", "doesNotIncludeAllOf", "isClicked", "isNotClicked", "isAccepted", "isBefore", "isAfter", "isBooked", "isPartiallySubmitted", "isCompletelySubmitted", "isSet", "isNotSet", "isEmpty", "isNotEmpty", "isAnyOf" ], "type": "string" }, "rightOperand": { "anyOf": [ { "properties": { "type": { "const": "static", "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" } ] } }, "required": ["type", "value"], "type": "object" }, { "anyOf": [ { "properties": { "meta": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "element", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "properties": { "type": { "const": "variable", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "properties": { "type": { "const": "hiddenField", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" } ] } ] } }, "required": ["id", "leftOperand", "operator"], "type": "object" }, { "properties": {}, "type": "object" } ] }, { "$ref": "#/components/schemas/conditionGroup" } ] }, "type": "array" }, "connector": { "enum": ["and", "or"], "type": "string" }, "id": { "type": "string" } }, "required": ["id", "connector", "conditions"], "type": "object" }, "contact": { "properties": { "createdAt": { "description": "When the contact was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "Unique identifier for the contact", "type": "string" }, "updatedAt": { "description": "When the contact was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "userId": { "description": "Optional external user identifier", "type": ["string", "null"] }, "workspaceId": { "description": "The Workspace this contact belongs to", "type": "string" } }, "required": ["id", "userId", "createdAt", "updatedAt", "workspaceId", "environmentId"], "type": "object" }, "contactAttribute": { "properties": { "attributeKeyId": { "description": "The ID of the attribute key", "type": "string" }, "contactId": { "description": "The ID of the contact", "type": "string" }, "createdAt": { "description": "The date and time the contact attribute was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "id": { "description": "The ID of the contact attribute", "type": "string" }, "updatedAt": { "description": "The date and time the contact attribute was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "value": { "description": "The value of the attribute", "example": "example@email.com", "type": "string" } }, "required": ["id", "createdAt", "updatedAt", "attributeKeyId", "contactId", "value"], "type": "object" }, "contactAttributeKey": { "properties": { "createdAt": { "description": "The date and time the contact attribute key was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "description": { "description": "Description of the attribute", "example": "The user's email address", "type": ["string", "null"] }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the contact attribute key", "type": "string" }, "isUnique": { "description": "Whether the attribute must have unique values across contacts", "example": false, "type": "boolean" }, "key": { "description": "The attribute identifier used in the system", "example": "email", "type": "string" }, "name": { "description": "Display name for the attribute", "example": "Email Address", "type": ["string", "null"] }, "type": { "description": "Whether this is a default or custom attribute", "enum": ["default", "custom"], "example": "custom", "type": "string" }, "updatedAt": { "description": "The date and time the contact attribute key was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace this attribute belongs to", "type": "string" } }, "required": [ "id", "createdAt", "updatedAt", "isUnique", "key", "name", "description", "type", "workspaceId", "environmentId" ], "type": "object" }, "contactAttributeKeyId": { "description": "The ID of the contact attribute key", "type": "string" }, "contactAttributeKeyInput": { "description": "Input data for creating or updating a contact attribute", "properties": { "description": { "description": "Description of the attribute", "example": "The user's email address", "type": ["string", "null"] }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "key": { "description": "The attribute identifier used in the system", "example": "email", "type": "string" }, "name": { "description": "Display name for the attribute", "example": "Email Address", "type": ["string", "null"] }, "workspaceId": { "description": "The ID of the Workspace this attribute belongs to", "type": "string" } }, "required": ["key", "name", "description", "workspaceId", "environmentId"], "type": "object" }, "contactAttributeKeyUpdate": { "description": "A contact attribute key to update.", "properties": { "description": { "description": "Description of the attribute", "example": "The user's email address", "type": ["string", "null"] }, "key": { "description": "The attribute identifier used in the system", "example": "email", "type": "string" }, "name": { "description": "Display name for the attribute", "example": "Email Address", "type": ["string", "null"] } }, "required": ["name", "description", "key"], "type": "object" }, "health": { "description": "Health check status for critical application dependencies", "properties": { "cache_database": { "description": "Cache database connection status - true if cache database is reachable and running", "example": true, "type": "boolean" }, "main_database": { "description": "Main database connection status - true if database is reachable and running", "example": true, "type": "boolean" } }, "required": ["main_database", "cache_database"], "title": "Health Check Response", "type": "object" }, "me": { "properties": { "environments": { "deprecated": true, "description": "Deprecated alias of `workspaces`.", "items": { "properties": { "environmentId": { "deprecated": true, "type": "string" }, "environmentType": { "enum": ["production", "development"], "type": "string" }, "permission": { "enum": ["read", "write", "manage"], "type": "string" }, "projectId": { "type": "string" }, "projectName": { "type": "string" }, "workspaceId": { "type": "string" } }, "required": [ "workspaceId", "environmentId", "environmentType", "permission", "projectId", "projectName" ], "type": "object" }, "type": "array" }, "organizationAccess": { "properties": { "accessControl": { "additionalProperties": false, "properties": { "read": { "type": "boolean" }, "write": { "type": "boolean" } }, "required": ["read", "write"], "type": "object" } }, "required": ["accessControl"], "type": "object" }, "organizationId": { "type": "string" }, "workspaces": { "items": { "properties": { "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "environmentType": { "enum": ["production", "development"], "type": "string" }, "permission": { "enum": ["read", "write", "manage"], "type": "string" }, "projectId": { "type": "string" }, "projectName": { "type": "string" }, "workspaceId": { "type": "string" } }, "required": [ "workspaceId", "environmentId", "environmentType", "permission", "projectId", "projectName" ], "type": "object" }, "type": "array" } }, "required": ["organizationId", "organizationAccess", "workspaces", "environments"], "type": "object" }, "organizationId": { "description": "The ID of the organization", "type": "string" }, "projectTeam": { "properties": { "createdAt": { "description": "The date and time the Workspace team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "permission": { "description": "Level of access granted to the Workspace", "enum": ["read", "readWrite", "manage"], "type": "string" }, "projectId": { "description": "The ID of the Workspace", "type": "string" }, "teamId": { "description": "The ID of the team", "type": "string" }, "updatedAt": { "description": "The date and time the Workspace team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "required": ["createdAt", "updatedAt", "projectId", "teamId", "permission"], "type": "object" }, "response": { "properties": { "contactAttributes": { "additionalProperties": { "type": "string" }, "description": "The attributes of the contact", "example": { "attribute1": "value1", "attribute2": "value2" }, "type": ["object", "null"] }, "contactId": { "description": "The ID of the contact", "type": ["string", "null"] }, "createdAt": { "description": "The date and time the response was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "data": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" }, { "additionalProperties": { "type": "string" }, "type": "object" } ] }, "description": "The data of the response", "example": { "question1": "answer1", "question2": 2, "question3": ["answer3", "answer4"], "question4": { "subquestion1": "answer5" } }, "type": "object" }, "displayId": { "description": "The display ID of the response", "type": ["string", "null"] }, "endingId": { "description": "The ID of the ending", "type": ["string", "null"] }, "finished": { "description": "Whether the response is finished", "example": true, "type": "boolean" }, "id": { "description": "The ID of the response", "type": "string" }, "language": { "description": "The language of the response", "example": "en", "type": ["string", "null"] }, "meta": { "description": "The meta data of the response", "example": { "action": "click", "country": "US", "source": "https://example.com", "url": "https://example.com", "userAgent": { "browser": "Chrome", "device": "Desktop", "os": "Windows" } }, "properties": { "action": { "type": "string" }, "country": { "type": "string" }, "source": { "description": "The source of the response", "example": "https://example.com", "type": "string" }, "url": { "description": "The URL of the response", "example": "https://example.com", "type": "string" }, "userAgent": { "properties": { "browser": { "type": "string" }, "device": { "type": "string" }, "os": { "type": "string" } }, "type": "object" } }, "type": "object" }, "singleUseId": { "description": "The single use ID of the response", "type": ["string", "null"] }, "surveyId": { "description": "The ID of the survey", "type": "string" }, "ttc": { "additionalProperties": { "type": "number" }, "description": "The TTC of the response", "example": { "question1": 10, "question2": 20 }, "type": "object" }, "updatedAt": { "description": "The date and time the response was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "variables": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "description": "The variables of the response", "example": { "variable1": "answer1", "variable2": 2 }, "type": "object" } }, "required": [ "id", "createdAt", "updatedAt", "finished", "surveyId", "contactId", "endingId", "data", "variables", "ttc", "meta", "contactAttributes", "singleUseId", "language", "displayId" ], "type": "object" }, "responseId": { "description": "The ID of the response", "type": "string" }, "role": { "properties": { "data": { "items": { "anyOf": [ { "const": "owner", "type": "string" }, { "const": "manager", "type": "string" }, { "const": "member", "type": "string" }, { "const": "billing", "type": "string" } ] }, "type": "array" } }, "required": ["data"], "type": "object" }, "survey": { "properties": { "autoClose": { "description": "Auto close time in seconds", "type": ["number", "null"] }, "autoComplete": { "description": "Auto complete time in seconds", "type": ["number", "null"] }, "blocks": { "default": [], "description": "The blocks of the survey", "items": { "properties": { "backButtonLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "buttonLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "elements": { "items": { "anyOf": [ { "properties": { "charLimit": { "default": { "enabled": false }, "properties": { "enabled": { "default": false, "type": "boolean" }, "max": { "type": "number" }, "min": { "type": "number" } }, "type": "object" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "inputType": { "default": "text", "enum": ["text", "email", "url", "number", "phone"], "type": "string" }, "insightsEnabled": { "default": false, "type": "boolean" }, "isDraft": { "type": "boolean" }, "longAnswer": { "type": "boolean" }, "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "openText", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "inputType", "charLimit"], "type": "object" }, { "properties": { "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "label": { "additionalProperties": { "type": "string" }, "type": "object" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "consent", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "label"], "type": "object" }, { "properties": { "choices": { "items": { "properties": { "id": { "type": "string" }, "label": { "additionalProperties": { "type": "string" }, "type": "object" } }, "required": ["id", "label"], "type": "object" }, "minItems": 2, "type": "array" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "otherOptionPlaceholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "shuffleOption": { "enum": ["none", "all", "exceptLast"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "anyOf": [ { "const": "multipleChoiceSingle", "type": "string" }, { "const": "multipleChoiceMulti", "type": "string" } ] }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "choices"], "type": "object" }, { "properties": { "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isColorCodingEnabled": { "default": false, "type": "boolean" }, "isDraft": { "type": "boolean" }, "lowerLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "nps", "type": "string" }, "upperLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "isColorCodingEnabled"], "type": "object" }, { "properties": { "buttonExternal": { "default": false, "type": "boolean" }, "buttonUrl": { "type": "string" }, "ctaButtonLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "cta", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "buttonExternal"], "type": "object" }, { "properties": { "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isColorCodingEnabled": { "default": false, "type": "boolean" }, "isDraft": { "type": "boolean" }, "lowerLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 6, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "rating", "type": "string" }, "upperLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": [ "id", "type", "headline", "required", "scale", "range", "isColorCodingEnabled" ], "type": "object" }, { "properties": { "allowMulti": { "default": false, "type": "boolean" }, "choices": { "items": { "properties": { "id": { "type": "string" }, "imageUrl": { "type": "string" } }, "required": ["id", "imageUrl"], "type": "object" }, "minItems": 2, "type": "array" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "pictureSelection", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "allowMulti", "choices"], "type": "object" }, { "properties": { "format": { "enum": ["M-d-y", "d-M-y", "y-M-d"], "type": "string" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "html": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "date", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "format"], "type": "object" }, { "properties": { "allowMultipleFiles": { "type": "boolean" }, "allowedFileExtensions": { "items": { "enum": [ "heic", "png", "jpeg", "jpg", "webp", "pdf", "eml", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "csv", "mp4", "mov", "avi", "mkv", "webm", "zip", "rar", "7z", "tar" ], "type": "string" }, "type": "array" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "maxSizeInMB": { "type": "number" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "fileUpload", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "allowMultipleFiles"], "type": "object" }, { "properties": { "calHost": { "type": "string" }, "calUserName": { "minLength": 1, "type": "string" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "cal", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "calUserName"], "type": "object" }, { "properties": { "columns": { "items": { "properties": { "id": { "type": "string" }, "label": { "additionalProperties": { "type": "string" }, "type": "object" } }, "required": ["id", "label"], "type": "object" }, "type": "array" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "rows": { "items": { "properties": { "id": { "type": "string" }, "label": { "additionalProperties": { "type": "string" }, "type": "object" } }, "required": ["id", "label"], "type": "object" }, "type": "array" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "shuffleOption": { "default": "none", "enum": ["none", "all", "exceptLast"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "matrix", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": [ "id", "type", "headline", "required", "rows", "columns", "shuffleOption" ], "type": "object" }, { "properties": { "addressLine1": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "addressLine2": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "city": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "country": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "state": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "address", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" }, "zip": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" } }, "required": [ "id", "type", "headline", "required", "addressLine1", "addressLine2", "city", "state", "zip", "country" ], "type": "object" }, { "properties": { "choices": { "items": { "properties": { "id": { "type": "string" }, "label": { "additionalProperties": { "type": "string" }, "type": "object" } }, "required": ["id", "label"], "type": "object" }, "maxItems": 25, "minItems": 2, "type": "array" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "otherOptionPlaceholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "shuffleOption": { "enum": ["none", "all", "exceptLast"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "ranking", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type", "headline", "required", "choices"], "type": "object" }, { "properties": { "company": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "email": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "firstName": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "isDraft": { "type": "boolean" }, "lastName": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "phone": { "properties": { "placeholder": { "additionalProperties": { "type": "string" }, "type": "object" }, "required": { "type": "boolean" }, "show": { "type": "boolean" } }, "required": ["show", "required", "placeholder"], "type": "object" }, "range": { "anyOf": [ { "const": 5, "type": "number" }, { "const": 3, "type": "number" }, { "const": 4, "type": "number" }, { "const": 7, "type": "number" }, { "const": 10, "type": "number" } ] }, "required": { "type": "boolean" }, "scale": { "enum": ["number", "smiley", "star"], "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "contactInfo", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": [ "id", "type", "headline", "required", "firstName", "lastName", "email", "phone", "company" ], "type": "object" } ] }, "minItems": 1, "type": "array" }, "id": { "type": "string" }, "logic": { "items": { "properties": { "actions": { "items": { "anyOf": [ { "anyOf": [ { "properties": { "id": { "type": "string" }, "objective": { "const": "calculate", "type": "string" }, "operator": { "enum": ["assign", "concat"], "type": "string" }, "value": { "anyOf": [ { "properties": { "type": { "const": "static", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "anyOf": [ { "properties": { "meta": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "element", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "properties": { "type": { "const": "variable", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "properties": { "type": { "const": "hiddenField", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" } ] } ] }, "variableId": { "type": "string" } }, "required": ["id", "objective", "variableId", "operator", "value"], "type": "object" }, { "properties": { "id": { "type": "string" }, "objective": { "const": "calculate", "type": "string" }, "operator": { "enum": ["add", "subtract", "multiply", "divide", "assign"], "type": "string" }, "value": { "anyOf": [ { "properties": { "type": { "const": "static", "type": "string" }, "value": { "type": "number" } }, "required": ["type", "value"], "type": "object" }, { "anyOf": [ { "properties": { "meta": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "element", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "properties": { "type": { "const": "variable", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "properties": { "type": { "const": "hiddenField", "type": "string" }, "value": { "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" } ] } ] }, "variableId": { "type": "string" } }, "required": ["id", "objective", "variableId", "operator", "value"], "type": "object" } ] }, { "properties": { "id": { "type": "string" }, "objective": { "const": "requireAnswer", "type": "string" }, "target": { "minLength": 1, "type": "string" } }, "required": ["id", "objective", "target"], "type": "object" }, { "properties": { "id": { "type": "string" }, "objective": { "const": "jumpToBlock", "type": "string" }, "target": { "minLength": 1, "type": "string" } }, "required": ["id", "objective", "target"], "type": "object" } ] }, "type": "array" }, "conditions": { "$ref": "#/components/schemas/conditionGroup" }, "id": { "type": "string" } }, "required": ["id", "conditions", "actions"], "type": "object" }, "type": "array" }, "logicFallback": { "type": "string" }, "name": { "minLength": 1, "type": "string" } }, "required": ["id", "name", "elements"], "type": "object" }, "type": "array" }, "createdAt": { "description": "The date and time the survey was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "createdBy": { "description": "The user who created the survey", "type": ["string", "null"] }, "delay": { "description": "Delay before showing survey", "type": "number" }, "displayLimit": { "description": "Display limit for the survey", "type": ["number", "null"] }, "displayOption": { "description": "Display options for the survey", "enum": ["displayOnce", "displayMultiple", "displaySome", "respondMultiple"], "type": "string" }, "displayPercentage": { "description": "The display percentage of the survey", "type": ["number", "null"] }, "displayProgressBar": { "description": "Whether to display the progress bar", "type": ["boolean", "null"] }, "endings": { "default": [], "description": "The endings of the survey", "items": { "anyOf": [ { "properties": { "buttonLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "buttonLink": { "format": "uri", "type": "string" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "id": { "type": "string" }, "imageUrl": { "format": "uri", "type": "string" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "const": "endScreen", "type": "string" }, "videoUrl": { "format": "uri", "type": "string" } }, "required": ["id", "type"], "type": "object" }, { "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "type": { "const": "redirectToUrl", "type": "string" }, "url": { "format": "uri", "type": "string" } }, "required": ["id", "type"], "type": "object" } ] }, "type": "array" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "hiddenFields": { "description": "Hidden fields configuration", "properties": { "enabled": { "type": "boolean" }, "fieldIds": { "items": { "type": "string" }, "type": "array" } }, "required": ["enabled"], "type": "object" }, "id": { "description": "The ID of the survey", "type": "string" }, "inlineTriggers": { "description": "Inline triggers configuration", "items": {}, "type": ["array", "null"] }, "isAutoProgressingEnabled": { "description": "Whether auto-progress is enabled for eligible question types", "type": "boolean" }, "isBackButtonHidden": { "description": "Whether the back button is hidden", "type": "boolean" }, "isSingleResponsePerEmailEnabled": { "description": "Whether single response per email is enabled", "type": "boolean" }, "isVerifyEmailEnabled": { "description": "Whether email verification is enabled", "type": "boolean" }, "metadata": { "description": "Custom link metadata for social sharing", "properties": { "description": { "additionalProperties": { "type": "string" }, "type": "object" }, "ogImage": { "format": "uri", "type": "string" }, "title": { "additionalProperties": { "type": "string" }, "type": "object" } }, "type": "object" }, "name": { "description": "The name of the survey", "type": "string" }, "pin": { "description": "The pin of the survey", "type": ["string", "null"] }, "projectOverwrites": { "description": "Workspace-specific overwrites", "properties": { "brandColor": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "clickOutsideClose": { "type": ["boolean", "null"] }, "highlightBorderColor": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "overlay": { "enum": ["none", "light", "dark", null], "type": ["string", "null"] }, "placement": { "enum": ["bottomLeft", "bottomRight", "topLeft", "topRight", "center", null], "type": ["string", "null"] } }, "type": ["object", "null"] }, "questions": { "description": "The questions of the survey.", "items": {}, "type": "array" }, "recaptcha": { "description": "Google reCAPTCHA configuration", "properties": { "enabled": { "type": "boolean" }, "threshold": { "maximum": 0.9, "minimum": 0.1, "multipleOf": 0.1, "type": "number" } }, "required": ["enabled", "threshold"], "type": ["object", "null"] }, "recontactDays": { "description": "Days before recontacting", "type": ["number", "null"] }, "redirectUrl": { "description": "The URL to redirect to after the survey is completed", "format": "uri", "type": ["string", "null"] }, "segmentId": { "description": "ID of the segment", "type": ["string", "null"] }, "showLanguageSwitch": { "description": "Whether to show the language switch", "type": ["boolean", "null"] }, "showThankYouMessage": { "description": "Whether to show the thank you message", "type": ["boolean", "null"] }, "singleUse": { "description": "Single use configuration", "properties": { "enabled": { "type": "boolean" }, "isEncrypted": { "type": "boolean" } }, "required": ["enabled", "isEncrypted"], "type": "object" }, "status": { "description": "The status of the survey", "enum": ["draft", "inProgress", "paused", "completed"], "type": "string" }, "styling": { "description": "Survey styling configuration", "properties": { "background": { "properties": { "bg": { "type": ["string", "null"] }, "bgType": { "enum": ["animation", "color", "image", "upload", null], "type": ["string", "null"] }, "brightness": { "type": ["number", "null"] } }, "type": ["object", "null"] }, "brandColor": { "properties": { "dark": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "light": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": "string" } }, "required": ["light"], "type": ["object", "null"] }, "cardArrangement": { "properties": { "appSurveys": { "enum": ["casual", "straight", "simple"], "type": "string" }, "linkSurveys": { "enum": ["casual", "straight", "simple"], "type": "string" } }, "required": ["linkSurveys", "appSurveys"], "type": ["object", "null"] }, "cardBackgroundColor": { "properties": { "dark": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "light": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": "string" } }, "required": ["light"], "type": ["object", "null"] }, "cardBorderColor": { "properties": { "dark": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "light": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": "string" } }, "required": ["light"], "type": ["object", "null"] }, "hideProgressBar": { "type": ["boolean", "null"] }, "highlightBorderColor": { "properties": { "dark": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "light": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": "string" } }, "required": ["light"], "type": ["object", "null"] }, "inputBorderColor": { "properties": { "dark": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "light": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": "string" } }, "required": ["light"], "type": ["object", "null"] }, "inputColor": { "properties": { "dark": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "light": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": "string" } }, "required": ["light"], "type": ["object", "null"] }, "isDarkModeEnabled": { "type": ["boolean", "null"] }, "isLogoHidden": { "type": ["boolean", "null"] }, "logo": { "properties": { "bgColor": { "type": "string" }, "url": { "type": "string" } }, "type": ["object", "null"] }, "questionColor": { "properties": { "dark": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": ["string", "null"] }, "light": { "pattern": "^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "type": "string" } }, "required": ["light"], "type": ["object", "null"] }, "roundness": { "type": ["number", "null"] } }, "type": ["object", "null"] }, "surveyClosedMessage": { "description": "Message shown when survey is closed", "properties": { "enabled": { "type": "boolean" }, "heading": { "type": "string" }, "subheading": { "type": "string" } }, "required": ["enabled", "heading", "subheading"], "type": ["object", "null"] }, "thankYouMessage": { "description": "The thank you message of the survey", "type": ["string", "null"] }, "type": { "description": "The type of the survey", "enum": ["link", "app"], "type": "string" }, "updatedAt": { "description": "The date and time the survey was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "variables": { "description": "Survey variables", "items": { "oneOf": [ { "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "type": { "const": "number", "type": "string" }, "value": { "default": 0, "type": "number" } }, "required": ["id", "name", "type", "value"], "type": "object" }, { "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "type": { "const": "text", "type": "string" }, "value": { "default": "", "type": "string" } }, "required": ["id", "name", "type", "value"], "type": "object" } ] }, "type": "array" }, "welcomeCard": { "description": "The welcome card configuration", "properties": { "buttonLabel": { "additionalProperties": { "type": "string" }, "type": "object" }, "enabled": { "type": "boolean" }, "fileUrl": { "type": "string" }, "headline": { "additionalProperties": { "type": "string" }, "type": "object" }, "showResponseCount": { "type": "boolean" }, "subheader": { "additionalProperties": { "type": "string" }, "type": "object" }, "timeToFinish": { "type": "boolean" }, "videoUrl": { "type": "string" } }, "required": ["enabled", "timeToFinish", "showResponseCount"], "type": "object" }, "workspaceId": { "description": "The Workspace ID of the survey", "type": "string" } }, "required": [ "id", "createdAt", "updatedAt", "name", "redirectUrl", "type", "status", "thankYouMessage", "showLanguageSwitch", "showThankYouMessage", "welcomeCard", "displayProgressBar", "pin", "createdBy", "workspaceId", "environmentId", "blocks", "endings", "hiddenFields", "variables", "displayOption", "recontactDays", "displayLimit", "autoClose", "autoComplete", "delay", "surveyClosedMessage", "segmentId", "projectOverwrites", "styling", "singleUse", "isVerifyEmailEnabled", "isSingleResponsePerEmailEnabled", "inlineTriggers", "isBackButtonHidden", "isAutoProgressingEnabled", "recaptcha", "metadata", "displayPercentage", "questions" ], "type": "object" }, "team": { "properties": { "createdAt": { "description": "The date and time the team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "id": { "description": "The ID of the team", "type": "string" }, "name": { "description": "The name of the team", "example": "My team", "type": "string" }, "organizationId": { "description": "The ID of the organization", "type": "string" }, "updatedAt": { "description": "The date and time the team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "required": ["id", "createdAt", "updatedAt", "name", "organizationId"], "type": "object" }, "teamId": { "description": "The ID of the team", "type": "string" }, "user": { "properties": { "createdAt": { "description": "The date and time the user was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "email": { "description": "The email of the user", "example": "example@example.com", "format": "email", "maxLength": 255, "type": "string" }, "id": { "description": "The ID of the user", "type": "string" }, "isActive": { "description": "Whether the user is active", "example": true, "type": "boolean" }, "lastLoginAt": { "description": "The date and time the user last logged in", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "name": { "description": "The name of the user", "example": "John Doe", "minLength": 1, "pattern": "^[\\p{L}\\p{M}\\s'\\d-]+$", "type": "string" }, "role": { "description": "The role of the user in the organization", "enum": ["owner", "manager", "member"], "example": "member", "type": "string" }, "teams": { "description": "The list of teams the user is a member of", "example": ["team1", "team2"], "items": { "type": "string" }, "type": "array" }, "updatedAt": { "description": "The date and time the user was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "required": ["id", "createdAt", "updatedAt", "lastLoginAt", "isActive", "name", "email", "role"], "type": "object" }, "webhook": { "properties": { "createdAt": { "description": "The date and time the webhook was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the webhook", "type": "string" }, "name": { "description": "The name of the webhook", "type": ["string", "null"] }, "source": { "description": "The source of the webhook", "enum": ["user", "zapier", "make", "n8n"], "type": "string" }, "surveyIds": { "description": "The IDs of the surveys ", "items": { "type": "string" }, "type": "array" }, "triggers": { "description": "The triggers of the webhook", "items": { "enum": ["responseFinished", "responseCreated", "responseUpdated"], "type": "string" }, "minItems": 1, "type": "array" }, "updatedAt": { "description": "The date and time the webhook was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "url": { "description": "The URL of the webhook", "format": "uri", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace", "type": "string" } }, "required": [ "id", "name", "createdAt", "updatedAt", "url", "source", "workspaceId", "environmentId", "triggers", "surveyIds" ], "type": "object" }, "webhookId": { "description": "The ID of the webhook", "type": "string" } }, "securitySchemes": { "apiKeyAuth": { "description": "Use your Formbricks x-api-key to authenticate.", "in": "header", "name": "x-api-key", "type": "apiKey" } } }, "info": { "description": "Manage Formbricks resources programmatically.", "title": "Formbricks API", "version": "2.0.0" }, "openapi": "3.1.0", "paths": { "/client/{workspaceId}/contacts/{userId}/attributes": { "put": { "description": "Update a contact's attributes in Formbricks to keep them in sync with your app or when you want to set a custom attribute in Formbricks. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "parameters": [ { "in": "path", "name": "workspaceId", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "userId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "example": { "attributes": {} }, "type": "object" } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "example-0": {}, "example-1": {} }, "schema": { "type": "object" } } }, "description": "OK" }, "500": { "content": { "application/json": { "example": { "code": "internal_server_error", "details": {}, "message": "Unable to complete request: Expected" }, "schema": { "type": "object" } } }, "description": "Internal Server Error" } }, "security": [], "servers": [ { "description": "Formbricks Client", "url": "https://app.formbricks.com/api/v2" } ], "summary": "Update Contact (Attributes)", "tags": ["Client API - Contacts"] } }, "/client/{workspaceId}/displays": { "post": { "description": "Create a new display for a valid survey ID. If a userId is passed, the display is linked to the user. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "requestBody": { "content": { "application/json": { "schema": { "example": { "surveyId": "survey123", "userId": "user123" }, "type": "object" } } } }, "responses": { "201": { "content": { "application/json": { "example": { "displayId": "display123" }, "schema": { "type": "object" } } }, "description": "Created" } }, "security": [], "servers": [ { "description": "Formbricks Client", "url": "https://app.formbricks.com/api/v2" } ], "summary": "Create Display", "tags": ["Client API - Display"] } }, "/client/{workspaceId}/environment": { "get": { "description": "Retrieves the Workspace state to be used in Formbricks SDKs. Note - Environments are deprecated. Use Workspace/workspaceId terminology. **Cache Behavior**: This endpoint uses server-side caching with a **5-minute TTL (Time To Live)**. Any changes to surveys, action classes, Workspace settings, or other Workspace data will take up to 5 minutes to reflect in the API response. This caching is implemented to improve performance for high-frequency SDK requests.", "parameters": [ { "description": "The ID of the Workspace. Deprecated alias `environmentId`.", "in": "path", "name": "workspaceId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "example": { "environmentId": "env_01h2xce9q8p3w4x5y6z7a8b9c0", "state": "active", "workspaceId": "ws_01h2xce9q8p3w4x5y6z7a8b9c0" }, "schema": { "type": "object" } } }, "description": "OK" } }, "security": [], "servers": [ { "description": "Formbricks Client", "url": "https://app.formbricks.com/api/v2" } ], "summary": "Get Workspace State", "tags": ["Client API - Workspace"] } }, "/client/{workspaceId}/identify/contacts/{userId}": { "get": { "description": "Retrieves a contact's state including their segments, displays, responses and other tracking information. If the contact doesn't exist, it will be created. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "parameters": [ { "in": "path", "name": "workspaceId", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "userId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "example": { "state": "active", "userId": "user123" }, "schema": { "type": "object" } } }, "description": "OK" } }, "security": [], "servers": [ { "description": "Formbricks Client", "url": "https://app.formbricks.com/api/v2" } ], "summary": "Get Contact State", "tags": ["Client API - Contacts"] } }, "/client/{workspaceId}/responses": { "post": { "description": "Create a response for a survey and its fields with the user's responses. The userId & meta here is optional. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "requestBody": { "content": { "application/json": { "schema": { "example": { "responses": {}, "surveyId": "survey123" }, "type": "object" } } } }, "responses": { "201": { "content": { "application/json": { "example": { "responseId": "response123" }, "schema": { "type": "object" } } }, "description": "Created" } }, "security": [], "servers": [ { "description": "Formbricks Client", "url": "https://app.formbricks.com/api/v2" } ], "summary": "Create Response", "tags": ["Client API - Response"] } }, "/client/{workspaceId}/responses/{responseId}": { "put": { "description": "Update an existing response for example when you want to mark a response as finished or you want to change an existing response's value. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "parameters": [ { "description": "The ID of the Workspace. Deprecated alias `environmentId`.", "in": "path", "name": "workspaceId", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "responseId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "example": { "data": { "tcgls0063n8ri7dtrbnepcmz": "Who? Who? Who?" }, "finished": true }, "type": "object" } } } }, "responses": { "200": { "content": { "application/json": { "example": { "data": {} }, "schema": { "type": "object" } } }, "description": "OK" }, "404": { "content": { "application/json": { "example": { "code": "not_found", "details": { "resource_type": "Response" }, "message": "Response not found" }, "schema": { "type": "object" } } }, "description": "Not Found" } }, "security": [], "servers": [ { "description": "Formbricks Client", "url": "https://app.formbricks.com/api/v2" } ], "summary": "Update Response", "tags": ["Client API - Response"] } }, "/client/{workspaceId}/storage": { "post": { "description": "API endpoint for uploading private files. Uploaded files are kept private so that only users with access to the specified Workspace can retrieve them. The endpoint validates the survey ID, file name, and file type from the request body, and returns a signed URL for S3 uploads along with a local upload URL. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "parameters": [ { "description": "The ID of the Workspace. Deprecated alias `environmentId`.", "in": "path", "name": "workspaceId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "example": { "fileName": "example.jpg", "fileType": "image/jpeg", "surveyId": "cm7pr0x2y004o192zmit8cjvb" }, "properties": { "fileName": { "description": "The name of the file to be uploaded.", "type": "string" }, "fileType": { "description": "The MIME type of the file.", "type": "string" }, "surveyId": { "description": "The ID of the survey associated with the file.", "type": "string" } }, "required": ["surveyId", "fileName", "fileType"], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "example": { "data": { "fileUrl": "https://app.formbricks.com/storage/cm1ubebtj000614kqe4hs3c67/private/file--fid--b153ba3e-6602-4bb3-bed9-211b5b1ae463.jpg", "presignedFields": { "key": "uploads/env-id/private/file--fid--uuid.jpg", "policy": "", "x-amz-algorithm": "AWS4-HMAC-SHA256" }, "signedUrl": "https://s3.example.com/bucket", "updatedFileName": "file--fid--b153ba3e-6602-4bb3-bed9-211b5b1ae463.jpg" } }, "properties": { "data": { "properties": { "fileUrl": { "description": "URL where the uploaded file can be accessed.", "type": "string" }, "presignedFields": { "additionalProperties": { "type": "string" }, "description": "Presigned POST form fields required by S3-compatible storage.", "type": "object" }, "signedUrl": { "description": "Presigned POST URL for uploading the file to S3-compatible storage.", "type": "string" }, "updatedFileName": { "description": "The updated file name after processing.", "type": "string" } }, "type": "object" } }, "type": "object" } } }, "description": "OK - Returns the signed URL, presigned fields, updated file name, and file URL." }, "400": { "content": { "application/json": { "schema": { "example": { "error": "fileName is required" }, "properties": { "error": { "description": "Detailed error message.", "type": "string" } }, "type": "object" } } }, "description": "Bad Request - One or more required fields are missing." }, "404": { "content": { "application/json": { "schema": { "example": { "error": "Survey survey123 not found" }, "properties": { "error": { "description": "Detailed error message.", "type": "string" } }, "type": "object" } } }, "description": "Not Found - The specified survey or organization does not exist." } }, "security": [], "servers": [ { "description": "Formbricks API Server", "url": "https://app.formbricks.com/api/v2" } ], "summary": "Upload Private File", "tags": ["Client API - File Upload"] } }, "/client/{workspaceId}/user": { "post": { "description": "Endpoint for creating or identifying a user within the specified Workspace. If the user already exists, this will identify them and potentially update user attributes. If they don't exist, it will create a new user. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "requestBody": { "content": { "application/json": { "schema": { "example": { "attributes": {}, "userId": "user123" }, "type": "object" } } } }, "responses": { "200": { "content": { "application/json": { "example": { "state": "identified", "userId": "user123" }, "schema": { "type": "object" } } }, "description": "OK" } }, "security": [], "servers": [ { "description": "Formbricks Client", "url": "https://app.formbricks.com/api/v2" } ], "summary": "Create or Identify User", "tags": ["Client API - User"] } }, "/health": { "get": { "description": "Check the health status of critical application dependencies including database and cache.", "operationId": "healthCheck", "responses": { "200": { "content": { "application/json": { "schema": { "description": "Health check status for critical application dependencies", "properties": { "cache_database": { "description": "Cache database connection status - true if cache database is reachable and running", "example": true, "type": "boolean" }, "main_database": { "description": "Main database connection status - true if database is reachable and running", "example": true, "type": "boolean" } }, "title": "Health Check Response", "type": "object" } } }, "description": "Health check completed successfully. Check individual dependency status in response data." } }, "security": [], "summary": "Health Check", "tags": ["Health"] } }, "/management/contact-attribute-keys": { "get": { "description": "Gets contact attribute keys from the database. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "getContactAttributeKeys", "parameters": [ { "description": "Number of items to return", "in": "query", "name": "limit", "schema": { "default": 50, "description": "Number of items to return", "maximum": 250, "minimum": 1, "type": "number" } }, { "description": "Number of items to skip", "in": "query", "name": "skip", "schema": { "default": 0, "description": "Number of items to skip", "minimum": 0, "type": "number" } }, { "description": "Sort by field", "in": "query", "name": "sortBy", "schema": { "default": "createdAt", "description": "Sort by field", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "description": "Sort order", "in": "query", "name": "order", "schema": { "default": "desc", "description": "Sort order", "enum": ["asc", "desc"], "type": "string" } }, { "description": "Start date", "in": "query", "name": "startDate", "schema": { "description": "Start date", "type": "string" } }, { "description": "End date", "in": "query", "name": "endDate", "schema": { "description": "End date", "type": "string" } }, { "description": "Date field to filter by", "in": "query", "name": "filterDateField", "schema": { "description": "Date field to filter by", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "description": "The Workspace ID to filter by", "in": "query", "name": "workspaceId", "schema": { "description": "The Workspace ID to filter by", "type": "string" } }, { "deprecated": true, "description": "Deprecated alias for workspaceId", "in": "query", "name": "environmentId", "schema": { "description": "Deprecated alias for workspaceId", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "items": { "properties": { "createdAt": { "description": "The date and time the contact attribute key was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "description": { "description": "Description of the attribute", "example": "The user's email address", "type": ["string", "null"] }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the contact attribute key", "type": "string" }, "isUnique": { "description": "Whether the attribute must have unique values across contacts", "example": false, "type": "boolean" }, "key": { "description": "The attribute identifier used in the system", "example": "email", "type": "string" }, "name": { "description": "Display name for the attribute", "example": "Email Address", "type": ["string", "null"] }, "type": { "description": "Whether this is a default or custom attribute", "enum": ["default", "custom"], "example": "custom", "type": "string" }, "updatedAt": { "description": "The date and time the contact attribute key was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace this attribute belongs to", "type": "string" } }, "type": "object" }, "type": "array" }, "meta": { "properties": { "limit": { "type": "number" }, "offset": { "type": "number" }, "total": { "type": "number" } }, "type": "object" } }, "type": "object" } } }, "description": "Contact attribute keys retrieved successfully." } }, "summary": "Get contact attribute keys", "tags": ["Management API - Contact Attribute Keys"] }, "post": { "description": "Creates a contact attribute key in the database. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "createContactAttributeKey", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/contactAttributeKeyInput" } } }, "description": "The contact attribute key to create", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the contact attribute key was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "description": { "description": "Description of the attribute", "example": "The user's email address", "type": ["string", "null"] }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the contact attribute key", "type": "string" }, "isUnique": { "description": "Whether the attribute must have unique values across contacts", "example": false, "type": "boolean" }, "key": { "description": "The attribute identifier used in the system", "example": "email", "type": "string" }, "name": { "description": "Display name for the attribute", "example": "Email Address", "type": ["string", "null"] }, "type": { "description": "Whether this is a default or custom attribute", "enum": ["default", "custom"], "example": "custom", "type": "string" }, "updatedAt": { "description": "The date and time the contact attribute key was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace this attribute belongs to", "type": "string" } }, "type": "object" } } }, "description": "Contact attribute key created successfully." } }, "summary": "Create a contact attribute key", "tags": ["Management API - Contact Attribute Keys"] } }, "/management/contact-attribute-keys/{id}": { "delete": { "description": "Deletes a contact attribute key from the database.", "operationId": "deleteContactAttributeKey", "parameters": [ { "description": "The ID of the contact attribute key", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/contactAttributeKeyId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the contact attribute key was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "description": { "description": "Description of the attribute", "example": "The user's email address", "type": ["string", "null"] }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the contact attribute key", "type": "string" }, "isUnique": { "description": "Whether the attribute must have unique values across contacts", "example": false, "type": "boolean" }, "key": { "description": "The attribute identifier used in the system", "example": "email", "type": "string" }, "name": { "description": "Display name for the attribute", "example": "Email Address", "type": ["string", "null"] }, "type": { "description": "Whether this is a default or custom attribute", "enum": ["default", "custom"], "example": "custom", "type": "string" }, "updatedAt": { "description": "The date and time the contact attribute key was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace this attribute belongs to", "type": "string" } }, "type": "object" } } }, "description": "Contact attribute key deleted successfully." } }, "summary": "Delete a contact attribute key", "tags": ["Management API - Contact Attribute Keys"] }, "get": { "description": "Gets a contact attribute key from the database.", "operationId": "getContactAttributeKey", "parameters": [ { "description": "The ID of the contact attribute key", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/contactAttributeKeyId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the contact attribute key was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "description": { "description": "Description of the attribute", "example": "The user's email address", "type": ["string", "null"] }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the contact attribute key", "type": "string" }, "isUnique": { "description": "Whether the attribute must have unique values across contacts", "example": false, "type": "boolean" }, "key": { "description": "The attribute identifier used in the system", "example": "email", "type": "string" }, "name": { "description": "Display name for the attribute", "example": "Email Address", "type": ["string", "null"] }, "type": { "description": "Whether this is a default or custom attribute", "enum": ["default", "custom"], "example": "custom", "type": "string" }, "updatedAt": { "description": "The date and time the contact attribute key was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace this attribute belongs to", "type": "string" } }, "type": "object" } } }, "description": "Contact attribute key retrieved successfully." } }, "summary": "Get a contact attribute key", "tags": ["Management API - Contact Attribute Keys"] }, "put": { "description": "Updates a contact attribute key in the database.", "operationId": "updateContactAttributeKey", "parameters": [ { "description": "The ID of the contact attribute key", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/contactAttributeKeyId" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/contactAttributeKeyUpdate" } } }, "description": "The contact attribute key to update", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the contact attribute key was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "description": { "description": "Description of the attribute", "example": "The user's email address", "type": ["string", "null"] }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the contact attribute key", "type": "string" }, "isUnique": { "description": "Whether the attribute must have unique values across contacts", "example": false, "type": "boolean" }, "key": { "description": "The attribute identifier used in the system", "example": "email", "type": "string" }, "name": { "description": "Display name for the attribute", "example": "Email Address", "type": ["string", "null"] }, "type": { "description": "Whether this is a default or custom attribute", "enum": ["default", "custom"], "example": "custom", "type": "string" }, "updatedAt": { "description": "The date and time the contact attribute key was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace this attribute belongs to", "type": "string" } }, "type": "object" } } }, "description": "Contact attribute key updated successfully." } }, "summary": "Update a contact attribute key", "tags": ["Management API - Contact Attribute Keys"] } }, "/management/contacts": { "post": { "description": "Creates a single contact in the database. This endpoint expects a top-level `attributes` object. For bulk uploads, use `PUT /management/contacts/bulk`, which expects `contacts[].attributes[]` instead. Each contact must have a valid email address in the attributes. All attribute keys must already exist in the Workspace. The email is used as the unique identifier along with the Workspace. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "createContact", "requestBody": { "content": { "application/json": { "example": { "attributes": { "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "userId": "h2xce9q8p3w4x5y6z7a8b9c1" }, "environmentId": "env_01h2xce9q8p3w4x5y6z7a8b9c0", "workspaceId": "ws_01h2xce9q8p3w4x5y6z7a8b9c0" }, "schema": { "properties": { "attributes": { "additionalProperties": { "type": "string" }, "type": "object" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "workspaceId": { "type": "string" } }, "required": ["workspaceId", "environmentId", "attributes"], "type": "object" } } }, "description": "The single contact to create. Must include a top-level `attributes` object with an email attribute, and all attribute keys must already exist in the Workspace. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "required": true }, "responses": { "201": { "content": { "application/json": { "example": { "attributes": { "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "userId": "h2xce9q8p3w4x5y6z7a8b9c1" }, "createdAt": "2023-01-01T12:00:00.000Z", "environmentId": "env_01h2xce9q8p3w4x5y6z7a8b9c0", "id": "ctc_01h2xce9q8p3w4x5y6z7a8b9c2", "workspaceId": "ws_01h2xce9q8p3w4x5y6z7a8b9c0" }, "schema": { "properties": { "attributes": { "additionalProperties": { "type": "string" }, "type": "object" }, "createdAt": { "type": "string" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "type": "string" }, "workspaceId": { "type": "string" } }, "type": "object" } } }, "description": "Contact created successfully." } }, "summary": "Create a contact", "tags": ["Management API - Contacts"] } }, "/management/contacts/bulk": { "put": { "description": "Uploads contacts in bulk. This endpoint expects the bulk request shape: `contacts` must be an array, and each contact item must contain an `attributes` array of `{ attributeKey, value }` objects. Unlike `POST /management/contacts`, this endpoint does not accept a top-level `attributes` object. Each contact must include an `email` attribute in its `attributes` array, and that email must be valid. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "uploadBulkContacts", "requestBody": { "content": { "application/json": { "example": { "contacts": [ { "attributes": [ { "attributeKey": { "key": "email", "name": "Email Address" }, "value": "john.doe@example.com" }, { "attributeKey": { "key": "firstName", "name": "First Name" }, "value": "John" }, { "attributeKey": { "key": "lastName", "name": "Last Name" }, "value": "Doe" } ] }, { "attributes": [ { "attributeKey": { "key": "email", "name": "Email Address" }, "value": "jane.smith@example.com" }, { "attributeKey": { "key": "firstName", "name": "First Name" }, "value": "Jane" }, { "attributeKey": { "key": "lastName", "name": "Last Name" }, "value": "Smith" } ] } ], "environmentId": "env_01h2xce9q8p3w4x5y6z7a8b9c0", "workspaceId": "ws_01h2xce9q8p3w4x5y6z7a8b9c0" }, "schema": { "properties": { "contacts": { "items": { "properties": { "attributes": { "items": { "properties": { "attributeKey": { "properties": { "key": { "type": "string" }, "name": { "type": "string" } }, "required": ["key", "name"], "type": "object" }, "value": { "type": "string" } }, "required": ["attributeKey", "value"], "type": "object" }, "type": "array" } }, "required": ["attributes"], "type": "object" }, "maxItems": 250, "type": "array" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "workspaceId": { "type": "string" } }, "required": ["workspaceId", "environmentId", "contacts"], "type": "object" } } }, "description": "The contacts to upload. Use the full nested bulk body shown in the example or cURL snippet: `{ workspaceId, environmentId (deprecated), contacts: [{ attributes: [{ attributeKey: { key, name }, value }] }] }`. Each contact must include an `email` attribute inside its `attributes` array.", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "properties": { "message": { "type": "string" }, "status": { "type": "string" } }, "required": ["status", "message"], "type": "object" } }, "required": ["data"], "type": "object" } } }, "description": "Contacts uploaded successfully." }, "207": { "content": { "application/json": { "schema": { "properties": { "data": { "properties": { "message": { "type": "string" }, "skippedContacts": { "items": { "properties": { "index": { "type": "number" }, "userId": { "type": "string" } }, "required": ["index", "userId"], "type": "object" }, "type": "array" }, "status": { "type": "string" } }, "required": ["status", "message", "skippedContacts"], "type": "object" } }, "required": ["data"], "type": "object" } } }, "description": "Contacts uploaded partially successfully." } }, "summary": "Upload Bulk Contacts", "tags": ["Management API - Contacts"] } }, "/management/responses": { "get": { "description": "Gets responses from the database.", "operationId": "getResponses", "parameters": [ { "description": "Number of items to return", "in": "query", "name": "limit", "schema": { "default": 50, "description": "Number of items to return", "maximum": 250, "minimum": 1, "type": "number" } }, { "description": "Number of items to skip", "in": "query", "name": "skip", "schema": { "default": 0, "description": "Number of items to skip", "minimum": 0, "type": "number" } }, { "description": "Sort by field", "in": "query", "name": "sortBy", "schema": { "default": "createdAt", "description": "Sort by field", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "description": "Sort order", "in": "query", "name": "order", "schema": { "default": "desc", "description": "Sort order", "enum": ["asc", "desc"], "type": "string" } }, { "description": "Start date", "in": "query", "name": "startDate", "schema": { "description": "Start date", "type": "string" } }, { "description": "End date", "in": "query", "name": "endDate", "schema": { "description": "End date", "type": "string" } }, { "description": "Date field to filter by", "in": "query", "name": "filterDateField", "schema": { "description": "Date field to filter by", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "in": "query", "name": "surveyId", "schema": { "type": "string" } }, { "in": "query", "name": "contactId", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "items": { "properties": { "contactAttributes": { "additionalProperties": { "type": "string" }, "description": "The attributes of the contact", "example": { "attribute1": "value1", "attribute2": "value2" }, "type": ["object", "null"] }, "contactId": { "description": "The ID of the contact", "type": ["string", "null"] }, "createdAt": { "description": "The date and time the response was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "data": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" }, { "additionalProperties": { "type": "string" }, "type": "object" } ] }, "description": "The data of the response", "example": { "question1": "answer1", "question2": 2, "question3": ["answer3", "answer4"], "question4": { "subquestion1": "answer5" } }, "type": "object" }, "displayId": { "description": "The display ID of the response", "type": ["string", "null"] }, "endingId": { "description": "The ID of the ending", "type": ["string", "null"] }, "finished": { "description": "Whether the response is finished", "example": true, "type": "boolean" }, "id": { "description": "The ID of the response", "type": "string" }, "language": { "description": "The language of the response", "example": "en", "type": ["string", "null"] }, "meta": { "description": "The meta data of the response", "example": { "action": "click", "country": "US", "source": "https://example.com", "url": "https://example.com", "userAgent": { "browser": "Chrome", "device": "Desktop", "os": "Windows" } }, "properties": { "action": { "type": "string" }, "country": { "type": "string" }, "source": { "description": "The source of the response", "example": "https://example.com", "type": "string" }, "url": { "description": "The URL of the response", "example": "https://example.com", "type": "string" }, "userAgent": { "properties": { "browser": { "type": "string" }, "device": { "type": "string" }, "os": { "type": "string" } }, "type": "object" } }, "type": "object" }, "singleUseId": { "description": "The single use ID of the response", "type": ["string", "null"] }, "surveyId": { "description": "The ID of the survey", "type": "string" }, "ttc": { "additionalProperties": { "type": "number" }, "description": "The TTC of the response", "example": { "question1": 10, "question2": 20 }, "type": "object" }, "updatedAt": { "description": "The date and time the response was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "variables": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "description": "The variables of the response", "example": { "variable1": "answer1", "variable2": 2 }, "type": "object" } }, "type": "object" }, "type": "array" }, "meta": { "properties": { "limit": { "type": "number" }, "offset": { "type": "number" }, "total": { "type": "number" } }, "type": "object" } }, "type": "object" } } }, "description": "Responses retrieved successfully." } }, "summary": "Get responses", "tags": ["Management API - Responses"] }, "post": { "description": "Creates a response in the database. This will trigger the response pipeline, including webhooks, integrations, follow-up emails, and other configured actions.", "operationId": "createResponse", "requestBody": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the response was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "data": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" }, { "additionalProperties": { "type": "string" }, "type": "object" } ] }, "description": "The data of the response", "example": { "question1": "answer1", "question2": 2, "question3": ["answer3", "answer4"], "question4": { "subquestion1": "answer5" } }, "type": "object" }, "displayId": { "description": "The display ID of the response", "type": ["string", "null"] }, "endingId": { "description": "The ID of the ending", "type": ["string", "null"] }, "finished": { "description": "Whether the response is finished", "example": true, "type": "boolean" }, "language": { "description": "The language of the response", "example": "en", "type": ["string", "null"] }, "meta": { "description": "The meta data of the response", "example": { "action": "click", "country": "US", "source": "https://example.com", "url": "https://example.com", "userAgent": { "browser": "Chrome", "device": "Desktop", "os": "Windows" } }, "properties": { "action": { "type": "string" }, "country": { "type": "string" }, "source": { "description": "The source of the response", "example": "https://example.com", "type": "string" }, "url": { "description": "The URL of the response", "example": "https://example.com", "type": "string" }, "userAgent": { "properties": { "browser": { "type": "string" }, "device": { "type": "string" }, "os": { "type": "string" } }, "type": "object" } }, "type": "object" }, "singleUseId": { "description": "The single use ID of the response", "type": ["string", "null"] }, "surveyId": { "description": "The ID of the survey", "type": "string" }, "ttc": { "additionalProperties": { "type": "number" }, "description": "The TTC of the response", "example": { "question1": 10, "question2": 20 }, "type": "object" }, "updatedAt": { "description": "The date and time the response was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "userId": { "type": "string" }, "variables": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "description": "The variables of the response", "example": { "variable1": "answer1", "variable2": 2 }, "type": "object" } }, "required": ["surveyId", "finished", "data"], "type": "object" } } }, "description": "The response to create", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "contactAttributes": { "additionalProperties": { "type": "string" }, "description": "The attributes of the contact", "example": { "attribute1": "value1", "attribute2": "value2" }, "type": ["object", "null"] }, "contactId": { "description": "The ID of the contact", "type": ["string", "null"] }, "createdAt": { "description": "The date and time the response was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "data": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" }, { "additionalProperties": { "type": "string" }, "type": "object" } ] }, "description": "The data of the response", "example": { "question1": "answer1", "question2": 2, "question3": ["answer3", "answer4"], "question4": { "subquestion1": "answer5" } }, "type": "object" }, "displayId": { "description": "The display ID of the response", "type": ["string", "null"] }, "endingId": { "description": "The ID of the ending", "type": ["string", "null"] }, "finished": { "description": "Whether the response is finished", "example": true, "type": "boolean" }, "id": { "description": "The ID of the response", "type": "string" }, "language": { "description": "The language of the response", "example": "en", "type": ["string", "null"] }, "meta": { "description": "The meta data of the response", "example": { "action": "click", "country": "US", "source": "https://example.com", "url": "https://example.com", "userAgent": { "browser": "Chrome", "device": "Desktop", "os": "Windows" } }, "properties": { "action": { "type": "string" }, "country": { "type": "string" }, "source": { "description": "The source of the response", "example": "https://example.com", "type": "string" }, "url": { "description": "The URL of the response", "example": "https://example.com", "type": "string" }, "userAgent": { "properties": { "browser": { "type": "string" }, "device": { "type": "string" }, "os": { "type": "string" } }, "type": "object" } }, "type": "object" }, "singleUseId": { "description": "The single use ID of the response", "type": ["string", "null"] }, "surveyId": { "description": "The ID of the survey", "type": "string" }, "ttc": { "additionalProperties": { "type": "number" }, "description": "The TTC of the response", "example": { "question1": 10, "question2": 20 }, "type": "object" }, "updatedAt": { "description": "The date and time the response was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "variables": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "description": "The variables of the response", "example": { "variable1": "answer1", "variable2": 2 }, "type": "object" } }, "type": "object" } } }, "description": "Response created successfully." } }, "summary": "Create a response", "tags": ["Management API - Responses"] } }, "/management/responses/{id}": { "delete": { "description": "Deletes a response from the database.", "operationId": "deleteResponse", "parameters": [ { "description": "The ID of the response", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/responseId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "contactAttributes": { "additionalProperties": { "type": "string" }, "description": "The attributes of the contact", "example": { "attribute1": "value1", "attribute2": "value2" }, "type": ["object", "null"] }, "contactId": { "description": "The ID of the contact", "type": ["string", "null"] }, "createdAt": { "description": "The date and time the response was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "data": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" }, { "additionalProperties": { "type": "string" }, "type": "object" } ] }, "description": "The data of the response", "example": { "question1": "answer1", "question2": 2, "question3": ["answer3", "answer4"], "question4": { "subquestion1": "answer5" } }, "type": "object" }, "displayId": { "description": "The display ID of the response", "type": ["string", "null"] }, "endingId": { "description": "The ID of the ending", "type": ["string", "null"] }, "finished": { "description": "Whether the response is finished", "example": true, "type": "boolean" }, "id": { "description": "The ID of the response", "type": "string" }, "language": { "description": "The language of the response", "example": "en", "type": ["string", "null"] }, "meta": { "description": "The meta data of the response", "example": { "action": "click", "country": "US", "source": "https://example.com", "url": "https://example.com", "userAgent": { "browser": "Chrome", "device": "Desktop", "os": "Windows" } }, "properties": { "action": { "type": "string" }, "country": { "type": "string" }, "source": { "description": "The source of the response", "example": "https://example.com", "type": "string" }, "url": { "description": "The URL of the response", "example": "https://example.com", "type": "string" }, "userAgent": { "properties": { "browser": { "type": "string" }, "device": { "type": "string" }, "os": { "type": "string" } }, "type": "object" } }, "type": "object" }, "singleUseId": { "description": "The single use ID of the response", "type": ["string", "null"] }, "surveyId": { "description": "The ID of the survey", "type": "string" }, "ttc": { "additionalProperties": { "type": "number" }, "description": "The TTC of the response", "example": { "question1": 10, "question2": 20 }, "type": "object" }, "updatedAt": { "description": "The date and time the response was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "variables": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "description": "The variables of the response", "example": { "variable1": "answer1", "variable2": 2 }, "type": "object" } }, "type": "object" } } }, "description": "Response deleted successfully." } }, "summary": "Delete a response", "tags": ["Management API - Responses"] }, "get": { "description": "Gets a response from the database.", "operationId": "getResponse", "parameters": [ { "description": "The ID of the response", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/responseId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "contactAttributes": { "additionalProperties": { "type": "string" }, "description": "The attributes of the contact", "example": { "attribute1": "value1", "attribute2": "value2" }, "type": ["object", "null"] }, "contactId": { "description": "The ID of the contact", "type": ["string", "null"] }, "createdAt": { "description": "The date and time the response was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "data": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" }, { "additionalProperties": { "type": "string" }, "type": "object" } ] }, "description": "The data of the response", "example": { "question1": "answer1", "question2": 2, "question3": ["answer3", "answer4"], "question4": { "subquestion1": "answer5" } }, "type": "object" }, "displayId": { "description": "The display ID of the response", "type": ["string", "null"] }, "endingId": { "description": "The ID of the ending", "type": ["string", "null"] }, "finished": { "description": "Whether the response is finished", "example": true, "type": "boolean" }, "id": { "description": "The ID of the response", "type": "string" }, "language": { "description": "The language of the response", "example": "en", "type": ["string", "null"] }, "meta": { "description": "The meta data of the response", "example": { "action": "click", "country": "US", "source": "https://example.com", "url": "https://example.com", "userAgent": { "browser": "Chrome", "device": "Desktop", "os": "Windows" } }, "properties": { "action": { "type": "string" }, "country": { "type": "string" }, "source": { "description": "The source of the response", "example": "https://example.com", "type": "string" }, "url": { "description": "The URL of the response", "example": "https://example.com", "type": "string" }, "userAgent": { "properties": { "browser": { "type": "string" }, "device": { "type": "string" }, "os": { "type": "string" } }, "type": "object" } }, "type": "object" }, "singleUseId": { "description": "The single use ID of the response", "type": ["string", "null"] }, "surveyId": { "description": "The ID of the survey", "type": "string" }, "ttc": { "additionalProperties": { "type": "number" }, "description": "The TTC of the response", "example": { "question1": 10, "question2": 20 }, "type": "object" }, "updatedAt": { "description": "The date and time the response was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "variables": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "description": "The variables of the response", "example": { "variable1": "answer1", "variable2": 2 }, "type": "object" } }, "type": "object" } } }, "description": "Response retrieved successfully." } }, "summary": "Get a response", "tags": ["Management API - Responses"] }, "put": { "description": "Updates a response in the database. This will trigger the response pipeline, including webhooks, integrations, follow-up emails (if the response is marked as finished), and other configured actions.", "operationId": "updateResponse", "parameters": [ { "description": "The ID of the response", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/responseId" } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "data": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" }, { "additionalProperties": { "type": "string" }, "type": "object" } ] }, "type": "object" }, "endingId": { "type": ["string", "null"] }, "finished": { "type": "boolean" }, "language": { "type": "string" }, "ttc": { "additionalProperties": { "type": "number" }, "type": "object" }, "variables": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "type": "object" } }, "type": "object" } } }, "description": "The response fields to update", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "contactAttributes": { "additionalProperties": { "type": "string" }, "description": "The attributes of the contact", "example": { "attribute1": "value1", "attribute2": "value2" }, "type": ["object", "null"] }, "contactId": { "description": "The ID of the contact", "type": ["string", "null"] }, "createdAt": { "description": "The date and time the response was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "data": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "items": { "type": "string" }, "type": "array" }, { "additionalProperties": { "type": "string" }, "type": "object" } ] }, "description": "The data of the response", "example": { "question1": "answer1", "question2": 2, "question3": ["answer3", "answer4"], "question4": { "subquestion1": "answer5" } }, "type": "object" }, "displayId": { "description": "The display ID of the response", "type": ["string", "null"] }, "endingId": { "description": "The ID of the ending", "type": ["string", "null"] }, "finished": { "description": "Whether the response is finished", "example": true, "type": "boolean" }, "id": { "description": "The ID of the response", "type": "string" }, "language": { "description": "The language of the response", "example": "en", "type": ["string", "null"] }, "meta": { "description": "The meta data of the response", "example": { "action": "click", "country": "US", "source": "https://example.com", "url": "https://example.com", "userAgent": { "browser": "Chrome", "device": "Desktop", "os": "Windows" } }, "properties": { "action": { "type": "string" }, "country": { "type": "string" }, "source": { "description": "The source of the response", "example": "https://example.com", "type": "string" }, "url": { "description": "The URL of the response", "example": "https://example.com", "type": "string" }, "userAgent": { "properties": { "browser": { "type": "string" }, "device": { "type": "string" }, "os": { "type": "string" } }, "type": "object" } }, "type": "object" }, "singleUseId": { "description": "The single use ID of the response", "type": ["string", "null"] }, "surveyId": { "description": "The ID of the survey", "type": "string" }, "ttc": { "additionalProperties": { "type": "number" }, "description": "The TTC of the response", "example": { "question1": 10, "question2": 20 }, "type": "object" }, "updatedAt": { "description": "The date and time the response was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "variables": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "description": "The variables of the response", "example": { "variable1": "answer1", "variable2": 2 }, "type": "object" } }, "type": "object" } } }, "description": "Response updated successfully." } }, "summary": "Update a response", "tags": ["Management API - Responses"] } }, "/management/surveys/{surveyId}/contact-links/contacts/{contactId}/": { "get": { "description": "Retrieves a personalized link for a specific survey.", "operationId": "getPersonalizedSurveyLink", "parameters": [ { "description": "The ID of the survey", "in": "path", "name": "surveyId", "required": true, "schema": { "description": "The ID of the survey", "type": "string" } }, { "description": "The ID of the contact", "in": "path", "name": "contactId", "required": true, "schema": { "description": "The ID of the contact", "type": "string" } }, { "description": "Number of days until the generated JWT expires. If not provided, there is no expiration.", "in": "query", "name": "expirationDays", "schema": { "description": "Number of days until the generated JWT expires. If not provided, there is no expiration.", "maximum": 365, "minimum": 1, "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "properties": { "expiresAt": { "description": "The date and time the link expires, null if no expiration", "type": ["string", "null"] }, "surveyUrl": { "format": "uri", "type": "string" } }, "required": ["surveyUrl", "expiresAt"], "type": "object" } }, "type": "object" } } }, "description": "Personalized survey link retrieved successfully." } }, "summary": "Get personalized survey link for a contact", "tags": ["Management API - Surveys - Contact Links"] } }, "/management/surveys/{surveyId}/contact-links/segments/{segmentId}": { "get": { "description": "Generates personalized survey links for contacts in a segment.", "operationId": "getContactLinksBySegment", "parameters": [ { "description": "The ID of the survey", "in": "path", "name": "surveyId", "required": true, "schema": { "description": "The ID of the survey", "type": "string" } }, { "description": "The ID of the segment", "in": "path", "name": "segmentId", "required": true, "schema": { "description": "The ID of the segment", "type": "string" } }, { "description": "Number of items to return", "in": "query", "name": "limit", "schema": { "default": 50, "description": "Number of items to return", "maximum": 250, "minimum": 1, "type": "number" } }, { "description": "Number of items to skip", "in": "query", "name": "skip", "schema": { "default": 0, "description": "Number of items to skip", "minimum": 0, "type": "number" } }, { "description": "Number of days until the generated JWT expires. If not provided, there is no expiration.", "in": "query", "name": "expirationDays", "schema": { "default": null, "description": "Number of days until the generated JWT expires. If not provided, there is no expiration.", "maximum": 365, "minimum": 1, "type": ["number", "null"] } }, { "in": "query", "name": "attributeKeys", "schema": { "description": "Comma-separated list of contact attribute keys to include in the response. You can have max 20 keys. If not provided, no attributes will be included.", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "items": { "properties": { "attributes": { "additionalProperties": { "type": "string" }, "description": "The attributes of the contact", "type": "object" }, "contactId": { "description": "The ID of the contact", "type": "string" }, "expiresAt": { "description": "The date and time the link expires, null if no expiration", "type": ["string", "null"] }, "surveyUrl": { "description": "Personalized survey link", "format": "uri", "type": "string" } }, "type": "object" }, "type": "array" }, "meta": { "properties": { "limit": { "type": "number" }, "offset": { "type": "number" }, "total": { "type": "number" } }, "type": "object" } }, "type": "object" } } }, "description": "Contact links generated successfully." } }, "summary": "Get survey links for contacts in a segment", "tags": ["Management API - Surveys - Contact Links"] } }, "/management/webhooks": { "get": { "description": "Gets webhooks from the database. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "getWebhooks", "parameters": [ { "description": "Number of items to return", "in": "query", "name": "limit", "schema": { "default": 50, "description": "Number of items to return", "maximum": 250, "minimum": 1, "type": "number" } }, { "description": "Number of items to skip", "in": "query", "name": "skip", "schema": { "default": 0, "description": "Number of items to skip", "minimum": 0, "type": "number" } }, { "description": "Sort by field", "in": "query", "name": "sortBy", "schema": { "default": "createdAt", "description": "Sort by field", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "description": "Sort order", "in": "query", "name": "order", "schema": { "default": "desc", "description": "Sort order", "enum": ["asc", "desc"], "type": "string" } }, { "description": "Start date", "in": "query", "name": "startDate", "schema": { "description": "Start date", "type": "string" } }, { "description": "End date", "in": "query", "name": "endDate", "schema": { "description": "End date", "type": "string" } }, { "description": "Date field to filter by", "in": "query", "name": "filterDateField", "schema": { "description": "Date field to filter by", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "in": "query", "name": "surveyIds", "schema": { "items": { "type": "string" }, "type": "array" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "items": { "properties": { "createdAt": { "description": "The date and time the webhook was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the webhook", "type": "string" }, "name": { "description": "The name of the webhook", "type": ["string", "null"] }, "source": { "description": "The source of the webhook", "enum": ["user", "zapier", "make", "n8n"], "type": "string" }, "surveyIds": { "description": "The IDs of the surveys ", "items": { "type": "string" }, "type": "array" }, "triggers": { "description": "The triggers of the webhook", "items": { "enum": ["responseFinished", "responseCreated", "responseUpdated"], "type": "string" }, "minItems": 1, "type": "array" }, "updatedAt": { "description": "The date and time the webhook was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "url": { "description": "The URL of the webhook", "format": "uri", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace", "type": "string" } }, "type": "object" }, "type": "array" }, "meta": { "properties": { "limit": { "type": "number" }, "offset": { "type": "number" }, "total": { "type": "number" } }, "type": "object" } }, "type": "object" } } }, "description": "Webhooks retrieved successfully." } }, "summary": "Get webhooks", "tags": ["Management API - Webhooks"] }, "post": { "description": "Creates a webhook in the database. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "createWebhook", "requestBody": { "content": { "application/json": { "schema": { "properties": { "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "name": { "description": "The name of the webhook", "type": ["string", "null"] }, "source": { "description": "The source of the webhook", "enum": ["user", "zapier", "make", "n8n"], "type": "string" }, "surveyIds": { "description": "The IDs of the surveys ", "items": { "type": "string" }, "type": "array" }, "triggers": { "description": "The triggers of the webhook", "items": { "enum": ["responseFinished", "responseCreated", "responseUpdated"], "type": "string" }, "minItems": 1, "type": "array" }, "url": { "description": "The URL of the webhook", "format": "uri", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace", "type": "string" } }, "required": [ "name", "url", "source", "workspaceId", "environmentId", "triggers", "surveyIds" ], "type": "object" } } }, "description": "The webhook to create", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the webhook was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the webhook", "type": "string" }, "name": { "description": "The name of the webhook", "type": ["string", "null"] }, "source": { "description": "The source of the webhook", "enum": ["user", "zapier", "make", "n8n"], "type": "string" }, "surveyIds": { "description": "The IDs of the surveys ", "items": { "type": "string" }, "type": "array" }, "triggers": { "description": "The triggers of the webhook", "items": { "enum": ["responseFinished", "responseCreated", "responseUpdated"], "type": "string" }, "minItems": 1, "type": "array" }, "updatedAt": { "description": "The date and time the webhook was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "url": { "description": "The URL of the webhook", "format": "uri", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace", "type": "string" } }, "type": "object" } } }, "description": "Webhook created successfully." } }, "summary": "Create a webhook", "tags": ["Management API - Webhooks"] } }, "/management/webhooks/{id}": { "delete": { "description": "Deletes a webhook from the database. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "deleteWebhook", "parameters": [ { "description": "The ID of the webhook", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/webhookId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the webhook was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the webhook", "type": "string" }, "name": { "description": "The name of the webhook", "type": ["string", "null"] }, "source": { "description": "The source of the webhook", "enum": ["user", "zapier", "make", "n8n"], "type": "string" }, "surveyIds": { "description": "The IDs of the surveys ", "items": { "type": "string" }, "type": "array" }, "triggers": { "description": "The triggers of the webhook", "items": { "enum": ["responseFinished", "responseCreated", "responseUpdated"], "type": "string" }, "minItems": 1, "type": "array" }, "updatedAt": { "description": "The date and time the webhook was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "url": { "description": "The URL of the webhook", "format": "uri", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace", "type": "string" } }, "type": "object" } } }, "description": "Webhook deleted successfully." } }, "summary": "Delete a webhook", "tags": ["Management API - Webhooks"] }, "get": { "description": "Gets a webhook from the database. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "getWebhook", "parameters": [ { "description": "The ID of the webhook", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/webhookId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the webhook was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the webhook", "type": "string" }, "name": { "description": "The name of the webhook", "type": ["string", "null"] }, "source": { "description": "The source of the webhook", "enum": ["user", "zapier", "make", "n8n"], "type": "string" }, "surveyIds": { "description": "The IDs of the surveys ", "items": { "type": "string" }, "type": "array" }, "triggers": { "description": "The triggers of the webhook", "items": { "enum": ["responseFinished", "responseCreated", "responseUpdated"], "type": "string" }, "minItems": 1, "type": "array" }, "updatedAt": { "description": "The date and time the webhook was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "url": { "description": "The URL of the webhook", "format": "uri", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace", "type": "string" } }, "type": "object" } } }, "description": "Webhook retrieved successfully." } }, "summary": "Get a webhook", "tags": ["Management API - Webhooks"] }, "put": { "description": "Updates a webhook in the database. Note - Environments are deprecated. Use Workspace/workspaceId terminology.", "operationId": "updateWebhook", "parameters": [ { "description": "The ID of the webhook", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/webhookId" } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "name": { "description": "The name of the webhook", "type": ["string", "null"] }, "source": { "description": "The source of the webhook", "enum": ["user", "zapier", "make", "n8n"], "type": "string" }, "surveyIds": { "description": "The IDs of the surveys ", "items": { "type": "string" }, "type": "array" }, "triggers": { "description": "The triggers of the webhook", "items": { "enum": ["responseFinished", "responseCreated", "responseUpdated"], "type": "string" }, "minItems": 1, "type": "array" }, "url": { "description": "The URL of the webhook", "format": "uri", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace", "type": "string" } }, "required": [ "name", "url", "source", "workspaceId", "environmentId", "triggers", "surveyIds" ], "type": "object" } } }, "description": "The webhook to update", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the webhook was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "id": { "description": "The ID of the webhook", "type": "string" }, "name": { "description": "The name of the webhook", "type": ["string", "null"] }, "source": { "description": "The source of the webhook", "enum": ["user", "zapier", "make", "n8n"], "type": "string" }, "surveyIds": { "description": "The IDs of the surveys ", "items": { "type": "string" }, "type": "array" }, "triggers": { "description": "The triggers of the webhook", "items": { "enum": ["responseFinished", "responseCreated", "responseUpdated"], "type": "string" }, "minItems": 1, "type": "array" }, "updatedAt": { "description": "The date and time the webhook was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "url": { "description": "The URL of the webhook", "format": "uri", "type": "string" }, "workspaceId": { "description": "The ID of the Workspace", "type": "string" } }, "type": "object" } } }, "description": "Webhook updated successfully." } }, "summary": "Update a webhook", "tags": ["Management API - Webhooks"] } }, "/me": { "get": { "description": "Fetches the Workspaces and organizations associated with the API key.", "operationId": "me", "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "environments": { "deprecated": true, "description": "Deprecated alias of `workspaces`.", "items": { "properties": { "environmentId": { "deprecated": true, "type": "string" }, "environmentType": { "enum": ["production", "development"], "type": "string" }, "permission": { "enum": ["read", "write", "manage"], "type": "string" }, "projectId": { "type": "string" }, "projectName": { "type": "string" }, "workspaceId": { "type": "string" } }, "required": [ "workspaceId", "environmentId", "environmentType", "permission", "projectId", "projectName" ], "type": "object" }, "type": "array" }, "organizationAccess": { "properties": { "accessControl": { "additionalProperties": false, "properties": { "read": { "type": "boolean" }, "write": { "type": "boolean" } }, "required": ["read", "write"], "type": "object" } }, "required": ["accessControl"], "type": "object" }, "organizationId": { "type": "string" }, "workspaces": { "items": { "properties": { "environmentId": { "deprecated": true, "description": "Deprecated alias for workspaceId.", "type": "string" }, "environmentType": { "enum": ["production", "development"], "type": "string" }, "permission": { "enum": ["read", "write", "manage"], "type": "string" }, "projectId": { "type": "string" }, "projectName": { "type": "string" }, "workspaceId": { "type": "string" } }, "required": [ "workspaceId", "environmentId", "environmentType", "permission", "projectId", "projectName" ], "type": "object" }, "type": "array" } }, "type": "object" } } }, "description": "API key information retrieved successfully." } }, "summary": "Me", "tags": ["Me"] } }, "/organizations/{organizationId}/project-teams": { "delete": { "description": "Deletes a Workspace team from the database.", "operationId": "deleteProjectTeam", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } }, { "in": "query", "name": "teamId", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "projectId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the Workspace team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "permission": { "description": "Level of access granted to the Workspace", "enum": ["read", "readWrite", "manage"], "type": "string" }, "projectId": { "description": "The ID of the Workspace", "type": "string" }, "teamId": { "description": "The ID of the team", "type": "string" }, "updatedAt": { "description": "The date and time the Workspace team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "Workspace team deleted successfully." } }, "summary": "Delete a Workspace team", "tags": ["Organizations API - Workspace Teams"] }, "get": { "description": "Gets projectTeams from the database.", "operationId": "getProjectTeams", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } }, { "description": "Number of items to return", "in": "query", "name": "limit", "schema": { "default": 50, "description": "Number of items to return", "maximum": 250, "minimum": 1, "type": "number" } }, { "description": "Number of items to skip", "in": "query", "name": "skip", "schema": { "default": 0, "description": "Number of items to skip", "minimum": 0, "type": "number" } }, { "description": "Sort by field", "in": "query", "name": "sortBy", "schema": { "default": "createdAt", "description": "Sort by field", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "description": "Sort order", "in": "query", "name": "order", "schema": { "default": "desc", "description": "Sort order", "enum": ["asc", "desc"], "type": "string" } }, { "description": "Start date", "in": "query", "name": "startDate", "schema": { "description": "Start date", "type": "string" } }, { "description": "End date", "in": "query", "name": "endDate", "schema": { "description": "End date", "type": "string" } }, { "description": "Date field to filter by", "in": "query", "name": "filterDateField", "schema": { "description": "Date field to filter by", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "in": "query", "name": "teamId", "schema": { "type": "string" } }, { "in": "query", "name": "projectId", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "items": { "properties": { "createdAt": { "description": "The date and time the Workspace team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "permission": { "description": "Level of access granted to the Workspace", "enum": ["read", "readWrite", "manage"], "type": "string" }, "projectId": { "description": "The ID of the Workspace", "type": "string" }, "teamId": { "description": "The ID of the team", "type": "string" }, "updatedAt": { "description": "The date and time the Workspace team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" }, "type": "array" }, "meta": { "properties": { "limit": { "type": "number" }, "offset": { "type": "number" }, "total": { "type": "number" } }, "type": "object" } }, "type": "object" } } }, "description": "Workspace teams retrieved successfully." } }, "summary": "Get Workspace teams", "tags": ["Organizations API - Workspace Teams"] }, "post": { "description": "Creates a Workspace team in the database.", "operationId": "createProjectTeam", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "permission": { "description": "Level of access granted to the Workspace", "enum": ["read", "readWrite", "manage"], "type": "string" }, "projectId": { "description": "The ID of the Workspace", "type": "string" }, "teamId": { "description": "The ID of the team", "type": "string" } }, "required": ["teamId", "projectId", "permission"], "type": "object" } } }, "description": "The Workspace team to create", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the Workspace team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "permission": { "description": "Level of access granted to the Workspace", "enum": ["read", "readWrite", "manage"], "type": "string" }, "projectId": { "description": "The ID of the Workspace", "type": "string" }, "teamId": { "description": "The ID of the team", "type": "string" }, "updatedAt": { "description": "The date and time the Workspace team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "Workspace team created successfully." } }, "summary": "Create a projectTeam", "tags": ["Organizations API - Workspace Teams"] }, "put": { "description": "Updates a Workspace team in the database.", "operationId": "updateProjectTeam", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "permission": { "description": "Level of access granted to the Workspace", "enum": ["read", "readWrite", "manage"], "type": "string" }, "projectId": { "description": "The ID of the Workspace", "type": "string" }, "teamId": { "description": "The ID of the team", "type": "string" } }, "required": ["teamId", "projectId", "permission"], "type": "object" } } }, "description": "The Workspace team to update", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the Workspace team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "permission": { "description": "Level of access granted to the Workspace", "enum": ["read", "readWrite", "manage"], "type": "string" }, "projectId": { "description": "The ID of the Workspace", "type": "string" }, "teamId": { "description": "The ID of the team", "type": "string" }, "updatedAt": { "description": "The date and time the Workspace team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "Workspace team updated successfully." } }, "summary": "Update a Workspace team", "tags": ["Organizations API - Workspace Teams"] } }, "/organizations/{organizationId}/teams": { "get": { "description": "Gets teams from the database.", "operationId": "getTeams", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } }, { "description": "Number of items to return", "in": "query", "name": "limit", "schema": { "default": 50, "description": "Number of items to return", "maximum": 250, "minimum": 1, "type": "number" } }, { "description": "Number of items to skip", "in": "query", "name": "skip", "schema": { "default": 0, "description": "Number of items to skip", "minimum": 0, "type": "number" } }, { "description": "Sort by field", "in": "query", "name": "sortBy", "schema": { "default": "createdAt", "description": "Sort by field", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "description": "Sort order", "in": "query", "name": "order", "schema": { "default": "desc", "description": "Sort order", "enum": ["asc", "desc"], "type": "string" } }, { "description": "Start date", "in": "query", "name": "startDate", "schema": { "description": "Start date", "type": "string" } }, { "description": "End date", "in": "query", "name": "endDate", "schema": { "description": "End date", "type": "string" } }, { "description": "Date field to filter by", "in": "query", "name": "filterDateField", "schema": { "description": "Date field to filter by", "enum": ["createdAt", "updatedAt"], "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "items": { "properties": { "createdAt": { "description": "The date and time the team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "id": { "description": "The ID of the team", "type": "string" }, "name": { "description": "The name of the team", "example": "My team", "type": "string" }, "organizationId": { "description": "The ID of the organization", "type": "string" }, "updatedAt": { "description": "The date and time the team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" }, "type": "array" }, "meta": { "properties": { "limit": { "type": "number" }, "offset": { "type": "number" }, "total": { "type": "number" } }, "type": "object" } }, "type": "object" } } }, "description": "Teams retrieved successfully." } }, "summary": "Get teams", "tags": ["Organizations API - Teams"] }, "post": { "description": "Creates a team in the database.", "operationId": "createTeam", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "name": { "description": "The name of the team", "example": "My team", "type": "string" } }, "required": ["name"], "type": "object" } } }, "description": "The team to create", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "id": { "description": "The ID of the team", "type": "string" }, "name": { "description": "The name of the team", "example": "My team", "type": "string" }, "organizationId": { "description": "The ID of the organization", "type": "string" }, "updatedAt": { "description": "The date and time the team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "Team created successfully." } }, "summary": "Create a team", "tags": ["Organizations API - Teams"] } }, "/organizations/{organizationId}/teams/{id}": { "delete": { "description": "Deletes a team from the database.", "operationId": "deleteTeam", "parameters": [ { "description": "The ID of the team", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/teamId" } }, { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "id": { "description": "The ID of the team", "type": "string" }, "name": { "description": "The name of the team", "example": "My team", "type": "string" }, "organizationId": { "description": "The ID of the organization", "type": "string" }, "updatedAt": { "description": "The date and time the team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "Team deleted successfully." } }, "summary": "Delete a team", "tags": ["Organizations API - Teams"] }, "get": { "description": "Gets a team from the database.", "operationId": "getTeam", "parameters": [ { "description": "The ID of the team", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/teamId" } }, { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "id": { "description": "The ID of the team", "type": "string" }, "name": { "description": "The name of the team", "example": "My team", "type": "string" }, "organizationId": { "description": "The ID of the organization", "type": "string" }, "updatedAt": { "description": "The date and time the team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "Team retrieved successfully." } }, "summary": "Get a team", "tags": ["Organizations API - Teams"] }, "put": { "description": "Updates a team in the database.", "operationId": "updateTeam", "parameters": [ { "description": "The ID of the team", "in": "path", "name": "id", "required": true, "schema": { "$ref": "#/components/schemas/teamId" } }, { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "name": { "description": "The name of the team", "example": "My team", "type": "string" } }, "required": ["name"], "type": "object" } } }, "description": "The team to update", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the team was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "id": { "description": "The ID of the team", "type": "string" }, "name": { "description": "The name of the team", "example": "My team", "type": "string" }, "organizationId": { "description": "The ID of the organization", "type": "string" }, "updatedAt": { "description": "The date and time the team was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "Team updated successfully." } }, "summary": "Update a team", "tags": ["Organizations API - Teams"] } }, "/organizations/{organizationId}/users": { "get": { "description": "Gets users from the database.
Only available for self-hosted Formbricks.", "operationId": "getUsers", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } }, { "description": "Number of items to return", "in": "query", "name": "limit", "schema": { "default": 50, "description": "Number of items to return", "maximum": 250, "minimum": 1, "type": "number" } }, { "description": "Number of items to skip", "in": "query", "name": "skip", "schema": { "default": 0, "description": "Number of items to skip", "minimum": 0, "type": "number" } }, { "description": "Sort by field", "in": "query", "name": "sortBy", "schema": { "default": "createdAt", "description": "Sort by field", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "description": "Sort order", "in": "query", "name": "order", "schema": { "default": "desc", "description": "Sort order", "enum": ["asc", "desc"], "type": "string" } }, { "description": "Start date", "in": "query", "name": "startDate", "schema": { "description": "Start date", "type": "string" } }, { "description": "End date", "in": "query", "name": "endDate", "schema": { "description": "End date", "type": "string" } }, { "description": "Date field to filter by", "in": "query", "name": "filterDateField", "schema": { "description": "Date field to filter by", "enum": ["createdAt", "updatedAt"], "type": "string" } }, { "in": "query", "name": "id", "schema": { "type": "string" } }, { "in": "query", "name": "email", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "items": { "properties": { "createdAt": { "description": "The date and time the user was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "email": { "description": "The email of the user", "example": "example@example.com", "format": "email", "maxLength": 255, "type": "string" }, "id": { "description": "The ID of the user", "type": "string" }, "isActive": { "description": "Whether the user is active", "example": true, "type": "boolean" }, "lastLoginAt": { "description": "The date and time the user last logged in", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "name": { "description": "The name of the user", "example": "John Doe", "minLength": 1, "pattern": "^[\\p{L}\\p{M}\\s'\\d-]+$", "type": "string" }, "role": { "description": "The role of the user in the organization", "enum": ["owner", "manager", "member"], "example": "member", "type": "string" }, "teams": { "description": "The list of teams the user is a member of", "example": ["team1", "team2"], "items": { "type": "string" }, "type": "array" }, "updatedAt": { "description": "The date and time the user was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" }, "type": "array" }, "meta": { "properties": { "limit": { "type": "number" }, "offset": { "type": "number" }, "total": { "type": "number" } }, "type": "object" } }, "type": "object" } } }, "description": "Users retrieved successfully." } }, "summary": "Get users", "tags": ["Organizations API - Users"] }, "patch": { "description": "Updates an existing user in the database.
Only available for self-hosted Formbricks.", "operationId": "updateUser", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "email": { "description": "The email of the user", "example": "example@example.com", "format": "email", "maxLength": 255, "type": "string" }, "isActive": { "description": "Whether the user is active", "example": true, "type": "boolean" }, "name": { "minLength": 1, "pattern": "^[\\p{L}\\p{M}\\s'\\d-]+$", "type": "string" }, "role": { "description": "The role of the user in the organization", "enum": ["owner", "manager", "member"], "example": "member", "type": "string" }, "teams": { "description": "The list of teams the user is a member of", "example": ["team1", "team2"], "items": { "type": "string" }, "type": "array" } }, "required": ["email"], "type": "object" } } }, "description": "The user to update", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the user was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "email": { "description": "The email of the user", "example": "example@example.com", "format": "email", "maxLength": 255, "type": "string" }, "id": { "description": "The ID of the user", "type": "string" }, "isActive": { "description": "Whether the user is active", "example": true, "type": "boolean" }, "lastLoginAt": { "description": "The date and time the user last logged in", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "name": { "description": "The name of the user", "example": "John Doe", "minLength": 1, "pattern": "^[\\p{L}\\p{M}\\s'\\d-]+$", "type": "string" }, "role": { "description": "The role of the user in the organization", "enum": ["owner", "manager", "member"], "example": "member", "type": "string" }, "teams": { "description": "The list of teams the user is a member of", "example": ["team1", "team2"], "items": { "type": "string" }, "type": "array" }, "updatedAt": { "description": "The date and time the user was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "User updated successfully." } }, "summary": "Update a user", "tags": ["Organizations API - Users"] }, "post": { "description": "Create a new user in the database.
Only available for self-hosted Formbricks.", "operationId": "createUser", "parameters": [ { "description": "The ID of the organization", "in": "path", "name": "organizationId", "required": true, "schema": { "$ref": "#/components/schemas/organizationId" } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "email": { "description": "The email of the user", "example": "example@example.com", "format": "email", "maxLength": 255, "type": "string" }, "isActive": { "description": "Whether the user is active", "example": true, "type": "boolean" }, "name": { "description": "The name of the user", "example": "John Doe", "minLength": 1, "pattern": "^[\\p{L}\\p{M}\\s'\\d-]+$", "type": "string" }, "role": { "description": "The role of the user in the organization", "enum": ["owner", "manager", "member"], "example": "member", "type": "string" }, "teams": { "description": "The list of teams the user is a member of", "example": ["team1", "team2"], "items": { "type": "string" }, "type": "array" } }, "required": ["name", "email", "role"], "type": "object" } } }, "description": "The user to create", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "createdAt": { "description": "The date and time the user was created", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "email": { "description": "The email of the user", "example": "example@example.com", "format": "email", "maxLength": 255, "type": "string" }, "id": { "description": "The ID of the user", "type": "string" }, "isActive": { "description": "Whether the user is active", "example": true, "type": "boolean" }, "lastLoginAt": { "description": "The date and time the user last logged in", "example": "2021-01-01T00:00:00.000Z", "type": "string" }, "name": { "description": "The name of the user", "example": "John Doe", "minLength": 1, "pattern": "^[\\p{L}\\p{M}\\s'\\d-]+$", "type": "string" }, "role": { "description": "The role of the user in the organization", "enum": ["owner", "manager", "member"], "example": "member", "type": "string" }, "teams": { "description": "The list of teams the user is a member of", "example": ["team1", "team2"], "items": { "type": "string" }, "type": "array" }, "updatedAt": { "description": "The date and time the user was last updated", "example": "2021-01-01T00:00:00.000Z", "type": "string" } }, "type": "object" } } }, "description": "User created successfully." } }, "summary": "Create a user", "tags": ["Organizations API - Users"] } }, "/roles": { "get": { "description": "Gets roles from the database.", "operationId": "getRoles", "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "items": { "anyOf": [ { "const": "owner", "type": "string" }, { "const": "manager", "type": "string" }, { "const": "member", "type": "string" }, { "const": "billing", "type": "string" } ] }, "type": "array" } }, "type": "object" } } }, "description": "Roles retrieved successfully." } }, "summary": "Get roles", "tags": ["Roles"] } } }, "security": [ { "apiKeyAuth": [] } ], "servers": [ { "description": "Formbricks Cloud", "url": "https://app.formbricks.com/api/v2" } ], "tags": [ { "description": "Operations for checking critical application dependencies health status.", "name": "Health" }, { "description": "Operations for managing roles.", "name": "Roles" }, { "description": "Operations for managing your API key.", "name": "Me" }, { "description": "Operations for managing responses.", "name": "Management API - Responses" }, { "description": "Operations for managing contacts.", "name": "Management API - Contacts" }, { "description": "Operations for managing contact attributes.", "name": "Management API - Contact Attributes" }, { "description": "Operations for managing contact attribute keys.", "name": "Management API - Contact Attribute Keys" }, { "description": "Operations for managing surveys.", "name": "Management API - Surveys" }, { "description": "Operations for generating personalized survey links for contacts.", "name": "Management API - Surveys - Contact Links" }, { "description": "Operations for managing webhooks.", "name": "Management API - Webhooks" }, { "description": "Operations for managing teams.", "name": "Organizations API - Teams" }, { "description": "Operations for managing Workspace teams.", "name": "Organizations API - Workspace Teams" }, { "description": "Operations for managing users.", "name": "Organizations API - Users" } ] }