{
  "openapi": "3.0.4",
  "info": {
    "title": "Web API | Loopify",
    "description": "Our Web API lets your applications work with data from Loopify. Based on simple REST principles, the API returns data in the JSON format. Read more on how to use the API <a href='https://support.loopify.com/hc/en-us/articles/360008488414' target=_blank>here</a><br><br>The API is also documented <a href='/docs'>here</a>",
    "contact": {
      "name": "Loopify",
      "url": "https://www.loopify.com",
      "email": "support@loopify.com"
    },
    "version": "v1",
    "x-logo": {
      "url": "http://static.loopify.com/images/Loopify_logo_2.png"
    }
  },
  "paths": {
    "/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get contacts",
        "description": " #### Auth policies: ContactDataManagement,ReadContacts,AccountAPIKey \n\n ### Example with selectTags\nThis will match contacts with the tag:tester within the tagGroup: tags\n\n    [{name:'tags',tags:['tester']}]\n\n",
        "operationId": "getContacts",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of contacts to return",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "pageIndex",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "A string to search for",
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "selectedTags",
            "in": "query",
            "description": "JSON formatted array of tags you want to filter by",
            "schema": {
              "type": "string",
              "default": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            }
          },
          "500": {
            "description": "Get contacts failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ContactDataManagement",
              "ReadContacts",
              "AccountAPIKey"
            ]
          },
          {
            "oauth2": [
              "ContactDataManagement",
              "ReadContacts",
              "AccountAPIKey"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Create a new contact",
        "description": " #### Auth policies: ContactDataManagement,WriteContacts,AccountAPIKey \n\n ",
        "operationId": "insertContact",
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInsert"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInsert"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInsert"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contact was successfully inserted"
          },
          "400": {
            "description": "1: License issue, 2:Contact is missing or malformed\n3: Contact already exist"
          },
          "500": {
            "description": "Insert failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ContactDataManagement",
              "WriteContacts",
              "AccountAPIKey"
            ]
          },
          {
            "oauth2": [
              "ContactDataManagement",
              "WriteContacts",
              "AccountAPIKey"
            ]
          }
        ]
      }
    },
    "/contacts/{contactId}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get a specific contact",
        "description": " #### Auth policies: ContactDataManagement,ReadContacts,AccountAPIKey \n\n \n\n",
        "operationId": "getContact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Get contact failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ContactDataManagement",
              "ReadContacts",
              "AccountAPIKey"
            ]
          },
          {
            "oauth2": [
              "ContactDataManagement",
              "ReadContacts",
              "AccountAPIKey"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "description": " #### Auth policies: ContactDataManagement,WriteContacts \n\n \n\n",
        "operationId": "deleteContact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact was successfully deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "500": {
            "description": "Delete failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ContactDataManagement",
              "WriteContacts"
            ]
          },
          {
            "oauth2": [
              "ContactDataManagement",
              "WriteContacts"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Contacts"
        ],
        "summary": "Update a contact",
        "description": " #### Auth policies: ContactDataManagement,WriteContacts,AccountAPIKey \n\n This will replace the contact with the supplied payload. Make sure you supply a complete contact",
        "operationId": "updateContact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          },
          {
            "name": "force",
            "in": "query",
            "description": "If a contact with same email exist - set to true to force the update",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "skipNullFields",
            "in": "query",
            "description": "",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpdate"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpdate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpdate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contact was successfully updated"
          },
          "500": {
            "description": "Update failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ContactDataManagement",
              "WriteContacts",
              "AccountAPIKey"
            ]
          },
          {
            "oauth2": [
              "ContactDataManagement",
              "WriteContacts",
              "AccountAPIKey"
            ]
          }
        ]
      }
    },
    "/contacts/search": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Search contacts",
        "description": " #### Auth policies: ContactDataManagement,ReadContacts,AccountAPIKey \n\n The projection field can be used to limit the fields returned (ie. {firstName:1, email:1})\nIf an array of contactIds are supplied in the payload, the segment search will not be executed.\n\n",
        "operationId": "getContactsBySegment",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of contacts to return",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "pageIndex",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          }
        ],
        "requestBody": {
          "description": "Smart segment and projection",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ContactSearchParameters"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactSearchParameters"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactSearchParameters"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ContactSearchParameters"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            }
          },
          "500": {
            "description": "Get contacts failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ContactDataManagement",
              "ReadContacts",
              "AccountAPIKey"
            ]
          },
          {
            "oauth2": [
              "ContactDataManagement",
              "ReadContacts",
              "AccountAPIKey"
            ]
          }
        ]
      }
    },
    "/contacts/upsert": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Upsert a contact",
        "description": " #### Auth policies: ContactDataManagement,WriteContacts,AccountAPIKey \n\n ",
        "operationId": "upsertContact",
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpsertRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpsertRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpsertRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contact was successfully inserted/updated"
          },
          "400": {
            "description": "1: License issue"
          },
          "500": {
            "description": "Insert failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ContactDataManagement",
              "WriteContacts",
              "AccountAPIKey"
            ]
          },
          {
            "oauth2": [
              "ContactDataManagement",
              "WriteContacts",
              "AccountAPIKey"
            ]
          }
        ]
      }
    },
    "/events/count": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Count events",
        "description": " #### Auth policies: User \n\n See /events/query\n\nUses the Count API (https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-count.html)\n\n",
        "operationId": "countEvents",
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": { }
            },
            "application/json": {
              "schema": { }
            },
            "text/json": {
              "schema": { }
            },
            "application/*+json": {
              "schema": { }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EventCountResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventCountResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventCountResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "User"
            ]
          },
          {
            "oauth2": [
              "User"
            ]
          }
        ]
      }
    },
    "/events/query": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Query events",
        "description": " #### Auth policies: ContactDataManagement,ReadContacts \n\n  ### Request\n Uses the Search API (https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search.html)\n \n Request playload must be in Elasticsearch Query DSL (https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-dsl.html)\n \n At minimum it must include a query.bool.must array clause:\n \n     {\n         \"query\": {\n             \"bool\": {\n                 \"must\": [{\n                     \"match\": { \n                         \"type\": \"11\"\n                     }\n                 }]\n             }\n         }\n     }\n \n ### EventTypes\n \n| EventType                   | type     | EventType                 | type     | EventType              | type     | EventType              | type     |\n| --------------------------- |:--------:| ------------------------  |:--------:| ---------------------- |:--------:| ---------------------- |:--------:|\n| EmailSent                   | 5        | SMSSent                   | 13       | PageClick              | 25       | FlowBlockExecuted      | 18       |\n| EmailSoftBounced            | 6        | SMSFailed                 | 14       | SMSIncoming            | 12       | FlowBlockExecutedTrue  | 19       |\n| EmailHardBounced            | 7        | SMSUnsubscribed           | 15       | ReportSent             | 32       | FlowBlockExecutedFalse | 20       |\n| EmailComplained             | 8        | SMSLinkClicked            | 16       | ContactImportStarted   | 1        | FlowBlockExecutedDone  | 21       |\n| EmailUnsubscribed           | 9        | SMSPreviouslyUnsubscribed | 34       | ContactImportInProgress| 2        | FlowBlockExecutedError | 22       |\n| EmailOpened                 | 10       | PrintSent                 | 31       | ContactImportFinalized | 3        | SplitBlockExecuted     | 26       |\n| EmailLinkClicked            | 11       | PageFormSubmit            | 23       | ContactImportCanceled  | 4        | FlowJobCreated         | 27       |\n| EmailFailed                 | 28       | PageVisit                 | 24       | SMSIncoming            | 12       | SplitTestBlockExecuted | 29       |\n| EmailPreviouslyUnsubscribed | 33       | PrintQRCodeScanned        | 17       | PrintFailed            | 35       | FlowActivated          | 30       |\n| EmailSuppressed             | 36       | SMSSuppressed             | 37       | CouponRedeemed         | 38       | FlowTestActivated      | 39       |\n| FlowFrozen                  | 40       | FlowUnfrozen              | 41       | FlowStopped            | 42       | WebhookSucceeded       | 43       |\n| PopupFormSubmit             | 44       |                           |          |                        |          |                        |          |\n ### Response example\n \n     {\n         \"took\": 26,\n         \"timed_out\": false,\n         \"_shards\": {\n             \"total\": 1,\n             \"successful\": 1,\n             \"failed\": 0\n          },\n          \"hits\": {\n               \"total\": 1,\n                \"max_score\": 3.57346,\n                \"hits\": [\n                {\n                    \"_index\": \"events\",\n                    \"_type\": \"eventelastic\",\n                    \"_id\": \"AWC3DTu8Ebxu-FvCbf8Y\",\n                    \"_score\": 3.57346,\n                    \"_source\": {\n                        \"accountId\": 2,\n                        \"userId\": 0,\n                        \"source\": \"mailgun-click\",\n                        \"stamp\": \"2018-01-02T13:26:25.9740794Z\",\n                        \"type\": 11,\n                        \"data\": {\n                            \"campaignId\": \"5a4b8848a122e5000516dbb0\",\n                            \"externalMessageId\": \"20180102132544.1.E4E7834568022EA5BD@loopify.com\",\n                            \"contactId\": \"59e49f7c5234534673746789584466d\",\n                            \"email\": \"some@email.com\",\n                            \"recipientData\": {\n                                \"country\": \"MK\",\n                                \"region\": \"38\",\n                                \"city\": \"Skopje\",\n                                \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36\",\n                                \"deviceType\": \"desktop\",\n                                \"clientType\": \"browser\",\n                                \"clientName\": \"Chrome\",\n                                \"clientOS\": \"Windows\"\n                            }\n                         }\n                    }\n                }]\n          }\n     }\n\n",
        "operationId": "queryEvents",
        "parameters": [
          {
            "name": "collectionName",
            "in": "query",
            "description": "Used to search in custom collections",
            "schema": {
              "type": "string",
              "default": ""
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": { }
            },
            "application/json": {
              "schema": { }
            },
            "text/json": {
              "schema": { }
            },
            "application/*+json": {
              "schema": { }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "400": {
            "description": "0: Query is missing a query.bool.must array"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ContactDataManagement",
              "ReadContacts"
            ]
          },
          {
            "oauth2": [
              "ContactDataManagement",
              "ReadContacts"
            ]
          }
        ]
      }
    },
    "/events/types": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "Get event types",
        "description": "See /events/query\n\n",
        "operationId": "getEventTypes",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EventTypesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventTypesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventTypesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/flows/{flowId}/api-entries/{blockId}": {
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Trigger an api-entries block in a flow",
        "description": " #### Auth policies: User \n\n Use this endpoint to trigger an api entry block in a flow.  \n\nCall this endpoint with the same jsonBody you used when mapping the block (must be done before calling this)\n### Options (optional):\n\nIf you choose to include the options you must pass the contacts like this:\n\n    {\n        \"options\": {\n            \"addToSegment\": \"segments.customers\", //\"status.active\" etc.\n            \"clearSegment\": true, //if true, removes the segment values from all other contacts\n            \"enableValidation\": false, //if true, response includes an array of non-imported contacts\n        },\n        \"contacts\": [{\n            \"firstName\": \"\",\n            ...\n        },\n        ...\n        ]\n    }\n    \n\nExample of response if enableValidation is true\n\n\t{\n\t\tstatus: \"error|success\",\n\t\terrors: [\n\t\t\t\"email: 'test@test@gftdf.no' failed at line 123\",\n\t\t\t\"mobile: '+95678762 4' failed at line 23\",\n\t\t]\n\t}\n\t\nNOTE: Partial validation fails will return a 200 (OK), so be sure to check the errors array in the response. \nIf all contacts fails, a 400 (BadRequest) is returned.\n\nNOTE: When useBackgroundTask=true, the response is returned before the complete payload has been processed. \nThis can be used to prevent request timeouts. \nPlease note that validation messages will not be returned in the response (status code 202 - Accepted).\n\n",
        "operationId": "executeApiEntry",
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          },
          {
            "name": "blockId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "useBackgroundTask",
            "in": "query",
            "description": "Payload will be processed in a background task - response (202) is returned early",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "description": "A json object {} (one contact) or array [] (multiple contacts)",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "application/json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "text/json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "application/*+json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEntryResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEntryResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEntryResult"
                }
              }
            }
          },
          "202": {
            "description": "Accepted - useBackgroundTask=true"
          },
          "400": {
            "description": "0: Json body is invalid\n\n1: Flow could not be found\n\n2: Flow-block is missing a mapping\n\n3: Flow is inactive\n\n4: Flow block does not exist in the flow\n\n5: addToSegment is not valid (should contain a dot (segments.customers)\n\n6: jsonBody was missing a contacts object/array\n\n7: License issue"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "User"
            ]
          },
          {
            "oauth2": [
              "User"
            ]
          }
        ]
      }
    },
    "/flows/{flowId}/api-entries/{blockId}/map": {
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Map an api-entries block in a flow",
        "description": " #### Auth policies: User \n\n On a successfull POST, a websocket message, containing the jsonBody (first array item if payload is an array), will be sent to the user who called this endpoint. \n### Sample message:\n\n    {\n        \"type\": \"flow.apiEntryData\",\n        \"message\": \"jsonBody\"\n    }",
        "operationId": "apiEntriesMapping",
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          },
          {
            "name": "blockId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "A json object {} or array []",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "application/json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "text/json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "application/*+json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "0: Json body is invalid\n\n1: Flow could not be found\n\n2: License issue"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "User"
            ]
          },
          {
            "oauth2": [
              "User"
            ]
          }
        ]
      }
    },
    "/flows/{flowId}/external-forms/{blockId}": {
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Trigger an external-form block in a flow",
        "description": "Use this endpoint to trigger an external form block in a flow.  \n\nCall this endpoint with the same payload you used when mapping the block (must be done before calling this)",
        "operationId": "executeExternalForm",
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          },
          {
            "name": "blockId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Use this if payload is application/json",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "application/json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "text/json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "application/*+json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "0: Json body is invalid\n\n1: Flow could not be found\n\n2: Flow-block is missing a mapping\n\n3: Could not validate payload\n\n4: License issue"
          }
        }
      }
    },
    "/flows/{flowId}/external-forms/{blockId}/{userId}/map": {
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Map an external form block in a flow",
        "description": "On a successfull POST, a websocket message, containing the jsonBody (object), will be sent to the user who called this endpoint. \n### Sample message:\n\n    {\n        \"type\": \"flow.externalFormData\",\n        \"message\": {\n            \"payload\": {jsonBody},\n            \"keysHash\": \"keysHash\",\n            \"referer\": \"referer\"\n        }\n    }",
        "operationId": "externalFormMapping",
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          },
          {
            "name": "blockId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "Use this if payload is application/json",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "application/json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "text/json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            },
            "application/*+json": {
              "schema": {
                "description": "JSON value (object or array)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "0: Json body is invalid\n\n1: Flow could not be found\n\n2: Could not get referer. Are you posting from localhost?\n\n3: License issue"
          }
        }
      }
    },
    "/flows/{flowId}/file-import/{blockId}": {
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Trigger a file import block in a flow",
        "description": " #### Auth policies: User,ManageCampaign,AccountAPIKey \n\n \n\n",
        "operationId": "insertFileImportJob",
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          },
          {
            "name": "blockId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AccountFlowTemplate"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountFlowTemplate"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountFlowTemplate"
                }
              }
            }
          },
          "400": {
            "description": "0: License issue"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "User",
              "ManageCampaign",
              "AccountAPIKey"
            ]
          },
          {
            "oauth2": [
              "User",
              "ManageCampaign",
              "AccountAPIKey"
            ]
          }
        ]
      }
    },
    "/flows/{flowId}/new-entry": {
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Add contact(s) to a flow's new-entry block",
        "description": " #### Auth policies: User,ManageCampaign,AccountAPIKey \n\n ",
        "operationId": "addContactToNewEntry",
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/NewEntryRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewEntryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/NewEntryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NewEntryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "0: No contact(s) found\n\n1: No new-entry blocks found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "User",
              "ManageCampaign",
              "AccountAPIKey"
            ]
          },
          {
            "oauth2": [
              "User",
              "ManageCampaign",
              "AccountAPIKey"
            ]
          }
        ]
      }
    },
    "/in/{sourceKey}": {
      "post": {
        "tags": [
          "IncomingEventSourceIngress"
        ],
        "summary": "Receive an incoming request at a source URL without an explicit event path selector.",
        "description": "Use this route with an event header or payload routing field. Missing selectors are retained as unmatched,\nincluding on single-event sources. Webhooks accept JSON;\nform sources also accept form-encoded bodies and _event selectors. Browser CORS applies only to\nform sources. Source-configured webhook authentication is enforced for POST requests.\nJSON Content-Type or Accept: application/json retains JSON 202/200/4xx responses. Browser forms\nuse an allowlisted redirect or a minimal status page; rejected redirects include loopify_error.\n\n",
        "operationId": "ingestSource",
        "parameters": [
          {
            "name": "sourceKey",
            "in": "path",
            "description": "The opaque public key identifying the configured source.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          }
        }
      },
      "options": {
        "tags": [
          "IncomingEventSourceIngress"
        ],
        "summary": "Receive an incoming request at a source URL without an explicit event path selector.",
        "description": "Use this route with an event header or payload routing field. Missing selectors are retained as unmatched,\nincluding on single-event sources. Webhooks accept JSON;\nform sources also accept form-encoded bodies and _event selectors. Browser CORS applies only to\nform sources. Source-configured webhook authentication is enforced for POST requests.\nJSON Content-Type or Accept: application/json retains JSON 202/200/4xx responses. Browser forms\nuse an allowlisted redirect or a minimal status page; rejected redirects include loopify_error.\n\n",
        "operationId": "ingestSource",
        "parameters": [
          {
            "name": "sourceKey",
            "in": "path",
            "description": "The opaque public key identifying the configured source.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/in/{sourceKey}/{pathKey}": {
      "post": {
        "tags": [
          "IncomingEventSourceIngress"
        ],
        "summary": "Receive an incoming request at a source URL with an explicit event path selector.",
        "description": "If the source also resolves an event from a configured header or payload field, that selector must\nagree with pathKey. Webhooks accept JSON only. Form sources also accept form\nbodies and handle browser CORS without credentials.\nBrowser destinations resolve from _redirect, binding configuration, then Referer against the\nbinding allowlist. Without a safe destination, only generic HTML status text is returned.\n\n",
        "operationId": "ingestSourceEvent",
        "parameters": [
          {
            "name": "sourceKey",
            "in": "path",
            "description": "The opaque public key identifying the configured source.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pathKey",
            "in": "path",
            "description": "The version-owned routing value.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          }
        }
      },
      "options": {
        "tags": [
          "IncomingEventSourceIngress"
        ],
        "summary": "Receive an incoming request at a source URL with an explicit event path selector.",
        "description": "If the source also resolves an event from a configured header or payload field, that selector must\nagree with pathKey. Webhooks accept JSON only. Form sources also accept form\nbodies and handle browser CORS without credentials.\nBrowser destinations resolve from _redirect, binding configuration, then Referer against the\nbinding allowlist. Without a safe destination, only generic HTML status text is returned.\n\n",
        "operationId": "ingestSourceEvent",
        "parameters": [
          {
            "name": "sourceKey",
            "in": "path",
            "description": "The opaque public key identifying the configured source.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pathKey",
            "in": "path",
            "description": "The version-owned routing value.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventIngestResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingEventErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/me": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update user settings",
        "description": " #### Auth policies:  \n\n ",
        "operationId": "update",
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdateModel"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdateModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdateModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdateModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [ ]
          },
          {
            "oauth2": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get Accounts you are connected to",
        "description": " #### Auth policies:  \n\n \n\n",
        "operationId": "getAccounts",
        "parameters": [
          {
            "name": "onlyActiveAccount",
            "in": "query",
            "description": "Return only the account you're currently logged into",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAccount"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [ ]
          },
          {
            "oauth2": [ ]
          }
        ]
      }
    },
    "/me/preview-recipients": {
      "get": {
        "tags": [
          "PreviewRecipients"
        ],
        "summary": "Get the calling user's saved preview contacts, sorted by name.",
        "description": " #### Auth policies: ReadCampaign \n\n \n\n",
        "operationId": "getRecipients",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PreviewRecipientResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PreviewRecipientResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PreviewRecipientResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ReadCampaign"
            ]
          },
          {
            "oauth2": [
              "ReadCampaign"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "PreviewRecipients"
        ],
        "summary": "Explicitly save a contact as a preview recipient. Repeated saves are idempotent.",
        "description": " #### Auth policies: ManageCampaign \n\n \n\n",
        "operationId": "addRecipient",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRecipientAddRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRecipientAddRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRecipientAddRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRecipientAddRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ManageCampaign"
            ]
          },
          {
            "oauth2": [
              "ManageCampaign"
            ]
          }
        ]
      }
    },
    "/me/preview-recipients/{contactId}": {
      "delete": {
        "tags": [
          "PreviewRecipients"
        ],
        "summary": "Remove a saved preview recipient. Missing rows also return 204.",
        "description": " #### Auth policies: ManageCampaign \n\n \n\n",
        "operationId": "removeRecipient",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "ManageCampaign"
            ]
          },
          {
            "oauth2": [
              "ManageCampaign"
            ]
          }
        ]
      }
    },
    "/users/{userId}": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Remove a user from the account",
        "description": " #### Auth policies: UserOrAdminOrAppUser \n\n userId has to belong to the account your are authenticated with",
        "operationId": "removeUser",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "description": "The user you want to remove",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "accountGuid",
            "in": "query",
            "description": "The account you want to remove the user from (current account if omitted)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appId",
            "in": "query",
            "description": "The app you want to remove the user from (if omitted, it's removed from the acccount completely)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "0: You do not have access\n\n1: User was not found for this account\n\n2: Cannot remove owner of the account\n\n3: App with supplied id does not exist"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "Bearer": [
              "UserOrAdminOrAppUser"
            ]
          },
          {
            "oauth2": [
              "UserOrAdminOrAppUser"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountFlowTemplate": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "integer",
            "format": "int32"
          },
          "_id": {
            "type": "string",
            "nullable": true
          },
          "tagGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagGroup"
            },
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "changed": {
            "type": "string",
            "format": "date-time"
          },
          "published": {
            "type": "boolean",
            "description": "Decides if the template is published as a usable template in the users account."
          },
          "rootTemplate": {
            "type": "boolean",
            "description": "A root template is a template that cannot be edited (overwritten) it can only be duplicated and saved with a new name"
          },
          "screenshot": {
            "type": "string",
            "description": "This is a root template only property, and is automatically generated in the upload process",
            "nullable": true
          },
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowBlock"
            },
            "nullable": true
          },
          "connections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowConnection"
            },
            "nullable": true
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InlineSegment"
            },
            "description": "List of document-only filters (smart segments). Should be empty for a template in most cases",
            "nullable": true
          },
          "deleted": {
            "$ref": "#/components/schemas/Deleted"
          },
          "commitHash": {
            "type": "string",
            "nullable": true
          },
          "branched": {
            "$ref": "#/components/schemas/BranchedDocument"
          },
          "folderId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ApiEntryResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BranchedDocument": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean"
          },
          "publishDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "stopDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Contact": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "nullable": true
          },
          "accountId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "avatar": {
            "type": "string",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "deleted": {
            "$ref": "#/components/schemas/Deleted"
          },
          "changed": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "emailSuppressed": {
            "type": "boolean",
            "description": "Only used on get",
            "nullable": true
          },
          "mobileSuppressed": {
            "type": "boolean",
            "description": "Only used on get",
            "nullable": true
          },
          "subscription": {
            "$ref": "#/components/schemas/Subscription"
          },
          "importConsent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactConsentAssertion"
            },
            "nullable": true
          },
          "campaignFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactCampaignField"
            },
            "nullable": true
          },
          "version": {
            "type": "string",
            "nullable": true
          },
          "lastImportJobId": {
            "type": "string",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "companyName": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "leadScore": {
            "type": "integer",
            "format": "int32"
          },
          "tagGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactTagGroup"
            },
            "nullable": true
          },
          "customFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactCustomField"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContactCampaignField": {
        "type": "object",
        "properties": {
          "flowId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "value": { }
        },
        "additionalProperties": false
      },
      "ContactConsentAssertion": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "accepted": {
            "type": "boolean",
            "nullable": true
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "confirm": {
            "type": "string",
            "nullable": true
          },
          "deny": {
            "type": "string",
            "nullable": true
          },
          "visible": {
            "type": "string",
            "nullable": true
          },
          "givenAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContactCustomField": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "nullable": true
          },
          "value": { }
        },
        "additionalProperties": false
      },
      "ContactInsert": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "companyName": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "leadScore": {
            "type": "integer",
            "format": "int32"
          },
          "tagGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactTagGroup"
            },
            "nullable": true
          },
          "customFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactCustomField"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContactResponse": {
        "type": "object",
        "properties": {
          "totalItems": {
            "type": "integer",
            "format": "int64"
          },
          "contacts": {
            "type": "array",
            "items": { },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContactSearchOptions": {
        "type": "object",
        "properties": {
          "excludeEmailSuppressed": {
            "type": "boolean",
            "default": false
          },
          "excludeSMSSuppressed": {
            "type": "boolean",
            "default": false
          },
          "returnTotals": {
            "type": "boolean",
            "default": true
          },
          "returnContacts": {
            "type": "boolean",
            "default": true
          },
          "skipSort": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ContactSearchParameters": {
        "type": "object",
        "properties": {
          "contactIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "segment": {
            "$ref": "#/components/schemas/SegmentSearch"
          },
          "projection": {
            "type": "object",
            "additionalProperties": { },
            "description": "Dynamic object",
            "nullable": true
          },
          "sortOrder": {
            "type": "object",
            "additionalProperties": { },
            "description": "Dynamic object",
            "nullable": true
          },
          "options": {
            "$ref": "#/components/schemas/ContactSearchOptions"
          }
        },
        "additionalProperties": false
      },
      "ContactTagGroup": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContactUpdate": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "companyName": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "leadScore": {
            "type": "integer",
            "format": "int32"
          },
          "tagGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactTagGroup"
            },
            "nullable": true
          },
          "customFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactCustomField"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContactUpsertRequest": {
        "type": "object",
        "properties": {
          "consent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactConsentAssertion"
            },
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "companyName": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "leadScore": {
            "type": "integer",
            "format": "int32"
          },
          "tagGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactTagGroup"
            },
            "nullable": true
          },
          "customFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactCustomField"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Deleted": {
        "type": "object",
        "properties": {
          "deletedStamp": {
            "type": "string",
            "description": "null means not deleted",
            "format": "date-time",
            "nullable": true
          },
          "userId": {
            "type": "integer",
            "format": "int32"
          },
          "purging": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Object is not deleted if field is null or { deletedStamp: null}"
      },
      "EventCountResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "EventTypesResponse": {
        "type": "object",
        "properties": {
          "types": {
            "type": "array",
            "items": { },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Filter": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "sourceType": {
            "$ref": "#/components/schemas/FilterSourceType"
          },
          "comperator": {
            "$ref": "#/components/schemas/FilterComperator"
          },
          "patternType": {
            "$ref": "#/components/schemas/FilterPatternType"
          },
          "pattern": {
            "type": "string",
            "description": "Scalar filter text, or JSON-encoded string array for V2 set comparators.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FilterComperator": {
        "enum": [
          "contains",
          "does not contain",
          "is equal to",
          "is not equal to",
          "begins with",
          "ends with",
          "is greater than",
          "is less than",
          "is greater than or equal to",
          "is less than or equal to",
          "is empty",
          "is not empty",
          "matches",
          "is before",
          "is after",
          "occurred in the last",
          "occurred before the last",
          "occurs within the next",
          "recurs yearly today",
          "is set",
          "is not set",
          "contains specific",
          "does not contain specific",
          "has changed in",
          "has not changed in",
          "was updated after",
          "has opened",
          "has not opened",
          "has clicked",
          "has not clicked",
          "has filed form",
          "has not filed form",
          "has received",
          "has not received",
          "recurs yearly in",
          "occurs in",
          "is true",
          "is false",
          "is not true",
          "has unsubscribed",
          "has bounced",
          "has hardbounced",
          "has softbounced",
          "is not false",
          "has occurred",
          "has not occurred",
          "occurs today",
          "occurred",
          "is guest",
          "has been",
          "campaign member",
          "up to turning",
          "from turning",
          "turning",
          "in time range",
          "has flow block executed",
          "has flow block executed true",
          "has flow block executed false",
          "has flow block executed error",
          "has flow job created",
          "has flow job queued",
          "is one of",
          "is none of"
        ],
        "type": "string",
        "description": "Allowed values: contains,does not contain,is equal to,is not equal to,begins with,ends with,is greater than,is less than,is greater than or equal to,is less than or equal to,is empty,is not empty,matches,is before,is after,occurred in the last,occurred before the last,occurs within the next,recurs yearly today,is set,is not set,contains specific,does not contain specific,has changed in,has not changed in,was updated after,has opened,has not opened,has clicked,has not clicked,has filed form,has not filed form,has received,has not received,recurs yearly in,occurs in,is true,is false,is not true,has unsubscribed,has bounced,has hardbounced,has softbounced,is not false,has occurred,has not occurred,occurs today,occurred,is guest,has been,campaign member,up to turning,from turning,turning,in time range,has flow block executed,has flow block executed true,has flow block executed false,has flow block executed error,has flow job created,has flow job queued,is one of,is none of"
      },
      "FilterGroup": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "$ref": "#/components/schemas/FilterGroupType"
          },
          "conjunction": {
            "$ref": "#/components/schemas/FilterGroupConjunction"
          },
          "joinType": {
            "$ref": "#/components/schemas/FilterGroupJoinType"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Filter"
            },
            "nullable": true
          },
          "showAll": {
            "type": "boolean"
          },
          "excludeEventResult": {
            "type": "boolean",
            "description": "Only used if type is event or custom-event"
          }
        },
        "additionalProperties": false
      },
      "FilterGroupConjunction": {
        "enum": [
          "AND",
          "OR"
        ],
        "type": "string",
        "description": "Allowed values: AND,OR"
      },
      "FilterGroupJoinType": {
        "enum": [
          "some",
          "all"
        ],
        "type": "string",
        "description": "Allowed values: some,all"
      },
      "FilterGroupType": {
        "enum": [
          "contact",
          "event",
          "custom-event",
          "event-booking",
          "job-data",
          "event-booking-v2",
          "data-collection"
        ],
        "type": "string",
        "description": "Allowed values: contact,event,custom-event,event-booking,job-data,event-booking-v2,data-collection"
      },
      "FilterPatternType": {
        "enum": [
          "date",
          "date offset",
          "number",
          "string",
          "regex",
          "path"
        ],
        "type": "string",
        "description": "Allowed values: date,date offset,number,string,regex,path"
      },
      "FilterSourceType": {
        "enum": [
          "number",
          "string",
          "date",
          "array",
          "object",
          "transaction",
          "boolean",
          "nullable boolean",
          "sum",
          "count",
          "event booking session",
          "date age",
          "datetime"
        ],
        "type": "string",
        "description": "Allowed values: number,string,date,array,object,transaction,boolean,nullable boolean,sum,count,event booking session,date age,datetime"
      },
      "FlowBlock": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "$ref": "#/components/schemas/FlowBlockType"
          },
          "group": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "position": {
            "$ref": "#/components/schemas/FlowBlockPosition"
          },
          "data": {
            "type": "object",
            "additionalProperties": { },
            "description": "Dynamic object",
            "nullable": true
          },
          "oldData": {
            "type": "object",
            "additionalProperties": { },
            "description": "Dynamic object",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": { },
              "description": "Dynamic object"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FlowBlockPosition": {
        "type": "object",
        "properties": {
          "x": {
            "type": "integer",
            "format": "int32"
          },
          "y": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "FlowBlockType": {
        "enum": [
          "flow-activated",
          "contacts",
          "new-entry",
          "page",
          "sms-in",
          "api-entry",
          "file-import",
          "wait",
          "split",
          "email",
          "sms",
          "print",
          "check-email-status",
          "check-sms-status",
          "check-page-status",
          "contact-match",
          "update-contact",
          "add-to-campaign",
          "send-alert",
          "send-report",
          "flow-test-activated",
          "flow-stopped",
          "external-form",
          "webhook",
          "incoming-events",
          "coupon",
          "switch-contact",
          "popup",
          "remove-from-campaign",
          "data-collections",
          "send-data",
          "delete-contact",
          "export",
          "campaign-activity",
          "flow-guard"
        ],
        "type": "string",
        "description": "Allowed values: flow-activated,contacts,new-entry,page,sms-in,api-entry,file-import,wait,split,email,sms,print,check-email-status,check-sms-status,check-page-status,contact-match,update-contact,add-to-campaign,send-alert,send-report,flow-test-activated,flow-stopped,external-form,webhook,incoming-events,coupon,switch-contact,popup,remove-from-campaign,data-collections,send-data,delete-contact,export,campaign-activity,flow-guard"
      },
      "FlowConnection": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "nullable": true
          },
          "target": {
            "type": "string",
            "nullable": true
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "event": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "IncomingEventErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "IncomingEventIngestResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InlineSegment": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "filterGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilterGroup"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Used in document-only filter (Ie: filters field in email document)"
      },
      "InputTypes": {
        "enum": [
          "taglist",
          "multiple-select",
          "single-select"
        ],
        "type": "string",
        "description": "Allowed values: taglist,multiple-select,single-select"
      },
      "NewEntryRequest": {
        "type": "object",
        "properties": {
          "contactIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "segment": {
            "$ref": "#/components/schemas/SegmentSearch"
          }
        },
        "additionalProperties": false
      },
      "PendingConsent": {
        "type": "object",
        "properties": {
          "pendingSince": {
            "type": "string",
            "format": "date-time"
          },
          "tokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "reminderSentAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "requestSource": {
            "type": "string",
            "nullable": true
          },
          "lastResentAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PreviewRecipientAddRequest": {
        "required": [
          "contact_id"
        ],
        "type": "object",
        "properties": {
          "contact_id": {
            "minLength": 1,
            "pattern": "^[0-9a-fA-F]{24}$",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "PreviewRecipientResponse": {
        "type": "object",
        "properties": {
          "contact_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "added_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "SegmentSearch": {
        "type": "object",
        "properties": {
          "filterGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilterGroup"
            },
            "nullable": true
          },
          "includeStatements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilterGroup"
            },
            "nullable": true
          },
          "conjunction": {
            "$ref": "#/components/schemas/FilterGroupConjunction"
          },
          "excludeStatements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilterGroup"
            },
            "nullable": true
          },
          "excludeConjunction": {
            "$ref": "#/components/schemas/FilterGroupConjunction"
          }
        },
        "additionalProperties": false
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "subscriptions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of SubscriptionCategory _ids",
            "nullable": true
          },
          "snooze": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "acceptEmail": {
            "type": "boolean",
            "nullable": true
          },
          "emailConsentGeneration": {
            "type": "integer",
            "format": "int64"
          },
          "acceptSMS": {
            "type": "boolean",
            "nullable": true
          },
          "emailPendingConsent": {
            "$ref": "#/components/schemas/PendingConsent"
          },
          "leavingReason": {
            "type": "string",
            "nullable": true
          },
          "leavingComment": {
            "type": "string",
            "nullable": true
          },
          "hasValidMobile": {
            "type": "boolean"
          },
          "hasValidEmail": {
            "type": "boolean"
          },
          "acceptedPrivacyPolicy": {
            "type": "boolean",
            "nullable": true
          },
          "acceptedTerms": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TagGroup": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "nullable": true
          },
          "locked": {
            "type": "boolean"
          },
          "managed": {
            "type": "boolean",
            "nullable": true
          },
          "appDomain": {
            "type": "string",
            "nullable": true
          },
          "deleted": {
            "$ref": "#/components/schemas/Deleted"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "externalTagGroupId": {
            "type": "string",
            "nullable": true
          },
          "inputType": {
            "$ref": "#/components/schemas/InputTypes"
          },
          "type": {
            "$ref": "#/components/schemas/TagGroupType"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "allowUsersToAdd": {
            "type": "boolean"
          },
          "createdByUserId": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "TagGroupType": {
        "enum": [
          "segment",
          "account-collection"
        ],
        "type": "string",
        "description": "Allowed values: segment,account-collection"
      },
      "UserAccount": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "avatar": {
            "type": "string",
            "nullable": true
          },
          "userId": {
            "type": "integer",
            "format": "int32"
          },
          "currentAccount": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "nullable": true
          },
          "userName": {
            "type": "string",
            "nullable": true
          },
          "mainLicenseKey": {
            "type": "string",
            "nullable": true
          },
          "mainLicenseProductName": {
            "type": "string",
            "nullable": true
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserAccountRoles"
            },
            "nullable": true
          },
          "mobileConfirmed": {
            "type": "boolean"
          },
          "mobileConfirmationPending": {
            "type": "boolean"
          },
          "mfaEnabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UserAccountRoles": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "appRoles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserAppRoles"
            },
            "nullable": true
          },
          "metadata": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserMetadataGet"
            },
            "nullable": true
          },
          "externalConsent": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "avatar": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "accountGuid": {
            "type": "string",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "ownerUserID": {
            "type": "integer",
            "format": "int32"
          },
          "environment": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UserAppRoles": {
        "type": "object",
        "properties": {
          "appId": {
            "type": "string",
            "nullable": true
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UserMetadataGet": {
        "type": "object",
        "properties": {
          "appId": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UserUpdateModel": {
        "required": [
          "email",
          "firstName"
        ],
        "type": "object",
        "properties": {
          "email": {
            "minLength": 1,
            "type": "string",
            "format": "email"
          },
          "firstName": {
            "minLength": 1,
            "type": "string"
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "avatar": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "nullable": true
          },
          "userName": {
            "maxLength": 200,
            "minLength": 5,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://auth.loopify.com/connect/authorize",
            "tokenUrl": "https://auth.loopify.com/token",
            "scopes": {
              "User": "Write access to some protected resources",
              "Admin": "Write access to protected resources",
              "Collaborator": "write access to shared resources",
              "CustomerService": "For internal use",
              "Alis": "For internal use",
              "TemplateBuilder": "For internal use"
            }
          }
        }
      },
      "Bearer": {
        "type": "http",
        "description": "Paste your JWT token here. Example: Bearer eyJhbGciOi...",
        "scheme": "Bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "tags": [
    {
      "name": "Contacts"
    },
    {
      "name": "Events"
    },
    {
      "name": "Flows"
    },
    {
      "name": "IncomingEventSourceIngress"
    },
    {
      "name": "Users"
    },
    {
      "name": "PreviewRecipients"
    }
  ]
}