{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Application lifecycle webhooks - Development Portal | Outreach","description":"Outreach extensibility development and documentation portal","siteUrl":"https://developers.outreach.io","keywords":"outreach developer portal, api documentation, api reference docs, sdk documentation","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"application-lifecycle-webhooks","__idx":0},"children":["Application lifecycle webhooks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Outreach allows for registering a webhook URL for getting notifications about lifecycle events of your application."," ","To configure webhooks add the \"Application lifecycle webhooks\" feature to your app and specify the URL which is going to be called."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/webhook-config.00b68f99b7fec0b93cb4feb991abc6438370549918f04f4febf4c269edf9f11c.9c1bb791.png","alt":"Configuring application lifecycle webhooks","title":"#width=500px;"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every time your application is installed, updated or reconfigured by an Outreach organization, your webhook will be called with the following payload:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"type\": \"install\",\n    \"id\": \"INSTALL_ID\",\n    \"relationships\": {\n      \"app\": {\n        \"data\": {\n          \"type\": \"app\",\n          \"id\": \"S2S_GUID\"\n        }\n      }\n    }\n  },\n  \"meta\": {\n    \"deliveredAt\": \"2019-01-01T00:00:00\",\n    \"eventName\": \"install.created\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When uninstalled, the value of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]}," will be ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["install.deleted"]},"."," ","When calling webhooks Outreach will set the following additional HTTP headers:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Header"},"children":["Header"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Content-Type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["application/vnd.api+json"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Outreach-Webhook-ID"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["UUID generated specifically for this request."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Outreach-Webhook-Signature"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HMAC digest of the request body and your specified webhooks secret. See below for information on how to calculate this signature."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"validating-webhook-requests","__idx":1},"children":["Validating webhook requests"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To validate webhook requests calculate the SHA256 HMAC and compare it with the value of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Outreach-Webhook-Signature"]}," header."," ","Outreach calculates this value as follows:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","header":{"controls":{"copy":{}}},"source":"OpenSSL::HMAC.hexdigest(\n  OpenSSL::Digest.new(\"sha256\"),\n  OUTREACH_WEBHOOK_SECRET,\n  request_body\n","lang":"ruby"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can find the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["OUTREACH_WEBHOOK_SECRET"]}," value in the webhook configuration page."]}]},"headings":[{"value":"Application lifecycle webhooks","id":"application-lifecycle-webhooks","depth":1},{"value":"Validating webhook requests","id":"validating-webhook-requests","depth":2}],"frontmatter":{"seo":{"title":"Application lifecycle webhooks - Development Portal | Outreach"}},"lastModified":"2023-10-02T06:20:49.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/client-extensions/app-lifecycle-webhooks","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}