{
  "swagger": "2.0",
  "info": {
    "title": "Gratavid",
    "description": "Gratavid is a SaaS service that allows organizations to collect and send personalized videos.",
    "version": "1.0",
    "contact": {
      "name": "Gratavid Support",
      "url": "https://gratavid.zendesk.com/",
      "email": "contact@gratavid.com"
    }
  },
  "host": "api.gratavid.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [],
  "produces": [],
  "paths": {
    "/api/manageIntegrations": {
      "x-ms-notification-content": {
        "description": "Id Response",
        "schema": {
          "type": "object",
          "properties": {
            "noteTitle": {
              "type": "string",
              "description": "The title of the Gratavid note",
              "title": "Gratavid Note Title"
            },
            "noteURL": {
              "type": "string",
              "description": "The URL of the Gratavid note",
              "title": "Gratavid Note URL"
            },
            "contact_customUserId": {
              "type": "string",
              "description": "The Gratavid Custom UserId of the contact",
              "title": "Contact Gratavid Custom User Id"
            },
            "contact_customAccountId": {
              "type": "string",
              "description": "The Gratavid Custom AccountId of the contact",
              "title": "Contact Gratavid Custom Account Id"
            },
            "contact_email": {
              "type": "string",
              "description": "The email of the Gratavid contact",
              "title": "Contact Email"
            },
            "contact_firstName": {
              "type": "string",
              "description": "The first name of the Gratavid contact",
              "title": "Contact First Name"
            },
            "contact_lastName": {
              "type": "string",
              "description": "The last name of the Gratavid contact",
              "title": "Contact Last Name"
            },
            "replyText": {
              "type": "string",
              "description": "The contact's reply to your Gratavid",
              "title": "Reply Message"
            },
            "replyVideoSrc": {
              "type": "string",
              "description": "If the contact replied to your Gratavid with a video, this will be the link of the reply video.",
              "title": "Video Reply Link"
            }
          }
        }
      },
      "get": {
        "responses": {
          "200": {
            "description": "default",
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "description": "status"
                },
                "data": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "id"
                      },
                      "label": {
                        "type": "string",
                        "description": "label",
                        "title": "",
                        "x-ms-visibility": "important"
                      },
                      "sample": {
                        "type": "string",
                        "description": "sample"
                      },
                      "value": {
                        "type": "string",
                        "description": "value"
                      }
                    }
                  },
                  "description": "data"
                }
              }
            }
          }
        },
        "summary": "Get Gratavid Data",
        "description": "Get Gratavid notes and users",
        "operationId": "getData",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "microsoftPowerAutomate",
            "x-ms-visibility": "internal"
          },
          {
            "name": "event",
            "in": "query",
            "required": true,
            "type": "string",
            "x-ms-visibility": "important",
            "enum": [
              "getUsers",
              "getNotes"
            ]
          }
        ],
        "x-ms-visibility": "internal"
      },
      "delete": {
        "responses": {
          "default": {
            "description": "default",
            "schema": {}
          }
        },
        "summary": "Webhook Unsubscribe",
        "description": "Unsubscribe the webhook",
        "operationId": "webhookUnsubscribe",
        "x-ms-visibility": "internal",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "microsoftPowerAutomate",
            "x-ms-visibility": "internal"
          },
          {
            "name": "event",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "webhookUnsubscribe",
            "x-ms-visibility": "advanced"
          },
          {
            "name": "webhookSubscribeId",
            "in": "query",
            "required": false,
            "type": "integer"
          },
          {
            "name": "webookHookEvent",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ]
      },
      "post": {
        "responses": {
          "default": {
            "description": "default",
            "schema": {}
          }
        },
        "summary": "When a new event (watch, reply, etc.) takes place in Gratavid",
        "description": "Triggers when a new event such as Gratavid watch, reply, task sent, unsubscribe, or text-opt out.",
        "operationId": "newEvent",
        "x-ms-trigger": "single",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "microsoftPowerAutomate",
            "x-ms-visibility": "internal"
          },
          {
            "name": "event",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "webhookSubscribe",
            "x-ms-visibility": "internal"
          },
          {
            "name": "webookHookEvent",
            "in": "query",
            "required": true,
            "type": "string",
            "enum": [
              "taskSent",
              "reply",
              "noteWatched",
              "unsubscribe",
              "stopText"
            ],
            "x-ms-enum-values": [
              {
                "displayName": "Gratavid task sent to a contact",
                "value": "taskSent"
              },
              {
                "displayName": "Contact replies to a Gratavid",
                "value": "reply"
              },
              {
                "displayName": "Contact watches a Gratavid all the way through",
                "value": "noteWatched"
              },
              {
                "displayName": "Contact unsubscribes from email after receiving Gratavid email",
                "value": "unsubscribe"
              },
              {
                "displayName": "Contact opt-out of text (replies 'STOP') after receiving Gratavid",
                "value": "stopText"
              }
            ],
            "x-ms-visibility": "important",
            "description": "Select the event you want to trigger on",
            "x-ms-summary": "Gratavid Event"
          },
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "webhookURL": {
                  "type": "string",
                  "description": "The webhook URL",
                  "x-ms-notification-url": true,
                  "x-ms-visibility": "internal"
                }
              },
              "required": [
                "webhookURL"
              ]
            }
          }
        ],
        "x-ms-visibility": "important"
      }
    },
    "/api/integrationsEndpoint": {
      "post": {
        "responses": {
          "200": {
            "description": "default",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "message"
                },
                "taskId": {
                  "type": "string",
                  "description": "The id of the task created"
                },
                "viewInGratavidLink": {
                  "type": "string",
                  "description": "Gratavid link"
                }
              }
            }
          }
        },
        "summary": "Create a Gratavid task",
        "operationId": "createTask",
        "description": "Create a Gratavid task",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "microsoftPowerAutomate",
            "x-ms-visibility": "internal"
          },
          {
            "name": "event",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "createTask",
            "x-ms-visibility": "internal"
          },
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "description": "The email of the contact",
                  "title": "Contact Email",
                  "x-ms-visibility": "important"
                },
                "firstName": {
                  "type": "string",
                  "description": "The first name of the contact",
                  "title": "Contact First Name",
                  "x-ms-visibility": "important"
                },
                "lastName": {
                  "type": "string",
                  "description": "The last name of the contact",
                  "title": "Contact Last Name",
                  "x-ms-visibility": "important"
                },
                "customUserId": {
                  "type": "string",
                  "description": "The id of the contact in your CRM",
                  "title": "Contact Gratavid Custom User Id"
                },
                "customAccountId": {
                  "type": "string",
                  "description": "The id of the contact's account in your CRM",
                  "title": "Contact Gratavid Custom Account Id"
                },
                "textOptIn": {
                  "type": "string",
                  "description": "The SMS/text opt-in status of the contact",
                  "title": "Contact Opted In To Text"
                },
                "cellNumber": {
                  "type": "string",
                  "description": "The cell number of the contact",
                  "title": "Contact Cell Number"
                },
                "comments": {
                  "type": "string",
                  "description": "The comments that will be added to the Gratavid task (ie - new donation for $500)",
                  "title": "Task comments",
                  "x-ms-visibility": "important"
                },
                "assignedTo": {
                  "type": "string",
                  "description": "The email of a user in your Gratavid account you want to assign to the task to",
                  "title": "Assign task to Gratavid user",
                  "x-ms-visibility": "important",
                  "x-ms-dynamic-values": {
                    "operationId": "getData",
                    "value-path": "id",
                    "value-collection": "data",
                    "value-title": "label",
                    "parameters": {
                      "source": "microsoftPowerAutomate",
                      "event": "getUsers"
                    }
                  }
                }
              },
              "required": [
                "email",
                "comments"
              ]
            }
          }
        ]
      },
      "put": {
        "responses": {
          "200": {
            "description": "default",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "message"
                },
                "noteId": {
                  "type": "string",
                  "description": "The id of the Gratavid note sent"
                },
                "gvSendId": {
                  "type": "string",
                  "description": "The send id of the Gratavid sent"
                },
                "viewInGratavidLink": {
                  "type": "string",
                  "description": "The link of the Gratavid note sent"
                }
              }
            }
          }
        },
        "summary": "Send a Gratavid note",
        "description": "Send a Gratavid note",
        "operationId": "sendNote",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "microsoftPowerAutomate",
            "x-ms-visibility": "internal"
          },
          {
            "name": "event",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "sendNote",
            "x-ms-visibility": "internal"
          },
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "noteId": {
                  "type": "string",
                  "description": "The note id of the Gratavid note",
                  "title": "Select Gratavid Note",
                  "x-ms-dynamic-values": {
                    "operationId": "getData",
                    "value-path": "id",
                    "value-collection": "data",
                    "value-title": "label",
                    "parameters": {
                      "source": "microsoftPowerAutomate",
                      "event": "getNotes"
                    }
                  }
                },
                "email": {
                  "type": "string",
                  "description": "The email of the contact",
                  "title": "Contact Email"
                },
                "firstName": {
                  "type": "string",
                  "description": "The first name of the contact",
                  "title": "Contact First Name"
                },
                "lastName": {
                  "type": "string",
                  "description": "The last name of the contact",
                  "title": "Contact Last Name"
                },
                "customUserId": {
                  "type": "string",
                  "description": "The id of the contact in your CRM",
                  "title": "Contact Gratavid Custom User Id"
                },
                "customAccountId": {
                  "type": "string",
                  "description": "The id of the contact's account in your CRM",
                  "title": "Contact Gratavid Custom Account Id"
                },
                "textOptIn": {
                  "type": "string",
                  "description": "The SMS/text opt-in status of the contact",
                  "title": "Contact Opted In To Text"
                },
                "cellNumber": {
                  "type": "string",
                  "description": "The cell number of the contact",
                  "title": "Contact Cell Number"
                }
              },
              "required": [
                "noteId",
                "email"
              ]
            }
          }
        ]
      }
    }
  },
  "definitions": {},
  "parameters": {},
  "responses": {},
  "securityDefinitions": {
    "API Key": {
      "type": "apiKey",
      "in": "query",
      "name": "apiKey"
    }
  },
  "security": [
    {
      "API Key": []
    }
  ],
  "tags": [],
  "x-ms-connector-metadata": [
    {
      "propertyName": "Website",
      "propertyValue": "https://gratavid.com/"
    },
    {
      "propertyName": "Privacy policy",
      "propertyValue": "https://account.gratavid.com/privacy"
    },
    {
      "propertyName": "Categories",
      "propertyValue": "Communication;Marketing"
    }
  ]
}