Add a Webhook

This article goes over integrating webhooks with your Teachable school.

Overview

Webhooks are used to send information from one app to another in a way that will trigger a specified behavior. On Teachable, there are 17 events that can be used with webhooks:

  1. New users join your school -  A user signs up for your school
  2. Users update their contact information - A user updates their profile on your school
  3. New sales - A student enrolls in a course on your school or is manually enrolled. This trigger affects free and paid courses. Bundled courses will count as one sale event.
  4. Transactions for one-time/recurring payments - A student is charged and makes a payment for a course (could be a one-time purchase or an ongoing subscription/payment plan). E.g. on a monthly subscription plan, there will be a New Transaction event each month when the student is charged. This event does not include free courses or courses purchased with 100%-off coupons.
  5. Student cancels a subscription - A student cancels a subscription on your school
  6. Enrollment is created - A user enrolls in a course (whether they purchased it or you manually added them). This differs from the New Sale trigger in that for bundled courses, each course in the bundle will count as a separate enrollment event.
  7. Lecture Completed - A user completes a lecture
  8. Response Created (user completes a graded quiz)
  9. Comment Created - a user leaves a comment on a course
  10. Transaction Refunded
  11. Enrollment Completed - A student completes 100% of your course
  12. User Opts out of Marketing Emails
  13. User Opts in to Marketing Emails
  14. New Unenrollment - A student is unenrolled from a course (includes manual unenrollment, unenrollment due to failed payments, or unenrollment when course access duration expires)
  15. New Admission - A user is admitted, or enrolled, to a coaching service
  16. Admission Disabled - A user is no longer admitted, or enrolled, in a coaching service
  17. Email Lead Subscribed - A customer has subscribed to your email list via an Email Leads Form

Add a Webhook

  1. Log in to your Teachable school.
  2. Select Settings from the admin sidebar.
  3. Click Webhooks
    settings-webhooks.png
  4. Select New Webhook.
  5. Enter a valid Webhook URL from a third-party application and select an Event Type from the list. Set the Send as JSON Array toggle to On if your integration needs that data format. Make sure to include the correct web protocol (https or http) in your Webhook URL.webhook-list-updated.png
  6. Click the orange Create Webhook button at the bottom.

Your webhook is now set up! When the event type you chose occurs, it will fire off a webhook event and the status of your webhook will change from “pending" to “verified."

Edit and Delete Webhooks

To edit a webhook, click the ellipses icon and then Edit.

edit_webhook.png

There, you can change the URL, event type, and JSON array toggle, and view the webhook's trigger history. In the trigger history, you will see whether the webhook event was executed successfully or unsuccessfully.

If a webhook fails four times, it will be automatically be disabled. If this happens, you can manually enable it from the edit page.

To delete a webhook, click the ellipses icon and then Delete.

edit_webhook.png

Data Returned From Webhooks

If you'd like to see the test data for any event type as a JSON response:

  1. Log in to the school for which you would like to view the test data.
  2. In your browser URL box, go to [SCHOOL_URL].teachable.com/api/v1/hooks/example?event_type=[EVENT.TYPE]. You'll have to replace [SCHOOL_URL] with the URL of your school, and [EVENT.TYPE] with the event type you would like to see the test data for (i.e. User.updated, Enrollment.created, etc. This URL is case specific.

    For example, to see the test data for a new sale for a school at testschool.teachable.com, you would enter "testschool.teachable.com/api/v1/hooks/example?event_type=Sale.created" into the URL box.

NOTE: You must run the relevant webhook at least once in your school to view the test data. For example, if you'd like to see the test data for new sales, there must be at least one instance where the New Sales webhook was used in your school.

Listed below are examples of the test data that would be returned for a variety of event types:

New Sales

[

{
 "created": 1326853478,
 "livemode": false,
 "id": 345,
 "type": "sale.created",
 "object": "event",
 "data": {
   "object": {
     "object": "sale",
     "school_id": 1,
     "created": 1405501752,
     "id": 495,
     "price": 400,
     "currency": "USD",
     "product_id": 47,
     "course_id": 47,
     "is_active": true,
     "livemode": false,
     "is_recurring": false,
     "user_id": 1,
     "product": {
       "id": 47,
       "name": "foo"
     },
     "course": {
       "id": 47,
       "name": "abc"
     },
     "user": {
       "id": 1,
       "email": "john_doe@example.com"
     }
   }
 }
}

]

New Users Join Your School

[

{
 "type": "User.created",
 "id": 1, 
 "livemode": false,
 "created": 628232400,
 "object": {
     "id":8014167,
     "role":"student",
     "email":"john_doe@example.com",
     "name":"John Doe",
     "school_id":116505,
     "src":null,
     "first_touch":null,
     "last_touch":null,
     "last_sign_in_at":"2017-11-06T22:38:34Z",
     "sign_in_count":3,
     "unsubscribe_from_marketing_emails":null
}
 }
}

]

Transactions for One-time/Recurring Sales

[  
   {  
      "type":"Transaction.created",
      "id":1459433,
      "livemode":true,
      "created":"2018-01-29T17:21:03+00:00",
      "hook_event_id":1,
      "object":{  
         "id":1459433,
         "user_id":8014167,
         "school_id":116505,
         "final_price":100,
         "currency":"USD",
         "affiliate_percent":0.0,
         "author_percent":0.0,
         "fedora_percent":0.0,
         "amount_refunded":100,
         "status":"paid",
         "is_recurring":false,
         "sale_id":9980514,
         "coupon_id":null,
         "net_charge":0,
         "stripe_charge_token":"ch_Xxxxxxxxxxxxxx",
         "net_charge_usd":0,
         "fedora_fee":0,
         "net_revenue_usd":0,
         "processor_fee_description":null,
         "affiliate_fees":0,
         "earnings_usd":0,
         "paypal_payment_id":null,
         "legacy_id":null,
         "purchased_at":"2017-11-06T22:39:36Z",
         "author_fees":0,
         "stripe_invoice_id":null,
         "stripe_event_id":null,
         "refunder_id":4106241,
         "processor_fee":0,
         "total_fedora_fee":0,
         "is_chargeback":null,
         "is_stripe_connect":null,
         "author_id":6431807,
         "credential_id":null,
         "is_custom_paypal":null,
         "data":{  
            "id":"ch_Xxxxxxxxxxxxxx",
            "paid":true,
            "order":null,
            "amount":100,
            "object":"charge",
            "review":null,
            "source":{  
               "id":"card_Xxxxxxxxxxxxxx",
               "name":null,
               "brand":"Visa",
               "last4":"2620",
               "object":"card",
               "country":"US",
               "funding":"debit",
               "customer":"cus_Xxxxxxxxxxxxxx",
               "exp_year":2019,
               "metadata":{  

               },
               "cvc_check":"pass",
               "exp_month":1,
               "address_zip":"11101",
               "fingerprint":"heQxxxxxxxxxxxxx",
               "address_city":null,
               "address_line1":null,
               "address_line2":null,
               "address_state":null,
               "dynamic_last4":null,
               "address_country":null,
               "address_zip_check":"pass",
               "address_line1_check":null,
               "tokenization_method":null
            },
            "status":"succeeded",
            "created":1510007975,
            "dispute":null,
            "invoice":null,
            "outcome":{  
               "type":"authorized",
               "reason":null,
               "risk_level":"normal",
               "network_status":"approved_by_network",
               "seller_message":"Payment complete."
            },
            "refunds":{  
               "url":"/v1/charges/ch_Xxxxxxxxxxxxxx/refunds",
               "data":[  
                  {  
                     "id":"re_Xxxxxxxxxxxxxx",
                     "amount":100,
                     "charge":"ch_Xxxxxxxxxxxxxx",
                     "object":"refund",
                     "reason":null,
                     "status":"succeeded",
                     "created":1510009679,
                     "currency":"usd",
                     "metadata":{  

                     },
                     "receipt_number":null,
                     "balance_transaction":{  
                        "id":"txn_Xxxxxxxxxxxxxx",
                        "fee":-33,
                        "net":-67,
                        "type":"refund",
                        "amount":-100,
                        "object":"balance_transaction",
                        "source":"ch_Xxxxxxxxxxxxxx",
                        "status":"available",
                        "created":1510009679,
                        "currency":"usd",
                        "description":"REFUND FOR CHARGE (sagdsag)",
                        "fee_details":[  
                           {  
                              "type":"stripe_fee",
                              "amount":-33,
                              "currency":"usd",
                              "application":null,
                              "description":"Stripe processing fee refund"
                           }
                        ],
                        "available_on":1510099200,
                        "sourced_transfers":{  
                           "url":"/v1/transfers?source_transaction=re_Xxxxxxxxxxxxxx",
                           "data":[  

                           ],
                           "object":"list",
                           "has_more":false,
                           "total_count":0
                        }
                     }
                  }
               ],
               "object":"list",
               "has_more":false,
               "total_count":1
            },
            "captured":true,
            "currency":"usd",
            "customer":"cus_Xxxxxxxxxxxxxx",
            "livemode":true,
            "metadata":{  
               "email":"john_doe@example.com",
               "order":"order_Xxxxxxxx",
               "country":"US",
               "school_id":"116505",
               "product_id":"429527",
               "course_name":"How to Have Fun!",
               "product_name":"sagdsag"
            },
            "refunded":true,
            "shipping":null,
            "application":null,
            "description":"sagdsag",
            "destination":null,
            "failure_code":null,
            "on_behalf_of":null,
            "fraud_details":{  

            },
            "receipt_email":null,
            "receipt_number":null,
            "transfer_group":null,
            "amount_refunded":100,
            "application_fee":null,
            "failure_message":null,
            "source_transfer":null,
            "balance_transaction":{  
               "id":"txn_Xxxxxxxxxxxxxx",
               "fee":33,
               "net":67,
               "type":"charge",
               "amount":100,
               "object":"balance_transaction",
               "source":"ch_Xxxxxxxxxxxxxx",
               "status":"available",
               "created":1510007979,
               "currency":"usd",
               "description":"sagdsag",
               "fee_details":[  
                  {  
                     "type":"stripe_fee",
                     "amount":33,
                     "currency":"usd",
                     "application":null,
                     "description":"Stripe processing fees"
                  }
               ],
               "available_on":1510099200,
               "sourced_transfers":{  
                  "url":"/v1/transfers?source_transaction=ch_Xxxxxxxxxxxxxx",
                  "data":[  

                  ],
                  "object":"list",
                  "has_more":false,
                  "total_count":0
               }
            },
            "statement_descriptor":"How to Have Fun"
         },
         "vat_fees":0,
         "usd_conversion_rate":null,
         "school_plan_id":20,
         "sale":{  
            "id":9980514,
            "price":100,
            "currency":"USD",
            "is_active":true,
            "is_recurring":false,
            "user_id":8014167,
            "school_id":116505,
            "final_price":100,
            "course":{  
               "id":158157,
               "name":"How to Have Fun!",
               "url":"http://testschool.teachable.com/courses/123456",
               "friendly_url":"how-to-aoihdgoiahdgoih",
               "meta_description":"oaidhgaodughadoiughadoighadiog",
               "description":"\u003cp\u003eTESTESTESTESTESTESTETEWSRTSTESTESTESTESTESTSETESTEST\n\u003c/p\u003e",
               "author_bio":{  
                  "created_at":"2017-10-19T20:08:55Z",
                  "headline":"sdgsdag",
                  "profile_image_url":null,
                  "bio":"\u003cp\u003easdgasd\n\u003c/p\u003e",
                  "position":null,
                  "user_id":null,
                  "name":"sgsa",
                  "id":115523,
                  "meta":{  
                     "class":"authorbio",
                     "url":"/author_bios/115523",
                     "name":"sgsa",
                     "description":"",
                     "image_url":null
                  }
               }
            },
            "product":{  
               "id":429527,
               "is_recurring":false,
               "price":100,
               "name":"sagdsag",
               "currency":"USD"
            },
            "user":{  
               "id":8014167,
               "role":"student",
               "email":"john_doe@example.com",
               "name":"John Doe",
               "school_id":116505,
               "src":null,
               "first_touch":null,
               "last_touch":null,
               "last_sign_in_at":"2017-11-06T22:39:37Z",
               "sign_in_count":4,
               "unsubscribe_from_marketing_emails":null
            },
            "coupon":null,
            "affiliate":null,
            "transactions":[  
               {  
                  "created_at":"2017-11-06T22:39:36Z",
                  "custom_gateway?":false,
                  "fully_refunded?":true,
                  "is_stripe_connect?":false,
                  "is_custom_paypal?":false,
                  "user_id":8014167,
                  "final_price":100,
                  "currency":"USD",
                  "affiliate_percent":0.0,
                  "author_percent":0.0,
                  "author_id":6431807,
                  "teachable_percent":0.0,
                  "teachable_processor_fee":0,
                  "amount_refunded":100,
                  "status":"paid",
                  "affiliate_fees":0,
                  "author_fees":0,
                  "sale_id":9980514,
                  "coupon_id":null,
                  "net_charge":0,
                  "earnings_usd":0,
                  "net_charge_usd":0,
                  "teachable_fixed_fee":0,
                  "total_teachable_fee":0,
                  "is_recurring":false,
                  "stripe_charge_token":"ch_Xxxxxxxxxxxxxx",
                  "paypal_payment_id":null,
                  "stripe_invoice_id":null,
                  "purchased_at":"2017-11-06T22:39:36Z",
                  "refundable":false,
                  "vat_fees":0,
                  "is_chargeback":null,
                  "id":1459433,
                  "net_tax_charge":0,
                  "net_product_charge_usd":0,
                  "meta":{  
                     "class":"transaction",
                     "url":null,
                     "name":"1459433",
                     "description":"",
                     "image_url":null
                  }
               }
            ]
         },
         "user":{  
            "id":8014167,
            "role":"student",
            "email":"john_doe@example.com",
            "name":"John Doe",
            "school_id":116505,
            "src":null,
            "first_touch":null,
            "last_touch":null,
            "last_sign_in_at":"2017-11-06T22:39:37Z",
            "sign_in_count":4,
            "unsubscribe_from_marketing_emails":null
         },
         "coupon":null
      }
   }
]

Users Update Their Profiles

[
{
 "type":"User.updated",
      "id":1234567,
      "livemode":true,
      "created":"2017-05-15T18:49:45+00:00",
      "hook_event_id":1,
      "object":{  
         "id":1234567,
         "role":"student",
         "email":"john_doe@example.com",
         "name":"john doe",
         "school_id":12345,
         "src":null,
         "first_touch":null,
         "last_touch":null,
         "last_sign_in_at":"2017-04-11T17:58:41Z",
         "sign_in_count":2,
         "unsubscribe_from_marketing_emails":null,
         "old_email":"john_doe2@example.com",
         "new_email":"john_doe@example.com",
         "old_name":"john doe",
         "new_name":"john doe"
  }
}
]
 

Student Cancels A Subscription

[

{
       "type" => "Sale.subscription_canceled",
         "id" => 4242424242,
   "livemode" => "true",
    "created" => "2016-03-24T11:26:30-04:00",
     "object" => {
                 "id" => 1289757,
              "price" => 1000,
           "currency" => "USD",
          "is_active" => false,
       "is_recurring" => true,
            "user_id" => 4567,
          "school_id" => 1234,
        "final_price" => 1000,
             "course" => {
             "id" => 686868,
           "name" => "How to Have Fun",
            "url" => "http://testschool.teachable.com/courses/how-to-have-fun"
       },
            "product" => {
                     "id" => 12345,
           "is_recurring" => true,
                  "price" => 1000,
                   "name" => "Monthly Payment (12 months)",
               "currency" => "USD"
       },
               "user" => {
                        "id" => 4567,
                      "role" => "guest",
                     "email" => "john_doe@example.com",
                      "name" => "John Doe",
                 "school_id" => 1234,
                       "src" => nil,
               "first_touch" => nil,
                "last_touch" => nil,
           "last_sign_in_at" => "2016-03-08T19:31:05Z",
             "sign_in_count" => 6
       },
             "coupon" => nil,
          "affiliate" => nil,
       "transactions" => [
           [0] {
                   "custom_gateway?" => nil,
                   "fully_refunded?" => false,
                                "id" => 166020,
                           "user_id" => 4567,
                         "school_id" => 1234,
                        "created_at" => "2016-02-08T18:39:32Z",
                        "updated_at" => "2016-03-08T18:40:32Z",
                       "final_price" => 1000,
                          "currency" => "USD",
                 "affiliate_percent" => nil,
                    "author_percent" => 0.0,
                         "author_id" => nil,
                    "fedora_percent" => 0.1,
               "total_processor_fee" => 59,
                   "amount_refunded" => 0,
                            "status" => "paid",
                    "affiliate_fees" => 0,
                       "author_fees" => 0,
                         "coupon_id" => nil,
                        "net_charge" => 1000,
                      "earnings_usd" => 747,
                    "net_charge_usd" => 1000,
                        "fedora_fee" => 1,
                  "total_fedora_fee" => 194,
                   "net_revenue_usd" => 747,
                      "purchased_at" => "2016-02-08T18:39:32Z",
                        "refundable" => true,
                          "vat_fees" => 0,
                     "is_chargeback" => nil,
                              "meta" => {
                         "class" => "transaction",
                           "url" => nil,
                          "name" => nil,
                   "description" => nil,
                     "image_url" => nil
         }

     }

  }

]

Enrollment Created

[
  {
     "type":"Enrollment.created",
     "id":1,
     "livemode":"true",
     "created":"2016-08-08T10:38:24-04:00",
     "hook_event_id":31,
     "object":{
        "created_at":null,
        "coupon":null,
        "user_id":1,
        "course_id":2,
        "primary_course_id":2,
        "sale_id":1,
        "is_active":true,
        "enrolled_at":"2016-08-08T14:38:24Z",
        "percent_complete":0.0,
        "has_full_access":false,
        "id":1,
        "meta":{
           "class":"enrollment",
           "url":null,
           "name":"1",
           "description":null,
           "image_url":null
        },
        "course":{
           "created_at":"2016-08-05T20:38:32Z",
           "path":"/courses/good-course",
           "safe_image_url":"//d6xfpzo6h49n1.cloudfront.net/O3FPQEI9tlnWDtlA0vVKvDXxxxx=/fit-in/705x0/https://d3gvvapoxxxxxx.cloudfront.net/icons/default-course-image.png",
           "default_product_formatted_price":"$10",
           "has_published_lecture":false,
           "has_published_product":true,
           "promo_video":null,
           "name":"Good course",
           "heading":null,
           "page_title":"Good course",
           "meta_description":null,
           "friendly_url":"good-course",
           "description":null,
           "author_bio_id":1,
           "position":0,
           "conversion_pixels":null,
           "closing_letter":null,
           "image_url":null,
           "hero_image_url":"https://d3gvvapxxxx.cloudfront.net/bg/default-hero.png",
           "is_published":false,
           "bundled_courses_count":0,
           "child_course_ids":[
           ],
           "preenrollment_call_to_action":"Sign up to get this course when it launches",
           "is_open":true,
           "is_accepting_preenrollments":false,
           "use_old_course_page":null,
           "purchase_redirect_url":null,
           "skip_thank_you_page":null,
           "onboarded_at":null,
           "id":2,
           "meta":{
              "class":"course",
              "url":"/courses/2/",
              "name":"Good course",
              "description":null,
              "image_url":null
           },
           "categories":[
           ],
           "author_bio":{
              "created_at":"2016-08-03T04:03:58Z",
              "headline":"headline ex",
              "profile_image_url":null,
              "bio":"Bacon ipsum dolor amet shankle ham pork belly jowl.",
              "position":null,
              "user_id":2,
              "name":"Jane Doe",
              "id":1,
              "meta":{
                 "class":"authorbio",
                 "url":"/author_bios/1",
                 "name":"Jane Doe",
                 "description":null,
                 "image_url":null
              }
           }
        },
        "user":{
           "created_at":"2016-08-03T04:03:58Z",
           "Role":"owner",
           "gravatar_url":"https://s.gravatar.com/avatar/12345288e5d61695b0d3f9c63835c?d=mm\u0026s=70",
           "email":"john_doe@example.como",
           "notes":null,
           "affiliate_code":"1_12orpy2s",
           "name":"John Doe",
           "is_owner":true,
           "sign_in_count":7,
           "is_student":true,
           "is_affiliate":false,
           "is_author":false,
           "src":null,
           "current_sign_in_at":"2016-08-05T20:17:15Z",
           "last_four":null,
           "paypal_email":"john_doe@example.com",
           "affiliate_revenue_share":null,
           "joined_at":"2016-08-03T14:13:37Z",
           "transactions_gross":0,
           "signed_up_affiliate_code":null,
           "author_revenue_share":0.0,
           "last_sign_in_ip":"::1",
           "current_sign_in_ip":"::1",
           "id":1,
           "school_id":1,
           "meta":{
              "class":"user",
              "url":null,
              "name":"John Doe",
              "description":"john_doe@example.com",
              "image_url":"https://s.gravatar.com/avatar/12345144288e5d61695b0d3f9c63835c?d=mm\u0026s=100"
   },
           "author_bio_id":null,
           "total_sales":0,
           "author_bio":null
        }
     }
  }
]

Lecture Completed

[
  {
     "type":"LectureProgress.created",
     "id":45454545454,
     "livemode":true,
     "created":"2016-08-31T16:54:47+00:00",
     "hook_event_id":1,
     "object":{
        "id":54545454545,
        "is_completed":true,
        "course_id":444444,
        "lecture_id":32322,
        "school_id":859,
        "percent_complete":21.0,
        "course":{
           "id":232323232,
           "name":"How to Have Fun",
           "url":"http://testschool.teachable.com/courses/how-to-have-fun"
        },
        "user":{
           "id":111111,
           "role":"student",
           "email":"john_doe@example.com",
           "name":"John Doe",
           "school_id":859,
           "src":null,
           "first_touch":null,
           "last_touch":null,
           "last_sign_in_at":"2016-08-28T18:07:23Z",
           "sign_in_count":10
        },
        "lecture":{
           "id":43444344444,
           "name":"Lead Magnet #1: The \"Checklist\"",
           "is_published":true
        }
     }
  }
]

Response Created (User Completes a graded quiz)

[
  {
     "type":"Response.created",
     "id":3333333,
     "livemode":true,
     "created":"2016-08-31T16:56:00+00:00",
     "hook_event_id":1,
     "object":{
        "id":323232,
        "user_id":33333,
        "custom_form_id":122,
        "answers":{
           "answer-1":[
              "Make a quiz"
           ],
           "answer-2":[
              "Ankur"
           ]
        },
        "created_at":"2016-08-28T08:14:03Z",
        "updated_at":"2016-08-28T08:14:22Z",
        "school_id":859,
        "submitted_at":"2016-08-28T08:14:22Z",
        "grade":{
           "total":2,
           "correct":1,
           "answered":2,
           "remaining":0,
           "percent_correct":0.5,
           "percent_answered":1.0
        },
        "custom_form":{
           "id":122,
           "type":"Quiz",
           "topic_id":3333334,
           "topic_type":"Attachment",
           "data":{
              "graded":true,
              "answerKey":{
                 "answer-1":[
                    "Make a quiz"
                 ],
                 "answer-2":[
                    "answer1",
                    "answer2"
                 ]
              }
           },
           "school_id":859,
           "is_published":false,
           "identifier":null,
           "created_at":"2015-06-08T17:05:26Z",
           "updated_at":"2015-06-08T17:50:23Z",
           "schema":{
              "type":"object",
              "required":[
                 "answer-1",
                 "answer-2"
              ],
              "properties":{
                 "answer-1":{
                    "enum":[
                       "Make a quiz",
                       "Start a blog",
                       "Create an email campaign"
                    ],
                    "type":"string",
                    "title":"What is one of the easiest ways to engage your audience?"
                 },
                 "answer-2":{
                    "enum":[
                       "answer1",
                       "answer2",
                       "answer3"
                    ],
                    "type":"string",
                    "title":"Who are the founders of Fedora?"
                 }
              }
           },
           "attachment":{
              "id":22222222,
              "attachable_type":"Lecture",
              "attachable_id":22222222,
              "kind":"quiz"
           }
        },
        "user":{
           "id":22222222,
           "role":"student",
           "email":"john_doe@example.com",
           "name":"John Doe",
           "school_id":859,
           "src":null,
           "first_touch":null,
           "last_touch":null,
           "last_sign_in_at":"2016-08-30T07:51:52Z",
           "sign_in_count":46
        }
     }
  }
]

Comment Created

[
   {
      "type":"Comment.created",
      "id":214950,
      "livemode":true,
      "created":"2017-05-15T18:53:43+00:00",
      "hook_event_id":1,
      "object":{
         "id":214950,
         "user_id":3119253,
         "school_id":69842,
         "created_at":"2017-01-19T17:39:02Z",
         "updated_at":"2017-01-19T17:39:02Z",
         "body": "comment text here",
         "user":{
            "id":3119253,
            "role":"student",
            "email":"john_doe@example.com",
            "name":"John Doe",
            "school_id":69842,
            "src":null,
            "first_touch":null,
            "last_touch":null,
            "last_sign_in_at":"2017-01-19T17:38:48Z",
            "sign_in_count":11,
            "unsubscribe_from_marketing_emails":null
         },
         "commentable":{
            "created_at":"2017-01-19T17:30:13Z",
            "code_syntax":null,
            "content_type":null,
            "audio_type":null,
            "should_be_uploaded_to_wistia?":false,
            "data":null,
            "schema":null,
            "text_constructor":null,
            "full_url": "https://schoolurl.teachable.com/courses/111111/lectures/1234567",
            "cdn_url":null,
            "url":null,
            "host_id":null,
            "source":"user",
            "kind":"native_comments",
            "name":null,
            "host":null,
            "position":1,
            "attachable_id":2034508,
            "is_published":true,
            "downloadable":false,
            "text":null,
            "attachable_type":"Lecture",
            "thumbnail_url":null,
            "meta":{
               "class":"attachment",
               "url":null,
               "name":null,
               "description":null,
               "image_url":null,
               "status":null
            },
            "embeddable":true,
            "id":45307557,
            "display_text":"",
            "plain_text_html":""
         }
      }
   }
]

Transaction Refunded

[
   {
      "type":"Transaction.refunded",
      "id":867110,
      "livemode":true,
      "created":"2017-05-15T18:57:24+00:00",
      "hook_event_id":1,
      "object":{
         "id":867110,
         "user_id":4831317,
         "school_id":5783,
         "final_price":500,
         "currency":"USD",
         "affiliate_percent":null,
         "author_percent":0.0,
         "fedora_percent":0.2,
         "amount_refunded":500,
         "status":"paid",
         "is_recurring":false,
         "sale_id":5810934,
         "coupon_id":null,
         "net_charge":0,
         "stripe_charge_token":"ch_Xxxxxxxxxxxxxx",
         "net_charge_usd":0,
         "fedora_fee":0,
         "net_revenue_usd":0,
         "processor_fee_description":null,
         "affiliate_fees":0,
         "earnings_usd":0,
         "paypal_payment_id":null,
         "legacy_id":null,
         "purchased_at":"2017-04-26T17:47:53Z",
         "author_fees":0,
         "stripe_invoice_id":null,
         "stripe_event_id":null,
         "refunder_id":2184202,
         "processor_fee":0,
         "total_fedora_fee":0,
         "is_chargeback":null,
         "is_stripe_connect":null,
         "author_id":null,
         "credential_id":null,
         "is_custom_paypal":null,
         "data":{
            "id":"ch_Xxxxxxxxxxxxxx",
            "paid":true,
            "order":null,
            "amount":500,
            "object":"charge",
            "review":null,
            "source":{
               "id":"card_Xxxxxxxxxxxxxx",
               "name":null,
               "brand":"Visa",
               "last4":"1234",
               "object":"card",
               "country":"US",
               "funding":"debit",
               "customer":"cus_Xxxxxxxxxxxxxx",
               "exp_year":2020,
               "metadata":{

               },
               "cvc_check":"pass",
               "exp_month":6,
               "address_zip":null,
               "fingerprint":"Xxxxxxxxxxxxxx",
               "address_city":null,
               "address_line1":null,
               "address_line2":null,
               "address_state":null,
               "dynamic_last4":null,
               "address_country":null,
               "address_zip_check":null,
               "address_line1_check":null,
               "tokenization_method":null
            },
            "status":"succeeded",
            "created":1493228874,
            "dispute":null,
            "invoice":null,
            "outcome":{
               "type":"authorized",
               "reason":null,
               "risk_level":"normal",
               "network_status":"approved_by_network",
               "seller_message":"Payment complete."
            },
            "refunds":{
               "url":"/v1/charges/ch_Xxxxxxxxxxxxxx/refunds",
               "data":[
                  {
                     "id":"re_Xxxxxxxxxxxxxx",
                     "amount":500,
                     "charge":"ch_Xxxxxxxxxxxxxx",
                     "object":"refund",
                     "reason":null,
                     "status":"succeeded",
                     "created":1493228931,
                     "currency":"usd",
                     "metadata":{

                     },
                     "receipt_number":null,
                     "balance_transaction":{
                        "id":"txn_Xxxxxxxxxxxxxx",
                        "fee":-43,
                        "net":-457,
                        "type":"refund",
                        "amount":-500,
                        "object":"balance_transaction",
                        "source":"ch_Xxxxxxxxxxxxxx",
                        "status":"pending",
                        "created":1493228931,
                        "currency":"usd",
                        "description":"REFUND FOR CHARGE (Paid Course)",
                        "fee_details":[
                           {
                              "type":"stripe_fee",
                              "amount":-43,
                              "currency":"usd",
                              "application":null,
                              "description":"Stripe processing fee refund"
                           }
                        ],
                        "available_on":1493337600,
                        "sourced_transfers":{
                           "url":"/v1/transfers?source_transaction=re_Xxxxxxxxxxxxxx",
                           "data":[

                           ],
                           "object":"list",
                           "has_more":false,
                           "total_count":0
                        }
                     }
                  }
               ],
               "object":"list",
               "has_more":false,
               "total_count":1
            },
            "captured":true,
            "currency":"usd",
            "customer":"cus_Xxxxxxxxxxxxxx",
            "livemode":true,
            "metadata":{
               "name":"John Doe",
               "email":"john_doe@example.com",
               "country":"US",
               "sale_id":"5810934",
               "user_id":"4831317",
               "school_id":"5783",
               "product_id":"300137",
               "course_name":"Bundle Course",
               "product_name":"Paid Course"
            },
            "refunded":true,
            "shipping":null,
            "application":null,
            "description":"Paid Course",
            "destination":null,
            "failure_code":null,
            "on_behalf_of":null,
            "fraud_details":{

            },
            "receipt_email":null,
            "receipt_number":null,
            "transfer_group":null,
            "amount_refunded":500,
            "application_fee":null,
            "failure_message":null,
            "source_transfer":null,
            "balance_transaction":{
               "id":"txn_Xxxxxxxxxxxxxx",
               "fee":43,
               "net":457,
               "type":"charge",
               "amount":500,
               "object":"balance_transaction",
               "source":"ch_Xxxxxxxxxxxxxx",
               "status":"pending",
               "created":1493228914,
               "currency":"usd",
               "description":"Paid Course",
               "fee_details":[
                  {
                     "type":"stripe_fee",
                     "amount":43,
                     "currency":"usd",
                     "application":null,
                     "description":"Stripe processing fees"
                  }
               ],
               "available_on":1493337600,
               "sourced_transfers":{
                  "url":"/v1/transfers?source_transaction=ch_Xxxxxxxxxxxxxx",
                  "data":[

                  ],
                  "object":"list",
                  "has_more":false,
                  "total_count":0
               }
            },
            "statement_descriptor":"statement descriptor here"
         },
         "vat_fees":0,
         "usd_conversion_rate":null,
         "school_plan_id":3,
         "sale":{
            "id":5810934,
            "price":500,
            "currency":"USD",
            "is_active":true,
            "is_recurring":false,
            "user_id":4831317,
            "school_id":5783,
            "final_price":500,
            "course":{
               "id":82791,
               "name":"Bundle Course",
               "url":"http://testschool.teachable.com/courses/12345",
               "friendly_url":"terms",
               "meta_description":"description here",
               "description":"description here",
               "author_bio":{
                  "created_at":"2015-03-09T16:08:46Z",
                  "headline":"headline here",
                  "profile_image_url":null,
                  "bio":null,
                  "position":null,
                  "user_id":null,
                  "name":"Jane Doe",
                  "id":5083,
                  "meta":{
                     "class":"authorbio",
                     "url":"/author_bios/5083",
                     "name":"Jane Doe",
                     "description":null,
                     "image_url":null
                  }
               }
            },
            "product":{
               "id":300137,
               "is_recurring":false,
               "price":500,
               "name":"Paid Course",
               "currency":"USD"
            },
            "user":{
               "id":4831317,
               "role":"student",
               "email":"john_doe@example.com",
               "name":"John Doe",
               "school_id":5783,
               "src":null,
               "first_touch":null,
               "last_touch":null,
               "last_sign_in_at":"2017-04-26T17:47:20Z",
               "sign_in_count":2,
               "unsubscribe_from_marketing_emails":null
            },
            "coupon":null,
            "affiliate":{
               "id":250053,
               "role":"affiliate",
               "email":"john_affiliate@example.com",
               "name":"John Affiliate",
               "school_id":5783,
               "src":null,
               "first_touch":null,
               "last_touch":null,
               "last_sign_in_at":"2015-02-03T17:43:29Z",
               "sign_in_count":1,
               "unsubscribe_from_marketing_emails":null
            },
            "transactions":[
               {
                  "created_at":"2017-04-26T17:47:55Z",
                  "custom_gateway?":null,
                  "fully_refunded?":true,
                  "is_stripe_connect?":false,
                  "is_custom_paypal?":false,
                  "user_id":4831317,
                  "final_price":500,
                  "currency":"USD",
                  "affiliate_percent":null,
                  "author_percent":0.0,
                  "author_id":null,
                  "teachable_percent":0.2,
                  "teachable_processor_fee":0,
                  "amount_refunded":500,
                  "status":"paid",
                  "affiliate_fees":0,
                  "author_fees":0,
                  "sale_id":5810934,
                  "coupon_id":null,
                  "net_charge":0,
                  "earnings_usd":0,
                  "net_charge_usd":0,
                  "teachable_fixed_fee":0,
                  "total_teachable_fee":0,
                  "is_recurring":false,
                  "stripe_charge_token":"ch_Xxxxxxxxxxxxxx",
                  "paypal_payment_id":null,
                  "stripe_invoice_id":null,
                  "purchased_at":"2017-04-26T17:47:53Z",
                  "refundable":false,
                  "vat_fees":0,
                  "is_chargeback":null,
                  "id":867110,
                  "net_tax_charge":0,
                  "net_product_charge_usd":0,
                  "meta":{
                     "class":"transaction",
                     "url":null,
                     "name":"867110",
                     "description":null,
                     "image_url":null
                  }
               }
            ]
         },
         "user":{
            "id":4831317,
            "role":"student",
            "email":"john_doe@example.com",
            "name":"John Doe",
            "school_id":5783,
            "src":null,
            "first_touch":null,
            "last_touch":null,
            "last_sign_in_at":"2017-04-26T17:47:20Z",
            "sign_in_count":2,
            "unsubscribe_from_marketing_emails":null
         },
         "coupon":null
      }
   }
]

Enrollment Completed

[
   {
      "type":"Enrollment.completed",
      "id":12345,
      "livemode":true,
      "created":"2016-08-31T16:50:28+00:00",
      "hook_event_id":1,
      "object":{
         "created_at":"2016-08-31T16:27:34Z",
         "coupon":null,
         "user_id":43434343,
         "course_id":444444,
         "primary_course_id":444444,
         "sale_id":333333,
         "is_active":true,
         "enrolled_at":"2016-08-31T16:27:34Z",
         "percent_complete":100.0,
         "has_full_access":false,
         "id":22232323,
         "meta":{
            "class":"enrollment",
            "url":null,
            "name":"222232323",
            "description":null,
            "image_url":null
         },
         "user":{
            "created_at":"2016-08-31T16:27:34Z",
            "role":"student",
            "gravatar_url":"https://s.gravatar.com/avatar/12345?d=mm",
            "email":"john_doe@example.com",
            "notes":null,
            "affiliate_code":"5559_9r2htpcz",
            "name":"John Doe",
            "is_owner":false,
            "sign_in_count":3,
            "is_student":true,
            "is_affiliate":false,
            "is_author":false,
            "src":null,
            "current_sign_in_at":"2016-08-31T16:27:35Z",
            "last_four":null,
            "paypal_email":"john_doe@example.com",
            "affiliate_revenue_share":null,
            "joined_at":"2016-08-31T16:27:34Z",
            "transactions_gross":0,
            "signed_up_affiliate_code":null,
            "author_revenue_share":0.0,
            "last_sign_in_ip":"99.224.146.47",
            "current_sign_in_ip":"99.224.146.47",
            "id":2058707,
            "school_id":859,
            "meta":{
               "class":"user",
               "url":null,
               "name":"John Doe",
               "description":"john_doe@example.com",
               "image_url":"https://s.gravatar.com/avatar/12345?d=mm\u0026size=100"
            },
            "author_bio_id":null,
            "total_sales":0,
            "author_bio":null
         },
         "course":{
            "id":4444444,
            "name":"How to Have Fun",
            "url":"http://testschool.teachable.com/courses/how-to-have-fun"
         }
      }
   }
]

User Opts out of Marketing Emails

[
  {
    "type": "User.unsubscribe_from_marketing_emails",
    "id": 11659146,
    "livemode": true,
    "created": "2018-05-22T21:50:57+00:00",
    "hook_event_id": 1,
    "object": {
      "id": 11659146,
      "role": "affiliate",
      "email": "john_doe@example.com",
      "name": "John Doe",
      "school_id": 116505,
      "src": null,
      "first_touch": null,
      "last_touch": null,
      "last_sign_in_at": "2018-05-22T16:16:28Z",
      "sign_in_count": 2,
      "unsubscribe_from_marketing_emails": null
    }
  }
]

User Opts in to Marketing Emails

[
  {
    "type": "User.subscribe_to_marketing_emails",
    "id": 12477454,
    "livemode": true,
    "created": "2018-06-27T20:47:23+00:00",
    "hook_event_id": 1,
    "object": {
      "id": 12477454,
      "role": "student",
      "email": "john_doe@example.com",
      "name": "John Doe",
      "school_id": 116505,
      "src": null,
      "first_touch": null,
      "last_touch": null,
      "last_sign_in_at": "2018-06-27T20:43:47Z",
      "sign_in_count": 1,
      "unsubscribe_from_marketing_emails": false
    }
  }
]

New Unenrollment

[
  {
    "type": "Enrollment.disabled",
    "id": 121,
    "livemode": true,
    "created": "2021-01-06T15:54:32+00:00",
    "hook_event_id": 6,
    "object": {
      "created_at": "2021-01-06T15:12:26Z",
      "coupon": null,
      "user_id": 116,
      "course_id": 3,
      "primary_course_id": 3,
      "sale_id": 120,
      "is_active": false,
      "enrolled_at": "2021-01-06T15:12:26Z",
      "percent_complete": 0,
      "has_full_access": false,
      "id": 121,
      "course_progress_id": 121,
      "updated_at": "2021-01-06T15:54:31Z",
      "meta":{
        "class": enrollment,
        "url": null,
        "name":	121,
        "description":	
        "image_url": null,
        "status": null,
         },
      "user":{
        "created_at": 2021-01-06T15:12:26Z,
        "role": guest,
        "sanitized_name": John Doe,
        "gravatar_url": https://s.gravatar.com/avatar/12345?d=mm,
        "is_teachable_account": true,
        "author_bio": null,
        "author_bio_id": null,
        "custom_role":	null,
        "custom_role_name": null,
        "primary_owner?": false,
        "show_custom_role_upgrade?": false,
        "has_zoom_credential?": false,
        "email": john_doe@example.com,
        "notes": null,
        "affiliate_code": 1_madu8hph,
        "name": bc student 2,
        "is_owner": false,
        "sign_in_count": 1,
        "is_student": true,
        "is_affiliate": false,
        "is_author": false,
        "src":	null,
        "current_sign_in_at": 2021-01-06T15:12:34Z,
        "confirmed_at": 2021-01-06T15:12:58Z,
        "last_four": null,
        "paypal_email": null,
        "affiliate_revenue_share": null,
        "joined_at": 2021-01-06T15:12:26Z,
        "signed_up_affiliate_code": null,
        "author_revenue_share": 0,
        "last_sign_in_ip": 68.123.123.123,
        "current_sign_in_ip": 68.123.123.123,
        "id": 116,
        "school_id": 1,
        "teachable_account_id": 109,
        "is_staff_user": null,
        "agree_updated_privacy_policy": true,
        "unsubscribe_from_marketing_emails": false,
        "meta":{
           "class": user,
           "url": null,
           "name": bc student 2,
           "description":	
           "image_url":	null,
           "status": null,
         },
         "transactions_gross": 1000,
         "shipping_address":{
         	"id":18,
          "line1": 123 Apple Street, 
          "line2": Apt 1,
          "city": new york,
          "region": NY,
          "postal_code": 10016,
          "country": US,
          },
        },
       },
    "course":{
    	"id": 3,
      "name":	Course Name 0,
      "url":	http://testschool.teachable.cloud/courses/3,
      "friendly_url":	friendly-url-0,
      "meta_description": Course Heading,
      "description":	Course Description,
      "author_bio":{
      	"created_at":	2020-05-05T15:09:09Z,
        "headline": MyText,
        "profile_image_url": http://www.example.com,
        "bio": MyText,
        "position": null,
        "user_id": null,
        "name": Author Name,
        "id":	4,
        "meta:"{
        	"class": authorbio,
          "url": /author_bios/4,
          "name": Author Name,
          "description":	
          "image_url": null,
          "status": null,
          },
  			},
      },
     },
    }
]

New Admission

[
  {
  "type": Admission.created,
	"id": 138,
	"livemode": true,
	"created": 2021-01-12T21:03:41+00:00,
	"hook_event_id": 108,
  "object": {
  	"user": {
    	"id": 489,
   		"role":	student,
    	"email": john_doe@example.com,
    	"name":	Test Student,
    	"school_id": 1,
    	"src": null,
    	"first_touch": null,
    	"last_touch": null,
    	"last_sign_in_at": 2021-01-08T16:53:31Z,
    	"sign_in_count": 2,
    	"unsubscribe_from_marketing_emails": false,
      },
      "purchasable": {
      	"type": creator_product,
        "creator_product": {
        	"id": 3,
      		"author_bio_id": 170,
      		"description": null,
      		"image_url": https://cdn.filestackcontent.com/IcMn5yXSQaQ12345679,
      		"name":	Coaching Service Test,
      		"position": 2,
      		"status": published,
      		"school_id": 1,
      		"created_at": 2020-01-03T19:57:14Z,
      		"updated_at": 2020-09-30T20:30:57Z,
      		"friendly_url":	test-coaching,
      		"destroyed_at":	null,
      		"preferences":
      		"external_url":	
      		"author_id": null,
          },
        },
      },
    }
 ]

Admission Disabled

[
  {
  "type": Admission.disabled,
  "id": 135,
  "livemode": true,
  "created": 2021-01-12T21:03:55+00:00,
  "hook_event_id": 112,
  "object": {
     "user": {
    	"id":	488,
    	"role":	student,
   	 	"email": john_doe@example.com,
    	"name":	Test Student,
    	"school_id": 1,
    	"src":	null,
    	"first_touch": null,
    	"last_touch": null,
    	"last_sign_in_at": 2021-01-08T16:30:17Z,
    	"sign_in_count": 3,
    	"unsubscribe_from_marketing_emails": false,
      },
    "purchasable": {
    	"type":	creator_product,
    	"creator_product": {
      	"id": 3,
      	"author_bio_id": 170,
      	"description": null,
      	"image_url": https://cdn.filestackcontent.com/IcMn5yXS12345123456,
      	"name":	Test Coaching Service,
      	"position": 2,
      	"status": published,
      	"school_id": 1,
      	"created_at": 2020-01-03T19:57:14Z,
      	"updated_at": 2020-09-30T20:30:57Z,
      	"friendly_url": test-coaching,
      	"destroyed_at":	null,
      	"preferences":
      	"external_url":	
      	"author_id": null,
 	},
        },
      },
    }
  ]
  

Email Lead Subscribed

{
  "type": "EmailLead.created",
  "id": 42,
  "livemode": true,
  "created": "2021-03-03T18:26:27+00:00",
  "hook_event_id": 988,
  "object": {
    "email": "test@example.com",
    "source": "Form Name Here",
    "created_at": "2021-03-03T18:26:24Z"
  }
}
  
Was this article helpful?
22 out of 68 found this helpful
thanks_illustration

Can't find what you're looking for?

Contact us
thanks_illustration