{
  "swagger": "2.0",
  "info": {
    "title": "CRM Bot",
    "description": "Create powerful conversation experience for your customers right from your CRM system.\nLearn more https://docs.crmbot.ai/",
    "version": "1.0",
    "contact": {
      "name": "CRM Bot Ltd - Support",
      "url": "https://github.com/crmbot-ai/crmbot-community/issues",
      "email": "support@crmbot.ai"
    }
  },
  "host": "services.crmbot-cloud.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [],
  "produces": [],
  "paths": {
    "/runtime/api/message/custom": {
      "post": {
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "object",
                  "title": "Adaptive card"
                }
              }
            }
          }
        },
        "operationId": "build-custom-message",
        "summary": "Build Adaptive Card Response",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "description": "Use Platform parameter from trigger action",
                  "title": "Platform"
                },
                "text": {
                  "type": "string",
                  "description": "Paste here your adaptive card JSON",
                  "title": "Payload"
                }
              },
              "required": [
                "text",
                "platform"
              ]
            },
            "x-ms-visibility": "advanced"
          }
        ],
        "description": "Creates Microsoft Adaptive Card response to send to the user.",
        "x-ms-visibility": "important"
      }
    },
    "/runtime/api/message/text": {
      "post": {
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "object",
                  "title": "Text message"
                }
              }
            }
          }
        },
        "operationId": "build-text-message",
        "summary": "Build Text Response",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "description": "Use Platform parameter from trigger action",
                  "title": "Platform"
                },
                "text": {
                  "type": "string",
                  "description": "Provide your response",
                  "title": "Text"
                }
              },
              "required": [
                "text",
                "platform"
              ]
            },
            "x-ms-visibility": "advanced"
          }
        ],
        "description": "Creates a standard text response to send to the user.",
        "x-ms-visibility": "important"
      }
    },
    "/runtime/api/message/card": {
      "post": {
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "object",
                  "title": "Card message"
                }
              }
            }
          }
        },
        "operationId": "build-card-message",
        "summary": "Build Card Response",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "description": "Use Platform parameter from trigger action",
                  "title": "Platform"
                },
                "title": {
                  "type": "string",
                  "description": "Enter card title",
                  "title": "Title"
                },
                "subtitle": {
                  "type": "string",
                  "description": "Enter card description (optional)",
                  "title": "Description"
                },
                "url": {
                  "type": "string",
                  "description": "Enter url of your .jpg or .png (optional)",
                  "title": "Image URL"
                },
                "isCarousel": {
                  "type": "boolean",
                  "description": "Set to NO as default.",
                  "title": "Display as carousel",
                  "default": false
                },
                "buttontitle1": {
                  "type": "string",
                  "description": "Title of your button",
                  "title": "1st Button Title"
                },
                "buttonpostback1": {
                  "type": "string",
                  "description": "Postback (text sent to Flow) of your button",
                  "title": "1st Button Postback"
                },
                "buttontitle2": {
                  "type": "string",
                  "description": "Title of your button",
                  "title": "2nd Button Title"
                },
                "buttonpostback2": {
                  "type": "string",
                  "description": "Postback (text sent to Flow) of your button",
                  "title": "2nd Button Postback"
                },
                "buttontitle3": {
                  "type": "string",
                  "description": "Title of your button",
                  "title": "3rd Button Title"
                },
                "buttonpostback3": {
                  "type": "string",
                  "description": "Postback (text sent to Flow) of your button",
                  "title": "3rd Button Postback"
                }
              },
              "required": [
                "title",
                "platform",
                "isCarousel"
              ]
            },
            "x-ms-visibility": "advanced"
          }
        ],
        "description": "Creates Card response to send to the user.",
        "x-ms-visibility": "important"
      }
    },
    "/runtime/api/message/quickreplies": {
      "post": {
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "object",
                  "title": "Quick replies message"
                }
              }
            }
          }
        },
        "operationId": "build-quickreplies-message",
        "summary": "Build Quick Reply Response",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "description": "Use Platform parameter from trigger action",
                  "title": "Platform"
                },
                "title": {
                  "type": "string",
                  "description": "Text to display above the options",
                  "title": "Title"
                },
                "text": {
                  "type": "string",
                  "description": "Provide list of comma separated options",
                  "title": "Menu options"
                }
              },
              "required": [
                "text",
                "platform",
                "title"
              ]
            }
          }
        ],
        "description": "Creates a small menu of suggested actions for the user.",
        "x-ms-visibility": "important"
      }
    },
    "/runtime/api/message/media": {
      "post": {
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "object",
                  "title": "Media message"
                }
              }
            }
          }
        },
        "operationId": "build-media-message",
        "summary": "Build Media Response",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "description": "Use Platform parameter from trigger action",
                  "title": "Platform"
                },
                "url": {
                  "type": "string",
                  "description": "Enter url of your image or video",
                  "title": "Image/Video URL"
                },
                "mediaType": {
                  "type": "string",
                  "enum": [
                    "Image",
                    "Video"
                  ],
                  "x-ms-editor-options": {
                    "items": [
                      {
                        "title": "Image",
                        "value": "1"
                      },
                      {
                        "title": "Video",
                        "value": "2"
                      }
                    ]
                  },
                  "title": "Media type",
                  "description": "Select right type"
                }
              },
              "required": [
                "url",
                "mediaType",
                "platform"
              ]
            }
          }
        ],
        "description": "Creates an image or video to send to the user.",
        "x-ms-visibility": "important"
      }
    },
    "/runtime/api/flowconnector/response": {
      "post": {
        "operationId": "send-response",
        "summary": "Send Response",
        "description": "Sends your response to the user within the context of existing conversation (Requires Bot Trigger).",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "useGlossary",
                "targetLanguage",
                "sessionId"
              ],
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "title": "Bot Session ID",
                  "description": "Use BotSessionID parameter from trigger action"
                },
                "useGlossary": {
                  "type": "boolean",
                  "description": "If you have a custom dictionary for your Bot select Yes",
                  "title": "Use Custom Dictionary"
                },
                "targetLanguage": {
                  "type": "string",
                  "description": "Use Language parameter from trigger action",
                  "title": "Target Language"
                },
                "webhookResponse": {
                  "type": "object",
                  "properties": {
                    "FulfillmentMessages": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "title": "Fullfilment Messages",
                      "description": "Use Message parameter from your Response Actions"
                    },
                    "EventName": {
                      "description": "Select the event you would like to invoke",
                      "type": "string",
                      "x-ms-summary": "Select the event you would like to invoke",
                      "x-ms-dynamic-values": {
                        "operationId": "get-events"
                      },
                      "title": "Event"
                    },
                    "OutputContextName": {
                      "description": "Apply specific context to response",
                      "type": "string",
                      "x-ms-summary": "Apply specific context to response",
                      "x-ms-dynamic-values": {
                        "operationId": "get-contexts"
                      },
                      "title": "Output Context"
                    },
                    "OutputContextLifespan": {
                      "description": "Duration of context",
                      "type": "integer",
                      "x-ms-summary": "Duration of context",
                      "title": "Context Lifespan"
                    }
                  }
                }
              }
            }
          }
        ],
        "x-ms-visibility": "important"
      }
    },
    "/runtime/api/flowconnector/proactive": {
      "post": {
        "operationId": "send-proactive-message",
        "summary": "Send Proactive Message",
        "description": "Sends your response to the user outside of the standard conversation (requires User ID).",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "sessionId",
                "useGlossary",
                "targetLanguage"
              ],
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Needs to come from your trigger or supporting datasets",
                  "title": "User ID"
                },
                "useGlossary": {
                  "type": "boolean",
                  "description": "If you have a custom dictionary for your Bot select Yes",
                  "title": "Use Custom Dictionary"
                },
                "targetLanguage": {
                  "type": "string",
                  "description": "Use Language parameter from trigger action",
                  "title": "Target Language"
                },
                "webhookResponse": {
                  "type": "object",
                  "properties": {
                    "FulfillmentMessages": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Use Message parameter from your Response Actions",
                      "title": "Fullfilment Messages"
                    }
                  }
                }
              }
            }
          }
        ],
        "x-ms-visibility": "important"
      }
    },
    "/runtime/api/flowconnector/getIntents": {
      "get": {
        "operationId": "get-intents",
        "summary": "Get intents",
        "description": "Get intents",
        "x-ms-visibility": "internal",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "intent": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/runtime/api/flowconnector/getContexts": {
      "get": {
        "operationId": "get-contexts",
        "summary": "Get contexts",
        "description": "Get contexts",
        "x-ms-visibility": "internal",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "/runtime/api/flowconnector/getEvents": {
      "get": {
        "operationId": "get-events",
        "summary": "Get events",
        "description": "Get events",
        "x-ms-visibility": "internal",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "/runtime/api/flowconnector/getSchema/{intent}": {
      "get": {
        "operationId": "get-schema",
        "summary": "Get intent schema",
        "description": "Get intent schema",
        "x-ms-visibility": "internal",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        },
        "parameters": [
          {
            "name": "intent",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Select the intent",
            "default": "test"
          }
        ]
      }
    },
    "/runtime/api/flowconnector": {
      "x-ms-notification-content": {
        "schema": {
          "type": "object",
          "x-ms-dynamic-schema": {
            "operationId": "get-schema",
            "parameters": {
              "intent": {
                "parameter": "intent"
              }
            }
          },
          "x-ms-dynamic-properties": {
            "operationId": "get-schema",
            "parameters": {
              "intent": {
                "parameterReference": "body/intent"
              }
            }
          }
        },
        "description": "Api Response"
      },
      "x-ms-visibility": "important",
      "post": {
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        },
        "operationId": "intent-detected",
        "summary": "When Intent is detected",
        "x-ms-trigger": "single",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "callbackUrl": {
                  "type": "string",
                  "description": "callbackUrl",
                  "x-ms-visibility": "internal",
                  "title": "",
                  "x-ms-notification-url": true
                },
                "intent": {
                  "description": "Select intent you would like to trigger on",
                  "type": "string",
                  "x-ms-summary": "Select intent you would like to trigger on",
                  "x-ms-dynamic-values": {
                    "operationId": "get-intents",
                    "value-path": "intent",
                    "value-title": "intent"
                  },
                  "title": "Intent",
                  "x-ms-visibility": "important"
                },
                "platform": {
                  "title": "Platform",
                  "description": "Use Unspecified if your flow is platform agnostic",
                  "type": "string",
                  "x-ms-visibility": "important",
                  "x-ms-summary": "Use Unspecified if your flow is platform agnostic",
                  "enum": [
                    "Unspecified",
                    "Messenger",
                    "Google Assistant",
                    "Skype",
                    "Slack"
                  ]
                }
              },
              "required": [
                "callbackUrl",
                "intent",
                "platform"
              ]
            },
            "x-ms-visibility": "advanced"
          }
        ],
        "description": "Triggers when CRM Bot matches user request to one of your Intents with fullfilment.",
        "x-ms-visibility": "important"
      }
    }
  },
  "definitions": {},
  "parameters": {},
  "responses": {},
  "securityDefinitions": {
    "API Key": {
      "type": "apiKey",
      "in": "header",
      "name": "X-Tcb-Api-Key"
    }
  },
  "security": [
    {
      "API Key": []
    }
  ],
  "tags": [],
  "x-ms-connector-metadata": [
    {
      "propertyName": "Website",
      "propertyValue": "https://docs.crmbot.ai"
    },
    {
      "propertyName": "Privacy policy",
      "propertyValue": "https://crmbot.ai/privacy"
    },
    {
      "propertyName": "Categories",
      "propertyValue": "Sales and CRM;AI"
    }
  ]
}