Storing custom metadata on events

The metadata feature in SavvyCal allows you to store custom properties on events that you can retrieve via webhooks or by querying the SavvyCal API. For example, if you are sending scheduling links from your application and you'd like to record the user_id for the person scheduling, you can use metadata for this.

Setting metadata via the query string

When sharing a scheduling link, you can pass metadata via the query string. We'll parse any query string parameters named like this: metadata[KEY]=VALUE. For example, when someone uses this link, we'll set the user_id metadata property to 123:

https://savvycal.com/john/chat?metadata[user_id]=123

Any metadata you set will be included in the event payload.

{
  "id": "event_XXXXX",
  "metadata": {
    "user_id": "123"
  },
  ...
}

Setting metadata on embedded links

When initializing an embedded SavvyCal link, you can pass an object of metadata.

<script>
  // Widget
  SavvyCal('init', {
    widget: {
      link: 'john/chat',
      metadata: {
        user_id: '123'
      }
    }
  })

  // Inline
  SavvyCal('inline', {
    link: 'john/chat',
    selector: '#sc-embed',
    metadata: {
      user_id: '123'
    }
  })
</script>

Using metadata in workflows

You can access event metadata via the event.metadata object. For example, if you set a user_id metadata property, you can access that value in workflow emails like this:

{{ event.metadata.user_id }}

Still need help? Contact Us Contact Us