cancel
Showing results for 
Search instead for 
Did you mean: 

Webhook event data schema

miknowak
Mt. Kenya

I'm looking into implementing webhooks into my application, however, I cannot find a complete event schema anywhere.

https://developers.strava.com/docs/webhooks/

The above website contains only one example, with update of activity title. I what to know what data I'll receive when activity is created. Will I also get a webhook call of type "create an athlete" when someone signs up for my application? Or I just couldn't find the docs I was searching for?

Cheers,

1 REPLY 1

ActivityFix
Superuser
Superuser

While only one example is given, the event data section has a table showing the various webhooks you will receive.

Create athlete - There is no webhook for that. Since the athlete has to go through the OAuth process to authorize your app, you can use that to determine when someone signs up. You do get a webhook when an athlete revokes authorization for your app (object type = athlete, updates = { "authorized" : "false" })

Activity webhooks - You'll get ones for create, update, and delete. The data in the updates field will vary depending on which call is made. Create will not have any, update will be one or more of title, type, and private, depending on what changed.

To answer your specific question, a create activity webhook will look something like below, where object_id is the new activity ID, owner_id is the ID of the athlete creating the activity, and subscription_id is your webhook subscription ID.

 

 

{
    "aspect_type": "create",
    "event_time": 1725991232,
    "object_id": 12345,
    "object_type": "activity",
    "owner_id": 67890,
    "subscription_id": 98765,
    "updates": {
    }
}