{
   "openapi": "3.0.0",
   "info": {
      "title": "Unified.to FORMS API",
      "version": "1.0",
      "description": "One API to Rule Them All",
      "contact": {
         "email": "hello@unified.to",
         "url": "https://unified.to/contact"
      },
      "termsOfService": "https://unified.to/tos"
   },
   "externalDocs": {
      "description": "API Documentation",
      "url": "https://docs.unified.to"
   },
   "tags": [
      {
         "name": "unifiedapi",
         "description": "Unified.to API"
      },
      {
         "name": "forms"
      },
      {
         "name": "form"
      },
      {
         "name": "submission"
      }
   ],
   "security": [
      {
         "jwt": []
      }
   ],
   "servers": [
      {
         "url": "https://api.unified.to",
         "description": "North American data region"
      },
      {
         "url": "https://api-eu.unified.to",
         "description": "European data region"
      },
      {
         "url": "https://api-au.unified.to",
         "description": "Australian data region"
      }
   ],
   "components": {
      "securitySchemes": {
         "jwt": {
            "type": "apiKey",
            "name": "authorization",
            "in": "header"
         }
      },
      "requestBodies": {
         "FormsForm": {
            "required": true,
            "content": {
               "application/json": {
                  "schema": {
                     "$ref": "#/components/schemas/FormsForm"
                  }
               }
            }
         }
      },
      "schemas": {
         "property_FormField_choices": {
            "type": "array",
            "items": {
               "type": "string"
            },
            "description": "For select/radio/checkbox fields"
         },
         "FormField": {
            "type": "object",
            "properties": {
               "id": {
                  "type": "string"
               },
               "created_at": {
                  "type": "string",
                  "format": "date-time"
               },
               "updated_at": {
                  "type": "string",
                  "format": "date-time"
               },
               "name": {
                  "type": "string"
               },
               "description": {
                  "type": "string"
               },
               "type": {
                  "type": "string",
                  "enum": [
                     "TEXT",
                     "TEXTAREA",
                     "NUMBER",
                     "EMAIL",
                     "URL",
                     "DATE",
                     "TIME",
                     "DATETIME",
                     "PHONE",
                     "BOOLEAN",
                     "SINGLE_SELECT",
                     "MULTIPLE_SELECT",
                     "FILE_UPLOAD",
                     "RATING",
                     "SCALE",
                     "MATRIX",
                     "SECTION_HEADER",
                     "OTHER"
                  ],
                  "x-speakeasy-unknown-values": "allow"
               },
               "is_required": {
                  "type": "boolean"
               },
               "is_active": {
                  "type": "boolean"
               },
               "choices": {
                  "$ref": "#/components/schemas/property_FormField_choices"
               },
               "default_value": {
                  "type": "string"
               },
               "min": {
                  "type": "number"
               },
               "max": {
                  "type": "number"
               },
               "pattern": {
                  "type": "string"
               },
               "min_length": {
                  "type": "number"
               },
               "max_length": {
                  "type": "number"
               },
               "order": {
                  "type": "number"
               }
            },
            "required": [
               "name",
               "type"
            ]
         },
         "property_FormsForm_fields": {
            "type": "array",
            "items": {
               "$ref": "#/components/schemas/FormField"
            }
         },
         "FormsForm": {
            "type": "object",
            "properties": {
               "id": {
                  "type": "string"
               },
               "created_at": {
                  "type": "string",
                  "format": "date-time"
               },
               "updated_at": {
                  "type": "string",
                  "format": "date-time"
               },
               "name": {
                  "type": "string"
               },
               "description": {
                  "type": "string"
               },
               "fields": {
                  "$ref": "#/components/schemas/property_FormsForm_fields"
               },
               "is_active": {
                  "type": "boolean"
               },
               "published_url": {
                  "type": "string"
               },
               "response_count": {
                  "type": "number"
               },
               "has_multiple_submissions": {
                  "type": "boolean"
               },
               "has_progress_bar": {
                  "type": "boolean"
               },
               "has_shuffle_questions": {
                  "type": "boolean"
               },
               "confirmation_message": {
                  "type": "string"
               },
               "confirmation_redirect_url": {
                  "type": "string"
               },
               "raw": {
                  "type": "object",
                  "additionalProperties": true
               }
            }
         },
         "FormsForms": {
            "type": "array",
            "items": {
               "$ref": "#/components/schemas/FormsForm"
            }
         },
         "property_FormAnswer_file_ids": {
            "type": "array",
            "items": {
               "type": "string"
            },
            "description": "references StorageFile ID"
         },
         "FormAnswer": {
            "type": "object",
            "properties": {
               "field_id": {
                  "type": "string"
               },
               "field_name": {
                  "type": "string"
               },
               "value": {
                  "type": "string"
               },
               "file_ids": {
                  "$ref": "#/components/schemas/property_FormAnswer_file_ids"
               }
            },
            "required": [
               "field_id"
            ]
         },
         "property_FormsSubmission_answers": {
            "type": "array",
            "items": {
               "$ref": "#/components/schemas/FormAnswer"
            }
         },
         "FormsSubmission": {
            "type": "object",
            "properties": {
               "id": {
                  "type": "string"
               },
               "created_at": {
                  "type": "string",
                  "format": "date-time"
               },
               "updated_at": {
                  "type": "string",
                  "format": "date-time"
               },
               "form_id": {
                  "type": "string"
               },
               "respondent_email": {
                  "type": "string"
               },
               "respondent_name": {
                  "type": "string"
               },
               "answers": {
                  "$ref": "#/components/schemas/property_FormsSubmission_answers"
               },
               "raw": {
                  "type": "object",
                  "additionalProperties": true
               }
            },
            "required": [
               "form_id",
               "answers"
            ]
         },
         "FormsSubmissions": {
            "type": "array",
            "items": {
               "$ref": "#/components/schemas/FormsSubmission"
            }
         }
      }
   },
   "paths": {
      "/forms/{connection_id}/form": {
         "post": {
            "summary": "Create a form",
            "parameters": [
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "created_at",
                           "updated_at",
                           "name",
                           "description",
                           "fields",
                           "is_active",
                           "published_url",
                           "response_count",
                           "has_multiple_submissions",
                           "has_progress_bar",
                           "has_shuffle_questions",
                           "confirmation_message",
                           "confirmation_redirect_url",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "forms",
               "form"
            ],
            "requestBody": {
               "required": true,
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/FormsForm"
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/FormsForm"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "createFormsForm"
         },
         "get": {
            "summary": "List all forms",
            "parameters": [
               {
                  "schema": {
                     "type": "number"
                  },
                  "name": "limit",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "number"
                  },
                  "name": "offset",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "updated_gte",
                  "in": "query",
                  "required": false,
                  "description": "Return only results whose updated date is equal or greater to this value (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "sort",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "order",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "query",
                  "in": "query",
                  "required": false,
                  "description": "Query string to search. eg. email address or name"
               },
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "created_at",
                           "updated_at",
                           "name",
                           "description",
                           "fields",
                           "is_active",
                           "published_url",
                           "response_count",
                           "has_multiple_submissions",
                           "has_progress_bar",
                           "has_shuffle_questions",
                           "confirmation_message",
                           "confirmation_redirect_url",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "forms",
               "form"
            ],
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/FormsForms"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "listFormsForms"
         }
      },
      "/forms/{connection_id}/form/{id}": {
         "get": {
            "summary": "Retrieve a form",
            "parameters": [
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "created_at",
                           "updated_at",
                           "name",
                           "description",
                           "fields",
                           "is_active",
                           "published_url",
                           "response_count",
                           "has_multiple_submissions",
                           "has_progress_bar",
                           "has_shuffle_questions",
                           "confirmation_message",
                           "confirmation_redirect_url",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the Form",
                  "name": "id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "forms",
               "form"
            ],
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/FormsForm"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "getFormsForm"
         },
         "put": {
            "summary": "Update a form",
            "parameters": [
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "created_at",
                           "updated_at",
                           "name",
                           "description",
                           "fields",
                           "is_active",
                           "published_url",
                           "response_count",
                           "has_multiple_submissions",
                           "has_progress_bar",
                           "has_shuffle_questions",
                           "confirmation_message",
                           "confirmation_redirect_url",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the Form",
                  "name": "id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "forms",
               "form"
            ],
            "requestBody": {
               "required": true,
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/FormsForm"
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/FormsForm"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "updateFormsForm"
         },
         "patch": {
            "summary": "Update a form",
            "parameters": [
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "created_at",
                           "updated_at",
                           "name",
                           "description",
                           "fields",
                           "is_active",
                           "published_url",
                           "response_count",
                           "has_multiple_submissions",
                           "has_progress_bar",
                           "has_shuffle_questions",
                           "confirmation_message",
                           "confirmation_redirect_url",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the Form",
                  "name": "id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "forms",
               "form"
            ],
            "requestBody": {
               "required": true,
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/FormsForm"
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/FormsForm"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "patchFormsForm"
         },
         "delete": {
            "summary": "Remove a form",
            "parameters": [
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the Form",
                  "name": "id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "forms",
               "form"
            ],
            "responses": {
               "200": {
                  "description": "Successful"
               },
               "default": {
                  "headers": {
                     "Content-Type": {
                        "required": false,
                        "schema": {
                           "type": "string"
                        }
                     }
                  },
                  "content": {},
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "removeFormsForm"
         }
      },
      "/forms/{connection_id}/submission/{id}": {
         "get": {
            "summary": "Retrieve a submission",
            "parameters": [
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "created_at",
                           "updated_at",
                           "form_id",
                           "respondent_email",
                           "respondent_name",
                           "answers",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the Submission",
                  "name": "id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "forms",
               "submission"
            ],
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/FormsSubmission"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "getFormsSubmission"
         }
      },
      "/forms/{connection_id}/submission": {
         "get": {
            "summary": "List all submissions",
            "parameters": [
               {
                  "schema": {
                     "type": "number"
                  },
                  "name": "limit",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "number"
                  },
                  "name": "offset",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "updated_gte",
                  "in": "query",
                  "required": false,
                  "description": "Return only results whose updated date is equal or greater to this value (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "sort",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "order",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "query",
                  "in": "query",
                  "required": false,
                  "description": "Query string to search. eg. email address or name"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "form_id",
                  "in": "query",
                  "required": false,
                  "description": "The form ID to filter by"
               },
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "created_at",
                           "updated_at",
                           "form_id",
                           "respondent_email",
                           "respondent_name",
                           "answers",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "forms",
               "submission"
            ],
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/FormsSubmissions"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "listFormsSubmissions"
         }
      }
   }
}